diff --git a/README.md b/README.md index af40b97..c291d3b 100644 --- a/README.md +++ b/README.md @@ -76,76 +76,21 @@ All URIs are relative to *https://api.reveng.ai* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AgentApi* | [**checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet**](docs/AgentApi.md#checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet) | **GET** /v2/analyses/{analysis_id}/agent/capabilities/status | Check the status of a capabilities analysis workflow -*AgentApi* | [**checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet**](docs/AgentApi.md#checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet) | **GET** /v2/analyses/{analysis_id}/agent/report-analysis/status | Check the status of a report analysis workflow -*AgentApi* | [**checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet**](docs/AgentApi.md#checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet) | **GET** /v2/analyses/{analysis_id}/agent/triage/status | Check the status of a triage analysis workflow -*AgentApi* | [**createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost**](docs/AgentApi.md#createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost) | **POST** /v2/analyses/{analysis_id}/agent/capabilities | Queues a capabilities analysis workflow process -*AgentApi* | [**createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost**](docs/AgentApi.md#createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost) | **POST** /v2/analyses/{analysis_id}/agent/report-analysis | Queues a combined report analysis workflow process -*AgentApi* | [**createTriageTaskV2AnalysesAnalysisIdAgentTriagePost**](docs/AgentApi.md#createTriageTaskV2AnalysesAnalysisIdAgentTriagePost) | **POST** /v2/analyses/{analysis_id}/agent/triage | Queues a triage analysis workflow process -*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 -*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 -*AnalysesCommentsApi* | [**deleteAnalysisComment**](docs/AnalysesCommentsApi.md#deleteAnalysisComment) | **DELETE** /v2/analyses/{analysis_id}/comments/{comment_id} | Delete a comment -*AnalysesCommentsApi* | [**getAnalysisComments**](docs/AnalysesCommentsApi.md#getAnalysisComments) | **GET** /v2/analyses/{analysis_id}/comments | Get comments for this analysis -*AnalysesCommentsApi* | [**updateAnalysisComment**](docs/AnalysesCommentsApi.md#updateAnalysisComment) | **PATCH** /v2/analyses/{analysis_id}/comments/{comment_id} | Update a comment *AnalysesCoreApi* | [**addUserStringToAnalysis**](docs/AnalysesCoreApi.md#addUserStringToAnalysis) | **POST** /v3/analyses/{analysis_id}/user-provided-strings | Add a user-provided string to an analysis. -*AnalysesCoreApi* | [**createAnalysis**](docs/AnalysesCoreApi.md#createAnalysis) | **POST** /v2/analyses | Create Analysis -*AnalysesCoreApi* | [**deleteAnalysis**](docs/AnalysesCoreApi.md#deleteAnalysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis -*AnalysesCoreApi* | [**getAnalysisBasicInfo**](docs/AnalysesCoreApi.md#getAnalysisBasicInfo) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information -*AnalysesCoreApi* | [**getAnalysisBasicInfo_0**](docs/AnalysesCoreApi.md#getAnalysisBasicInfo_0) | **GET** /v3/analyses/{analysis_id}/basic | Get basic analysis information +*AnalysesCoreApi* | [**getAnalysisBasicInfo**](docs/AnalysesCoreApi.md#getAnalysisBasicInfo) | **GET** /v3/analyses/{analysis_id}/basic | Get basic analysis information *AnalysesCoreApi* | [**getAnalysisBytes**](docs/AnalysesCoreApi.md#getAnalysisBytes) | **GET** /v3/analyses/{analysis_id}/bytes | Get the bytes of a binary -*AnalysesCoreApi* | [**getAnalysisFunctionMap**](docs/AnalysesCoreApi.md#getAnalysisFunctionMap) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map *AnalysesCoreApi* | [**getAnalysisFunctionMatches**](docs/AnalysesCoreApi.md#getAnalysisFunctionMatches) | **GET** /v3/analyses/{analysis_id}/functions/matches | Get function-matching results for an analysis *AnalysesCoreApi* | [**getAnalysisFunctionMatchingStatus**](docs/AnalysesCoreApi.md#getAnalysisFunctionMatchingStatus) | **GET** /v3/analyses/{analysis_id}/functions/matches/status | Get function-matching status for an analysis -*AnalysesCoreApi* | [**getAnalysisLogs**](docs/AnalysesCoreApi.md#getAnalysisLogs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis -*AnalysesCoreApi* | [**getAnalysisParams**](docs/AnalysesCoreApi.md#getAnalysisParams) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information -*AnalysesCoreApi* | [**getAnalysisStatus**](docs/AnalysesCoreApi.md#getAnalysisStatus) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis *AnalysesCoreApi* | [**getDynamicExecutionReport**](docs/AnalysesCoreApi.md#getDynamicExecutionReport) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/report | Get dynamic execution report *AnalysesCoreApi* | [**getDynamicExecutionStatus**](docs/AnalysesCoreApi.md#getDynamicExecutionStatus) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/status | Get dynamic execution status -*AnalysesCoreApi* | [**insertAnalysisLog**](docs/AnalysesCoreApi.md#insertAnalysisLog) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis -*AnalysesCoreApi* | [**listAnalyses**](docs/AnalysesCoreApi.md#listAnalyses) | **GET** /v2/analyses/list | Gets the most recent analyses -*AnalysesCoreApi* | [**lookupBinaryId**](docs/AnalysesCoreApi.md#lookupBinaryId) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID -*AnalysesCoreApi* | [**putAnalysisStrings**](docs/AnalysesCoreApi.md#putAnalysisStrings) | **PUT** /v2/analyses/{analysis_id}/strings | Add strings to the analysis -*AnalysesCoreApi* | [**requeueAnalysis**](docs/AnalysesCoreApi.md#requeueAnalysis) | **POST** /v2/analyses/{analysis_id}/requeue | Requeue Analysis *AnalysesCoreApi* | [**startAnalysisFunctionMatching**](docs/AnalysesCoreApi.md#startAnalysisFunctionMatching) | **POST** /v3/analyses/{analysis_id}/functions/matches | Start function matching for an analysis -*AnalysesCoreApi* | [**updateAnalysis**](docs/AnalysesCoreApi.md#updateAnalysis) | **PATCH** /v2/analyses/{analysis_id} | Update Analysis -*AnalysesCoreApi* | [**updateAnalysisTags**](docs/AnalysesCoreApi.md#updateAnalysisTags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags -*AnalysesCoreApi* | [**uploadFile**](docs/AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File *AnalysesCoreApi* | [**v3GetAnalysisAutoUnstripStatus**](docs/AnalysesCoreApi.md#v3GetAnalysisAutoUnstripStatus) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. *AnalysesCoreApi* | [**v3GetAnalysisStrings**](docs/AnalysesCoreApi.md#v3GetAnalysisStrings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. *AnalysesCoreApi* | [**v3GetAnalysisStringsStatus**](docs/AnalysesCoreApi.md#v3GetAnalysisStringsStatus) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. *AnalysesCoreApi* | [**v3ListAnalyses**](docs/AnalysesCoreApi.md#v3ListAnalyses) | **GET** /v3/analyses | List analyses *AnalysesCoreApi* | [**v3ListExampleAnalyses**](docs/AnalysesCoreApi.md#v3ListExampleAnalyses) | **GET** /v3/analyses/examples | List example analyses -*AnalysesResultsMetadataApi* | [**getAnalysisFunctionsPaginated**](docs/AnalysesResultsMetadataApi.md#getAnalysisFunctionsPaginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis -*AnalysesResultsMetadataApi* | [**getCapabilities**](docs/AnalysesResultsMetadataApi.md#getCapabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis -*AnalysesResultsMetadataApi* | [**getFunctionsList**](docs/AnalysesResultsMetadataApi.md#getFunctionsList) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis -*AnalysesResultsMetadataApi* | [**getSbom**](docs/AnalysesResultsMetadataApi.md#getSbom) | **GET** /v2/analyses/{analysis_id}/sbom | Gets the software-bill-of-materials (SBOM) found in the analysis -*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 -*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 -*AuthenticationUsersApi* | [**submitUserFeedback**](docs/AuthenticationUsersApi.md#submitUserFeedback) | **POST** /v2/users/feedback | Submit feedback about the application -*BinariesApi* | [**downloadZippedBinary**](docs/BinariesApi.md#downloadZippedBinary) | **GET** /v2/binaries/{binary_id}/download-zipped | Downloads a zipped binary with password protection -*BinariesApi* | [**getBinaryAdditionalDetails**](docs/BinariesApi.md#getBinaryAdditionalDetails) | **GET** /v2/binaries/{binary_id}/additional-details | Gets the additional details of a binary -*BinariesApi* | [**getBinaryAdditionalDetailsStatus**](docs/BinariesApi.md#getBinaryAdditionalDetailsStatus) | **GET** /v2/binaries/{binary_id}/additional-details/status | Gets the status of the additional details task for a binary -*BinariesApi* | [**getBinaryAdditionalDetailsStatus_0**](docs/BinariesApi.md#getBinaryAdditionalDetailsStatus_0) | **GET** /v3/binaries/{binary_id}/additional-details/status | Get the additional-details extraction status for a binary. -*BinariesApi* | [**getBinaryAdditionalDetails_0**](docs/BinariesApi.md#getBinaryAdditionalDetails_0) | **GET** /v3/binaries/{binary_id}/additional-details | Get additional details for a binary. -*BinariesApi* | [**getBinaryDetails**](docs/BinariesApi.md#getBinaryDetails) | **GET** /v2/binaries/{binary_id}/details | Gets the details of a binary -*BinariesApi* | [**getBinaryDieInfo**](docs/BinariesApi.md#getBinaryDieInfo) | **GET** /v2/binaries/{binary_id}/die-info | Gets the die info of a binary -*BinariesApi* | [**getBinaryExternals**](docs/BinariesApi.md#getBinaryExternals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary -*BinariesApi* | [**getBinaryRelatedStatus**](docs/BinariesApi.md#getBinaryRelatedStatus) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary -*BinariesApi* | [**getRelatedBinaries**](docs/BinariesApi.md#getRelatedBinaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. -*CollectionsApi* | [**createCollection**](docs/CollectionsApi.md#createCollection) | **POST** /v2/collections | Creates new collection information -*CollectionsApi* | [**deleteCollection**](docs/CollectionsApi.md#deleteCollection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection -*CollectionsApi* | [**getCollection**](docs/CollectionsApi.md#getCollection) | **GET** /v2/collections/{collection_id} | Returns a collection -*CollectionsApi* | [**listCollections**](docs/CollectionsApi.md#listCollections) | **GET** /v2/collections | Gets basic collections information -*CollectionsApi* | [**updateCollection**](docs/CollectionsApi.md#updateCollection) | **PATCH** /v2/collections/{collection_id} | Updates a collection -*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 +*BinariesApi* | [**getBinaryAdditionalDetails**](docs/BinariesApi.md#getBinaryAdditionalDetails) | **GET** /v3/binaries/{binary_id}/additional-details | Get additional details for a binary. +*BinariesApi* | [**getBinaryAdditionalDetailsStatus**](docs/BinariesApi.md#getBinaryAdditionalDetailsStatus) | **GET** /v3/binaries/{binary_id}/additional-details/status | Get the additional-details extraction status for a binary. *CollectionsApi* | [**v3CreateCollection**](docs/CollectionsApi.md#v3CreateCollection) | **POST** /v3/collections | Create a collection. *CollectionsApi* | [**v3DeleteCollection**](docs/CollectionsApi.md#v3DeleteCollection) | **DELETE** /v3/collections/{collection_id} | Delete a collection. *CollectionsApi* | [**v3GetCollection**](docs/CollectionsApi.md#v3GetCollection) | **GET** /v3/collections/{collection_id} | Get a collection. @@ -153,7 +98,6 @@ Class | Method | HTTP request | Description *CollectionsApi* | [**v3PatchCollection**](docs/CollectionsApi.md#v3PatchCollection) | **PATCH** /v3/collections/{collection_id} | Update a collection. *CollectionsApi* | [**v3PatchCollectionBinaries**](docs/CollectionsApi.md#v3PatchCollectionBinaries) | **PATCH** /v3/collections/{collection_id}/binaries | Replace the binaries in a collection. *CollectionsApi* | [**v3PatchCollectionTags**](docs/CollectionsApi.md#v3PatchCollectionTags) | **PATCH** /v3/collections/{collection_id}/tags | Replace the tags on a collection. -*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 @@ -161,17 +105,11 @@ Class | Method | HTTP request | Description *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 -*FirmwareApi* | [**getBinariesForFirmwareTask**](docs/FirmwareApi.md#getBinariesForFirmwareTask) | **GET** /v2/firmware/get-binaries/{task_id} | Upload firmware for unpacking -*FirmwareApi* | [**uploadFirmware**](docs/FirmwareApi.md#uploadFirmware) | **POST** /v2/firmware | Upload firmware for unpacking *FunctionsAiDecompilationApi* | [**createAiDecompilation**](docs/FunctionsAiDecompilationApi.md#createAiDecompilation) | **POST** /v3/functions/{function_id}/ai-decompilation | Start AI decompilation *FunctionsAiDecompilationApi* | [**deleteAiDecompilationInlineComment**](docs/FunctionsAiDecompilationApi.md#deleteAiDecompilationInlineComment) | **DELETE** /v3/functions/{function_id}/ai-decompilation/inline-comments/{line} | Delete a single inline comment *FunctionsAiDecompilationApi* | [**getAiDecompilation**](docs/FunctionsAiDecompilationApi.md#getAiDecompilation) | **GET** /v3/functions/{function_id}/ai-decompilation | Get AI decompilation result *FunctionsAiDecompilationApi* | [**getAiDecompilationInlineComments**](docs/FunctionsAiDecompilationApi.md#getAiDecompilationInlineComments) | **GET** /v3/functions/{function_id}/ai-decompilation/inline-comments | Get AI decompilation inline comments *FunctionsAiDecompilationApi* | [**getAiDecompilationInlineCommentsStatus**](docs/FunctionsAiDecompilationApi.md#getAiDecompilationInlineCommentsStatus) | **GET** /v3/functions/{function_id}/ai-decompilation/inline-comments/status | Get inline comments generation workflow status -*FunctionsAiDecompilationApi* | [**getAiDecompilationRating**](docs/FunctionsAiDecompilationApi.md#getAiDecompilationRating) | **GET** /v2/functions/{function_id}/ai-decompilation/rating | Get rating for AI decompilation *FunctionsAiDecompilationApi* | [**getAiDecompilationStatus**](docs/FunctionsAiDecompilationApi.md#getAiDecompilationStatus) | **GET** /v3/functions/{function_id}/ai-decompilation/status | Get AI decompilation workflow status *FunctionsAiDecompilationApi* | [**getAiDecompilationSummary**](docs/FunctionsAiDecompilationApi.md#getAiDecompilationSummary) | **GET** /v3/functions/{function_id}/ai-decompilation/summary | Get AI decompilation summary *FunctionsAiDecompilationApi* | [**getAiDecompilationSummaryStatus**](docs/FunctionsAiDecompilationApi.md#getAiDecompilationSummaryStatus) | **GET** /v3/functions/{function_id}/ai-decompilation/summary/status | Get summary generation workflow status @@ -181,23 +119,14 @@ Class | Method | HTTP request | Description *FunctionsAiDecompilationApi* | [**regenerateAiDecompilationSummary**](docs/FunctionsAiDecompilationApi.md#regenerateAiDecompilationSummary) | **POST** /v3/functions/{function_id}/ai-decompilation/summary | Regenerate AI decompilation summary *FunctionsAiDecompilationApi* | [**streamAiDecompilation**](docs/FunctionsAiDecompilationApi.md#streamAiDecompilation) | **GET** /v3/functions/{function_id}/ai-decompilation/events | Stream live AI decompilation output (SSE) *FunctionsAiDecompilationApi* | [**upsertAiDecompilationOverrides**](docs/FunctionsAiDecompilationApi.md#upsertAiDecompilationOverrides) | **PATCH** /v3/functions/{function_id}/ai-decompilation/overrides | Upsert variable/function name overrides -*FunctionsAiDecompilationApi* | [**upsertAiDecompilationRating**](docs/FunctionsAiDecompilationApi.md#upsertAiDecompilationRating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation *FunctionsCoreApi* | [**addFunctionCallee**](docs/FunctionsCoreApi.md#addFunctionCallee) | **POST** /v3/functions/{function_id}/callees | Add a callee to a function *FunctionsCoreApi* | [**addUserStringToFunction**](docs/FunctionsCoreApi.md#addUserStringToFunction) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. -*FunctionsCoreApi* | [**getAnalysisStrings**](docs/FunctionsCoreApi.md#getAnalysisStrings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis -*FunctionsCoreApi* | [**getAnalysisStringsStatus**](docs/FunctionsCoreApi.md#getAnalysisStringsStatus) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis -*FunctionsCoreApi* | [**getFunctionBlocks**](docs/FunctionsCoreApi.md#getFunctionBlocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function -*FunctionsCoreApi* | [**getFunctionBlocks_0**](docs/FunctionsCoreApi.md#getFunctionBlocks_0) | **GET** /v3/functions/{function_id}/blocks | Get function disassembly -*FunctionsCoreApi* | [**getFunctionCalleesCallers**](docs/FunctionsCoreApi.md#getFunctionCalleesCallers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function -*FunctionsCoreApi* | [**getFunctionCalleesCallersBulk**](docs/FunctionsCoreApi.md#getFunctionCalleesCallersBulk) | **GET** /v2/functions/callees_callers | Get list of functions that call or are called for a list of functions -*FunctionsCoreApi* | [**getFunctionCalleesCallers_0**](docs/FunctionsCoreApi.md#getFunctionCalleesCallers_0) | **GET** /v3/functions/{function_id}/callees-callers | Get callees and callers for a function -*FunctionsCoreApi* | [**getFunctionCapabilities**](docs/FunctionsCoreApi.md#getFunctionCapabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities -*FunctionsCoreApi* | [**getFunctionCapabilities_0**](docs/FunctionsCoreApi.md#getFunctionCapabilities_0) | **GET** /v3/functions/{function_id}/capabilities | Get capabilities for a function -*FunctionsCoreApi* | [**getFunctionDetails**](docs/FunctionsCoreApi.md#getFunctionDetails) | **GET** /v2/functions/{function_id} | Get function details -*FunctionsCoreApi* | [**getFunctionDetails_0**](docs/FunctionsCoreApi.md#getFunctionDetails_0) | **GET** /v3/functions/{function_id} | Get function details +*FunctionsCoreApi* | [**getFunctionBlocks**](docs/FunctionsCoreApi.md#getFunctionBlocks) | **GET** /v3/functions/{function_id}/blocks | Get function disassembly +*FunctionsCoreApi* | [**getFunctionCalleesCallers**](docs/FunctionsCoreApi.md#getFunctionCalleesCallers) | **GET** /v3/functions/{function_id}/callees-callers | Get callees and callers for a function +*FunctionsCoreApi* | [**getFunctionCapabilities**](docs/FunctionsCoreApi.md#getFunctionCapabilities) | **GET** /v3/functions/{function_id}/capabilities | Get capabilities for a function +*FunctionsCoreApi* | [**getFunctionDetails**](docs/FunctionsCoreApi.md#getFunctionDetails) | **GET** /v3/functions/{function_id} | Get function details *FunctionsCoreApi* | [**getFunctionIndirectCallSites**](docs/FunctionsCoreApi.md#getFunctionIndirectCallSites) | **GET** /v3/functions/{function_id}/indirect-call-sites | Get indirect call sites for a function -*FunctionsCoreApi* | [**getFunctionStrings**](docs/FunctionsCoreApi.md#getFunctionStrings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function -*FunctionsCoreApi* | [**getFunctionStrings_0**](docs/FunctionsCoreApi.md#getFunctionStrings_0) | **GET** /v3/functions/{function_id}/strings | List strings for a function. +*FunctionsCoreApi* | [**getFunctionStrings**](docs/FunctionsCoreApi.md#getFunctionStrings) | **GET** /v3/functions/{function_id}/strings | List strings for a function. *FunctionsCoreApi* | [**getFunctionsCalleesCallers**](docs/FunctionsCoreApi.md#getFunctionsCalleesCallers) | **GET** /v3/functions/callees-callers | Get callees and callers for many functions *FunctionsCoreApi* | [**getFunctionsMatches**](docs/FunctionsCoreApi.md#getFunctionsMatches) | **GET** /v3/functions/matches | Get function-matching results for an explicit set of functions *FunctionsCoreApi* | [**getFunctionsMatchingStatus**](docs/FunctionsCoreApi.md#getFunctionsMatchingStatus) | **GET** /v3/functions/matches/status | Get function-matching status for an explicit set of functions @@ -207,32 +136,19 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**startFunctionsMatching**](docs/FunctionsCoreApi.md#startFunctionsMatching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions *FunctionsCoreApi* | [**v3CanonicalizeFunctionNames**](docs/FunctionsCoreApi.md#v3CanonicalizeFunctionNames) | **POST** /v3/functions/canonical-names | Canonicalize a batch of function names *FunctionsDataTypesApi* | [**batchUpdateFunctionDataTypes**](docs/FunctionsDataTypesApi.md#batchUpdateFunctionDataTypes) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types -*FunctionsDataTypesApi* | [**generateFunctionDataTypesForAnalysis**](docs/FunctionsDataTypesApi.md#generateFunctionDataTypesForAnalysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types -*FunctionsDataTypesApi* | [**generateFunctionDataTypesForFunctions**](docs/FunctionsDataTypesApi.md#generateFunctionDataTypesForFunctions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions *FunctionsDataTypesApi* | [**getFunctionDataTypes**](docs/FunctionsDataTypesApi.md#getFunctionDataTypes) | **GET** /v3/analyses/{analysis_id}/functions/{function_id}/data-types | Get data types for a single function *FunctionsDataTypesApi* | [**listAnalysisFunctionsDataTypes**](docs/FunctionsDataTypesApi.md#listAnalysisFunctionsDataTypes) | **GET** /v3/analyses/{analysis_id}/functions/data-types | List data types for all functions in an analysis -*FunctionsDataTypesApi* | [**listFunctionDataTypesForAnalysis**](docs/FunctionsDataTypesApi.md#listFunctionDataTypesForAnalysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types -*FunctionsDataTypesApi* | [**listFunctionDataTypesForFunctions**](docs/FunctionsDataTypesApi.md#listFunctionDataTypesForFunctions) | **GET** /v2/functions/data_types | List Function Data Types *FunctionsDataTypesApi* | [**listFunctionsDataTypes**](docs/FunctionsDataTypesApi.md#listFunctionsDataTypes) | **GET** /v3/functions/data-types | Get data types for many functions *FunctionsDataTypesApi* | [**updateFunctionDataTypes**](docs/FunctionsDataTypesApi.md#updateFunctionDataTypes) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update function data types -*FunctionsRenamingHistoryApi* | [**batchRenameFunction**](docs/FunctionsRenamingHistoryApi.md#batchRenameFunction) | **POST** /v2/functions/rename/batch | Batch Rename Functions *FunctionsRenamingHistoryApi* | [**batchRenameFunctions**](docs/FunctionsRenamingHistoryApi.md#batchRenameFunctions) | **POST** /v3/functions/rename | Batch rename functions *FunctionsRenamingHistoryApi* | [**getFunctionHistory**](docs/FunctionsRenamingHistoryApi.md#getFunctionHistory) | **GET** /v3/functions/{function_id}/history | Get function name history -*FunctionsRenamingHistoryApi* | [**getFunctionNameHistory**](docs/FunctionsRenamingHistoryApi.md#getFunctionNameHistory) | **GET** /v2/functions/history/{function_id} | Get Function Name History *FunctionsRenamingHistoryApi* | [**renameFunction**](docs/FunctionsRenamingHistoryApi.md#renameFunction) | **POST** /v3/functions/{function_id}/rename | Rename a function -*FunctionsRenamingHistoryApi* | [**renameFunctionId**](docs/FunctionsRenamingHistoryApi.md#renameFunctionId) | **POST** /v2/functions/rename/{function_id} | Rename Function -*FunctionsRenamingHistoryApi* | [**revertFunctionName**](docs/FunctionsRenamingHistoryApi.md#revertFunctionName) | **POST** /v2/functions/history/{function_id}/{history_id} | Revert the function name -*FunctionsRenamingHistoryApi* | [**revertFunctionName_0**](docs/FunctionsRenamingHistoryApi.md#revertFunctionName_0) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name +*FunctionsRenamingHistoryApi* | [**revertFunctionName**](docs/FunctionsRenamingHistoryApi.md#revertFunctionName) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name *IamUsersApi* | [**getMe**](docs/IamUsersApi.md#getMe) | **GET** /v2/iam/me | Get current user *IamUsersApi* | [**getMyPermissions**](docs/IamUsersApi.md#getMyPermissions) | **GET** /v2/iam/me/permissions | Get current user permissions -*ModelsApi* | [**getModels**](docs/ModelsApi.md#getModels) | **GET** /v2/models | Gets models *ReportsApi* | [**createPdfReport**](docs/ReportsApi.md#createPdfReport) | **POST** /v3/analyses/{analysis_id}/pdf | Start PDF report generation *ReportsApi* | [**downloadPdfReport**](docs/ReportsApi.md#downloadPdfReport) | **GET** /v3/analyses/{analysis_id}/pdf | Download generated PDF report *ReportsApi* | [**getPdfReportStatus**](docs/ReportsApi.md#getPdfReportStatus) | **GET** /v3/analyses/{analysis_id}/pdf/status | Get PDF report workflow status -*SearchApi* | [**searchBinaries**](docs/SearchApi.md#searchBinaries) | **GET** /v2/search/binaries | Binaries search -*SearchApi* | [**searchCollections**](docs/SearchApi.md#searchCollections) | **GET** /v2/search/collections | Collections search -*SearchApi* | [**searchFunctions**](docs/SearchApi.md#searchFunctions) | **GET** /v2/search/functions | Functions search -*SearchApi* | [**searchTags**](docs/SearchApi.md#searchTags) | **GET** /v2/search/tags | Tags search ## Documentation for Models @@ -247,118 +163,21 @@ Class | Method | HTTP request | Description - [AddTeamMemberInputBody](docs/AddTeamMemberInputBody.md) - [AddUserStringInputBody](docs/AddUserStringInputBody.md) - [AddUserStringToFunctionInputBody](docs/AddUserStringToFunctionInputBody.md) - - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) - - [AiDecompilationRating](docs/AiDecompilationRating.md) - - [AnalysisAccessInfo](docs/AnalysisAccessInfo.md) - [AnalysisBasicInfoOutputBody](docs/AnalysisBasicInfoOutputBody.md) - - [AnalysisBulkAddTagsRequest](docs/AnalysisBulkAddTagsRequest.md) - - [AnalysisBulkAddTagsResponse](docs/AnalysisBulkAddTagsResponse.md) - - [AnalysisBulkAddTagsResponseItem](docs/AnalysisBulkAddTagsResponseItem.md) - - [AnalysisConfig](docs/AnalysisConfig.md) - - [AnalysisConfigSnapshot](docs/AnalysisConfigSnapshot.md) - - [AnalysisCreateRequest](docs/AnalysisCreateRequest.md) - - [AnalysisCreateResponse](docs/AnalysisCreateResponse.md) - - [AnalysisDetailResponse](docs/AnalysisDetailResponse.md) - [AnalysisFunctionEntry](docs/AnalysisFunctionEntry.md) - - [AnalysisFunctionMapping](docs/AnalysisFunctionMapping.md) - - [AnalysisFunctions](docs/AnalysisFunctions.md) - - [AnalysisFunctionsList](docs/AnalysisFunctionsList.md) - [AnalysisLogMessage](docs/AnalysisLogMessage.md) - [AnalysisLogs](docs/AnalysisLogs.md) - - [AnalysisRecord](docs/AnalysisRecord.md) - [AnalysisRecordBody](docs/AnalysisRecordBody.md) - [AnalysisReport](docs/AnalysisReport.md) - - [AnalysisScope](docs/AnalysisScope.md) - [AnalysisStringFunction](docs/AnalysisStringFunction.md) - - [AnalysisStringInput](docs/AnalysisStringInput.md) - [AnalysisStringItem](docs/AnalysisStringItem.md) - - [AnalysisStringsResponse](docs/AnalysisStringsResponse.md) - - [AnalysisStringsStatusResponse](docs/AnalysisStringsStatusResponse.md) - [AnalysisTagBody](docs/AnalysisTagBody.md) - - [AnalysisTags](docs/AnalysisTags.md) - - [AnalysisUpdateRequest](docs/AnalysisUpdateRequest.md) - - [AnalysisUpdateTagsRequest](docs/AnalysisUpdateTagsRequest.md) - - [AnalysisUpdateTagsResponse](docs/AnalysisUpdateTagsResponse.md) - [ApiCall](docs/ApiCall.md) - - [AppApiRestV2AgentSchemaCapability](docs/AppApiRestV2AgentSchemaCapability.md) - - [AppApiRestV2AnalysesEnumsOrderBy](docs/AppApiRestV2AnalysesEnumsOrderBy.md) - - [AppApiRestV2CollectionsEnumsOrderBy](docs/AppApiRestV2CollectionsEnumsOrderBy.md) - - [AppApiRestV2FunctionsResponsesFunction](docs/AppApiRestV2FunctionsResponsesFunction.md) - - [AppApiRestV2FunctionsTypesFunction](docs/AppApiRestV2FunctionsTypesFunction.md) - - [AppApiRestV2InfoTypesCapability](docs/AppApiRestV2InfoTypesCapability.md) - [ArchiveContentEntry](docs/ArchiveContentEntry.md) - - [Argument](docs/Argument.md) - [Artifact](docs/Artifact.md) - [AttemptFailedEvent](docs/AttemptFailedEvent.md) - [AttemptStartedEvent](docs/AttemptStartedEvent.md) - - [AutoRunAgents](docs/AutoRunAgents.md) - [AutoUnstripStatusOutputBody](docs/AutoUnstripStatusOutputBody.md) - - [BaseResponse](docs/BaseResponse.md) - - [BaseResponseAdditionalDetailsStatusResponse](docs/BaseResponseAdditionalDetailsStatusResponse.md) - - [BaseResponseAnalysisBulkAddTagsResponse](docs/BaseResponseAnalysisBulkAddTagsResponse.md) - - [BaseResponseAnalysisCreateResponse](docs/BaseResponseAnalysisCreateResponse.md) - - [BaseResponseAnalysisDetailResponse](docs/BaseResponseAnalysisDetailResponse.md) - - [BaseResponseAnalysisFunctionMapping](docs/BaseResponseAnalysisFunctionMapping.md) - - [BaseResponseAnalysisFunctions](docs/BaseResponseAnalysisFunctions.md) - - [BaseResponseAnalysisFunctionsList](docs/BaseResponseAnalysisFunctionsList.md) - - [BaseResponseAnalysisStringsResponse](docs/BaseResponseAnalysisStringsResponse.md) - - [BaseResponseAnalysisStringsStatusResponse](docs/BaseResponseAnalysisStringsStatusResponse.md) - - [BaseResponseAnalysisTags](docs/BaseResponseAnalysisTags.md) - - [BaseResponseAnalysisUpdateTagsResponse](docs/BaseResponseAnalysisUpdateTagsResponse.md) - - [BaseResponseBasic](docs/BaseResponseBasic.md) - - [BaseResponseBinariesRelatedStatusResponse](docs/BaseResponseBinariesRelatedStatusResponse.md) - - [BaseResponseBinaryAdditionalResponse](docs/BaseResponseBinaryAdditionalResponse.md) - - [BaseResponseBinaryDetailsResponse](docs/BaseResponseBinaryDetailsResponse.md) - - [BaseResponseBinaryExternalsResponse](docs/BaseResponseBinaryExternalsResponse.md) - - [BaseResponseBinarySearchResponse](docs/BaseResponseBinarySearchResponse.md) - - [BaseResponseBool](docs/BaseResponseBool.md) - - [BaseResponseCalleesCallerFunctionsResponse](docs/BaseResponseCalleesCallerFunctionsResponse.md) - - [BaseResponseCapabilities](docs/BaseResponseCapabilities.md) - - [BaseResponseCapabilitiesAgentResponse](docs/BaseResponseCapabilitiesAgentResponse.md) - - [BaseResponseChildBinariesResponse](docs/BaseResponseChildBinariesResponse.md) - - [BaseResponseCollectionBinariesUpdateResponse](docs/BaseResponseCollectionBinariesUpdateResponse.md) - - [BaseResponseCollectionResponse](docs/BaseResponseCollectionResponse.md) - - [BaseResponseCollectionSearchResponse](docs/BaseResponseCollectionSearchResponse.md) - - [BaseResponseCollectionTagsUpdateResponse](docs/BaseResponseCollectionTagsUpdateResponse.md) - - [BaseResponseCommentResponse](docs/BaseResponseCommentResponse.md) - - [BaseResponseConfigResponse](docs/BaseResponseConfigResponse.md) - - [BaseResponseCreated](docs/BaseResponseCreated.md) - - [BaseResponseDict](docs/BaseResponseDict.md) - - [BaseResponseExternalResponse](docs/BaseResponseExternalResponse.md) - - [BaseResponseFunctionBlocksResponse](docs/BaseResponseFunctionBlocksResponse.md) - - [BaseResponseFunctionCapabilityResponse](docs/BaseResponseFunctionCapabilityResponse.md) - - [BaseResponseFunctionDataTypes](docs/BaseResponseFunctionDataTypes.md) - - [BaseResponseFunctionDataTypesList](docs/BaseResponseFunctionDataTypesList.md) - - [BaseResponseFunctionSearchResponse](docs/BaseResponseFunctionSearchResponse.md) - - [BaseResponseFunctionStringsResponse](docs/BaseResponseFunctionStringsResponse.md) - - [BaseResponseFunctionsDetailResponse](docs/BaseResponseFunctionsDetailResponse.md) - - [BaseResponseGenerateFunctionDataTypes](docs/BaseResponseGenerateFunctionDataTypes.md) - - [BaseResponseGenerationStatusList](docs/BaseResponseGenerationStatusList.md) - - [BaseResponseGetPublicUserResponse](docs/BaseResponseGetPublicUserResponse.md) - - [BaseResponseListCalleesCallerFunctionsResponse](docs/BaseResponseListCalleesCallerFunctionsResponse.md) - - [BaseResponseListCollectionResults](docs/BaseResponseListCollectionResults.md) - - [BaseResponseListCommentResponse](docs/BaseResponseListCommentResponse.md) - - [BaseResponseListDieMatch](docs/BaseResponseListDieMatch.md) - - [BaseResponseListFunctionNameHistory](docs/BaseResponseListFunctionNameHistory.md) - - [BaseResponseListSBOM](docs/BaseResponseListSBOM.md) - - [BaseResponseListUserActivityResponse](docs/BaseResponseListUserActivityResponse.md) - - [BaseResponseLogs](docs/BaseResponseLogs.md) - - [BaseResponseModelsResponse](docs/BaseResponseModelsResponse.md) - - [BaseResponseParams](docs/BaseResponseParams.md) - - [BaseResponseQueuedWorkflowTaskResponse](docs/BaseResponseQueuedWorkflowTaskResponse.md) - - [BaseResponseRecent](docs/BaseResponseRecent.md) - - [BaseResponseReportAnalysisResponse](docs/BaseResponseReportAnalysisResponse.md) - - [BaseResponseStatus](docs/BaseResponseStatus.md) - - [BaseResponseStr](docs/BaseResponseStr.md) - - [BaseResponseTagSearchResponse](docs/BaseResponseTagSearchResponse.md) - - [BaseResponseTaskResponse](docs/BaseResponseTaskResponse.md) - - [BaseResponseTaskStatusResponse](docs/BaseResponseTaskStatusResponse.md) - - [BaseResponseTriageReportResponse](docs/BaseResponseTriageReportResponse.md) - - [BaseResponseUnionGetAiDecompilationRatingResponseNoneType](docs/BaseResponseUnionGetAiDecompilationRatingResponseNoneType.md) - - [BaseResponseUploadResponse](docs/BaseResponseUploadResponse.md) - - [BaseResponseVulnerabilities](docs/BaseResponseVulnerabilities.md) - - [BaseResponseXrefResponse](docs/BaseResponseXrefResponse.md) - - [Basic](docs/Basic.md) - [BatchBinaryMatchResult](docs/BatchBinaryMatchResult.md) - [BatchMatchingOutputBody](docs/BatchMatchingOutputBody.md) - [BatchRenameInputBody](docs/BatchRenameInputBody.md) @@ -368,57 +187,21 @@ Class | Method | HTTP request | Description - [BatchUpdateDataTypesItem](docs/BatchUpdateDataTypesItem.md) - [BatchUpdateDataTypesOutputBody](docs/BatchUpdateDataTypesOutputBody.md) - [BatchUpdateDataTypesResult](docs/BatchUpdateDataTypesResult.md) - - [BinariesRelatedStatusResponse](docs/BinariesRelatedStatusResponse.md) - - [BinariesTaskStatus](docs/BinariesTaskStatus.md) - [Binary](docs/Binary.md) - - [BinaryAdditionalDetailsDataResponse](docs/BinaryAdditionalDetailsDataResponse.md) - - [BinaryAdditionalResponse](docs/BinaryAdditionalResponse.md) - - [BinaryConfig](docs/BinaryConfig.md) - - [BinaryDetailsResponse](docs/BinaryDetailsResponse.md) - - [BinaryExternalsResponse](docs/BinaryExternalsResponse.md) - - [BinarySearchResponse](docs/BinarySearchResponse.md) - - [BinarySearchResult](docs/BinarySearchResult.md) - - [BinaryTaskStatus](docs/BinaryTaskStatus.md) - [BulkCreateUserResult](docs/BulkCreateUserResult.md) - [BulkCreateUsersOutputBody](docs/BulkCreateUsersOutputBody.md) - - [BulkDeleteAnalysesRequest](docs/BulkDeleteAnalysesRequest.md) - [CallEdge](docs/CallEdge.md) - [CallEdgesOutputBody](docs/CallEdgesOutputBody.md) - - [CalleeFunctionInfo](docs/CalleeFunctionInfo.md) - - [CalleesCallerFunctionsResponse](docs/CalleesCallerFunctionsResponse.md) - - [CallerFunctionInfo](docs/CallerFunctionInfo.md) - [CanonicalName](docs/CanonicalName.md) - [CanonicalizeNamesInputBody](docs/CanonicalizeNamesInputBody.md) - [CanonicalizeNamesOutputBody](docs/CanonicalizeNamesOutputBody.md) - - [Capabilities](docs/Capabilities.md) - - [CapabilitiesAgentResponse](docs/CapabilitiesAgentResponse.md) - [CapabilitiesOutputBody](docs/CapabilitiesOutputBody.md) - [CapabilityEntry](docs/CapabilityEntry.md) - - [ChildBinariesResponse](docs/ChildBinariesResponse.md) - - [CodeSignatureModel](docs/CodeSignatureModel.md) - - [CollectionBinariesUpdateRequest](docs/CollectionBinariesUpdateRequest.md) - - [CollectionBinariesUpdateResponse](docs/CollectionBinariesUpdateResponse.md) - - [CollectionBinaryResponse](docs/CollectionBinaryResponse.md) - - [CollectionCreateRequest](docs/CollectionCreateRequest.md) - - [CollectionListItem](docs/CollectionListItem.md) - [CollectionListItemBody](docs/CollectionListItemBody.md) - - [CollectionResponse](docs/CollectionResponse.md) - - [CollectionResponseBinariesInner](docs/CollectionResponseBinariesInner.md) - - [CollectionScope](docs/CollectionScope.md) - - [CollectionSearchResponse](docs/CollectionSearchResponse.md) - - [CollectionSearchResult](docs/CollectionSearchResult.md) - - [CollectionTagsUpdateRequest](docs/CollectionTagsUpdateRequest.md) - - [CollectionTagsUpdateResponse](docs/CollectionTagsUpdateResponse.md) - - [CollectionUpdateRequest](docs/CollectionUpdateRequest.md) - - [CommentBase](docs/CommentBase.md) - - [CommentResponse](docs/CommentResponse.md) - - [CommentUpdateRequest](docs/CommentUpdateRequest.md) - [CommentsData](docs/CommentsData.md) - - [ConfigResponse](docs/ConfigResponse.md) - [ConfirmToolInputBody](docs/ConfirmToolInputBody.md) - [Connection](docs/Connection.md) - [ConsoleOutputEntry](docs/ConsoleOutputEntry.md) - - [Context](docs/Context.md) - [Conversation](docs/Conversation.md) - [ConversationContext](docs/ConversationContext.md) - [ConversationWithEvents](docs/ConversationWithEvents.md) @@ -434,30 +217,15 @@ Class | Method | HTTP request | Description - [CreatePortalSessionInputBody](docs/CreatePortalSessionInputBody.md) - [CreateTeamInputBody](docs/CreateTeamInputBody.md) - [CreateUserInputBody](docs/CreateUserInputBody.md) - - [Created](docs/Created.md) - [DataTypesEntry](docs/DataTypesEntry.md) - [DecompFailedEvent](docs/DecompFailedEvent.md) - [DecompFinishedEvent](docs/DecompFinishedEvent.md) - - [DecompilationCommentContext](docs/DecompilationCommentContext.md) - [DecompilationData](docs/DecompilationData.md) - - [DieMatch](docs/DieMatch.md) - [DisassemblyOutputBody](docs/DisassemblyOutputBody.md) - [DnsQuery](docs/DnsQuery.md) - [DrakvufFileMetadata](docs/DrakvufFileMetadata.md) - - [DynamicExecutionStatus](docs/DynamicExecutionStatus.md) - [DynamicExecutionStatusResponse](docs/DynamicExecutionStatusResponse.md) - - [ELFImportModel](docs/ELFImportModel.md) - - [ELFModel](docs/ELFModel.md) - - [ELFRelocation](docs/ELFRelocation.md) - - [ELFSection](docs/ELFSection.md) - - [ELFSecurity](docs/ELFSecurity.md) - - [ELFSegment](docs/ELFSegment.md) - - [ELFSymbol](docs/ELFSymbol.md) - - [ElfDynamicEntry](docs/ElfDynamicEntry.md) - - [EntrypointModel](docs/EntrypointModel.md) - - [Enumeration](docs/Enumeration.md) - [ErrorBody](docs/ErrorBody.md) - - [ErrorModel](docs/ErrorModel.md) - [Event](docs/Event.md) - [EventAttemptFailed](docs/EventAttemptFailed.md) - [EventAttemptStarted](docs/EventAttemptStarted.md) @@ -486,77 +254,36 @@ Class | Method | HTTP request | Description - [EventTOOLCONFIRMATIONREQUIRED](docs/EventTOOLCONFIRMATIONREQUIRED.md) - [EventWarning](docs/EventWarning.md) - [Example](docs/Example.md) - - [ExportModel](docs/ExportModel.md) - - [ExternalResponse](docs/ExternalResponse.md) - [ExtractedURL](docs/ExtractedURL.md) - [FileActivityEntry](docs/FileActivityEntry.md) - - [FileFormat](docs/FileFormat.md) - - [FileHashes](docs/FileHashes.md) - - [FileMetadata](docs/FileMetadata.md) - - [Filters](docs/Filters.md) - [FormFile](docs/FormFile.md) - - [FuncDepsInner](docs/FuncDepsInner.md) - [FunctionArgument](docs/FunctionArgument.md) - - [FunctionBlockDestinationResponse](docs/FunctionBlockDestinationResponse.md) - - [FunctionBlockResponse](docs/FunctionBlockResponse.md) - - [FunctionBlocksResponse](docs/FunctionBlocksResponse.md) - - [FunctionBoundary](docs/FunctionBoundary.md) - [FunctionCallEdges](docs/FunctionCallEdges.md) - - [FunctionCapabilityResponse](docs/FunctionCapabilityResponse.md) - - [FunctionDataTypes](docs/FunctionDataTypes.md) - - [FunctionDataTypesList](docs/FunctionDataTypesList.md) - - [FunctionDataTypesListItem](docs/FunctionDataTypesListItem.md) - - [FunctionDataTypesParams](docs/FunctionDataTypesParams.md) - - [FunctionDataTypesStatus](docs/FunctionDataTypesStatus.md) - [FunctionDependency](docs/FunctionDependency.md) - [FunctionDetailsOutputBody](docs/FunctionDetailsOutputBody.md) - [FunctionHeader](docs/FunctionHeader.md) - [FunctionInfo](docs/FunctionInfo.md) - - [FunctionListItem](docs/FunctionListItem.md) - - [FunctionLocalVariableResponse](docs/FunctionLocalVariableResponse.md) - - [FunctionMapping](docs/FunctionMapping.md) - [FunctionMatch](docs/FunctionMatch.md) - - [FunctionNameHistory](docs/FunctionNameHistory.md) - - [FunctionParamResponse](docs/FunctionParamResponse.md) - - [FunctionRename](docs/FunctionRename.md) - - [FunctionRenameMap](docs/FunctionRenameMap.md) - - [FunctionSearchResponse](docs/FunctionSearchResponse.md) - - [FunctionSearchResult](docs/FunctionSearchResult.md) - - [FunctionSourceType](docs/FunctionSourceType.md) - [FunctionStackVariable](docs/FunctionStackVariable.md) - - [FunctionString](docs/FunctionString.md) - [FunctionStringItem](docs/FunctionStringItem.md) - - [FunctionStringsResponse](docs/FunctionStringsResponse.md) - [FunctionType](docs/FunctionType.md) - - [FunctionsDetailResponse](docs/FunctionsDetailResponse.md) - - [FunctionsListRename](docs/FunctionsListRename.md) - - [GenerateFunctionDataTypes](docs/GenerateFunctionDataTypes.md) - [GeneratePDFOutputBody](docs/GeneratePDFOutputBody.md) - - [GenerationStatusList](docs/GenerationStatusList.md) - [GetAdditionalDetailsOutputBody](docs/GetAdditionalDetailsOutputBody.md) - [GetAdditionalDetailsStatusOutputBody](docs/GetAdditionalDetailsStatusOutputBody.md) - - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) - [GetAnalysisStringsStatusOutputBody](docs/GetAnalysisStringsStatusOutputBody.md) - [GetCollectionOutputBody](docs/GetCollectionOutputBody.md) - [GetMatchesOutputBody](docs/GetMatchesOutputBody.md) - [GetMatchesStatusOutputBody](docs/GetMatchesStatusOutputBody.md) - [GetProductsOutputBody](docs/GetProductsOutputBody.md) - - [GetPublicUserResponse](docs/GetPublicUserResponse.md) - [GetSubscriptionOutputBody](docs/GetSubscriptionOutputBody.md) - - [GlobalVariable](docs/GlobalVariable.md) - [HistoryEntry](docs/HistoryEntry.md) - [HttpRequest](docs/HttpRequest.md) - - [IOC](docs/IOC.md) - - [ISA](docs/ISA.md) - - [IconModel](docs/IconModel.md) - - [ImportModel](docs/ImportModel.md) - [ImportedFunctionCallerEntry](docs/ImportedFunctionCallerEntry.md) - [ImportedFunctionDetailOutputBody](docs/ImportedFunctionDetailOutputBody.md) - [ImportedFunctionEntry](docs/ImportedFunctionEntry.md) - [IndirectCallSite](docs/IndirectCallSite.md) - [IndirectCallSitesOutputBody](docs/IndirectCallSitesOutputBody.md) - [InlineComment](docs/InlineComment.md) - - [InsertAnalysisLogRequest](docs/InsertAnalysisLogRequest.md) - [InviteUserInputBody](docs/InviteUserInputBody.md) - [IssuerAllowedDomain](docs/IssuerAllowedDomain.md) - [ListAnalysesOutputBody](docs/ListAnalysesOutputBody.md) @@ -564,7 +291,6 @@ Class | Method | HTTP request | Description - [ListAnalysisFunctionsOutputBody](docs/ListAnalysisFunctionsOutputBody.md) - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) - [ListArchiveContentsOutputBody](docs/ListArchiveContentsOutputBody.md) - - [ListCollectionResults](docs/ListCollectionResults.md) - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) - [ListExampleAnalysesOutputBody](docs/ListExampleAnalysesOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) @@ -573,30 +299,19 @@ Class | Method | HTTP request | Description - [ListTeamsOutputBody](docs/ListTeamsOutputBody.md) - [ListUsersOutputBody](docs/ListUsersOutputBody.md) - [LocationOutputBody](docs/LocationOutputBody.md) - - [Logs](docs/Logs.md) - - [MITRETechnique](docs/MITRETechnique.md) - [MatchFilters](docs/MatchFilters.md) - [MatchedFunction](docs/MatchedFunction.md) - [MemdumpEntry](docs/MemdumpEntry.md) - [MessageBody](docs/MessageBody.md) - - [MetaModel](docs/MetaModel.md) - - [ModelName](docs/ModelName.md) - - [ModelsResponse](docs/ModelsResponse.md) - [ModuleLoadEntry](docs/ModuleLoadEntry.md) - [MutexEntry](docs/MutexEntry.md) - [NameConfidence](docs/NameConfidence.md) - - [NameSourceType](docs/NameSourceType.md) - [NetworkActivity](docs/NetworkActivity.md) - [OIDCCallbackInputBody](docs/OIDCCallbackInputBody.md) - - [Order](docs/Order.md) - [Organisation](docs/Organisation.md) - [OrganisationGroup](docs/OrganisationGroup.md) - [OrganisationIssuer](docs/OrganisationIssuer.md) - [OrganisationOwner](docs/OrganisationOwner.md) - - [PDBDebugModel](docs/PDBDebugModel.md) - - [PEModel](docs/PEModel.md) - - [PaginationModel](docs/PaginationModel.md) - - [Params](docs/Params.md) - [PasswordResetInputBody](docs/PasswordResetInputBody.md) - [PatchCollectionBinariesInputBody](docs/PatchCollectionBinariesInputBody.md) - [PatchCollectionBinariesOutputBody](docs/PatchCollectionBinariesOutputBody.md) @@ -607,7 +322,6 @@ Class | Method | HTTP request | Description - [PatchCommentBody](docs/PatchCommentBody.md) - [PcapBodyInfo](docs/PcapBodyInfo.md) - [Permissions](docs/Permissions.md) - - [Platform](docs/Platform.md) - [PriceOutput](docs/PriceOutput.md) - [PriceSummary](docs/PriceSummary.md) - [ProcessActivityEntry](docs/ProcessActivityEntry.md) @@ -618,45 +332,26 @@ Class | Method | HTTP request | Description - [ProductSummary](docs/ProductSummary.md) - [ProgressMessage](docs/ProgressMessage.md) - [ProseEvent](docs/ProseEvent.md) - - [PutAnalysisStringsRequest](docs/PutAnalysisStringsRequest.md) - - [QueuedWorkflowTaskResponse](docs/QueuedWorkflowTaskResponse.md) - - [ReAnalysisForm](docs/ReAnalysisForm.md) - - [Recent](docs/Recent.md) - [RefreshBody](docs/RefreshBody.md) - [RegenerateOutputBody](docs/RegenerateOutputBody.md) - [RegisterUserInputBody](docs/RegisterUserInputBody.md) - [RegistryOperation](docs/RegistryOperation.md) - - [RelativeBinaryResponse](docs/RelativeBinaryResponse.md) - [RenameAppliedEvent](docs/RenameAppliedEvent.md) - [RenameInputBody](docs/RenameInputBody.md) - [RenameOutputBody](docs/RenameOutputBody.md) - [ReplacementValue](docs/ReplacementValue.md) - - [ReportAnalysisResponse](docs/ReportAnalysisResponse.md) - [ReportEvent](docs/ReportEvent.md) - [ReportInfo](docs/ReportInfo.md) - [ReportOptions](docs/ReportOptions.md) - [RevokeBody](docs/RevokeBody.md) - - [SBOM](docs/SBOM.md) - - [SBOMPackage](docs/SBOMPackage.md) - [SSOProvider](docs/SSOProvider.md) - [SSOProvidersOutputBody](docs/SSOProvidersOutputBody.md) - - [SandboxOptions](docs/SandboxOptions.md) - - [SandboxStartMethod](docs/SandboxStartMethod.md) - - [SandboxTimeout](docs/SandboxTimeout.md) - [ScheduledTaskEntry](docs/ScheduledTaskEntry.md) - - [ScrapeThirdPartyConfig](docs/ScrapeThirdPartyConfig.md) - - [SectionModel](docs/SectionModel.md) - - [SecurityModel](docs/SecurityModel.md) - - [SegmentInfo](docs/SegmentInfo.md) - [SendMessageRequest](docs/SendMessageRequest.md) - [ServerSentEventsInner](docs/ServerSentEventsInner.md) - [ServerSentEventsInner1](docs/ServerSentEventsInner1.md) - [ServiceEntry](docs/ServiceEntry.md) - [SessionOutputBody](docs/SessionOutputBody.md) - - [SingleCodeCertificateModel](docs/SingleCodeCertificateModel.md) - - [SingleCodeSignatureModel](docs/SingleCodeSignatureModel.md) - - [SinglePDBEntryModel](docs/SinglePDBEntryModel.md) - - [SingleSectionModel](docs/SingleSectionModel.md) - [SourceDeltaEvent](docs/SourceDeltaEvent.md) - [SourceResetEvent](docs/SourceResetEvent.md) - [SseEventContextCompactedData](docs/SseEventContextCompactedData.md) @@ -676,42 +371,21 @@ Class | Method | HTTP request | Description - [SseEventToolCallResultData](docs/SseEventToolCallResultData.md) - [SseEventToolCallStartData](docs/SseEventToolCallStartData.md) - [SseEventToolConfirmationRequiredData](docs/SseEventToolConfirmationRequiredData.md) - - [StackVariable](docs/StackVariable.md) - [StartBatchMatchingInputBody](docs/StartBatchMatchingInputBody.md) - [StartMatchingForAnalysisInputBody](docs/StartMatchingForAnalysisInputBody.md) - [StartMatchingForFunctionsInputBody](docs/StartMatchingForFunctionsInputBody.md) - [StartMatchingOutputBody](docs/StartMatchingOutputBody.md) - [StartupInfo](docs/StartupInfo.md) - - [StatusInput](docs/StatusInput.md) - - [StatusOutput](docs/StatusOutput.md) - [StatusResponse](docs/StatusResponse.md) - - [StringFunctions](docs/StringFunctions.md) - - [StringSource](docs/StringSource.md) - - [Structure](docs/Structure.md) - - [StructureMember](docs/StructureMember.md) - - [SubmitUserFeedbackRequest](docs/SubmitUserFeedbackRequest.md) - [SummaryData](docs/SummaryData.md) - - [Symbols](docs/Symbols.md) - - [Tag](docs/Tag.md) - - [TagItem](docs/TagItem.md) - - [TagResponse](docs/TagResponse.md) - - [TagSearchResponse](docs/TagSearchResponse.md) - - [TagSearchResult](docs/TagSearchResult.md) - - [TaskResponse](docs/TaskResponse.md) - - [TaskStatus](docs/TaskStatus.md) - - [TaskStatusResponse](docs/TaskStatusResponse.md) - [TcpCarvedFile](docs/TcpCarvedFile.md) - [Team](docs/Team.md) - [TeamMember](docs/TeamMember.md) - - [TimestampModel](docs/TimestampModel.md) - [TokenInputBody](docs/TokenInputBody.md) - [TokenResponse](docs/TokenResponse.md) - [TokenisedData](docs/TokenisedData.md) - - [TriageFunctionResponse](docs/TriageFunctionResponse.md) - - [TriageReportResponse](docs/TriageReportResponse.md) - [TriggerDynamicExecutionInputBody](docs/TriggerDynamicExecutionInputBody.md) - [Ttp](docs/Ttp.md) - - [TypeDefinition](docs/TypeDefinition.md) - [UpdateDataTypesInputBody](docs/UpdateDataTypesInputBody.md) - [UpdateDataTypesOutputBody](docs/UpdateDataTypesOutputBody.md) - [UpdateIssuerInputBody](docs/UpdateIssuerInputBody.md) @@ -722,27 +396,14 @@ Class | Method | HTTP request | Description - [UpdateUserCreditsInputBody](docs/UpdateUserCreditsInputBody.md) - [UpdateUserInputBody](docs/UpdateUserInputBody.md) - [UpdateUserPasswordInputBody](docs/UpdateUserPasswordInputBody.md) - - [UploadFileType](docs/UploadFileType.md) - - [UploadResponse](docs/UploadResponse.md) - - [UpsertAiDecomplationRatingRequest](docs/UpsertAiDecomplationRatingRequest.md) - [UpsertOverridesData](docs/UpsertOverridesData.md) - [UpsertOverridesInputBody](docs/UpsertOverridesInputBody.md) - [User](docs/User.md) - - [UserActivityResponse](docs/UserActivityResponse.md) - [UserCredits](docs/UserCredits.md) - [UserIdentity](docs/UserIdentity.md) - [UserProfile](docs/UserProfile.md) - - [V2FunctionHeader](docs/V2FunctionHeader.md) - - [V2FunctionInfo](docs/V2FunctionInfo.md) - - [V2FunctionType](docs/V2FunctionType.md) - - [Vulnerabilities](docs/Vulnerabilities.md) - - [Vulnerability](docs/Vulnerability.md) - [WarningEvent](docs/WarningEvent.md) - [WorkflowProgress](docs/WorkflowProgress.md) - - [Workspace](docs/Workspace.md) - - [XrefFromResponse](docs/XrefFromResponse.md) - - [XrefResponse](docs/XrefResponse.md) - - [XrefToResponse](docs/XrefToResponse.md) ## Recommendation diff --git a/docs/AdditionalDetailsStatusResponse.md b/docs/AdditionalDetailsStatusResponse.md deleted file mode 100644 index 6a5a186..0000000 --- a/docs/AdditionalDetailsStatusResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AdditionalDetailsStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **String** | The current status of the additional details task | | - - - diff --git a/docs/AgentApi.md b/docs/AgentApi.md deleted file mode 100644 index 552e81f..0000000 --- a/docs/AgentApi.md +++ /dev/null @@ -1,668 +0,0 @@ -# AgentApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet**](AgentApi.md#checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet) | **GET** /v2/analyses/{analysis_id}/agent/capabilities/status | Check the status of a capabilities analysis workflow | -| [**checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet**](AgentApi.md#checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet) | **GET** /v2/analyses/{analysis_id}/agent/report-analysis/status | Check the status of a report analysis workflow | -| [**checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet**](AgentApi.md#checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet) | **GET** /v2/analyses/{analysis_id}/agent/triage/status | Check the status of a triage analysis workflow | -| [**createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost**](AgentApi.md#createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost) | **POST** /v2/analyses/{analysis_id}/agent/capabilities | Queues a capabilities analysis workflow process | -| [**createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost**](AgentApi.md#createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost) | **POST** /v2/analyses/{analysis_id}/agent/report-analysis | Queues a combined report analysis workflow process | -| [**createTriageTaskV2AnalysesAnalysisIdAgentTriagePost**](AgentApi.md#createTriageTaskV2AnalysesAnalysisIdAgentTriagePost) | **POST** /v2/analyses/{analysis_id}/agent/triage | Queues a triage analysis workflow process | -| [**getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet**](AgentApi.md#getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet) | **GET** /v2/analyses/{analysis_id}/agent/capabilities | Get Capabilities Result | -| [**getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet**](AgentApi.md#getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet) | **GET** /v2/analyses/{analysis_id}/agent/report-analysis | Get Report Analysis Result | -| [**getTriageResultV2AnalysesAnalysisIdAgentTriageGet**](AgentApi.md#getTriageResultV2AnalysesAnalysisIdAgentTriageGet) | **GET** /v2/analyses/{analysis_id}/agent/triage | Get Triage Result | - - - -# **checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet** -> TaskStatusResponse checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet(analysisId) - -Check the status of a capabilities analysis workflow - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - TaskStatusResponse result = apiInstance.checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet"); - 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 - -[**TaskStatusResponse**](TaskStatusResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet** -> TaskStatusResponse checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet(analysisId) - -Check the status of a report analysis workflow - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - TaskStatusResponse result = apiInstance.checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet"); - 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 - -[**TaskStatusResponse**](TaskStatusResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet** -> TaskStatusResponse checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet(analysisId) - -Check the status of a triage analysis workflow - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - TaskStatusResponse result = apiInstance.checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet"); - 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 - -[**TaskStatusResponse**](TaskStatusResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost** -> BaseResponseQueuedWorkflowTaskResponse createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost(analysisId) - -Queues a capabilities analysis workflow process - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseQueuedWorkflowTaskResponse result = apiInstance.createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost"); - 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 - -[**BaseResponseQueuedWorkflowTaskResponse**](BaseResponseQueuedWorkflowTaskResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **202** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost** -> QueuedWorkflowTaskResponse createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost(analysisId) - -Queues a combined report analysis workflow process - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - QueuedWorkflowTaskResponse result = apiInstance.createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost"); - 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 - -[**QueuedWorkflowTaskResponse**](QueuedWorkflowTaskResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **202** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **409** | Task already completed or queued | - | - - -# **createTriageTaskV2AnalysesAnalysisIdAgentTriagePost** -> BaseResponseQueuedWorkflowTaskResponse createTriageTaskV2AnalysesAnalysisIdAgentTriagePost(analysisId) - -Queues a triage analysis workflow process - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseQueuedWorkflowTaskResponse result = apiInstance.createTriageTaskV2AnalysesAnalysisIdAgentTriagePost(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#createTriageTaskV2AnalysesAnalysisIdAgentTriagePost"); - 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 - -[**BaseResponseQueuedWorkflowTaskResponse**](BaseResponseQueuedWorkflowTaskResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **202** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet** -> BaseResponseCapabilitiesAgentResponse getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet(analysisId) - -Get Capabilities Result - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseCapabilitiesAgentResponse result = apiInstance.getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet"); - 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 - -[**BaseResponseCapabilitiesAgentResponse**](BaseResponseCapabilitiesAgentResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet** -> BaseResponseReportAnalysisResponse getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet(analysisId) - -Get Report Analysis Result - -Returns: - A summary of the analysis - The software type of the binary - An attack flow summary - List of IOCs - List of MITRE executable techniques - A YARA rule - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseReportAnalysisResponse result = apiInstance.getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet"); - 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 - -[**BaseResponseReportAnalysisResponse**](BaseResponseReportAnalysisResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getTriageResultV2AnalysesAnalysisIdAgentTriageGet** -> BaseResponseTriageReportResponse getTriageResultV2AnalysesAnalysisIdAgentTriageGet(analysisId) - -Get Triage Result - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AgentApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AgentApi apiInstance = new AgentApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseTriageReportResponse result = apiInstance.getTriageResultV2AnalysesAnalysisIdAgentTriageGet(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AgentApi#getTriageResultV2AnalysesAnalysisIdAgentTriageGet"); - 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 - -[**BaseResponseTriageReportResponse**](BaseResponseTriageReportResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - diff --git a/docs/AiDecompilationRating.md b/docs/AiDecompilationRating.md deleted file mode 100644 index 5a5bf9f..0000000 --- a/docs/AiDecompilationRating.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AiDecompilationRating - -## Enum - - -* `POSITIVE` (value: `"POSITIVE"`) - -* `NEGATIVE` (value: `"NEGATIVE"`) - -* `NEUTRAL` (value: `"NEUTRAL"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/AnalysesBulkActionsApi.md b/docs/AnalysesBulkActionsApi.md deleted file mode 100644 index 76d0382..0000000 --- a/docs/AnalysesBulkActionsApi.md +++ /dev/null @@ -1,160 +0,0 @@ -# AnalysesBulkActionsApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**bulkAddAnalysisTags**](AnalysesBulkActionsApi.md#bulkAddAnalysisTags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags | -| [**bulkDeleteAnalyses**](AnalysesBulkActionsApi.md#bulkDeleteAnalyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses | - - - -# **bulkAddAnalysisTags** -> BaseResponseAnalysisBulkAddTagsResponse bulkAddAnalysisTags(analysisBulkAddTagsRequest) - -Bulk Add Analysis Tags - -Updates analysis tags for multiple analyses. User must be the owner. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesBulkActionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesBulkActionsApi apiInstance = new AnalysesBulkActionsApi(defaultClient); - AnalysisBulkAddTagsRequest analysisBulkAddTagsRequest = new AnalysisBulkAddTagsRequest(); // AnalysisBulkAddTagsRequest | - try { - BaseResponseAnalysisBulkAddTagsResponse result = apiInstance.bulkAddAnalysisTags(analysisBulkAddTagsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesBulkActionsApi#bulkAddAnalysisTags"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **analysisBulkAddTagsRequest** | [**AnalysisBulkAddTagsRequest**](AnalysisBulkAddTagsRequest.md)| | | - -### Return type - -[**BaseResponseAnalysisBulkAddTagsResponse**](BaseResponseAnalysisBulkAddTagsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **bulkDeleteAnalyses** -> BaseResponseDict bulkDeleteAnalyses(bulkDeleteAnalysesRequest) - -Bulk Delete Analyses - -Deletes multiple analyses. User must be the owner of all analyses. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesBulkActionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesBulkActionsApi apiInstance = new AnalysesBulkActionsApi(defaultClient); - BulkDeleteAnalysesRequest bulkDeleteAnalysesRequest = new BulkDeleteAnalysesRequest(); // BulkDeleteAnalysesRequest | - try { - BaseResponseDict result = apiInstance.bulkDeleteAnalyses(bulkDeleteAnalysesRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesBulkActionsApi#bulkDeleteAnalyses"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **bulkDeleteAnalysesRequest** | [**BulkDeleteAnalysesRequest**](BulkDeleteAnalysesRequest.md)| | | - -### Return type - -[**BaseResponseDict**](BaseResponseDict.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | Not Found | - | -| **403** | Forbidden | - | - diff --git a/docs/AnalysesCommentsApi.md b/docs/AnalysesCommentsApi.md deleted file mode 100644 index f4cd9d6..0000000 --- a/docs/AnalysesCommentsApi.md +++ /dev/null @@ -1,321 +0,0 @@ -# AnalysesCommentsApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createAnalysisComment**](AnalysesCommentsApi.md#createAnalysisComment) | **POST** /v2/analyses/{analysis_id}/comments | Create a comment for this analysis | -| [**deleteAnalysisComment**](AnalysesCommentsApi.md#deleteAnalysisComment) | **DELETE** /v2/analyses/{analysis_id}/comments/{comment_id} | Delete a comment | -| [**getAnalysisComments**](AnalysesCommentsApi.md#getAnalysisComments) | **GET** /v2/analyses/{analysis_id}/comments | Get comments for this analysis | -| [**updateAnalysisComment**](AnalysesCommentsApi.md#updateAnalysisComment) | **PATCH** /v2/analyses/{analysis_id}/comments/{comment_id} | Update a comment | - - - -# **createAnalysisComment** -> BaseResponseCommentResponse createAnalysisComment(analysisId, commentBase) - -Create a comment for this analysis - -Creates a comment associated with a specified analysis). - -### 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.AnalysesCommentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCommentsApi apiInstance = new AnalysesCommentsApi(defaultClient); - Integer analysisId = 56; // Integer | - CommentBase commentBase = new CommentBase(); // CommentBase | - try { - BaseResponseCommentResponse result = apiInstance.createAnalysisComment(analysisId, commentBase); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCommentsApi#createAnalysisComment"); - 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**| | | -| **commentBase** | [**CommentBase**](CommentBase.md)| | | - -### Return type - -[**BaseResponseCommentResponse**](BaseResponseCommentResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **400** | Bad Request | - | - - -# **deleteAnalysisComment** -> BaseResponseBool deleteAnalysisComment(commentId, analysisId) - -Delete a comment - -Deletes an existing comment. Users can only delete their own comments. - -### 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.AnalysesCommentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCommentsApi apiInstance = new AnalysesCommentsApi(defaultClient); - Integer commentId = 56; // Integer | - Integer analysisId = 56; // Integer | - try { - BaseResponseBool result = apiInstance.deleteAnalysisComment(commentId, analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCommentsApi#deleteAnalysisComment"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **commentId** | **Integer**| | | -| **analysisId** | **Integer**| | | - -### Return type - -[**BaseResponseBool**](BaseResponseBool.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **403** | You can only delete your own comments | - | -| **400** | Bad Request | - | - - -# **getAnalysisComments** -> BaseResponseListCommentResponse getAnalysisComments(analysisId) - -Get comments for this analysis - -Retrieves all comments created for a specific analysis. Only returns comments for resources the requesting user has access to. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCommentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCommentsApi apiInstance = new AnalysesCommentsApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseListCommentResponse result = apiInstance.getAnalysisComments(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCommentsApi#getAnalysisComments"); - 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 - -[**BaseResponseListCommentResponse**](BaseResponseListCommentResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **updateAnalysisComment** -> BaseResponseCommentResponse updateAnalysisComment(commentId, analysisId, commentUpdateRequest) - -Update a comment - -Updates the content of an existing comment. Users can only update their own comments. - -### 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.AnalysesCommentsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCommentsApi apiInstance = new AnalysesCommentsApi(defaultClient); - Integer commentId = 56; // Integer | - Integer analysisId = 56; // Integer | - CommentUpdateRequest commentUpdateRequest = new CommentUpdateRequest(); // CommentUpdateRequest | - try { - BaseResponseCommentResponse result = apiInstance.updateAnalysisComment(commentId, analysisId, commentUpdateRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCommentsApi#updateAnalysisComment"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **commentId** | **Integer**| | | -| **analysisId** | **Integer**| | | -| **commentUpdateRequest** | [**CommentUpdateRequest**](CommentUpdateRequest.md)| | | - -### Return type - -[**BaseResponseCommentResponse**](BaseResponseCommentResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **403** | You can only update your own comments | - | -| **400** | Bad Request | - | - diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 1dba6a1..d181c14 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -5,28 +5,13 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**addUserStringToAnalysis**](AnalysesCoreApi.md#addUserStringToAnalysis) | **POST** /v3/analyses/{analysis_id}/user-provided-strings | Add a user-provided string to an analysis. | -| [**createAnalysis**](AnalysesCoreApi.md#createAnalysis) | **POST** /v2/analyses | Create Analysis | -| [**deleteAnalysis**](AnalysesCoreApi.md#deleteAnalysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis | -| [**getAnalysisBasicInfo**](AnalysesCoreApi.md#getAnalysisBasicInfo) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information | -| [**getAnalysisBasicInfo_0**](AnalysesCoreApi.md#getAnalysisBasicInfo_0) | **GET** /v3/analyses/{analysis_id}/basic | Get basic analysis information | +| [**getAnalysisBasicInfo**](AnalysesCoreApi.md#getAnalysisBasicInfo) | **GET** /v3/analyses/{analysis_id}/basic | Get basic analysis information | | [**getAnalysisBytes**](AnalysesCoreApi.md#getAnalysisBytes) | **GET** /v3/analyses/{analysis_id}/bytes | Get the bytes of a binary | -| [**getAnalysisFunctionMap**](AnalysesCoreApi.md#getAnalysisFunctionMap) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map | | [**getAnalysisFunctionMatches**](AnalysesCoreApi.md#getAnalysisFunctionMatches) | **GET** /v3/analyses/{analysis_id}/functions/matches | Get function-matching results for an analysis | | [**getAnalysisFunctionMatchingStatus**](AnalysesCoreApi.md#getAnalysisFunctionMatchingStatus) | **GET** /v3/analyses/{analysis_id}/functions/matches/status | Get function-matching status for an analysis | -| [**getAnalysisLogs**](AnalysesCoreApi.md#getAnalysisLogs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis | -| [**getAnalysisParams**](AnalysesCoreApi.md#getAnalysisParams) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information | -| [**getAnalysisStatus**](AnalysesCoreApi.md#getAnalysisStatus) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis | | [**getDynamicExecutionReport**](AnalysesCoreApi.md#getDynamicExecutionReport) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/report | Get dynamic execution report | | [**getDynamicExecutionStatus**](AnalysesCoreApi.md#getDynamicExecutionStatus) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/status | Get dynamic execution status | -| [**insertAnalysisLog**](AnalysesCoreApi.md#insertAnalysisLog) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis | -| [**listAnalyses**](AnalysesCoreApi.md#listAnalyses) | **GET** /v2/analyses/list | Gets the most recent analyses | -| [**lookupBinaryId**](AnalysesCoreApi.md#lookupBinaryId) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID | -| [**putAnalysisStrings**](AnalysesCoreApi.md#putAnalysisStrings) | **PUT** /v2/analyses/{analysis_id}/strings | Add strings to the analysis | -| [**requeueAnalysis**](AnalysesCoreApi.md#requeueAnalysis) | **POST** /v2/analyses/{analysis_id}/requeue | Requeue Analysis | | [**startAnalysisFunctionMatching**](AnalysesCoreApi.md#startAnalysisFunctionMatching) | **POST** /v3/analyses/{analysis_id}/functions/matches | Start function matching for an analysis | -| [**updateAnalysis**](AnalysesCoreApi.md#updateAnalysis) | **PATCH** /v2/analyses/{analysis_id} | Update Analysis | -| [**updateAnalysisTags**](AnalysesCoreApi.md#updateAnalysisTags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags | -| [**uploadFile**](AnalysesCoreApi.md#uploadFile) | **POST** /v2/upload | Upload File | | [**v3GetAnalysisAutoUnstripStatus**](AnalysesCoreApi.md#v3GetAnalysisAutoUnstripStatus) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. | | [**v3GetAnalysisStrings**](AnalysesCoreApi.md#v3GetAnalysisStrings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. | | [**v3GetAnalysisStringsStatus**](AnalysesCoreApi.md#v3GetAnalysisStringsStatus) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. | @@ -113,167 +98,13 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **createAnalysis** -> BaseResponseAnalysisCreateResponse createAnalysis(analysisCreateRequest, xRevEngApplication) - -Create Analysis - -Begins an analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - AnalysisCreateRequest analysisCreateRequest = new AnalysisCreateRequest(); // AnalysisCreateRequest | - String xRevEngApplication = "xRevEngApplication_example"; // String | - try { - BaseResponseAnalysisCreateResponse result = apiInstance.createAnalysis(analysisCreateRequest, xRevEngApplication); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#createAnalysis"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **analysisCreateRequest** | [**AnalysisCreateRequest**](AnalysisCreateRequest.md)| | | -| **xRevEngApplication** | **String**| | [optional] | - -### Return type - -[**BaseResponseAnalysisCreateResponse**](BaseResponseAnalysisCreateResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | Not Found | - | -| **400** | Bad Request | - | - - -# **deleteAnalysis** -> BaseResponseDict deleteAnalysis(analysisId) - -Delete Analysis - -Deletes an analysis based on the provided analysis ID. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseDict result = apiInstance.deleteAnalysis(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#deleteAnalysis"); - 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 - -[**BaseResponseDict**](BaseResponseDict.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | Not Found | - | -| **403** | Forbidden | - | - # **getAnalysisBasicInfo** -> BaseResponseBasic getAnalysisBasicInfo(analysisId) +> AnalysisBasicInfoOutputBody getAnalysisBasicInfo(analysisId) -Gets basic analysis information +Get basic analysis information -Returns basic analysis information for an analysis +Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied ### Example ```java @@ -301,9 +132,9 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | + Long analysisId = 56L; // Long | Analysis ID try { - BaseResponseBasic result = apiInstance.getAnalysisBasicInfo(analysisId); + AnalysisBasicInfoOutputBody result = apiInstance.getAnalysisBasicInfo(analysisId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnalysesCoreApi#getAnalysisBasicInfo"); @@ -320,11 +151,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +| **analysisId** | **Long**| Analysis ID | | ### Return type -[**BaseResponseBasic**](BaseResponseBasic.md) +[**AnalysisBasicInfoOutputBody**](AnalysisBasicInfoOutputBody.md) ### Authorization @@ -338,16 +169,19 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | - -# **getAnalysisBasicInfo_0** -> AnalysisBasicInfoOutputBody getAnalysisBasicInfo_0(analysisId) + +# **getAnalysisBytes** +> getAnalysisBytes(analysisId, page) -Get basic analysis information +Get the bytes of a binary -Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example ```java @@ -376,11 +210,11 @@ public class Example { AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); Long analysisId = 56L; // Long | Analysis ID + Long page = 56L; // Long | 64kb page of binary data try { - AnalysisBasicInfoOutputBody result = apiInstance.getAnalysisBasicInfo_0(analysisId); - System.out.println(result); + apiInstance.getAnalysisBytes(analysisId, page); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisBasicInfo_0"); + System.err.println("Exception when calling AnalysesCoreApi#getAnalysisBytes"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -395,10 +229,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Long**| Analysis ID | | +| **page** | **Long**| 64kb page of binary data | [optional] | ### Return type -[**AnalysisBasicInfoOutputBody**](AnalysisBasicInfoOutputBody.md) +null (empty response body) ### Authorization @@ -413,18 +248,19 @@ public class Example { | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | | **403** | Forbidden | - | | **404** | Not Found | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getAnalysisBytes** -> getAnalysisBytes(analysisId, page) + +# **getAnalysisFunctionMatches** +> GetMatchesOutputBody getAnalysisFunctionMatches(analysisId, matchId) -Get the bytes of a binary +Get function-matching results for an analysis -Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example ```java @@ -453,11 +289,12 @@ public class Example { AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); Long analysisId = 56L; // Long | Analysis ID - Long page = 56L; // Long | 64kb page of binary data + String matchId = "matchId_example"; // String | Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. try { - apiInstance.getAnalysisBytes(analysisId, page); + GetMatchesOutputBody result = apiInstance.getAnalysisFunctionMatches(analysisId, matchId); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisBytes"); + System.err.println("Exception when calling AnalysesCoreApi#getAnalysisFunctionMatches"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -472,11 +309,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Long**| Analysis ID | | -| **page** | **Long**| 64kb page of binary data | [optional] | +| **matchId** | **String**| Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. | [optional] | ### Return type -null (empty response body) +[**GetMatchesOutputBody**](GetMatchesOutputBody.md) ### Authorization @@ -497,13 +334,13 @@ null (empty response body) | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getAnalysisFunctionMap** -> BaseResponseAnalysisFunctionMapping getAnalysisFunctionMap(analysisId) + +# **getAnalysisFunctionMatchingStatus** +> GetMatchesStatusOutputBody getAnalysisFunctionMatchingStatus(analysisId, matchId) -Get Analysis Function Map +Get function-matching status for an analysis -Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. +Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example ```java @@ -531,12 +368,13 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | + Long analysisId = 56L; // Long | Analysis ID + String matchId = "matchId_example"; // String | Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. try { - BaseResponseAnalysisFunctionMapping result = apiInstance.getAnalysisFunctionMap(analysisId); + GetMatchesStatusOutputBody result = apiInstance.getAnalysisFunctionMatchingStatus(analysisId, matchId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisFunctionMap"); + System.err.println("Exception when calling AnalysesCoreApi#getAnalysisFunctionMatchingStatus"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -550,11 +388,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +| **analysisId** | **Long**| Analysis ID | | +| **matchId** | **String**| Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. | [optional] | ### Return type -[**BaseResponseAnalysisFunctionMapping**](BaseResponseAnalysisFunctionMapping.md) +[**GetMatchesStatusOutputBody**](GetMatchesStatusOutputBody.md) ### Authorization @@ -568,16 +407,20 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | - -# **getAnalysisFunctionMatches** -> GetMatchesOutputBody getAnalysisFunctionMatches(analysisId, matchId) + +# **getDynamicExecutionReport** +> AnalysisReport getDynamicExecutionReport(analysisId) -Get function-matching results for an analysis +Get dynamic execution report -Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete ### Example ```java @@ -606,12 +449,11 @@ public class Example { AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); Long analysisId = 56L; // Long | Analysis ID - String matchId = "matchId_example"; // String | Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. try { - GetMatchesOutputBody result = apiInstance.getAnalysisFunctionMatches(analysisId, matchId); + AnalysisReport result = apiInstance.getDynamicExecutionReport(analysisId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisFunctionMatches"); + System.err.println("Exception when calling AnalysesCoreApi#getDynamicExecutionReport"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -626,11 +468,10 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Long**| Analysis ID | | -| **matchId** | **String**| Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. | [optional] | ### Return type -[**GetMatchesOutputBody**](GetMatchesOutputBody.md) +[**AnalysisReport**](AnalysisReport.md) ### Authorization @@ -645,19 +486,18 @@ public class Example { | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | -| **400** | Bad Request | - | | **403** | Forbidden | - | -| **404** | Not Found | - | +| **409** | Conflict | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getAnalysisFunctionMatchingStatus** -> GetMatchesStatusOutputBody getAnalysisFunctionMatchingStatus(analysisId, matchId) + +# **getDynamicExecutionStatus** +> DynamicExecutionStatusResponse getDynamicExecutionStatus(analysisId) -Get function-matching status for an analysis +Get dynamic execution status -Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied ### Example ```java @@ -686,12 +526,11 @@ public class Example { AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); Long analysisId = 56L; // Long | Analysis ID - String matchId = "matchId_example"; // String | Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. try { - GetMatchesStatusOutputBody result = apiInstance.getAnalysisFunctionMatchingStatus(analysisId, matchId); + DynamicExecutionStatusResponse result = apiInstance.getDynamicExecutionStatus(analysisId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisFunctionMatchingStatus"); + System.err.println("Exception when calling AnalysesCoreApi#getDynamicExecutionStatus"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -706,11 +545,10 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Long**| Analysis ID | | -| **matchId** | **String**| Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. | [optional] | ### Return type -[**GetMatchesStatusOutputBody**](GetMatchesStatusOutputBody.md) +[**DynamicExecutionStatusResponse**](DynamicExecutionStatusResponse.md) ### Authorization @@ -725,19 +563,17 @@ public class Example { | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | -| **400** | Bad Request | - | | **403** | Forbidden | - | -| **404** | Not Found | - | | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getAnalysisLogs** -> BaseResponseLogs getAnalysisLogs(analysisId) + +# **startAnalysisFunctionMatching** +> StartMatchingOutputBody startAnalysisFunctionMatching(analysisId, startMatchingForAnalysisInputBody) -Gets the logs of an analysis +Start function matching for an analysis -Given an analysis ID gets the current logs of an analysis +Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example ```java @@ -765,12 +601,13 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | + Long analysisId = 56L; // Long | Analysis ID + StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody = new StartMatchingForAnalysisInputBody(); // StartMatchingForAnalysisInputBody | try { - BaseResponseLogs result = apiInstance.getAnalysisLogs(analysisId); + StartMatchingOutputBody result = apiInstance.startAnalysisFunctionMatching(analysisId, startMatchingForAnalysisInputBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisLogs"); + System.err.println("Exception when calling AnalysesCoreApi#startAnalysisFunctionMatching"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -784,11 +621,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | +| **analysisId** | **Long**| Analysis ID | | +| **startMatchingForAnalysisInputBody** | [**StartMatchingForAnalysisInputBody**](StartMatchingForAnalysisInputBody.md)| | | ### Return type -[**BaseResponseLogs**](BaseResponseLogs.md) +[**StartMatchingOutputBody**](StartMatchingOutputBody.md) ### Authorization @@ -796,784 +634,7 @@ public class Example { ### 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 | - | - - -# **getAnalysisParams** -> BaseResponseParams getAnalysisParams(analysisId) - -Gets analysis param information - -Gets the params that the analysis was run with - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseParams result = apiInstance.getAnalysisParams(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisParams"); - 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 - -[**BaseResponseParams**](BaseResponseParams.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getAnalysisStatus** -> BaseResponseStatus getAnalysisStatus(analysisId) - -Gets the status of an analysis - -Given an analysis ID gets the current status of the analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseStatus result = apiInstance.getAnalysisStatus(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisStatus"); - 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 - -[**BaseResponseStatus**](BaseResponseStatus.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getDynamicExecutionReport** -> AnalysisReport getDynamicExecutionReport(analysisId) - -Get dynamic execution report - -Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Long analysisId = 56L; // Long | Analysis ID - try { - AnalysisReport result = apiInstance.getDynamicExecutionReport(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getDynamicExecutionReport"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Long**| Analysis ID | | - -### Return type - -[**AnalysisReport**](AnalysisReport.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **403** | Forbidden | - | -| **409** | Conflict | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - - -# **getDynamicExecutionStatus** -> DynamicExecutionStatusResponse getDynamicExecutionStatus(analysisId) - -Get dynamic execution status - -Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Long analysisId = 56L; // Long | Analysis ID - try { - DynamicExecutionStatusResponse result = apiInstance.getDynamicExecutionStatus(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getDynamicExecutionStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Long**| Analysis ID | | - -### Return type - -[**DynamicExecutionStatusResponse**](DynamicExecutionStatusResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **403** | Forbidden | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - - -# **insertAnalysisLog** -> BaseResponse insertAnalysisLog(analysisId, insertAnalysisLogRequest) - -Insert a log entry for an analysis - -Inserts a log record for an analysis. Only the analysis owner can insert logs. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - InsertAnalysisLogRequest insertAnalysisLogRequest = new InsertAnalysisLogRequest(); // InsertAnalysisLogRequest | - try { - BaseResponse result = apiInstance.insertAnalysisLog(analysisId, insertAnalysisLogRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#insertAnalysisLog"); - 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**| | | -| **insertAnalysisLogRequest** | [**InsertAnalysisLogRequest**](InsertAnalysisLogRequest.md)| | | - -### Return type - -[**BaseResponse**](BaseResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **listAnalyses** -> BaseResponseRecent listAnalyses(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order) - -Gets the most recent analyses - -Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - String searchTerm = ""; // String | - 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 - 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 | - Integer offset = 0; // Integer | - AppApiRestV2AnalysesEnumsOrderBy orderBy = AppApiRestV2AnalysesEnumsOrderBy.fromValue("created"); // AppApiRestV2AnalysesEnumsOrderBy | - Order order = Order.fromValue("ASC"); // Order | - try { - BaseResponseRecent result = apiInstance.listAnalyses(searchTerm, workspace, status, modelName, dynamicExecutionStatus, usernames, sha256Hash, limit, offset, orderBy, order); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#listAnalyses"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **searchTerm** | **String**| | [optional] [default to ] | -| **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** | [**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] | -| **offset** | **Integer**| | [optional] [default to 0] | -| **orderBy** | [**AppApiRestV2AnalysesEnumsOrderBy**](.md)| | [optional] [default to created] [enum: created, name, size] | -| **order** | [**Order**](.md)| | [optional] [default to DESC] [enum: ASC, DESC] | - -### Return type - -[**BaseResponseRecent**](BaseResponseRecent.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **lookupBinaryId** -> Object lookupBinaryId(binaryId) - -Gets the analysis ID from binary ID - -Given an binary ID gets the ID of an analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - Object result = apiInstance.lookupBinaryId(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#lookupBinaryId"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -**Object** - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **putAnalysisStrings** -> BaseResponse putAnalysisStrings(analysisId, putAnalysisStringsRequest) - -Add strings to the analysis - -Add strings to the analysis. Rejects if any string already exists at the given vaddr. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - PutAnalysisStringsRequest putAnalysisStringsRequest = new PutAnalysisStringsRequest(); // PutAnalysisStringsRequest | - try { - BaseResponse result = apiInstance.putAnalysisStrings(analysisId, putAnalysisStringsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#putAnalysisStrings"); - 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**| | | -| **putAnalysisStringsRequest** | [**PutAnalysisStringsRequest**](PutAnalysisStringsRequest.md)| | | - -### Return type - -[**BaseResponse**](BaseResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **requeueAnalysis** -> BaseResponseCreated requeueAnalysis(analysisId, reAnalysisForm, xRevEngApplication) - -Requeue Analysis - -Re-queues an already uploaded analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - ReAnalysisForm reAnalysisForm = new ReAnalysisForm(); // ReAnalysisForm | - String xRevEngApplication = "xRevEngApplication_example"; // String | - try { - BaseResponseCreated result = apiInstance.requeueAnalysis(analysisId, reAnalysisForm, xRevEngApplication); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#requeueAnalysis"); - 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**| | | -| **reAnalysisForm** | [**ReAnalysisForm**](ReAnalysisForm.md)| | | -| **xRevEngApplication** | **String**| | [optional] | - -### Return type - -[**BaseResponseCreated**](BaseResponseCreated.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | Not Found | - | -| **400** | Bad Request | - | - - -# **startAnalysisFunctionMatching** -> StartMatchingOutputBody startAnalysisFunctionMatching(analysisId, startMatchingForAnalysisInputBody) - -Start function matching for an analysis - -Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Long analysisId = 56L; // Long | Analysis ID - StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody = new StartMatchingForAnalysisInputBody(); // StartMatchingForAnalysisInputBody | - try { - StartMatchingOutputBody result = apiInstance.startAnalysisFunctionMatching(analysisId, startMatchingForAnalysisInputBody); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#startAnalysisFunctionMatching"); - 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 | | -| **startMatchingForAnalysisInputBody** | [**StartMatchingForAnalysisInputBody**](StartMatchingForAnalysisInputBody.md)| | | - -### Return type - -[**StartMatchingOutputBody**](StartMatchingOutputBody.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -1586,236 +647,6 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **updateAnalysis** -> BaseResponseAnalysisDetailResponse updateAnalysis(analysisId, analysisUpdateRequest) - -Update Analysis - -Updates analysis attributes (binary_name, analysis_scope). User must be the owner. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - AnalysisUpdateRequest analysisUpdateRequest = new AnalysisUpdateRequest(); // AnalysisUpdateRequest | - try { - BaseResponseAnalysisDetailResponse result = apiInstance.updateAnalysis(analysisId, analysisUpdateRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#updateAnalysis"); - 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**| | | -| **analysisUpdateRequest** | [**AnalysisUpdateRequest**](AnalysisUpdateRequest.md)| | | - -### Return type - -[**BaseResponseAnalysisDetailResponse**](BaseResponseAnalysisDetailResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **updateAnalysisTags** -> BaseResponseAnalysisUpdateTagsResponse updateAnalysisTags(analysisId, analysisUpdateTagsRequest) - -Update Analysis Tags - -Updates analysis tags. User must be the owner. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - AnalysisUpdateTagsRequest analysisUpdateTagsRequest = new AnalysisUpdateTagsRequest(); // AnalysisUpdateTagsRequest | - try { - BaseResponseAnalysisUpdateTagsResponse result = apiInstance.updateAnalysisTags(analysisId, analysisUpdateTagsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#updateAnalysisTags"); - 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**| | | -| **analysisUpdateTagsRequest** | [**AnalysisUpdateTagsRequest**](AnalysisUpdateTagsRequest.md)| | | - -### Return type - -[**BaseResponseAnalysisUpdateTagsResponse**](BaseResponseAnalysisUpdateTagsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **uploadFile** -> BaseResponseUploadResponse uploadFile(uploadFileType, _file, packedPassword, forceOverwrite) - -Upload File - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - UploadFileType uploadFileType = UploadFileType.fromValue("BINARY"); // UploadFileType | - File _file = new File("/path/to/file"); // File | - String packedPassword = "packedPassword_example"; // String | - Boolean forceOverwrite = false; // Boolean | - try { - BaseResponseUploadResponse result = apiInstance.uploadFile(uploadFileType, _file, packedPassword, forceOverwrite); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#uploadFile"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **uploadFileType** | [**UploadFileType**](UploadFileType.md)| | [enum: BINARY, DEBUG, PACKED, FIRMWARE] | -| **_file** | **File**| | | -| **packedPassword** | **String**| | [optional] | -| **forceOverwrite** | **Boolean**| | [optional] [default to false] | - -### Return type - -[**BaseResponseUploadResponse**](BaseResponseUploadResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **v3GetAnalysisAutoUnstripStatus** > AutoUnstripStatusOutputBody v3GetAnalysisAutoUnstripStatus(analysisId) diff --git a/docs/AnalysesResultsMetadataApi.md b/docs/AnalysesResultsMetadataApi.md deleted file mode 100644 index 74fdb77..0000000 --- a/docs/AnalysesResultsMetadataApi.md +++ /dev/null @@ -1,466 +0,0 @@ -# AnalysesResultsMetadataApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getAnalysisFunctionsPaginated**](AnalysesResultsMetadataApi.md#getAnalysisFunctionsPaginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis | -| [**getCapabilities**](AnalysesResultsMetadataApi.md#getCapabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis | -| [**getFunctionsList**](AnalysesResultsMetadataApi.md#getFunctionsList) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis | -| [**getSbom**](AnalysesResultsMetadataApi.md#getSbom) | **GET** /v2/analyses/{analysis_id}/sbom | Gets the software-bill-of-materials (SBOM) found in the analysis | -| [**getTags**](AnalysesResultsMetadataApi.md#getTags) | **GET** /v2/analyses/{analysis_id}/tags | Get function tags with maliciousness score | -| [**getVulnerabilities**](AnalysesResultsMetadataApi.md#getVulnerabilities) | **GET** /v2/analyses/{analysis_id}/vulnerabilities | Gets the vulnerabilities found in the analysis | - - - -# **getAnalysisFunctionsPaginated** -> BaseResponseAnalysisFunctionsList getAnalysisFunctionsPaginated(analysisId, page, pageSize) - -Get functions from analysis - -Returns a paginated list of functions identified during analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesResultsMetadataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesResultsMetadataApi apiInstance = new AnalysesResultsMetadataApi(defaultClient); - Integer analysisId = 56; // Integer | - Integer page = 1; // Integer | The page number to retrieve. - Integer pageSize = 1000; // Integer | Number of items per page. - try { - BaseResponseAnalysisFunctionsList result = apiInstance.getAnalysisFunctionsPaginated(analysisId, page, pageSize); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesResultsMetadataApi#getAnalysisFunctionsPaginated"); - 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**| | | -| **page** | **Integer**| The page number to retrieve. | [optional] [default to 1] | -| **pageSize** | **Integer**| Number of items per page. | [optional] [default to 1000] | - -### Return type - -[**BaseResponseAnalysisFunctionsList**](BaseResponseAnalysisFunctionsList.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getCapabilities** -> BaseResponseCapabilities getCapabilities(analysisId) - -Gets the capabilities from the analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesResultsMetadataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesResultsMetadataApi apiInstance = new AnalysesResultsMetadataApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseCapabilities result = apiInstance.getCapabilities(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesResultsMetadataApi#getCapabilities"); - 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 - -[**BaseResponseCapabilities**](BaseResponseCapabilities.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getFunctionsList** -> BaseResponseAnalysisFunctions getFunctionsList(analysisId, searchTerm, minVAddr, maxVAddr, includeEmbeddings, page, pageSize) - -Gets functions from analysis - -Gets the functions identified during analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesResultsMetadataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesResultsMetadataApi apiInstance = new AnalysesResultsMetadataApi(defaultClient); - Integer analysisId = 56; // Integer | - String searchTerm = "searchTerm_example"; // String | - Integer minVAddr = 56; // Integer | - Integer maxVAddr = 56; // Integer | - Boolean includeEmbeddings = true; // Boolean | - Integer page = 1; // Integer | The page number to retrieve. - Integer pageSize = 1000; // Integer | Number of items per page. - try { - BaseResponseAnalysisFunctions result = apiInstance.getFunctionsList(analysisId, searchTerm, minVAddr, maxVAddr, includeEmbeddings, page, pageSize); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesResultsMetadataApi#getFunctionsList"); - 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**| | | -| **searchTerm** | **String**| | [optional] | -| **minVAddr** | **Integer**| | [optional] | -| **maxVAddr** | **Integer**| | [optional] | -| **includeEmbeddings** | **Boolean**| | [optional] [default to true] | -| **page** | **Integer**| The page number to retrieve. | [optional] [default to 1] | -| **pageSize** | **Integer**| Number of items per page. | [optional] [default to 1000] | - -### Return type - -[**BaseResponseAnalysisFunctions**](BaseResponseAnalysisFunctions.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getSbom** -> BaseResponseListSBOM getSbom(analysisId) - -Gets the software-bill-of-materials (SBOM) found in the analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesResultsMetadataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesResultsMetadataApi apiInstance = new AnalysesResultsMetadataApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseListSBOM result = apiInstance.getSbom(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesResultsMetadataApi#getSbom"); - 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 - -[**BaseResponseListSBOM**](BaseResponseListSBOM.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getTags** -> BaseResponseAnalysisTags getTags(analysisId) - -Get function tags with maliciousness score - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesResultsMetadataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesResultsMetadataApi apiInstance = new AnalysesResultsMetadataApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseAnalysisTags result = apiInstance.getTags(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesResultsMetadataApi#getTags"); - 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 - -[**BaseResponseAnalysisTags**](BaseResponseAnalysisTags.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getVulnerabilities** -> BaseResponseVulnerabilities getVulnerabilities(analysisId) - -Gets the vulnerabilities found in the analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesResultsMetadataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesResultsMetadataApi apiInstance = new AnalysesResultsMetadataApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseVulnerabilities result = apiInstance.getVulnerabilities(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesResultsMetadataApi#getVulnerabilities"); - 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 - -[**BaseResponseVulnerabilities**](BaseResponseVulnerabilities.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - diff --git a/docs/AnalysesXRefsApi.md b/docs/AnalysesXRefsApi.md deleted file mode 100644 index 7b94f96..0000000 --- a/docs/AnalysesXRefsApi.md +++ /dev/null @@ -1,86 +0,0 @@ -# AnalysesXRefsApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getXrefByVaddr**](AnalysesXRefsApi.md#getXrefByVaddr) | **GET** /v2/analyses/{analysis_id}/xrefs/{vaddr} | [Beta] Look up xrefs by virtual address | - - - -# **getXrefByVaddr** -> BaseResponseXrefResponse getXrefByVaddr(analysisId, vaddr) - -[Beta] Look up xrefs by virtual address - -**This endpoint is in beta and may change without notice.** - -### 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.AnalysesXRefsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AnalysesXRefsApi apiInstance = new AnalysesXRefsApi(defaultClient); - Integer analysisId = 56; // Integer | - Integer vaddr = 56; // Integer | Virtual address to match against xrefs - try { - BaseResponseXrefResponse result = apiInstance.getXrefByVaddr(analysisId, vaddr); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesXRefsApi#getXrefByVaddr"); - 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**| | | -| **vaddr** | **Integer**| Virtual address to match against xrefs | | - -### Return type - -[**BaseResponseXrefResponse**](BaseResponseXrefResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | Xref or analysis cache not found | - | - diff --git a/docs/AnalysisAccessInfo.md b/docs/AnalysisAccessInfo.md deleted file mode 100644 index 0dd9cd3..0000000 --- a/docs/AnalysisAccessInfo.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# AnalysisAccessInfo - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**owner** | **Boolean** | | | -|**username** | **String** | | | - - - diff --git a/docs/AnalysisBulkAddTagsRequest.md b/docs/AnalysisBulkAddTagsRequest.md deleted file mode 100644 index 9a62fda..0000000 --- a/docs/AnalysisBulkAddTagsRequest.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# AnalysisBulkAddTagsRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tags** | **List<String>** | | | -|**analysisIds** | **List<Integer>** | | | - - - diff --git a/docs/AnalysisBulkAddTagsResponse.md b/docs/AnalysisBulkAddTagsResponse.md deleted file mode 100644 index eaf3b6b..0000000 --- a/docs/AnalysisBulkAddTagsResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AnalysisBulkAddTagsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**results** | [**List<AnalysisBulkAddTagsResponseItem>**](AnalysisBulkAddTagsResponseItem.md) | | | - - - diff --git a/docs/AnalysisBulkAddTagsResponseItem.md b/docs/AnalysisBulkAddTagsResponseItem.md deleted file mode 100644 index 7bd58ca..0000000 --- a/docs/AnalysisBulkAddTagsResponseItem.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# AnalysisBulkAddTagsResponseItem - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisId** | **Integer** | | | -|**message** | **String** | Success message if the update was successful | | -|**error** | **String** | Error message if the update failed | [optional] | - - - diff --git a/docs/AnalysisConfig.md b/docs/AnalysisConfig.md deleted file mode 100644 index 7ad2fef..0000000 --- a/docs/AnalysisConfig.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# AnalysisConfig - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**scrapeThirdPartyConfig** | [**ScrapeThirdPartyConfig**](ScrapeThirdPartyConfig.md) | Settings to scrape third party sources | [optional] | -|**generateCves** | **Boolean** | A configuration option for fetching CVEs data. | [optional] | -|**generateSbom** | **Boolean** | A configuration option for generating software bill of materials data. | [optional] | -|**generateCapabilities** | **Boolean** | A configuration option for generating capabilities of a binary | [optional] | -|**noCache** | **Boolean** | When enabled, skips using cached data within the processing. | [optional] | -|**advancedAnalysis** | **Boolean** | Enables an advanced security analysis. | [optional] | -|**sandboxConfig** | [**SandboxOptions**](SandboxOptions.md) | Including a sandbox config enables the dynamic execution sandbox | [optional] | - - - diff --git a/docs/AnalysisConfigSnapshot.md b/docs/AnalysisConfigSnapshot.md deleted file mode 100644 index 30bbc34..0000000 --- a/docs/AnalysisConfigSnapshot.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# AnalysisConfigSnapshot - -Point-in-time record of which features an analysis was submitted with. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functions** | **Boolean** | | | -|**sandbox** | **Boolean** | | | -|**scrape** | **Boolean** | | | -|**capabilities** | **Boolean** | | | -|**triage** | **Boolean** | | | - - - diff --git a/docs/AnalysisCreateRequest.md b/docs/AnalysisCreateRequest.md deleted file mode 100644 index 212be48..0000000 --- a/docs/AnalysisCreateRequest.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# AnalysisCreateRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**filename** | **String** | The name of the file | | -|**sha256Hash** | **String** | The sha256 hash of the file | | -|**tags** | [**List<Tag>**](Tag.md) | List of tags to assign to an analysis | [optional] | -|**analysisScope** | **AnalysisScope** | The scope of the analysis determines who can access it | [optional] | -|**symbols** | [**Symbols**](Symbols.md) | Symbols are user-defined properties which inform how the binary is decompiled | [optional] | -|**debugHash** | **String** | Hash of the debug file | [optional] | -|**analysisConfig** | [**AnalysisConfig**](AnalysisConfig.md) | The analysis config enables the configuration of optional analysis stages | [optional] | -|**binaryConfig** | [**BinaryConfig**](BinaryConfig.md) | The binary config can override automatically determined values such as ISA, Platform, File Format, etc | [optional] | -|**autoRunAgents** | [**AutoRunAgents**](AutoRunAgents.md) | | [optional] | - - - diff --git a/docs/AnalysisCreateResponse.md b/docs/AnalysisCreateResponse.md deleted file mode 100644 index 22f373e..0000000 --- a/docs/AnalysisCreateResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# AnalysisCreateResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisId** | **Integer** | ID of created analysis | | -|**binaryId** | **Integer** | ID of created binary | | - - - diff --git a/docs/AnalysisDetailResponse.md b/docs/AnalysisDetailResponse.md deleted file mode 100644 index cd68a11..0000000 --- a/docs/AnalysisDetailResponse.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# AnalysisDetailResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**access** | [**AnalysisAccessInfo**](AnalysisAccessInfo.md) | | | -|**analysisId** | **Integer** | | | -|**analysisScope** | **String** | | | -|**architecture** | **String** | | | -|**binaryDynamic** | **Boolean** | | | -|**binaryFormat** | **String** | | | -|**binaryName** | **String** | | | -|**binarySize** | **Integer** | | | -|**binaryType** | **String** | | | -|**creation** | **String** | | | -|**dashboardUrl** | **String** | URL to view this analysis in the dashboard | | -|**debug** | **Boolean** | | | -|**modelName** | **String** | | | -|**sbom** | **Map<String, Object>** | | [optional] | -|**sha256Hash** | **String** | | | -|**autoRunAgents** | [**AutoRunAgents**](AutoRunAgents.md) | | | -|**requestedConfig** | [**AnalysisConfigSnapshot**](AnalysisConfigSnapshot.md) | Snapshot of the configuration the analysis was submitted with. | | - - - diff --git a/docs/AnalysisFunctionEntry.md b/docs/AnalysisFunctionEntry.md index 369a59c..269499d 100644 --- a/docs/AnalysisFunctionEntry.md +++ b/docs/AnalysisFunctionEntry.md @@ -13,7 +13,7 @@ |**functionName** | **String** | | | |**functionSize** | **Long** | | | |**functionVaddr** | **Long** | | | -|**mangledName** | **String** | Search is applied to string value | [optional] | +|**mangledName** | **String** | | [optional] | |**sourceAnalysisId** | **Long** | ID of the analysis the source function belongs to, if any | [optional] | |**sourceBinaryId** | **Long** | | [optional] | |**sourceFunctionId** | **Long** | ID of the source function this name was transferred from, if any | [optional] | diff --git a/docs/AnalysisFunctionMapping.md b/docs/AnalysisFunctionMapping.md deleted file mode 100644 index 1680f62..0000000 --- a/docs/AnalysisFunctionMapping.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AnalysisFunctionMapping - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionMaps** | [**FunctionMapping**](FunctionMapping.md) | A map of function ids to function addresses for the analysis, and it's inverse. | | - - - diff --git a/docs/AnalysisFunctions.md b/docs/AnalysisFunctions.md deleted file mode 100644 index d3e0607..0000000 --- a/docs/AnalysisFunctions.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AnalysisFunctions - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functions** | [**List<AppApiRestV2FunctionsTypesFunction>**](AppApiRestV2FunctionsTypesFunction.md) | The functions associated with the analysis | | - - - diff --git a/docs/AnalysisFunctionsList.md b/docs/AnalysisFunctionsList.md deleted file mode 100644 index 1f4aca4..0000000 --- a/docs/AnalysisFunctionsList.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# AnalysisFunctionsList - -API response schema for paginated functions list - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functions** | [**List<FunctionListItem>**](FunctionListItem.md) | The functions associated with the analysis | | - - - diff --git a/docs/AnalysisRecord.md b/docs/AnalysisRecord.md deleted file mode 100644 index df315f7..0000000 --- a/docs/AnalysisRecord.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# AnalysisRecord - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisId** | **Integer** | ID to identify analysis | | -|**analysisScope** | **String** | Scope of the analysis | | -|**binaryId** | **Integer** | ID to identify the binary analyse | | -|**modelId** | **Integer** | ID to identify the model used for analysis | | -|**modelName** | **String** | Name of the model used for analysis | | -|**status** | **String** | The current status of analysis | | -|**creation** | **OffsetDateTime** | The datetime of when the analysis was created | | -|**isOwner** | **Boolean** | Whether the current user is the owner of a binary | | -|**binaryName** | **String** | The name of the file uploaded | | -|**sha256Hash** | **String** | The hash of the binary | | -|**functionBoundariesHash** | **String** | The hash of the function boundaries | | -|**binarySize** | **Integer** | The size of the binary | | -|**username** | **String** | The username of the analysis owner | | -|**dynamicExecutionStatus** | **DynamicExecutionStatus** | If searching for dynamic execution, the status of the task | [optional] | -|**dynamicExecutionTaskId** | **Integer** | If searching for dynamic execution, the task ID of the task | [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/AnalysisScope.md b/docs/AnalysisScope.md deleted file mode 100644 index 4841009..0000000 --- a/docs/AnalysisScope.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AnalysisScope - -## Enum - - -* `PRIVATE` (value: `"PRIVATE"`) - -* `PUBLIC` (value: `"PUBLIC"`) - -* `TEAM` (value: `"TEAM"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/AnalysisStringInput.md b/docs/AnalysisStringInput.md deleted file mode 100644 index b87b8c1..0000000 --- a/docs/AnalysisStringInput.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# AnalysisStringInput - -Input model for inserting a string into an analysis. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**value** | **String** | The string literal value | | -|**vaddr** | **Integer** | The virtual address of the string | | -|**source** | **StringSource** | The source of the string | | - - - diff --git a/docs/AnalysisStringsResponse.md b/docs/AnalysisStringsResponse.md deleted file mode 100644 index 52b7eaa..0000000 --- a/docs/AnalysisStringsResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# AnalysisStringsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**strings** | [**List<StringFunctions>**](StringFunctions.md) | The strings associated with the analysis | | -|**totalStrings** | **Integer** | The total number of strings associated with this analysis | | - - - diff --git a/docs/AnalysisStringsStatusResponse.md b/docs/AnalysisStringsStatusResponse.md deleted file mode 100644 index 6cfea76..0000000 --- a/docs/AnalysisStringsStatusResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AnalysisStringsStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **BinariesTaskStatus** | The current status of the strings extraction task | | - - - diff --git a/docs/AnalysisTags.md b/docs/AnalysisTags.md deleted file mode 100644 index b9b341f..0000000 --- a/docs/AnalysisTags.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AnalysisTags - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisTags** | [**List<TagItem>**](TagItem.md) | | | - - - diff --git a/docs/AnalysisUpdateRequest.md b/docs/AnalysisUpdateRequest.md deleted file mode 100644 index b608df2..0000000 --- a/docs/AnalysisUpdateRequest.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# AnalysisUpdateRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaryName** | **String** | | [optional] | -|**analysisScope** | **AnalysisScope** | The scope of the analysis determines who can access it | [optional] | - - - diff --git a/docs/AnalysisUpdateTagsRequest.md b/docs/AnalysisUpdateTagsRequest.md deleted file mode 100644 index 48cb36f..0000000 --- a/docs/AnalysisUpdateTagsRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AnalysisUpdateTagsRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tags** | **List<String>** | | | - - - diff --git a/docs/AnalysisUpdateTagsResponse.md b/docs/AnalysisUpdateTagsResponse.md deleted file mode 100644 index 369b445..0000000 --- a/docs/AnalysisUpdateTagsResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AnalysisUpdateTagsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tags** | [**List<TagResponse>**](TagResponse.md) | The analysis tags after updating | | - - - diff --git a/docs/AppApiRestV2AgentSchemaCapability.md b/docs/AppApiRestV2AgentSchemaCapability.md deleted file mode 100644 index a3aab84..0000000 --- a/docs/AppApiRestV2AgentSchemaCapability.md +++ /dev/null @@ -1,35 +0,0 @@ - - -# AppApiRestV2AgentSchemaCapability - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionVaddr** | **String** | Vaddr of the function containing the capability | | -|**description** | **String** | Description of the capability | | -|**capability** | **String** | Name of the capability | | -|**type** | [**TypeEnum**](#TypeEnum) | Type of the capability | | -|**functionName** | **String** | Name of the function containing the capability | | -|**functionId** | **Integer** | ID of the function containing the capability | | - - - -## Enum: TypeEnum - -| Name | Value | -|---- | -----| -| EXECUTE | "Execute" | -| CRYPTO | "Crypto" | -| NETWORK | "Network" | -| FILES | "Files" | -| MEMORY | "Memory" | -| STRING | "String" | -| ENVIRONMENT | "Environment" | -| FILE_HEADER | "File Header" | -| OTHER | "Other" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - diff --git a/docs/AppApiRestV2AnalysesEnumsOrderBy.md b/docs/AppApiRestV2AnalysesEnumsOrderBy.md deleted file mode 100644 index f199a7e..0000000 --- a/docs/AppApiRestV2AnalysesEnumsOrderBy.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AppApiRestV2AnalysesEnumsOrderBy - -## Enum - - -* `CREATED` (value: `"created"`) - -* `NAME` (value: `"name"`) - -* `SIZE` (value: `"size"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/AppApiRestV2CollectionsEnumsOrderBy.md b/docs/AppApiRestV2CollectionsEnumsOrderBy.md deleted file mode 100644 index d03c1ec..0000000 --- a/docs/AppApiRestV2CollectionsEnumsOrderBy.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# AppApiRestV2CollectionsEnumsOrderBy - -## Enum - - -* `CREATED` (value: `"created"`) - -* `COLLECTION` (value: `"collection"`) - -* `OWNER` (value: `"owner"`) - -* `COLLECTION_SIZE` (value: `"collection_size"`) - -* `UPDATED` (value: `"updated"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/AppApiRestV2FunctionsResponsesFunction.md b/docs/AppApiRestV2FunctionsResponsesFunction.md deleted file mode 100644 index be7aeb0..0000000 --- a/docs/AppApiRestV2FunctionsResponsesFunction.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# AppApiRestV2FunctionsResponsesFunction - -Function schema used in function strings response. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Integer** | | [optional] | -|**functionVaddr** | **Long** | Function virtual address | | - - - diff --git a/docs/AppApiRestV2FunctionsTypesFunction.md b/docs/AppApiRestV2FunctionsTypesFunction.md deleted file mode 100644 index 9c9ab27..0000000 --- a/docs/AppApiRestV2FunctionsTypesFunction.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# AppApiRestV2FunctionsTypesFunction - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | Function id | | -|**functionName** | **String** | Demangled name of the function | | -|**functionMangledName** | **String** | Mangled name of the function | | -|**functionVaddr** | **Long** | Function virtual address | | -|**functionSize** | **Integer** | Function size | | -|**debug** | **Boolean** | Whether the function is debug | | - - - diff --git a/docs/AppApiRestV2InfoTypesCapability.md b/docs/AppApiRestV2InfoTypesCapability.md deleted file mode 100644 index 8014713..0000000 --- a/docs/AppApiRestV2InfoTypesCapability.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# AppApiRestV2InfoTypesCapability - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionName** | **String** | The name of the function with a capability | | -|**functionVaddr** | **Long** | The virtual address of the function where the capability comes from | | -|**capabilities** | **List<String>** | The list of capabilities associated with the function | | - - - diff --git a/docs/Argument.md b/docs/Argument.md deleted file mode 100644 index 3e2dcda..0000000 --- a/docs/Argument.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# Argument - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this argument | [optional] | -|**offset** | **Integer** | Offset of the argument in the function signature | | -|**name** | **String** | Name of the argument | | -|**type** | **String** | Data type of the argument | | -|**size** | **Integer** | Size of the argument in bytes | | - - - diff --git a/docs/AuthenticationUsersApi.md b/docs/AuthenticationUsersApi.md deleted file mode 100644 index 6a2d89c..0000000 --- a/docs/AuthenticationUsersApi.md +++ /dev/null @@ -1,225 +0,0 @@ -# AuthenticationUsersApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getUser**](AuthenticationUsersApi.md#getUser) | **GET** /v2/users/{user_id} | Get a user's public information | -| [**getUserActivity**](AuthenticationUsersApi.md#getUserActivity) | **GET** /v2/users/activity | Get auth user activity | -| [**submitUserFeedback**](AuthenticationUsersApi.md#submitUserFeedback) | **POST** /v2/users/feedback | Submit feedback about the application | - - - -# **getUser** -> BaseResponseGetPublicUserResponse getUser(userId) - -Get a user's public information - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AuthenticationUsersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AuthenticationUsersApi apiInstance = new AuthenticationUsersApi(defaultClient); - Integer userId = 56; // Integer | - try { - BaseResponseGetPublicUserResponse result = apiInstance.getUser(userId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AuthenticationUsersApi#getUser"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **userId** | **Integer**| | | - -### Return type - -[**BaseResponseGetPublicUserResponse**](BaseResponseGetPublicUserResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getUserActivity** -> BaseResponseListUserActivityResponse getUserActivity() - -Get auth user activity - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AuthenticationUsersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AuthenticationUsersApi apiInstance = new AuthenticationUsersApi(defaultClient); - try { - BaseResponseListUserActivityResponse result = apiInstance.getUserActivity(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AuthenticationUsersApi#getUserActivity"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**BaseResponseListUserActivityResponse**](BaseResponseListUserActivityResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **submitUserFeedback** -> BaseResponse submitUserFeedback(submitUserFeedbackRequest) - -Submit feedback about the application - -Submits feedback about the application and forwards it to the RevEng.ai project management tool. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AuthenticationUsersApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - AuthenticationUsersApi apiInstance = new AuthenticationUsersApi(defaultClient); - SubmitUserFeedbackRequest submitUserFeedbackRequest = new SubmitUserFeedbackRequest(); // SubmitUserFeedbackRequest | - try { - BaseResponse result = apiInstance.submitUserFeedback(submitUserFeedbackRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AuthenticationUsersApi#submitUserFeedback"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **submitUserFeedbackRequest** | [**SubmitUserFeedbackRequest**](SubmitUserFeedbackRequest.md)| | | - -### Return type - -[**BaseResponse**](BaseResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - diff --git a/docs/AutoRunAgents.md b/docs/AutoRunAgents.md deleted file mode 100644 index 671f4e2..0000000 --- a/docs/AutoRunAgents.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AutoRunAgents - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**triage** | **Boolean** | | [optional] | - - - diff --git a/docs/BaseResponse.md b/docs/BaseResponse.md deleted file mode 100644 index 0666328..0000000 --- a/docs/BaseResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | **Object** | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAdditionalDetailsStatusResponse.md b/docs/BaseResponseAdditionalDetailsStatusResponse.md deleted file mode 100644 index f2f6d2d..0000000 --- a/docs/BaseResponseAdditionalDetailsStatusResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAdditionalDetailsStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AdditionalDetailsStatusResponse**](AdditionalDetailsStatusResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisBulkAddTagsResponse.md b/docs/BaseResponseAnalysisBulkAddTagsResponse.md deleted file mode 100644 index 4d17a53..0000000 --- a/docs/BaseResponseAnalysisBulkAddTagsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisBulkAddTagsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisBulkAddTagsResponse**](AnalysisBulkAddTagsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisCreateResponse.md b/docs/BaseResponseAnalysisCreateResponse.md deleted file mode 100644 index 74256af..0000000 --- a/docs/BaseResponseAnalysisCreateResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisCreateResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisCreateResponse**](AnalysisCreateResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisDetailResponse.md b/docs/BaseResponseAnalysisDetailResponse.md deleted file mode 100644 index 369f81c..0000000 --- a/docs/BaseResponseAnalysisDetailResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisDetailResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisDetailResponse**](AnalysisDetailResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisFunctionMapping.md b/docs/BaseResponseAnalysisFunctionMapping.md deleted file mode 100644 index 4f7fa6c..0000000 --- a/docs/BaseResponseAnalysisFunctionMapping.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisFunctionMapping - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisFunctionMapping**](AnalysisFunctionMapping.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisFunctions.md b/docs/BaseResponseAnalysisFunctions.md deleted file mode 100644 index 62eea18..0000000 --- a/docs/BaseResponseAnalysisFunctions.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisFunctions - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisFunctions**](AnalysisFunctions.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisFunctionsList.md b/docs/BaseResponseAnalysisFunctionsList.md deleted file mode 100644 index 61b0ef8..0000000 --- a/docs/BaseResponseAnalysisFunctionsList.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisFunctionsList - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisFunctionsList**](AnalysisFunctionsList.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisStringsResponse.md b/docs/BaseResponseAnalysisStringsResponse.md deleted file mode 100644 index e51f701..0000000 --- a/docs/BaseResponseAnalysisStringsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisStringsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisStringsResponse**](AnalysisStringsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisStringsStatusResponse.md b/docs/BaseResponseAnalysisStringsStatusResponse.md deleted file mode 100644 index a194a5a..0000000 --- a/docs/BaseResponseAnalysisStringsStatusResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisStringsStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisStringsStatusResponse**](AnalysisStringsStatusResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisTags.md b/docs/BaseResponseAnalysisTags.md deleted file mode 100644 index 1ca5c6c..0000000 --- a/docs/BaseResponseAnalysisTags.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisTags - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisTags**](AnalysisTags.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseAnalysisUpdateTagsResponse.md b/docs/BaseResponseAnalysisUpdateTagsResponse.md deleted file mode 100644 index 9ae42c5..0000000 --- a/docs/BaseResponseAnalysisUpdateTagsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseAnalysisUpdateTagsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**AnalysisUpdateTagsResponse**](AnalysisUpdateTagsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseBasic.md b/docs/BaseResponseBasic.md deleted file mode 100644 index 88d2092..0000000 --- a/docs/BaseResponseBasic.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseBasic - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**Basic**](Basic.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseBinariesRelatedStatusResponse.md b/docs/BaseResponseBinariesRelatedStatusResponse.md deleted file mode 100644 index ee5a001..0000000 --- a/docs/BaseResponseBinariesRelatedStatusResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseBinariesRelatedStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**BinariesRelatedStatusResponse**](BinariesRelatedStatusResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseBinaryAdditionalResponse.md b/docs/BaseResponseBinaryAdditionalResponse.md deleted file mode 100644 index 9796fdc..0000000 --- a/docs/BaseResponseBinaryAdditionalResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseBinaryAdditionalResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**BinaryAdditionalResponse**](BinaryAdditionalResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseBinaryDetailsResponse.md b/docs/BaseResponseBinaryDetailsResponse.md deleted file mode 100644 index 56bb40c..0000000 --- a/docs/BaseResponseBinaryDetailsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseBinaryDetailsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**BinaryDetailsResponse**](BinaryDetailsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseBinaryExternalsResponse.md b/docs/BaseResponseBinaryExternalsResponse.md deleted file mode 100644 index cdc2216..0000000 --- a/docs/BaseResponseBinaryExternalsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseBinaryExternalsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**BinaryExternalsResponse**](BinaryExternalsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseBinarySearchResponse.md b/docs/BaseResponseBinarySearchResponse.md deleted file mode 100644 index f747d59..0000000 --- a/docs/BaseResponseBinarySearchResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseBinarySearchResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**BinarySearchResponse**](BinarySearchResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseBool.md b/docs/BaseResponseBool.md deleted file mode 100644 index 02a6c42..0000000 --- a/docs/BaseResponseBool.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseBool - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | **Boolean** | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCalleesCallerFunctionsResponse.md b/docs/BaseResponseCalleesCallerFunctionsResponse.md deleted file mode 100644 index e77133b..0000000 --- a/docs/BaseResponseCalleesCallerFunctionsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCalleesCallerFunctionsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**CalleesCallerFunctionsResponse**](CalleesCallerFunctionsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCapabilities.md b/docs/BaseResponseCapabilities.md deleted file mode 100644 index 76eb6ac..0000000 --- a/docs/BaseResponseCapabilities.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCapabilities - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**Capabilities**](Capabilities.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCapabilitiesAgentResponse.md b/docs/BaseResponseCapabilitiesAgentResponse.md deleted file mode 100644 index db534b5..0000000 --- a/docs/BaseResponseCapabilitiesAgentResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCapabilitiesAgentResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**CapabilitiesAgentResponse**](CapabilitiesAgentResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseChildBinariesResponse.md b/docs/BaseResponseChildBinariesResponse.md deleted file mode 100644 index 06fdee4..0000000 --- a/docs/BaseResponseChildBinariesResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseChildBinariesResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ChildBinariesResponse**](ChildBinariesResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCollectionBinariesUpdateResponse.md b/docs/BaseResponseCollectionBinariesUpdateResponse.md deleted file mode 100644 index 4bc771f..0000000 --- a/docs/BaseResponseCollectionBinariesUpdateResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCollectionBinariesUpdateResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**CollectionBinariesUpdateResponse**](CollectionBinariesUpdateResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCollectionResponse.md b/docs/BaseResponseCollectionResponse.md deleted file mode 100644 index ba86979..0000000 --- a/docs/BaseResponseCollectionResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCollectionResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**CollectionResponse**](CollectionResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCollectionSearchResponse.md b/docs/BaseResponseCollectionSearchResponse.md deleted file mode 100644 index 0f4383e..0000000 --- a/docs/BaseResponseCollectionSearchResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCollectionSearchResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**CollectionSearchResponse**](CollectionSearchResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCollectionTagsUpdateResponse.md b/docs/BaseResponseCollectionTagsUpdateResponse.md deleted file mode 100644 index d220ce2..0000000 --- a/docs/BaseResponseCollectionTagsUpdateResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCollectionTagsUpdateResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**CollectionTagsUpdateResponse**](CollectionTagsUpdateResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCommentResponse.md b/docs/BaseResponseCommentResponse.md deleted file mode 100644 index 31df0e2..0000000 --- a/docs/BaseResponseCommentResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCommentResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**CommentResponse**](CommentResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseConfigResponse.md b/docs/BaseResponseConfigResponse.md deleted file mode 100644 index 791bfab..0000000 --- a/docs/BaseResponseConfigResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseConfigResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ConfigResponse**](ConfigResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseCreated.md b/docs/BaseResponseCreated.md deleted file mode 100644 index b69f560..0000000 --- a/docs/BaseResponseCreated.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseCreated - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**Created**](Created.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseDict.md b/docs/BaseResponseDict.md deleted file mode 100644 index f4ac7a2..0000000 --- a/docs/BaseResponseDict.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseDict - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | **Map<String, Object>** | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseExternalResponse.md b/docs/BaseResponseExternalResponse.md deleted file mode 100644 index 4a6990d..0000000 --- a/docs/BaseResponseExternalResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseExternalResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ExternalResponse**](ExternalResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseFunctionBlocksResponse.md b/docs/BaseResponseFunctionBlocksResponse.md deleted file mode 100644 index 55cc297..0000000 --- a/docs/BaseResponseFunctionBlocksResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseFunctionBlocksResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**FunctionBlocksResponse**](FunctionBlocksResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseFunctionCapabilityResponse.md b/docs/BaseResponseFunctionCapabilityResponse.md deleted file mode 100644 index 5c013f5..0000000 --- a/docs/BaseResponseFunctionCapabilityResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseFunctionCapabilityResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**FunctionCapabilityResponse**](FunctionCapabilityResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseFunctionDataTypes.md b/docs/BaseResponseFunctionDataTypes.md deleted file mode 100644 index 63ad39c..0000000 --- a/docs/BaseResponseFunctionDataTypes.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseFunctionDataTypes - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**FunctionDataTypes**](FunctionDataTypes.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseFunctionDataTypesList.md b/docs/BaseResponseFunctionDataTypesList.md deleted file mode 100644 index 6e562b3..0000000 --- a/docs/BaseResponseFunctionDataTypesList.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseFunctionDataTypesList - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**FunctionDataTypesList**](FunctionDataTypesList.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseFunctionSearchResponse.md b/docs/BaseResponseFunctionSearchResponse.md deleted file mode 100644 index d9d1176..0000000 --- a/docs/BaseResponseFunctionSearchResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseFunctionSearchResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**FunctionSearchResponse**](FunctionSearchResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseFunctionStringsResponse.md b/docs/BaseResponseFunctionStringsResponse.md deleted file mode 100644 index 3ae8b7c..0000000 --- a/docs/BaseResponseFunctionStringsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseFunctionStringsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**FunctionStringsResponse**](FunctionStringsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseFunctionsDetailResponse.md b/docs/BaseResponseFunctionsDetailResponse.md deleted file mode 100644 index 744ae6c..0000000 --- a/docs/BaseResponseFunctionsDetailResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseFunctionsDetailResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**FunctionsDetailResponse**](FunctionsDetailResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseGenerateFunctionDataTypes.md b/docs/BaseResponseGenerateFunctionDataTypes.md deleted file mode 100644 index a34b8e7..0000000 --- a/docs/BaseResponseGenerateFunctionDataTypes.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseGenerateFunctionDataTypes - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**GenerateFunctionDataTypes**](GenerateFunctionDataTypes.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseGenerationStatusList.md b/docs/BaseResponseGenerationStatusList.md deleted file mode 100644 index 4666480..0000000 --- a/docs/BaseResponseGenerationStatusList.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseGenerationStatusList - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**GenerationStatusList**](GenerationStatusList.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseGetPublicUserResponse.md b/docs/BaseResponseGetPublicUserResponse.md deleted file mode 100644 index 3391416..0000000 --- a/docs/BaseResponseGetPublicUserResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseGetPublicUserResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**GetPublicUserResponse**](GetPublicUserResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseListCalleesCallerFunctionsResponse.md b/docs/BaseResponseListCalleesCallerFunctionsResponse.md deleted file mode 100644 index 63a7df4..0000000 --- a/docs/BaseResponseListCalleesCallerFunctionsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseListCalleesCallerFunctionsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**List<CalleesCallerFunctionsResponse>**](CalleesCallerFunctionsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseListCollectionResults.md b/docs/BaseResponseListCollectionResults.md deleted file mode 100644 index 1ff0dfc..0000000 --- a/docs/BaseResponseListCollectionResults.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseListCollectionResults - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ListCollectionResults**](ListCollectionResults.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseListCommentResponse.md b/docs/BaseResponseListCommentResponse.md deleted file mode 100644 index ec3f718..0000000 --- a/docs/BaseResponseListCommentResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseListCommentResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**List<CommentResponse>**](CommentResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseListDieMatch.md b/docs/BaseResponseListDieMatch.md deleted file mode 100644 index b872a85..0000000 --- a/docs/BaseResponseListDieMatch.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseListDieMatch - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**List<DieMatch>**](DieMatch.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseListFunctionNameHistory.md b/docs/BaseResponseListFunctionNameHistory.md deleted file mode 100644 index f3a5ada..0000000 --- a/docs/BaseResponseListFunctionNameHistory.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseListFunctionNameHistory - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**List<FunctionNameHistory>**](FunctionNameHistory.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseListSBOM.md b/docs/BaseResponseListSBOM.md deleted file mode 100644 index a6464db..0000000 --- a/docs/BaseResponseListSBOM.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseListSBOM - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**List<SBOM>**](SBOM.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseListUserActivityResponse.md b/docs/BaseResponseListUserActivityResponse.md deleted file mode 100644 index c96574b..0000000 --- a/docs/BaseResponseListUserActivityResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseListUserActivityResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**List<UserActivityResponse>**](UserActivityResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseLogs.md b/docs/BaseResponseLogs.md deleted file mode 100644 index 4f070c7..0000000 --- a/docs/BaseResponseLogs.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseLogs - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**Logs**](Logs.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseModelsResponse.md b/docs/BaseResponseModelsResponse.md deleted file mode 100644 index e85d4a3..0000000 --- a/docs/BaseResponseModelsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseModelsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ModelsResponse**](ModelsResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseParams.md b/docs/BaseResponseParams.md deleted file mode 100644 index 71086c8..0000000 --- a/docs/BaseResponseParams.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseParams - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**Params**](Params.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseQueuedWorkflowTaskResponse.md b/docs/BaseResponseQueuedWorkflowTaskResponse.md deleted file mode 100644 index 645c420..0000000 --- a/docs/BaseResponseQueuedWorkflowTaskResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseQueuedWorkflowTaskResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**QueuedWorkflowTaskResponse**](QueuedWorkflowTaskResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseRecent.md b/docs/BaseResponseRecent.md deleted file mode 100644 index a5ac022..0000000 --- a/docs/BaseResponseRecent.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseRecent - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**Recent**](Recent.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseReportAnalysisResponse.md b/docs/BaseResponseReportAnalysisResponse.md deleted file mode 100644 index 05caff2..0000000 --- a/docs/BaseResponseReportAnalysisResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseReportAnalysisResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**ReportAnalysisResponse**](ReportAnalysisResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseStatus.md b/docs/BaseResponseStatus.md deleted file mode 100644 index d02b359..0000000 --- a/docs/BaseResponseStatus.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseStatus - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**StatusOutput**](StatusOutput.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseStr.md b/docs/BaseResponseStr.md deleted file mode 100644 index 0b4c4e2..0000000 --- a/docs/BaseResponseStr.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseStr - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | **String** | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseTagSearchResponse.md b/docs/BaseResponseTagSearchResponse.md deleted file mode 100644 index 98cb5d8..0000000 --- a/docs/BaseResponseTagSearchResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseTagSearchResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**TagSearchResponse**](TagSearchResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseTaskResponse.md b/docs/BaseResponseTaskResponse.md deleted file mode 100644 index ca9d038..0000000 --- a/docs/BaseResponseTaskResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseTaskResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**TaskResponse**](TaskResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseTaskStatusResponse.md b/docs/BaseResponseTaskStatusResponse.md deleted file mode 100644 index 4b6e206..0000000 --- a/docs/BaseResponseTaskStatusResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseTaskStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**TaskStatusResponse**](TaskStatusResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseTriageReportResponse.md b/docs/BaseResponseTriageReportResponse.md deleted file mode 100644 index 2fe21e5..0000000 --- a/docs/BaseResponseTriageReportResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseTriageReportResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**TriageReportResponse**](TriageReportResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseUnionGetAiDecompilationRatingResponseNoneType.md b/docs/BaseResponseUnionGetAiDecompilationRatingResponseNoneType.md deleted file mode 100644 index 3167247..0000000 --- a/docs/BaseResponseUnionGetAiDecompilationRatingResponseNoneType.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseUnionGetAiDecompilationRatingResponseNoneType - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**GetAiDecompilationRatingResponse**](GetAiDecompilationRatingResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseUploadResponse.md b/docs/BaseResponseUploadResponse.md deleted file mode 100644 index efb913b..0000000 --- a/docs/BaseResponseUploadResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseUploadResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**UploadResponse**](UploadResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseVulnerabilities.md b/docs/BaseResponseVulnerabilities.md deleted file mode 100644 index 8024972..0000000 --- a/docs/BaseResponseVulnerabilities.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseVulnerabilities - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**Vulnerabilities**](Vulnerabilities.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/BaseResponseXrefResponse.md b/docs/BaseResponseXrefResponse.md deleted file mode 100644 index 18f2358..0000000 --- a/docs/BaseResponseXrefResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BaseResponseXrefResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **Boolean** | Response status on whether the request succeeded | [optional] | -|**data** | [**XrefResponse**](XrefResponse.md) | Response data | [optional] | -|**message** | **String** | Response message | [optional] | -|**errors** | [**List<ErrorModel>**](ErrorModel.md) | List of errors | [optional] | -|**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] | - - - diff --git a/docs/Basic.md b/docs/Basic.md deleted file mode 100644 index 571d396..0000000 --- a/docs/Basic.md +++ /dev/null @@ -1,30 +0,0 @@ - - -# Basic - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaryId** | **Integer** | The ID of the binary | | -|**binaryName** | **String** | The name of the binary uploaded | | -|**binarySize** | **Integer** | The size of the binary uploaded (bytes) | | -|**creation** | **OffsetDateTime** | When the binary was uploaded | | -|**sha256Hash** | **String** | The hash of the binary uploaded | | -|**modelName** | **String** | The model name used for analysis | | -|**modelId** | **Integer** | The model ID used for analysis | | -|**ownerUsername** | **String** | The name of the owner of the binary | | -|**isSystem** | **Boolean** | Whether the analysis is a system analysis | | -|**analysisScope** | **String** | The scope of the analysis | | -|**isOwner** | **Boolean** | Whether the current user is the owner | | -|**debug** | **Boolean** | Whether the current analysis was analysed with debug symbols | | -|**functionCount** | **Integer** | The number of functions in the binary | | -|**isAdvanced** | **Boolean** | Whether the analysis was advanced | | -|**baseAddress** | **Integer** | The base address of the binary | | -|**binaryUuid** | **String** | The UUID of the binary | [optional] | -|**sequencerVersion** | **String** | The sequencer version used for analysis | [optional] | -|**teamId** | **Integer** | The team ID of the analysis | | - - - diff --git a/docs/BinariesApi.md b/docs/BinariesApi.md index 97ff560..8987167 100644 --- a/docs/BinariesApi.md +++ b/docs/BinariesApi.md @@ -4,241 +4,17 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**downloadZippedBinary**](BinariesApi.md#downloadZippedBinary) | **GET** /v2/binaries/{binary_id}/download-zipped | Downloads a zipped binary with password protection | -| [**getBinaryAdditionalDetails**](BinariesApi.md#getBinaryAdditionalDetails) | **GET** /v2/binaries/{binary_id}/additional-details | Gets the additional details of a binary | -| [**getBinaryAdditionalDetailsStatus**](BinariesApi.md#getBinaryAdditionalDetailsStatus) | **GET** /v2/binaries/{binary_id}/additional-details/status | Gets the status of the additional details task for a binary | -| [**getBinaryAdditionalDetailsStatus_0**](BinariesApi.md#getBinaryAdditionalDetailsStatus_0) | **GET** /v3/binaries/{binary_id}/additional-details/status | Get the additional-details extraction status for a binary. | -| [**getBinaryAdditionalDetails_0**](BinariesApi.md#getBinaryAdditionalDetails_0) | **GET** /v3/binaries/{binary_id}/additional-details | Get additional details for a binary. | -| [**getBinaryDetails**](BinariesApi.md#getBinaryDetails) | **GET** /v2/binaries/{binary_id}/details | Gets the details of a binary | -| [**getBinaryDieInfo**](BinariesApi.md#getBinaryDieInfo) | **GET** /v2/binaries/{binary_id}/die-info | Gets the die info of a binary | -| [**getBinaryExternals**](BinariesApi.md#getBinaryExternals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary | -| [**getBinaryRelatedStatus**](BinariesApi.md#getBinaryRelatedStatus) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary | -| [**getRelatedBinaries**](BinariesApi.md#getRelatedBinaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. | +| [**getBinaryAdditionalDetails**](BinariesApi.md#getBinaryAdditionalDetails) | **GET** /v3/binaries/{binary_id}/additional-details | Get additional details for a binary. | +| [**getBinaryAdditionalDetailsStatus**](BinariesApi.md#getBinaryAdditionalDetailsStatus) | **GET** /v3/binaries/{binary_id}/additional-details/status | Get the additional-details extraction status for a binary. | - -# **downloadZippedBinary** -> File downloadZippedBinary(binaryId) - -Downloads a zipped binary with password protection - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.BinariesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - BinariesApi apiInstance = new BinariesApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - File result = apiInstance.downloadZippedBinary(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#downloadZippedBinary"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -[**File**](File.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/zip, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Download file | - | -| **422** | Invalid request parameters | - | - # **getBinaryAdditionalDetails** -> BaseResponseBinaryAdditionalResponse getBinaryAdditionalDetails(binaryId) - -Gets the additional details of a binary - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.BinariesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - BinariesApi apiInstance = new BinariesApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - BaseResponseBinaryAdditionalResponse result = apiInstance.getBinaryAdditionalDetails(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getBinaryAdditionalDetails"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -[**BaseResponseBinaryAdditionalResponse**](BaseResponseBinaryAdditionalResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getBinaryAdditionalDetailsStatus** -> BaseResponseAdditionalDetailsStatusResponse getBinaryAdditionalDetailsStatus(binaryId) - -Gets the status of the additional details task for a binary - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.BinariesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - BinariesApi apiInstance = new BinariesApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - BaseResponseAdditionalDetailsStatusResponse result = apiInstance.getBinaryAdditionalDetailsStatus(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getBinaryAdditionalDetailsStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -[**BaseResponseAdditionalDetailsStatusResponse**](BaseResponseAdditionalDetailsStatusResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | +> GetAdditionalDetailsOutputBody getBinaryAdditionalDetails(binaryId) - -# **getBinaryAdditionalDetailsStatus_0** -> GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus_0(binaryId) - -Get the additional-details extraction status for a binary. +Get additional details for a binary. -Returns the status of the additional-details extraction task. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied ### Example ```java @@ -268,10 +44,10 @@ public class Example { BinariesApi apiInstance = new BinariesApi(defaultClient); Long binaryId = 56L; // Long | Binary ID try { - GetAdditionalDetailsStatusOutputBody result = apiInstance.getBinaryAdditionalDetailsStatus_0(binaryId); + GetAdditionalDetailsOutputBody result = apiInstance.getBinaryAdditionalDetails(binaryId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getBinaryAdditionalDetailsStatus_0"); + System.err.println("Exception when calling BinariesApi#getBinaryAdditionalDetails"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -289,7 +65,7 @@ public class Example { ### Return type -[**GetAdditionalDetailsStatusOutputBody**](GetAdditionalDetailsStatusOutputBody.md) +[**GetAdditionalDetailsOutputBody**](GetAdditionalDetailsOutputBody.md) ### Authorization @@ -309,13 +85,13 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getBinaryAdditionalDetails_0** -> GetAdditionalDetailsOutputBody getBinaryAdditionalDetails_0(binaryId) + +# **getBinaryAdditionalDetailsStatus** +> GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus(binaryId) -Get additional details for a binary. +Get the additional-details extraction status for a binary. -Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +Returns the status of the additional-details extraction task. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied ### Example ```java @@ -345,10 +121,10 @@ public class Example { BinariesApi apiInstance = new BinariesApi(defaultClient); Long binaryId = 56L; // Long | Binary ID try { - GetAdditionalDetailsOutputBody result = apiInstance.getBinaryAdditionalDetails_0(binaryId); + GetAdditionalDetailsStatusOutputBody result = apiInstance.getBinaryAdditionalDetailsStatus(binaryId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getBinaryAdditionalDetails_0"); + System.err.println("Exception when calling BinariesApi#getBinaryAdditionalDetailsStatus"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -366,7 +142,7 @@ public class Example { ### Return type -[**GetAdditionalDetailsOutputBody**](GetAdditionalDetailsOutputBody.md) +[**GetAdditionalDetailsStatusOutputBody**](GetAdditionalDetailsStatusOutputBody.md) ### Authorization @@ -386,364 +162,3 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getBinaryDetails** -> BaseResponseBinaryDetailsResponse getBinaryDetails(binaryId) - -Gets the details of a binary - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.BinariesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - BinariesApi apiInstance = new BinariesApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - BaseResponseBinaryDetailsResponse result = apiInstance.getBinaryDetails(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getBinaryDetails"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -[**BaseResponseBinaryDetailsResponse**](BaseResponseBinaryDetailsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getBinaryDieInfo** -> BaseResponseListDieMatch getBinaryDieInfo(binaryId) - -Gets the die info of a binary - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.BinariesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - BinariesApi apiInstance = new BinariesApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - BaseResponseListDieMatch result = apiInstance.getBinaryDieInfo(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getBinaryDieInfo"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -[**BaseResponseListDieMatch**](BaseResponseListDieMatch.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getBinaryExternals** -> BaseResponseBinaryExternalsResponse getBinaryExternals(binaryId) - -Gets the external details of a binary - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.BinariesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - BinariesApi apiInstance = new BinariesApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - BaseResponseBinaryExternalsResponse result = apiInstance.getBinaryExternals(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getBinaryExternals"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -[**BaseResponseBinaryExternalsResponse**](BaseResponseBinaryExternalsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getBinaryRelatedStatus** -> BaseResponseBinariesRelatedStatusResponse getBinaryRelatedStatus(binaryId) - -Gets the status of the unpack binary task for a binary - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.BinariesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - BinariesApi apiInstance = new BinariesApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - BaseResponseBinariesRelatedStatusResponse result = apiInstance.getBinaryRelatedStatus(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getBinaryRelatedStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -[**BaseResponseBinariesRelatedStatusResponse**](BaseResponseBinariesRelatedStatusResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getRelatedBinaries** -> BaseResponseChildBinariesResponse getRelatedBinaries(binaryId) - -Gets the related binaries of a binary. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.BinariesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - BinariesApi apiInstance = new BinariesApi(defaultClient); - Integer binaryId = 56; // Integer | - try { - BaseResponseChildBinariesResponse result = apiInstance.getRelatedBinaries(binaryId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling BinariesApi#getRelatedBinaries"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **binaryId** | **Integer**| | | - -### Return type - -[**BaseResponseChildBinariesResponse**](BaseResponseChildBinariesResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **403** | Forbidden | - | - diff --git a/docs/BinariesRelatedStatusResponse.md b/docs/BinariesRelatedStatusResponse.md deleted file mode 100644 index 13f1516..0000000 --- a/docs/BinariesRelatedStatusResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# BinariesRelatedStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **String** | The current status of the unpack binary task | | - - - diff --git a/docs/BinariesTaskStatus.md b/docs/BinariesTaskStatus.md deleted file mode 100644 index 89355db..0000000 --- a/docs/BinariesTaskStatus.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# BinariesTaskStatus - -## Enum - - -* `UNINITIALISED` (value: `"UNINITIALISED"`) - -* `PENDING` (value: `"PENDING"`) - -* `RUNNING` (value: `"RUNNING"`) - -* `COMPLETED` (value: `"COMPLETED"`) - -* `FAILED` (value: `"FAILED"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/BinaryAdditionalDetailsDataResponse.md b/docs/BinaryAdditionalDetailsDataResponse.md deleted file mode 100644 index 2ba4318..0000000 --- a/docs/BinaryAdditionalDetailsDataResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# BinaryAdditionalDetailsDataResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**_file** | [**FileMetadata**](FileMetadata.md) | | | -|**pe** | [**PEModel**](PEModel.md) | | [optional] | -|**elf** | [**ELFModel**](ELFModel.md) | | [optional] | - - - diff --git a/docs/BinaryAdditionalResponse.md b/docs/BinaryAdditionalResponse.md deleted file mode 100644 index ab8e5ef..0000000 --- a/docs/BinaryAdditionalResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# BinaryAdditionalResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaryId** | **Integer** | | | -|**details** | [**BinaryAdditionalDetailsDataResponse**](BinaryAdditionalDetailsDataResponse.md) | | | -|**creation** | **OffsetDateTime** | | [optional] | - - - diff --git a/docs/BinaryConfig.md b/docs/BinaryConfig.md deleted file mode 100644 index ff69e9c..0000000 --- a/docs/BinaryConfig.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# BinaryConfig - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**isa** | **ISA** | Instruction Set Architecture | [optional] | -|**platform** | **Platform** | | [optional] | -|**fileFormat** | **FileFormat** | | [optional] | - - - diff --git a/docs/BinaryDetailsResponse.md b/docs/BinaryDetailsResponse.md deleted file mode 100644 index 5f3efbd..0000000 --- a/docs/BinaryDetailsResponse.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# BinaryDetailsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**arch** | **String** | The architecture of the binary | | -|**bits** | **Integer** | The size of the binary in bits | | -|**crc32** | **String** | | | -|**propertyClass** | **String** | | | -|**entropy** | **BigDecimal** | | | -|**fileSize** | **Integer** | | | -|**language** | **String** | | | -|**md5** | **String** | | | -|**machine** | **String** | | | -|**os** | **String** | OS target of the binary | | -|**sha1** | **String** | SHA1 hash of the binary | | -|**sha256** | **String** | SHA256 hash of the binary | | -|**ssdeep** | **String** | | | -|**_static** | **Boolean** | | | -|**stripped** | **Boolean** | | | -|**subSys** | **String** | | | -|**tlsh** | **String** | | | -|**type** | **String** | | | -|**debug** | **Boolean** | | | -|**firstSeen** | **OffsetDateTime** | | | - - - diff --git a/docs/BinaryExternalsResponse.md b/docs/BinaryExternalsResponse.md deleted file mode 100644 index b158ad1..0000000 --- a/docs/BinaryExternalsResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# BinaryExternalsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**sha256Hash** | **String** | SHA256 hash of the binary | | -|**vt** | **Map<String, Object>** | VirusTotal information | | -|**vtLastUpdated** | **OffsetDateTime** | VirusTotal last updated date | | -|**mb** | **Map<String, Object>** | MalwareBazaar information | | -|**mbLastUpdated** | **OffsetDateTime** | MalwareBazaar last updated date | | - - - diff --git a/docs/BinarySearchResponse.md b/docs/BinarySearchResponse.md deleted file mode 100644 index 4ab0576..0000000 --- a/docs/BinarySearchResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# BinarySearchResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**results** | [**List<BinarySearchResult>**](BinarySearchResult.md) | The results of the search | | - - - diff --git a/docs/BinarySearchResult.md b/docs/BinarySearchResult.md deleted file mode 100644 index 680094c..0000000 --- a/docs/BinarySearchResult.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# BinarySearchResult - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaryId** | **Integer** | The binary ID | | -|**binaryName** | **String** | The name of the binary | | -|**analysisId** | **Integer** | The analysis ID | | -|**sha256Hash** | **String** | The SHA-256 hash of the binary | | -|**tags** | **List<String>** | The tags of the binary | | -|**createdAt** | **OffsetDateTime** | The creation date of the binary | | -|**modelId** | **Integer** | The model ID of the binary | | -|**modelName** | **String** | The name of the model | | -|**ownedBy** | **String** | The owner of the binary | | - - - diff --git a/docs/BinaryTaskStatus.md b/docs/BinaryTaskStatus.md deleted file mode 100644 index ae31bbe..0000000 --- a/docs/BinaryTaskStatus.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# BinaryTaskStatus - -## Enum - - -* `UNINITIALISED` (value: `"UNINITIALISED"`) - -* `PENDING` (value: `"PENDING"`) - -* `RUNNING` (value: `"RUNNING"`) - -* `COMPLETED` (value: `"COMPLETED"`) - -* `FAILED` (value: `"FAILED"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/BulkCreateUserResult.md b/docs/BulkCreateUserResult.md index 33201dc..f3f9a2c 100644 --- a/docs/BulkCreateUserResult.md +++ b/docs/BulkCreateUserResult.md @@ -7,12 +7,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**email** | **String** | Search is applied to string value | | +|**email** | **String** | | | |**error** | **String** | Error description; present on failure | [optional] | |**index** | **Long** | 1-based row index in the CSV | | |**success** | **Boolean** | | | |**user** | [**User**](User.md) | Created user; present on success | [optional] | -|**username** | **String** | Search is applied to string value | | +|**username** | **String** | | | diff --git a/docs/BulkDeleteAnalysesRequest.md b/docs/BulkDeleteAnalysesRequest.md deleted file mode 100644 index be70bd5..0000000 --- a/docs/BulkDeleteAnalysesRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# BulkDeleteAnalysesRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisIds** | **List<Integer>** | | | - - - diff --git a/docs/CalleeFunctionInfo.md b/docs/CalleeFunctionInfo.md deleted file mode 100644 index 88b1820..0000000 --- a/docs/CalleeFunctionInfo.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# CalleeFunctionInfo - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | Unique identifier of the function | | -|**matchedFunctionId** | **Integer** | Unique identifier of the matched function | | -|**dashboardUrl** | **String** | | | -|**isExternal** | **Boolean** | Indicates if the function is external | [optional] | -|**calleeName** | **String** | Name of the called function | | -|**calleeVaddr** | **String** | Virtual address of the called function | | - - - diff --git a/docs/CalleesCallerFunctionsResponse.md b/docs/CalleesCallerFunctionsResponse.md deleted file mode 100644 index ae8f743..0000000 --- a/docs/CalleesCallerFunctionsResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# CalleesCallerFunctionsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**baseAddress** | **BigInteger** | Base address of the binary | | -|**callees** | [**List<CalleeFunctionInfo>**](CalleeFunctionInfo.md) | List of functions called by the target function | | -|**callers** | [**List<CallerFunctionInfo>**](CallerFunctionInfo.md) | List of functions that call the target function | | - - - diff --git a/docs/CallerFunctionInfo.md b/docs/CallerFunctionInfo.md deleted file mode 100644 index 1c7b0db..0000000 --- a/docs/CallerFunctionInfo.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# CallerFunctionInfo - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | Unique identifier of the function | | -|**matchedFunctionId** | **Integer** | Unique identifier of the matched function | | -|**dashboardUrl** | **String** | | | -|**isExternal** | **Boolean** | Indicates if the function is external | [optional] | -|**callerName** | **String** | Name of the calling function | | -|**callerVaddr** | **String** | Virtual address of the calling function | | - - - diff --git a/docs/Capabilities.md b/docs/Capabilities.md deleted file mode 100644 index 750d320..0000000 --- a/docs/Capabilities.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# Capabilities - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**capabilities** | [**List<AppApiRestV2InfoTypesCapability>**](AppApiRestV2InfoTypesCapability.md) | List of capabilities for a given analysis | | - - - diff --git a/docs/CapabilitiesAgentResponse.md b/docs/CapabilitiesAgentResponse.md deleted file mode 100644 index a59296d..0000000 --- a/docs/CapabilitiesAgentResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CapabilitiesAgentResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**capabilities** | [**List<AppApiRestV2AgentSchemaCapability>**](AppApiRestV2AgentSchemaCapability.md) | List of enriched capability data | | - - - diff --git a/docs/ChildBinariesResponse.md b/docs/ChildBinariesResponse.md deleted file mode 100644 index 57fae55..0000000 --- a/docs/ChildBinariesResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ChildBinariesResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**children** | [**List<RelativeBinaryResponse>**](RelativeBinaryResponse.md) | List of child binaries associated with the parent binary | | -|**parent** | [**RelativeBinaryResponse**](RelativeBinaryResponse.md) | Details of the parent binary if it exists | [optional] | - - - diff --git a/docs/CodeSignatureModel.md b/docs/CodeSignatureModel.md deleted file mode 100644 index 13500c5..0000000 --- a/docs/CodeSignatureModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# CodeSignatureModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**signed** | **Boolean** | | | -|**validSignature** | **Boolean** | | | -|**signatures** | [**List<SingleCodeSignatureModel>**](SingleCodeSignatureModel.md) | | | - - - diff --git a/docs/CollectionBinariesUpdateRequest.md b/docs/CollectionBinariesUpdateRequest.md deleted file mode 100644 index f1a73f0..0000000 --- a/docs/CollectionBinariesUpdateRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CollectionBinariesUpdateRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaries** | **List<Integer>** | | | - - - diff --git a/docs/CollectionBinariesUpdateResponse.md b/docs/CollectionBinariesUpdateResponse.md deleted file mode 100644 index 77054ea..0000000 --- a/docs/CollectionBinariesUpdateResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CollectionBinariesUpdateResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaries** | [**List<CollectionBinaryResponse>**](CollectionBinaryResponse.md) | Collection binaries | | - - - diff --git a/docs/CollectionBinaryResponse.md b/docs/CollectionBinaryResponse.md deleted file mode 100644 index 68cffcf..0000000 --- a/docs/CollectionBinaryResponse.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CollectionBinaryResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisId** | **Integer** | Analysis ID | | -|**binaryId** | **Integer** | Binary ID | | -|**binaryName** | **String** | Binary name | | -|**ownerId** | **Integer** | Binary owner | | -|**sha256Hash** | **String** | Binary SHA-256 hash | | -|**createdAt** | **OffsetDateTime** | Binary creation date | | -|**isSystemAnalysis** | **Boolean** | Is the analysis owned by a RevEng.AI account | | - - - diff --git a/docs/CollectionCreateRequest.md b/docs/CollectionCreateRequest.md deleted file mode 100644 index 4c9bf5c..0000000 --- a/docs/CollectionCreateRequest.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CollectionCreateRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**collectionName** | **String** | | | -|**description** | **String** | | | -|**collectionScope** | **CollectionScope** | | [optional] | -|**tags** | **List<String>** | | [optional] | -|**binaries** | **List<Integer>** | | [optional] | - - - diff --git a/docs/CollectionListItem.md b/docs/CollectionListItem.md deleted file mode 100644 index 5541904..0000000 --- a/docs/CollectionListItem.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# CollectionListItem - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**collectionName** | **String** | The name of the collection | | -|**description** | **String** | The description of the collection | | -|**collectionScope** | **String** | The scope of the collection | | -|**collectionOwner** | **String** | The owner of the collection | | -|**officialCollection** | **Boolean** | Whether the collection is maintained by RevEng.AI | | -|**collectionTags** | **List<String>** | The tags of the collection | [optional] | -|**collectionSize** | **Integer** | The size of the collection | | -|**collectionId** | **Integer** | The ID of the collection | | -|**creation** | **OffsetDateTime** | The datetime of when the collection was created | | -|**teamId** | **Integer** | The team ID for the collection | [optional] | - - - diff --git a/docs/CollectionResponse.md b/docs/CollectionResponse.md deleted file mode 100644 index f1eecb9..0000000 --- a/docs/CollectionResponse.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# CollectionResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**collectionId** | **Integer** | Collection ID | | -|**collectionName** | **String** | Collection name | | -|**description** | **String** | Collection description | | -|**userId** | **Integer** | Collection user ID | | -|**teamId** | **Integer** | Collection team ID | [optional] | -|**collectionScope** | **CollectionScope** | Collection public status | | -|**createdAt** | **OffsetDateTime** | Collection creation date | | -|**updatedAt** | **OffsetDateTime** | Collection last update date | | -|**tags** | **List<String>** | Collection tags | [optional] | -|**binaries** | [**List<CollectionResponseBinariesInner>**](CollectionResponseBinariesInner.md) | Collection binaries | [optional] | - - - diff --git a/docs/CollectionResponseBinariesInner.md b/docs/CollectionResponseBinariesInner.md deleted file mode 100644 index 2d83d68..0000000 --- a/docs/CollectionResponseBinariesInner.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CollectionResponseBinariesInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisId** | **Integer** | Analysis ID | | -|**binaryId** | **Integer** | Binary ID | | -|**binaryName** | **String** | Binary name | | -|**ownerId** | **Integer** | Binary owner | | -|**sha256Hash** | **String** | Binary SHA-256 hash | | -|**createdAt** | **OffsetDateTime** | Binary creation date | | -|**isSystemAnalysis** | **Boolean** | Is the analysis owned by a RevEng.AI account | | - - - diff --git a/docs/CollectionScope.md b/docs/CollectionScope.md deleted file mode 100644 index 3eb59e7..0000000 --- a/docs/CollectionScope.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CollectionScope - -## Enum - - -* `PRIVATE` (value: `"PRIVATE"`) - -* `PUBLIC` (value: `"PUBLIC"`) - -* `PROTECTED` (value: `"PROTECTED"`) - -* `TEAM` (value: `"TEAM"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/CollectionSearchResponse.md b/docs/CollectionSearchResponse.md deleted file mode 100644 index 6688bcd..0000000 --- a/docs/CollectionSearchResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CollectionSearchResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**results** | [**List<CollectionSearchResult>**](CollectionSearchResult.md) | The results of the search | | - - - diff --git a/docs/CollectionSearchResult.md b/docs/CollectionSearchResult.md deleted file mode 100644 index 10ef66c..0000000 --- a/docs/CollectionSearchResult.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# CollectionSearchResult - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**collectionId** | **Integer** | The ID of the collection | | -|**collectionName** | **String** | The name of the collection | | -|**scope** | **String** | The scope of the collection | | -|**lastUpdatedAt** | **OffsetDateTime** | The last update date of the collection | | -|**createdAt** | **OffsetDateTime** | The creation date of the collection | | -|**ownedBy** | **String** | The owner of the collection | | -|**tags** | **List<String>** | The tags of the collection | [optional] | -|**size** | **Integer** | The number of binaries in the collection | [optional] | -|**description** | **String** | The description of the collection | | -|**teamId** | **Integer** | The team ID of the collection | [optional] | - - - diff --git a/docs/CollectionTagsUpdateRequest.md b/docs/CollectionTagsUpdateRequest.md deleted file mode 100644 index 79c69c0..0000000 --- a/docs/CollectionTagsUpdateRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CollectionTagsUpdateRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tags** | **List<String>** | | | - - - diff --git a/docs/CollectionTagsUpdateResponse.md b/docs/CollectionTagsUpdateResponse.md deleted file mode 100644 index 4a58d49..0000000 --- a/docs/CollectionTagsUpdateResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CollectionTagsUpdateResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tags** | **List<String>** | Collection tags | | - - - diff --git a/docs/CollectionUpdateRequest.md b/docs/CollectionUpdateRequest.md deleted file mode 100644 index 81a0da6..0000000 --- a/docs/CollectionUpdateRequest.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# CollectionUpdateRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**collectionName** | **String** | | [optional] | -|**description** | **String** | | [optional] | -|**collectionScope** | **CollectionScope** | | [optional] | - - - diff --git a/docs/CollectionsApi.md b/docs/CollectionsApi.md index 25d879a..ca64fb7 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -4,13 +4,6 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**createCollection**](CollectionsApi.md#createCollection) | **POST** /v2/collections | Creates new collection information | -| [**deleteCollection**](CollectionsApi.md#deleteCollection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection | -| [**getCollection**](CollectionsApi.md#getCollection) | **GET** /v2/collections/{collection_id} | Returns a collection | -| [**listCollections**](CollectionsApi.md#listCollections) | **GET** /v2/collections | Gets basic collections information | -| [**updateCollection**](CollectionsApi.md#updateCollection) | **PATCH** /v2/collections/{collection_id} | Updates a collection | -| [**updateCollectionBinaries**](CollectionsApi.md#updateCollectionBinaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries | -| [**updateCollectionTags**](CollectionsApi.md#updateCollectionTags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags | | [**v3CreateCollection**](CollectionsApi.md#v3CreateCollection) | **POST** /v3/collections | Create a collection. | | [**v3DeleteCollection**](CollectionsApi.md#v3DeleteCollection) | **DELETE** /v3/collections/{collection_id} | Delete a collection. | | [**v3GetCollection**](CollectionsApi.md#v3GetCollection) | **GET** /v3/collections/{collection_id} | Get a collection. | @@ -20,550 +13,6 @@ All URIs are relative to *https://api.reveng.ai* | [**v3PatchCollectionTags**](CollectionsApi.md#v3PatchCollectionTags) | **PATCH** /v3/collections/{collection_id}/tags | Replace the tags on a collection. | - -# **createCollection** -> BaseResponseCollectionResponse createCollection(collectionCreateRequest) - -Creates new collection information - -A collection is a group of binaries that are related in some way. This endpoint creates a new collection and allows you to add tags and binaries to it. If you add tags or binaries to the collection, they will be returned in the response. - -### 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.CollectionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - CollectionsApi apiInstance = new CollectionsApi(defaultClient); - CollectionCreateRequest collectionCreateRequest = new CollectionCreateRequest(); // CollectionCreateRequest | - try { - BaseResponseCollectionResponse result = apiInstance.createCollection(collectionCreateRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CollectionsApi#createCollection"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **collectionCreateRequest** | [**CollectionCreateRequest**](CollectionCreateRequest.md)| | | - -### Return type - -[**BaseResponseCollectionResponse**](BaseResponseCollectionResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **deleteCollection** -> BaseResponseBool deleteCollection(collectionId) - -Deletes a collection - -Deletes a collection - -### 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.CollectionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - CollectionsApi apiInstance = new CollectionsApi(defaultClient); - Integer collectionId = 56; // Integer | - try { - BaseResponseBool result = apiInstance.deleteCollection(collectionId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CollectionsApi#deleteCollection"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **collectionId** | **Integer**| | | - -### Return type - -[**BaseResponseBool**](BaseResponseBool.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getCollection** -> BaseResponseCollectionResponse getCollection(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr) - -Returns a collection - -Gets a single collection. The collection can include binaries and tags if requested. You can specify whether to include tags and binaries in the response by using the query string parameters defined. - -### 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.CollectionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - CollectionsApi apiInstance = new CollectionsApi(defaultClient); - Integer collectionId = 56; // Integer | - Boolean includeTags = false; // Boolean | - Boolean includeBinaries = false; // Boolean | - Integer pageSize = 10; // Integer | - Integer pageNumber = 1; // Integer | - String binarySearchStr = "binarySearchStr_example"; // String | - try { - BaseResponseCollectionResponse result = apiInstance.getCollection(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CollectionsApi#getCollection"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **collectionId** | **Integer**| | | -| **includeTags** | **Boolean**| | [optional] [default to false] | -| **includeBinaries** | **Boolean**| | [optional] [default to false] | -| **pageSize** | **Integer**| | [optional] [default to 10] | -| **pageNumber** | **Integer**| | [optional] [default to 1] | -| **binarySearchStr** | **String**| | [optional] | - -### Return type - -[**BaseResponseCollectionResponse**](BaseResponseCollectionResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **listCollections** -> BaseResponseListCollectionResults listCollections(searchTerm, filters, limit, offset, orderBy, order) - -Gets basic collections information - -Returns a list of collections - -### 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.CollectionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - CollectionsApi apiInstance = new CollectionsApi(defaultClient); - String searchTerm = ""; // String | - List filters = Arrays.asList(); // List | - Integer limit = 20; // Integer | - Integer offset = 0; // Integer | - AppApiRestV2CollectionsEnumsOrderBy orderBy = AppApiRestV2CollectionsEnumsOrderBy.fromValue("created"); // AppApiRestV2CollectionsEnumsOrderBy | - Order order = Order.fromValue("ASC"); // Order | - try { - BaseResponseListCollectionResults result = apiInstance.listCollections(searchTerm, filters, limit, offset, orderBy, order); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CollectionsApi#listCollections"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **searchTerm** | **String**| | [optional] [default to ] | -| **filters** | [**List<Filters>**](Filters.md)| | [optional] | -| **limit** | **Integer**| | [optional] [default to 20] | -| **offset** | **Integer**| | [optional] [default to 0] | -| **orderBy** | [**AppApiRestV2CollectionsEnumsOrderBy**](.md)| | [optional] [default to collection] [enum: created, collection, owner, collection_size, updated] | -| **order** | [**Order**](.md)| | [optional] [default to ASC] [enum: ASC, DESC] | - -### Return type - -[**BaseResponseListCollectionResults**](BaseResponseListCollectionResults.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **updateCollection** -> BaseResponseCollectionResponse updateCollection(collectionId, collectionUpdateRequest) - -Updates a collection - -Updates a collection, you can update the collection name, description, and scope - -### 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.CollectionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - CollectionsApi apiInstance = new CollectionsApi(defaultClient); - Integer collectionId = 56; // Integer | - CollectionUpdateRequest collectionUpdateRequest = new CollectionUpdateRequest(); // CollectionUpdateRequest | - try { - BaseResponseCollectionResponse result = apiInstance.updateCollection(collectionId, collectionUpdateRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CollectionsApi#updateCollection"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **collectionId** | **Integer**| | | -| **collectionUpdateRequest** | [**CollectionUpdateRequest**](CollectionUpdateRequest.md)| | | - -### Return type - -[**BaseResponseCollectionResponse**](BaseResponseCollectionResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **updateCollectionBinaries** -> BaseResponseCollectionBinariesUpdateResponse updateCollectionBinaries(collectionId, collectionBinariesUpdateRequest) - -Updates a collection binaries - -Updates/changes a collection binaries to whatever is provided in the request. After this update the collection will only contain the binaries provided in the request. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.CollectionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - CollectionsApi apiInstance = new CollectionsApi(defaultClient); - Integer collectionId = 56; // Integer | - CollectionBinariesUpdateRequest collectionBinariesUpdateRequest = new CollectionBinariesUpdateRequest(); // CollectionBinariesUpdateRequest | - try { - BaseResponseCollectionBinariesUpdateResponse result = apiInstance.updateCollectionBinaries(collectionId, collectionBinariesUpdateRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CollectionsApi#updateCollectionBinaries"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **collectionId** | **Integer**| | | -| **collectionBinariesUpdateRequest** | [**CollectionBinariesUpdateRequest**](CollectionBinariesUpdateRequest.md)| | | - -### Return type - -[**BaseResponseCollectionBinariesUpdateResponse**](BaseResponseCollectionBinariesUpdateResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **updateCollectionTags** -> BaseResponseCollectionTagsUpdateResponse updateCollectionTags(collectionId, collectionTagsUpdateRequest) - -Updates a collection tags - -Updates/changes a collection tags to whatever is provided in the request. After this update the collection will only contain the tags provided in the request. - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.CollectionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - CollectionsApi apiInstance = new CollectionsApi(defaultClient); - Integer collectionId = 56; // Integer | - CollectionTagsUpdateRequest collectionTagsUpdateRequest = new CollectionTagsUpdateRequest(); // CollectionTagsUpdateRequest | - try { - BaseResponseCollectionTagsUpdateResponse result = apiInstance.updateCollectionTags(collectionId, collectionTagsUpdateRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CollectionsApi#updateCollectionTags"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **collectionId** | **Integer**| | | -| **collectionTagsUpdateRequest** | [**CollectionTagsUpdateRequest**](CollectionTagsUpdateRequest.md)| | | - -### Return type - -[**BaseResponseCollectionTagsUpdateResponse**](BaseResponseCollectionTagsUpdateResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **v3CreateCollection** > CreateCollectionOutputBody v3CreateCollection(createCollectionInputBody) diff --git a/docs/CommentBase.md b/docs/CommentBase.md deleted file mode 100644 index 88e9503..0000000 --- a/docs/CommentBase.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CommentBase - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**content** | **String** | Comment text content | | - - - diff --git a/docs/CommentResponse.md b/docs/CommentResponse.md deleted file mode 100644 index 8f3b957..0000000 --- a/docs/CommentResponse.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# CommentResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**content** | **String** | Comment text content | | -|**id** | **Integer** | | | -|**userId** | **Integer** | | | -|**resourceType** | **String** | | | -|**resourceId** | **String** | | | -|**context** | [**Context**](Context.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | | -|**updatedAt** | **OffsetDateTime** | | | - - - diff --git a/docs/CommentUpdateRequest.md b/docs/CommentUpdateRequest.md deleted file mode 100644 index ecfb0cb..0000000 --- a/docs/CommentUpdateRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# CommentUpdateRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**content** | **String** | Updated comment text | | - - - diff --git a/docs/ConfigApi.md b/docs/ConfigApi.md deleted file mode 100644 index 15cf436..0000000 --- a/docs/ConfigApi.md +++ /dev/null @@ -1,79 +0,0 @@ -# ConfigApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getConfig**](ConfigApi.md#getConfig) | **GET** /v2/config | Get Config | - - - -# **getConfig** -> BaseResponseConfigResponse getConfig() - -Get Config - -General configuration endpoint - -### 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.ConfigApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - ConfigApi apiInstance = new ConfigApi(defaultClient); - try { - BaseResponseConfigResponse result = apiInstance.getConfig(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ConfigApi#getConfig"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**BaseResponseConfigResponse**](BaseResponseConfigResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - diff --git a/docs/ConfigResponse.md b/docs/ConfigResponse.md deleted file mode 100644 index 04f9cb3..0000000 --- a/docs/ConfigResponse.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ConfigResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**dashboardUrl** | **String** | The domain of the RevEng.AI platform you are connected to | [optional] | -|**maxFileSizeBytes** | **Integer** | Maximum file size (in bytes) that can be uploaded for analysis | | -|**aiDecompilerUnsupportedLanguages** | **List<String>** | List of programming languages that are not supported for AI decompilation | | -|**aiDecompilerSupportedModels** | **List<String>** | List of models that support AI decompilation | | - - - diff --git a/docs/Context.md b/docs/Context.md deleted file mode 100644 index 1861e3e..0000000 --- a/docs/Context.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# Context - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**startLine** | **Integer** | | | -|**endLine** | **Integer** | | | - - - diff --git a/docs/Created.md b/docs/Created.md deleted file mode 100644 index 14b13b9..0000000 --- a/docs/Created.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# Created - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisId** | **Integer** | The ID corresponding to the newly created analysis | | -|**binaryId** | **Integer** | The ID corresponding to the binary that was created | | -|**reference** | **String** | Deprecated will always be empty string | | - - - diff --git a/docs/DecompilationCommentContext.md b/docs/DecompilationCommentContext.md deleted file mode 100644 index 3514ac3..0000000 --- a/docs/DecompilationCommentContext.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# DecompilationCommentContext - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**startLine** | **Integer** | | | -|**endLine** | **Integer** | | | - - - diff --git a/docs/DieMatch.md b/docs/DieMatch.md deleted file mode 100644 index 9034d0f..0000000 --- a/docs/DieMatch.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# DieMatch - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Canonical name of the matched signature/technology (e.g., 'UPX', 'GCC', 'MSVC'). | | -|**type** | **String** | Category assigned by DIE for the match (e.g., 'compiler', 'packer', 'file'). | | -|**display** | **String** | Human-readable description from DIE's 'string' field; suitable for UI/logs, not for parsing. | | -|**version** | **String** | Extracted version string when available; may be empty/None if unknown. | | - - - diff --git a/docs/DisassemblyOutputBody.md b/docs/DisassemblyOutputBody.md index 1c5ed12..536ec09 100644 --- a/docs/DisassemblyOutputBody.md +++ b/docs/DisassemblyOutputBody.md @@ -11,7 +11,7 @@ |**functionId** | **Long** | | | |**localVariables** | **Object** | | [optional] | |**params** | **Object** | | [optional] | -|**returnType** | **String** | Search is applied to string value | [optional] | +|**returnType** | **String** | | [optional] | |**returns** | **Boolean** | | | diff --git a/docs/DynamicExecutionStatus.md b/docs/DynamicExecutionStatus.md deleted file mode 100644 index 3e3d3ba..0000000 --- a/docs/DynamicExecutionStatus.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# DynamicExecutionStatus - -## Enum - - -* `PENDING` (value: `"PENDING"`) - -* `ERROR` (value: `"ERROR"`) - -* `SUCCESS` (value: `"SUCCESS"`) - -* `ALL` (value: `"ALL"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/ELFImportModel.md b/docs/ELFImportModel.md deleted file mode 100644 index 987cdae..0000000 --- a/docs/ELFImportModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ELFImportModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**numberOfImports** | **Integer** | | | -|**imports** | **List<String>** | | | - - - diff --git a/docs/ELFModel.md b/docs/ELFModel.md deleted file mode 100644 index 0bc1b60..0000000 --- a/docs/ELFModel.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# ELFModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**fileType** | **String** | | | -|**architecture** | **String** | | | -|**endianness** | **String** | | | -|**entryPoint** | **Integer** | | | -|**entryPointBytes** | **String** | | | -|**importHash** | **String** | | | -|**exportHash** | **String** | | | -|**buildId** | **String** | | | -|**security** | [**ELFSecurity**](ELFSecurity.md) | | | -|**sections** | [**List<ELFSection>**](ELFSection.md) | | | -|**segments** | [**List<ELFSegment>**](ELFSegment.md) | | | -|**symbols** | [**List<ELFSymbol>**](ELFSymbol.md) | | | -|**dynamicSymbols** | [**List<ELFSymbol>**](ELFSymbol.md) | | | -|**relocations** | [**List<ELFRelocation>**](ELFRelocation.md) | | | -|**imports** | [**ELFImportModel**](ELFImportModel.md) | | | -|**exportedFunctions** | **List<String>** | | | -|**dynamicEntries** | [**List<ElfDynamicEntry>**](ElfDynamicEntry.md) | | | -|**notes** | **List<Map<String, Object>>** | | | -|**debugInfo** | **Map<String, Object>** | | | -|**versionInfo** | **Map<String, Object>** | | | - - - diff --git a/docs/ELFRelocation.md b/docs/ELFRelocation.md deleted file mode 100644 index 33312e0..0000000 --- a/docs/ELFRelocation.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# ELFRelocation - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**address** | **Integer** | | | -|**type** | **String** | | | -|**size** | **Integer** | | | -|**addend** | **Integer** | | | -|**symbolName** | **String** | | | -|**isDynamic** | **Boolean** | | | -|**isPltgot** | **Boolean** | | | -|**isUnicodeSymbolName** | **Boolean** | | [optional] | - - - diff --git a/docs/ELFSection.md b/docs/ELFSection.md deleted file mode 100644 index ea6cc34..0000000 --- a/docs/ELFSection.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# ELFSection - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | | | -|**type** | **String** | | | -|**virtualAddress** | **Integer** | | | -|**virtualSize** | **Integer** | | | -|**rawSize** | **Integer** | | | -|**fileOffset** | **Integer** | | | -|**flags** | **String** | | | -|**flagsRaw** | **Integer** | | | -|**entropy** | **BigDecimal** | | | -|**alignment** | **Integer** | | | - - - diff --git a/docs/ELFSecurity.md b/docs/ELFSecurity.md deleted file mode 100644 index dbe65fb..0000000 --- a/docs/ELFSecurity.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# ELFSecurity - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**pie** | **Boolean** | | | -|**stripped** | **Boolean** | | | -|**canary** | **Boolean** | | | -|**nx** | **Boolean** | | | -|**relo** | **Boolean** | | | - - - diff --git a/docs/ELFSegment.md b/docs/ELFSegment.md deleted file mode 100644 index d19215d..0000000 --- a/docs/ELFSegment.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# ELFSegment - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**type** | **String** | | | -|**virtualAddress** | **Integer** | | | -|**virtualSize** | **Integer** | | | -|**physicalAddress** | **Integer** | | | -|**physicalSize** | **Integer** | | | -|**fileOffset** | **Integer** | | | -|**flags** | **String** | | | -|**flagsRaw** | **Integer** | | | -|**alignment** | **Integer** | | | - - - diff --git a/docs/ELFSymbol.md b/docs/ELFSymbol.md deleted file mode 100644 index 04b3a4c..0000000 --- a/docs/ELFSymbol.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# ELFSymbol - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | | | -|**value** | **Integer** | | | -|**size** | **Integer** | | | -|**type** | **String** | | | -|**binding** | **String** | | | -|**visibility** | **String** | | | -|**sectionIndex** | **Integer** | | | -|**isUnicodeName** | **Boolean** | | [optional] | - - - diff --git a/docs/ElfDynamicEntry.md b/docs/ElfDynamicEntry.md deleted file mode 100644 index ed1932b..0000000 --- a/docs/ElfDynamicEntry.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ElfDynamicEntry - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tag** | **String** | | | -|**value** | **Integer** | | | - - - diff --git a/docs/EntrypointModel.md b/docs/EntrypointModel.md deleted file mode 100644 index 99d2d67..0000000 --- a/docs/EntrypointModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# EntrypointModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**address** | **Integer** | | | -|**firstBytes** | **String** | | | - - - diff --git a/docs/Enumeration.md b/docs/Enumeration.md deleted file mode 100644 index c79166f..0000000 --- a/docs/Enumeration.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# Enumeration - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this enumeration | [optional] | -|**name** | **String** | Name of the enumeration | | -|**members** | **Map<String, Integer>** | Dictionary of enumeration members and their values | | -|**artifactType** | **String** | Type of artifact that the enumeration is associated with | [optional] | - - - diff --git a/docs/ErrorModel.md b/docs/ErrorModel.md deleted file mode 100644 index de50be9..0000000 --- a/docs/ErrorModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ErrorModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**code** | **String** | | | -|**message** | **String** | | | - - - diff --git a/docs/ExportModel.md b/docs/ExportModel.md deleted file mode 100644 index 0e0766f..0000000 --- a/docs/ExportModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ExportModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**numberOfExports** | **Integer** | | | -|**exports** | **List<Map<String, Integer>>** | | | - - - diff --git a/docs/ExternalResponse.md b/docs/ExternalResponse.md deleted file mode 100644 index 9b65c9b..0000000 --- a/docs/ExternalResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# ExternalResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**sha256Hash** | **String** | | | -|**data** | **Map<String, Object>** | | | -|**lastUpdated** | **OffsetDateTime** | | | - - - diff --git a/docs/ExternalSourcesApi.md b/docs/ExternalSourcesApi.md deleted file mode 100644 index 6beafb9..0000000 --- a/docs/ExternalSourcesApi.md +++ /dev/null @@ -1,229 +0,0 @@ -# ExternalSourcesApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createExternalTaskVt**](ExternalSourcesApi.md#createExternalTaskVt) | **POST** /v2/analysis/{analysis_id}/external/vt | Pulls data from VirusTotal | -| [**getVtData**](ExternalSourcesApi.md#getVtData) | **GET** /v2/analysis/{analysis_id}/external/vt | Get VirusTotal data | -| [**getVtTaskStatus**](ExternalSourcesApi.md#getVtTaskStatus) | **GET** /v2/analysis/{analysis_id}/external/vt/status | Check the status of VirusTotal data retrieval | - - - -# **createExternalTaskVt** -> BaseResponseStr createExternalTaskVt(analysisId) - -Pulls data from VirusTotal - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.ExternalSourcesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - ExternalSourcesApi apiInstance = new ExternalSourcesApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseStr result = apiInstance.createExternalTaskVt(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ExternalSourcesApi#createExternalTaskVt"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | - -### Return type - -[**BaseResponseStr**](BaseResponseStr.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **202** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **409** | Request already queued | - | - - -# **getVtData** -> BaseResponseExternalResponse getVtData(analysisId) - -Get VirusTotal data - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.ExternalSourcesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - ExternalSourcesApi apiInstance = new ExternalSourcesApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseExternalResponse result = apiInstance.getVtData(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ExternalSourcesApi#getVtData"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | - -### Return type - -[**BaseResponseExternalResponse**](BaseResponseExternalResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | No data retrieved from VirusTotal for the given analysis_id | - | - - -# **getVtTaskStatus** -> BaseResponseTaskResponse getVtTaskStatus(analysisId) - -Check the status of VirusTotal data retrieval - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.ExternalSourcesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - ExternalSourcesApi apiInstance = new ExternalSourcesApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseTaskResponse result = apiInstance.getVtTaskStatus(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ExternalSourcesApi#getVtTaskStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | - -### Return type - -[**BaseResponseTaskResponse**](BaseResponseTaskResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - diff --git a/docs/FileFormat.md b/docs/FileFormat.md deleted file mode 100644 index 54e79a6..0000000 --- a/docs/FileFormat.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# FileFormat - -## Enum - - -* `PE` (value: `"pe"`) - -* `ELF` (value: `"elf"`) - -* `BLOB` (value: `"blob"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/FileHashes.md b/docs/FileHashes.md deleted file mode 100644 index ff7381b..0000000 --- a/docs/FileHashes.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# FileHashes - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**md5** | **String** | | | -|**sha1** | **String** | | | -|**sha256** | **String** | | | -|**sha512** | **String** | | | -|**sha3224** | **String** | | | -|**sha3256** | **String** | | | -|**sha3384** | **String** | | | -|**sha3512** | **String** | | | - - - diff --git a/docs/FileMetadata.md b/docs/FileMetadata.md deleted file mode 100644 index 9596ad2..0000000 --- a/docs/FileMetadata.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# FileMetadata - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**size** | **Integer** | | | -|**friendlySize** | **String** | | | -|**entropy** | **BigDecimal** | | | -|**hashes** | [**FileHashes**](FileHashes.md) | | | - - - diff --git a/docs/Filters.md b/docs/Filters.md deleted file mode 100644 index 2f92aca..0000000 --- a/docs/Filters.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# Filters - -## Enum - - -* `OFFICIAL_ONLY` (value: `"official_only"`) - -* `USER_ONLY` (value: `"user_only"`) - -* `TEAM_ONLY` (value: `"team_only"`) - -* `PUBLIC_ONLY` (value: `"public_only"`) - -* `HIDE_EMPTY` (value: `"hide_empty"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/FirmwareApi.md b/docs/FirmwareApi.md deleted file mode 100644 index 9a5df70..0000000 --- a/docs/FirmwareApi.md +++ /dev/null @@ -1,161 +0,0 @@ -# FirmwareApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getBinariesForFirmwareTask**](FirmwareApi.md#getBinariesForFirmwareTask) | **GET** /v2/firmware/get-binaries/{task_id} | Upload firmware for unpacking | -| [**uploadFirmware**](FirmwareApi.md#uploadFirmware) | **POST** /v2/firmware | Upload firmware for unpacking | - - - -# **getBinariesForFirmwareTask** -> Object getBinariesForFirmwareTask(taskId) - -Upload firmware for unpacking - -Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response. - -### 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.FirmwareApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FirmwareApi apiInstance = new FirmwareApi(defaultClient); - String taskId = "taskId_example"; // String | - try { - Object result = apiInstance.getBinariesForFirmwareTask(taskId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FirmwareApi#getBinariesForFirmwareTask"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **taskId** | **String**| | | - -### Return type - -**Object** - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **uploadFirmware** -> Object uploadFirmware(_file, password) - -Upload firmware for unpacking - -Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response. - -### 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.FirmwareApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FirmwareApi apiInstance = new FirmwareApi(defaultClient); - File _file = new File("/path/to/file"); // File | - String password = "password_example"; // String | - try { - Object result = apiInstance.uploadFirmware(_file, password); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FirmwareApi#uploadFirmware"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **_file** | **File**| | | -| **password** | **String**| | [optional] | - -### Return type - -**Object** - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - diff --git a/docs/FormFile.md b/docs/FormFile.md index 5dad580..2b00f24 100644 --- a/docs/FormFile.md +++ b/docs/FormFile.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**contentType** | **String** | Search is applied to string value | | -|**filename** | **String** | Search is applied to string value | | +|**contentType** | **String** | | | +|**filename** | **String** | | | |**isSet** | **Boolean** | | | |**size** | **Long** | | | diff --git a/docs/FuncDepsInner.md b/docs/FuncDepsInner.md deleted file mode 100644 index ef74ffd..0000000 --- a/docs/FuncDepsInner.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# FuncDepsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this global variable | [optional] | -|**name** | **String** | Name of the global variable | | -|**size** | **Integer** | Size of the global variable in bytes | | -|**members** | **Map<String, Integer>** | Dictionary of enumeration members and their values | | -|**artifactType** | **String** | Type of artifact that the global variable is associated with | [optional] | -|**type** | **String** | Data type of the global variable | | -|**addr** | **Integer** | Memory address of the global variable | | - - - diff --git a/docs/FunctionBlockDestinationResponse.md b/docs/FunctionBlockDestinationResponse.md deleted file mode 100644 index e330b60..0000000 --- a/docs/FunctionBlockDestinationResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# FunctionBlockDestinationResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**destinationBlockId** | **Integer** | The block where execution can flow to from the current block | | -|**flowtype** | **String** | The type of execution flow between chunks | | -|**vaddr** | **String** | The vaddr of the destination where the execution flow continues from | | - - - diff --git a/docs/FunctionBlockResponse.md b/docs/FunctionBlockResponse.md deleted file mode 100644 index ad8f032..0000000 --- a/docs/FunctionBlockResponse.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# FunctionBlockResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asm** | **List<String>** | The ordered assembly strings for this chunk | | -|**id** | **Integer** | ID of the block | | -|**minAddr** | **Integer** | The minimum vaddr of the block | | -|**maxAddr** | **Integer** | The maximum vaddr of the block | | -|**destinations** | [**List<FunctionBlockDestinationResponse>**](FunctionBlockDestinationResponse.md) | The potential execution flow destinations from this block | | -|**comment** | **String** | An optional comment associated with this block, if any | [optional] | - - - diff --git a/docs/FunctionBlocksResponse.md b/docs/FunctionBlocksResponse.md deleted file mode 100644 index e8a3fce..0000000 --- a/docs/FunctionBlocksResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# FunctionBlocksResponse - -Response for returning disassembly of a function. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**blocks** | [**List<FunctionBlockResponse>**](FunctionBlockResponse.md) | Disassembly is broken into control flow blocks | | -|**localVariables** | [**List<FunctionLocalVariableResponse>**](FunctionLocalVariableResponse.md) | Local variables associated with this function | | -|**params** | [**List<FunctionParamResponse>**](FunctionParamResponse.md) | Params associated with this function | | -|**overviewComment** | **String** | An overview comment for the whole function | [optional] | - - - diff --git a/docs/FunctionBoundary.md b/docs/FunctionBoundary.md deleted file mode 100644 index 8ce1e71..0000000 --- a/docs/FunctionBoundary.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# FunctionBoundary - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**mangledName** | **String** | | | -|**startAddress** | **Long** | | | -|**endAddress** | **Long** | | | -|**includeInAnalysis** | **Boolean** | Indicates whether the function should be included in the analysis | [optional] | - - - diff --git a/docs/FunctionCapabilityResponse.md b/docs/FunctionCapabilityResponse.md deleted file mode 100644 index 5602b32..0000000 --- a/docs/FunctionCapabilityResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# FunctionCapabilityResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**capabilities** | **List<String>** | The capabilities of the function | | - - - diff --git a/docs/FunctionDataTypes.md b/docs/FunctionDataTypes.md deleted file mode 100644 index 7ecf2b3..0000000 --- a/docs/FunctionDataTypes.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# FunctionDataTypes - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**completed** | **Boolean** | Whether the service has completed data types generation | | -|**status** | **String** | The current status of the data types service | | -|**dataTypes** | [**V2FunctionInfo**](V2FunctionInfo.md) | Function data types information if available | [optional] | -|**dataTypesVersion** | **Integer** | If the data types information has been updated by the user, this field will be populated | [optional] | - - - diff --git a/docs/FunctionDataTypesList.md b/docs/FunctionDataTypesList.md deleted file mode 100644 index ee1d2d8..0000000 --- a/docs/FunctionDataTypesList.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# FunctionDataTypesList - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**totalCount** | **Integer** | Total number of functions in analysis | [optional] | -|**totalDataTypesCount** | **Integer** | Total number of functions with data types | [optional] | -|**items** | [**List<FunctionDataTypesListItem>**](FunctionDataTypesListItem.md) | List of function data types information | | - - - diff --git a/docs/FunctionDataTypesListItem.md b/docs/FunctionDataTypesListItem.md deleted file mode 100644 index 3fd02d2..0000000 --- a/docs/FunctionDataTypesListItem.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# FunctionDataTypesListItem - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**completed** | **Boolean** | Whether the service has completed data types generation | | -|**status** | **String** | The current status of the data types service | | -|**dataTypes** | [**V2FunctionInfo**](V2FunctionInfo.md) | Function data types information if available | [optional] | -|**dataTypesVersion** | **Integer** | If the data types information has been updated by the user, this field will be populated | [optional] | -|**functionId** | **Long** | Function id | | - - - diff --git a/docs/FunctionDataTypesParams.md b/docs/FunctionDataTypesParams.md deleted file mode 100644 index 7a362d1..0000000 --- a/docs/FunctionDataTypesParams.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# FunctionDataTypesParams - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionIds** | **List<Long>** | The function ID's to generate/get data types for | | - - - diff --git a/docs/FunctionDataTypesStatus.md b/docs/FunctionDataTypesStatus.md deleted file mode 100644 index e753780..0000000 --- a/docs/FunctionDataTypesStatus.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# FunctionDataTypesStatus - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | Function id | | -|**completed** | **Boolean** | Whether the service has completed data types generation | | -|**status** | **String** | The current status of the data types service | | - - - diff --git a/docs/FunctionListItem.md b/docs/FunctionListItem.md deleted file mode 100644 index b57d637..0000000 --- a/docs/FunctionListItem.md +++ /dev/null @@ -1,34 +0,0 @@ - - -# FunctionListItem - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **Long** | Function id | | -|**name** | **String** | Name of the function | | -|**nameSourceType** | [**NameSourceTypeEnum**](#NameSourceTypeEnum) | The source (process) the function name came from | | -|**nameSource** | [**NameSourceType**](NameSourceType.md) | The source of the current function name. | | -|**mangledName** | **String** | Mangled name of the function | | -|**vaddr** | **Long** | Function virtual address | | -|**size** | **Integer** | Function size in bytes | | -|**debug** | **Boolean** | Whether the function has debug information | | - - - -## Enum: NameSourceTypeEnum - -| Name | Value | -|---- | -----| -| SYSTEM | "SYSTEM" | -| USER | "USER" | -| AUTO_UNSTRIP | "AUTO_UNSTRIP" | -| EXTERNAL | "EXTERNAL" | -| AI_UNSTRIP | "AI_UNSTRIP" | -| AI_AGENT | "AI_AGENT" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - diff --git a/docs/FunctionLocalVariableResponse.md b/docs/FunctionLocalVariableResponse.md deleted file mode 100644 index 3a0de17..0000000 --- a/docs/FunctionLocalVariableResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# FunctionLocalVariableResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**address** | **String** | | | -|**dType** | **String** | | | -|**size** | **Integer** | | | -|**loc** | **String** | | | -|**name** | **String** | | | - - - diff --git a/docs/FunctionMapping.md b/docs/FunctionMapping.md deleted file mode 100644 index 6aaa79a..0000000 --- a/docs/FunctionMapping.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# FunctionMapping - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionMap** | **Map<String, Integer>** | Mapping of remote function ids to local function addresses | | -|**inverseFunctionMap** | **Map<String, Integer>** | Mapping of local function addresses to remote function ids | | -|**nameMap** | **Map<String, String>** | Mapping of local function addresses to mangled names | | - - - diff --git a/docs/FunctionNameHistory.md b/docs/FunctionNameHistory.md deleted file mode 100644 index f3b017c..0000000 --- a/docs/FunctionNameHistory.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# FunctionNameHistory - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**historyId** | **Integer** | The ID of the history record | | -|**changeMadeBy** | **String** | The user who made the change | | -|**functionName** | **String** | The name of the function | | -|**mangledName** | **String** | The mangled name of the function | | -|**isDebug** | **Boolean** | Whether the function is debugged | | -|**sourceType** | **FunctionSourceType** | The source type of the function | | -|**createdAt** | **String** | The timestamp when the function name was created | | - - - diff --git a/docs/FunctionParamResponse.md b/docs/FunctionParamResponse.md deleted file mode 100644 index 0aec65a..0000000 --- a/docs/FunctionParamResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# FunctionParamResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**dType** | **String** | | | -|**loc** | **String** | | | -|**addr** | **String** | | | -|**length** | **Integer** | | | -|**name** | **String** | | | - - - diff --git a/docs/FunctionRename.md b/docs/FunctionRename.md deleted file mode 100644 index f23802a..0000000 --- a/docs/FunctionRename.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# FunctionRename - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**newName** | **String** | The new name for the function | | -|**newMangledName** | **String** | The new mangled name for the function | | - - - diff --git a/docs/FunctionRenameMap.md b/docs/FunctionRenameMap.md deleted file mode 100644 index 941dfc5..0000000 --- a/docs/FunctionRenameMap.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# FunctionRenameMap - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | The ID of the function to rename | | -|**newName** | **String** | The new name for the function | | -|**newMangledName** | **String** | The new mangled name for the function | | - - - diff --git a/docs/FunctionSearchResponse.md b/docs/FunctionSearchResponse.md deleted file mode 100644 index 0335ab6..0000000 --- a/docs/FunctionSearchResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# FunctionSearchResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**results** | [**List<FunctionSearchResult>**](FunctionSearchResult.md) | The results of the search | | - - - diff --git a/docs/FunctionSearchResult.md b/docs/FunctionSearchResult.md deleted file mode 100644 index 139c8d7..0000000 --- a/docs/FunctionSearchResult.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# FunctionSearchResult - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | The function ID | | -|**functionName** | **String** | The name of the function | | -|**binaryName** | **String** | The name of the binary the function belongs to | | -|**createdAt** | **OffsetDateTime** | The creation date of the function | | -|**modelId** | **Integer** | The model ID used to analyze the binary the function belongs to | | -|**modelName** | **String** | The name of the model used to analyze the binary the function belongs to | | -|**ownedBy** | **String** | The owner of the binary the function belongs to | | - - - diff --git a/docs/FunctionSourceType.md b/docs/FunctionSourceType.md deleted file mode 100644 index d83cbc5..0000000 --- a/docs/FunctionSourceType.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# FunctionSourceType - -## Enum - - -* `SYSTEM` (value: `"SYSTEM"`) - -* `USER` (value: `"USER"`) - -* `EXTERNAL` (value: `"EXTERNAL"`) - -* `AUTO_UNSTRIP` (value: `"AUTO_UNSTRIP"`) - -* `AI_UNSTRIP` (value: `"AI_UNSTRIP"`) - -* `AI_AGENT` (value: `"AI_AGENT"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/FunctionString.md b/docs/FunctionString.md deleted file mode 100644 index 30fca47..0000000 --- a/docs/FunctionString.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# FunctionString - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**value** | **String** | The value of the string literal | | -|**vaddr** | **Integer** | The vaddr of the string value | | -|**source** | **StringSource** | The source of the string | [optional] | - - - diff --git a/docs/FunctionStringsResponse.md b/docs/FunctionStringsResponse.md deleted file mode 100644 index 4569e9f..0000000 --- a/docs/FunctionStringsResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# FunctionStringsResponse - -Response for listing all the strings of a function. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**strings** | [**List<FunctionString>**](FunctionString.md) | The strings associated with this function | | -|**totalStrings** | **Integer** | The total number of strings associated with this function | | - - - diff --git a/docs/FunctionsAiDecompilationApi.md b/docs/FunctionsAiDecompilationApi.md index dbeccff..0a8f2ff 100644 --- a/docs/FunctionsAiDecompilationApi.md +++ b/docs/FunctionsAiDecompilationApi.md @@ -9,7 +9,6 @@ All URIs are relative to *https://api.reveng.ai* | [**getAiDecompilation**](FunctionsAiDecompilationApi.md#getAiDecompilation) | **GET** /v3/functions/{function_id}/ai-decompilation | Get AI decompilation result | | [**getAiDecompilationInlineComments**](FunctionsAiDecompilationApi.md#getAiDecompilationInlineComments) | **GET** /v3/functions/{function_id}/ai-decompilation/inline-comments | Get AI decompilation inline comments | | [**getAiDecompilationInlineCommentsStatus**](FunctionsAiDecompilationApi.md#getAiDecompilationInlineCommentsStatus) | **GET** /v3/functions/{function_id}/ai-decompilation/inline-comments/status | Get inline comments generation workflow status | -| [**getAiDecompilationRating**](FunctionsAiDecompilationApi.md#getAiDecompilationRating) | **GET** /v2/functions/{function_id}/ai-decompilation/rating | Get rating for AI decompilation | | [**getAiDecompilationStatus**](FunctionsAiDecompilationApi.md#getAiDecompilationStatus) | **GET** /v3/functions/{function_id}/ai-decompilation/status | Get AI decompilation workflow status | | [**getAiDecompilationSummary**](FunctionsAiDecompilationApi.md#getAiDecompilationSummary) | **GET** /v3/functions/{function_id}/ai-decompilation/summary | Get AI decompilation summary | | [**getAiDecompilationSummaryStatus**](FunctionsAiDecompilationApi.md#getAiDecompilationSummaryStatus) | **GET** /v3/functions/{function_id}/ai-decompilation/summary/status | Get summary generation workflow status | @@ -19,7 +18,6 @@ All URIs are relative to *https://api.reveng.ai* | [**regenerateAiDecompilationSummary**](FunctionsAiDecompilationApi.md#regenerateAiDecompilationSummary) | **POST** /v3/functions/{function_id}/ai-decompilation/summary | Regenerate AI decompilation summary | | [**streamAiDecompilation**](FunctionsAiDecompilationApi.md#streamAiDecompilation) | **GET** /v3/functions/{function_id}/ai-decompilation/events | Stream live AI decompilation output (SSE) | | [**upsertAiDecompilationOverrides**](FunctionsAiDecompilationApi.md#upsertAiDecompilationOverrides) | **PATCH** /v3/functions/{function_id}/ai-decompilation/overrides | Upsert variable/function name overrides | -| [**upsertAiDecompilationRating**](FunctionsAiDecompilationApi.md#upsertAiDecompilationRating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation | @@ -415,78 +413,6 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getAiDecompilationRating** -> BaseResponseUnionGetAiDecompilationRatingResponseNoneType getAiDecompilationRating(functionId) - -Get rating for AI decompilation - -### 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.FunctionsAiDecompilationApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsAiDecompilationApi apiInstance = new FunctionsAiDecompilationApi(defaultClient); - Long functionId = 56L; // Long | The ID of the function for which to get the rating - try { - BaseResponseUnionGetAiDecompilationRatingResponseNoneType result = apiInstance.getAiDecompilationRating(functionId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsAiDecompilationApi#getAiDecompilationRating"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Long**| The ID of the function for which to get the rating | | - -### Return type - -[**BaseResponseUnionGetAiDecompilationRatingResponseNoneType**](BaseResponseUnionGetAiDecompilationRatingResponseNoneType.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **getAiDecompilationStatus** > WorkflowProgress getAiDecompilationStatus(functionId) @@ -1182,77 +1108,3 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **upsertAiDecompilationRating** -> BaseResponse upsertAiDecompilationRating(functionId, upsertAiDecomplationRatingRequest) - -Upsert rating for AI decompilation - -### 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.FunctionsAiDecompilationApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsAiDecompilationApi apiInstance = new FunctionsAiDecompilationApi(defaultClient); - Long functionId = 56L; // Long | The ID of the function being rated - UpsertAiDecomplationRatingRequest upsertAiDecomplationRatingRequest = new UpsertAiDecomplationRatingRequest(); // UpsertAiDecomplationRatingRequest | - try { - BaseResponse result = apiInstance.upsertAiDecompilationRating(functionId, upsertAiDecomplationRatingRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsAiDecompilationApi#upsertAiDecompilationRating"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Long**| The ID of the function being rated | | -| **upsertAiDecomplationRatingRequest** | [**UpsertAiDecomplationRatingRequest**](UpsertAiDecomplationRatingRequest.md)| | | - -### Return type - -[**BaseResponse**](BaseResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | - diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index c767d02..933628a 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -6,20 +6,12 @@ All URIs are relative to *https://api.reveng.ai* |------------- | ------------- | -------------| | [**addFunctionCallee**](FunctionsCoreApi.md#addFunctionCallee) | **POST** /v3/functions/{function_id}/callees | Add a callee to a function | | [**addUserStringToFunction**](FunctionsCoreApi.md#addUserStringToFunction) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. | -| [**getAnalysisStrings**](FunctionsCoreApi.md#getAnalysisStrings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis | -| [**getAnalysisStringsStatus**](FunctionsCoreApi.md#getAnalysisStringsStatus) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis | -| [**getFunctionBlocks**](FunctionsCoreApi.md#getFunctionBlocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function | -| [**getFunctionBlocks_0**](FunctionsCoreApi.md#getFunctionBlocks_0) | **GET** /v3/functions/{function_id}/blocks | Get function disassembly | -| [**getFunctionCalleesCallers**](FunctionsCoreApi.md#getFunctionCalleesCallers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function | -| [**getFunctionCalleesCallersBulk**](FunctionsCoreApi.md#getFunctionCalleesCallersBulk) | **GET** /v2/functions/callees_callers | Get list of functions that call or are called for a list of functions | -| [**getFunctionCalleesCallers_0**](FunctionsCoreApi.md#getFunctionCalleesCallers_0) | **GET** /v3/functions/{function_id}/callees-callers | Get callees and callers for a function | -| [**getFunctionCapabilities**](FunctionsCoreApi.md#getFunctionCapabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities | -| [**getFunctionCapabilities_0**](FunctionsCoreApi.md#getFunctionCapabilities_0) | **GET** /v3/functions/{function_id}/capabilities | Get capabilities for a function | -| [**getFunctionDetails**](FunctionsCoreApi.md#getFunctionDetails) | **GET** /v2/functions/{function_id} | Get function details | -| [**getFunctionDetails_0**](FunctionsCoreApi.md#getFunctionDetails_0) | **GET** /v3/functions/{function_id} | Get function details | +| [**getFunctionBlocks**](FunctionsCoreApi.md#getFunctionBlocks) | **GET** /v3/functions/{function_id}/blocks | Get function disassembly | +| [**getFunctionCalleesCallers**](FunctionsCoreApi.md#getFunctionCalleesCallers) | **GET** /v3/functions/{function_id}/callees-callers | Get callees and callers for a function | +| [**getFunctionCapabilities**](FunctionsCoreApi.md#getFunctionCapabilities) | **GET** /v3/functions/{function_id}/capabilities | Get capabilities for a function | +| [**getFunctionDetails**](FunctionsCoreApi.md#getFunctionDetails) | **GET** /v3/functions/{function_id} | Get function details | | [**getFunctionIndirectCallSites**](FunctionsCoreApi.md#getFunctionIndirectCallSites) | **GET** /v3/functions/{function_id}/indirect-call-sites | Get indirect call sites for a function | -| [**getFunctionStrings**](FunctionsCoreApi.md#getFunctionStrings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function | -| [**getFunctionStrings_0**](FunctionsCoreApi.md#getFunctionStrings_0) | **GET** /v3/functions/{function_id}/strings | List strings for a function. | +| [**getFunctionStrings**](FunctionsCoreApi.md#getFunctionStrings) | **GET** /v3/functions/{function_id}/strings | List strings for a function. | | [**getFunctionsCalleesCallers**](FunctionsCoreApi.md#getFunctionsCalleesCallers) | **GET** /v3/functions/callees-callers | Get callees and callers for many functions | | [**getFunctionsMatches**](FunctionsCoreApi.md#getFunctionsMatches) | **GET** /v3/functions/matches | Get function-matching results for an explicit set of functions | | [**getFunctionsMatchingStatus**](FunctionsCoreApi.md#getFunctionsMatchingStatus) | **GET** /v3/functions/matches/status | Get function-matching status for an explicit set of functions | @@ -189,244 +181,9 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getAnalysisStrings** -> BaseResponseAnalysisStringsResponse getAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder) - -Get string information found in the Analysis - -Get string information found in the analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - Integer page = 1; // Integer | The page number to retrieve. - Integer pageSize = 100; // Integer | Number of items per page. - String search = "search_example"; // String | Search is applied to string value - String functionSearch = "functionSearch_example"; // String | Search is applied to function names - String orderBy = "length"; // String | Order by field - String sortOrder = "ASC"; // String | Sort order for the results - try { - BaseResponseAnalysisStringsResponse result = apiInstance.getAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getAnalysisStrings"); - 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**| | | -| **page** | **Integer**| The page number to retrieve. | [optional] [default to 1] | -| **pageSize** | **Integer**| Number of items per page. | [optional] [default to 100] | -| **search** | **String**| Search is applied to string value | [optional] | -| **functionSearch** | **String**| Search is applied to function names | [optional] | -| **orderBy** | **String**| Order by field | [optional] [default to value] [enum: length, value] | -| **sortOrder** | **String**| Sort order for the results | [optional] [default to ASC] [enum: ASC, DESC] | - -### Return type - -[**BaseResponseAnalysisStringsResponse**](BaseResponseAnalysisStringsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getAnalysisStringsStatus** -> BaseResponseAnalysisStringsStatusResponse getAnalysisStringsStatus(analysisId) - -Get string processing state for the Analysis - -Get string processing state for the Analysis - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - BaseResponseAnalysisStringsStatusResponse result = apiInstance.getAnalysisStringsStatus(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getAnalysisStringsStatus"); - 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 - -[**BaseResponseAnalysisStringsStatusResponse**](BaseResponseAnalysisStringsStatusResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **getFunctionBlocks** -> BaseResponseFunctionBlocksResponse getFunctionBlocks(functionId) - -Get disassembly blocks related to the function - -Get disassembly blocks related to the function - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer functionId = 56; // Integer | - try { - BaseResponseFunctionBlocksResponse result = apiInstance.getFunctionBlocks(functionId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionBlocks"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Integer**| | | - -### Return type - -[**BaseResponseFunctionBlocksResponse**](BaseResponseFunctionBlocksResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | Not Found | - | - - -# **getFunctionBlocks_0** -> DisassemblyOutputBody getFunctionBlocks_0(functionId) +> DisassemblyOutputBody getFunctionBlocks(functionId) Get function disassembly @@ -460,10 +217,10 @@ public class Example { FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); Long functionId = 56L; // Long | Function ID try { - DisassemblyOutputBody result = apiInstance.getFunctionBlocks_0(functionId); + DisassemblyOutputBody result = apiInstance.getFunctionBlocks(functionId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionBlocks_0"); + System.err.println("Exception when calling FunctionsCoreApi#getFunctionBlocks"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -503,151 +260,7 @@ public class Example { # **getFunctionCalleesCallers** -> BaseResponseCalleesCallerFunctionsResponse getFunctionCalleesCallers(functionId) - -Get list of functions that call or are called by the specified function - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer functionId = 56; // Integer | - try { - BaseResponseCalleesCallerFunctionsResponse result = apiInstance.getFunctionCalleesCallers(functionId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionCalleesCallers"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Integer**| | | - -### Return type - -[**BaseResponseCalleesCallerFunctionsResponse**](BaseResponseCalleesCallerFunctionsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getFunctionCalleesCallersBulk** -> BaseResponseListCalleesCallerFunctionsResponse getFunctionCalleesCallersBulk(functionIds) - -Get list of functions that call or are called for a list of functions - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - List functionIds = Arrays.asList(); // List | - try { - BaseResponseListCalleesCallerFunctionsResponse result = apiInstance.getFunctionCalleesCallersBulk(functionIds); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionCalleesCallersBulk"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **functionIds** | [**List<Integer>**](Integer.md)| | | - -### Return type - -[**BaseResponseListCalleesCallerFunctionsResponse**](BaseResponseListCalleesCallerFunctionsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getFunctionCalleesCallers_0** -> CallEdgesOutputBody getFunctionCalleesCallers_0(functionId) +> CallEdgesOutputBody getFunctionCalleesCallers(functionId) Get callees and callers for a function @@ -681,10 +294,10 @@ public class Example { FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); Long functionId = 56L; // Long | Function ID try { - CallEdgesOutputBody result = apiInstance.getFunctionCalleesCallers_0(functionId); + CallEdgesOutputBody result = apiInstance.getFunctionCalleesCallers(functionId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionCalleesCallers_0"); + System.err.println("Exception when calling FunctionsCoreApi#getFunctionCalleesCallers"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -724,80 +337,7 @@ public class Example { # **getFunctionCapabilities** -> BaseResponseFunctionCapabilityResponse getFunctionCapabilities(functionId) - -Retrieve a functions capabilities - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer functionId = 56; // Integer | - try { - BaseResponseFunctionCapabilityResponse result = apiInstance.getFunctionCapabilities(functionId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionCapabilities"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Integer**| | | - -### Return type - -[**BaseResponseFunctionCapabilityResponse**](BaseResponseFunctionCapabilityResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | -| **404** | Not Found | - | - - -# **getFunctionCapabilities_0** -> CapabilitiesOutputBody getFunctionCapabilities_0(functionId) +> CapabilitiesOutputBody getFunctionCapabilities(functionId) Get capabilities for a function @@ -831,10 +371,10 @@ public class Example { FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); Long functionId = 56L; // Long | Function ID try { - CapabilitiesOutputBody result = apiInstance.getFunctionCapabilities_0(functionId); + CapabilitiesOutputBody result = apiInstance.getFunctionCapabilities(functionId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionCapabilities_0"); + System.err.println("Exception when calling FunctionsCoreApi#getFunctionCapabilities"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -874,79 +414,7 @@ public class Example { # **getFunctionDetails** -> BaseResponseFunctionsDetailResponse getFunctionDetails(functionId) - -Get function details - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer functionId = 56; // Integer | - try { - BaseResponseFunctionsDetailResponse result = apiInstance.getFunctionDetails(functionId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionDetails"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Integer**| | | - -### Return type - -[**BaseResponseFunctionsDetailResponse**](BaseResponseFunctionsDetailResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getFunctionDetails_0** -> FunctionDetailsOutputBody getFunctionDetails_0(functionId) +> FunctionDetailsOutputBody getFunctionDetails(functionId) Get function details @@ -980,10 +448,10 @@ public class Example { FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); Long functionId = 56L; // Long | Function ID try { - FunctionDetailsOutputBody result = apiInstance.getFunctionDetails_0(functionId); + FunctionDetailsOutputBody result = apiInstance.getFunctionDetails(functionId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionDetails_0"); + System.err.println("Exception when calling FunctionsCoreApi#getFunctionDetails"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1100,87 +568,7 @@ public class Example { # **getFunctionStrings** -> BaseResponseFunctionStringsResponse getFunctionStrings(functionId, page, pageSize, search) - -Get string information found in the function - -Get string information found in the function - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer functionId = 56; // Integer | - Integer page = 1; // Integer | The page number to retrieve. - Integer pageSize = 100; // Integer | Number of items per page. - String search = "search_example"; // String | Search is applied to string value - try { - BaseResponseFunctionStringsResponse result = apiInstance.getFunctionStrings(functionId, page, pageSize, search); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionStrings"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Integer**| | | -| **page** | **Integer**| The page number to retrieve. | [optional] [default to 1] | -| **pageSize** | **Integer**| Number of items per page. | [optional] [default to 100] | -| **search** | **String**| Search is applied to string value | [optional] | - -### Return type - -[**BaseResponseFunctionStringsResponse**](BaseResponseFunctionStringsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **getFunctionStrings_0** -> ListFunctionStringsOutputBody getFunctionStrings_0(functionId, page, pageSize, search) +> ListFunctionStringsOutputBody getFunctionStrings(functionId, page, pageSize, search) List strings for a function. @@ -1217,10 +605,10 @@ public class Example { Long pageSize = 100L; // Long | Number of results per page. String search = "search_example"; // String | Filter by string value (case-insensitive substring match). try { - ListFunctionStringsOutputBody result = apiInstance.getFunctionStrings_0(functionId, page, pageSize, search); + ListFunctionStringsOutputBody result = apiInstance.getFunctionStrings(functionId, page, pageSize, search); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionStrings_0"); + System.err.println("Exception when calling FunctionsCoreApi#getFunctionStrings"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); diff --git a/docs/FunctionsDataTypesApi.md b/docs/FunctionsDataTypesApi.md index 91fb4cc..3fe2a78 100644 --- a/docs/FunctionsDataTypesApi.md +++ b/docs/FunctionsDataTypesApi.md @@ -5,12 +5,8 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**batchUpdateFunctionDataTypes**](FunctionsDataTypesApi.md#batchUpdateFunctionDataTypes) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types | -| [**generateFunctionDataTypesForAnalysis**](FunctionsDataTypesApi.md#generateFunctionDataTypesForAnalysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types | -| [**generateFunctionDataTypesForFunctions**](FunctionsDataTypesApi.md#generateFunctionDataTypesForFunctions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions | | [**getFunctionDataTypes**](FunctionsDataTypesApi.md#getFunctionDataTypes) | **GET** /v3/analyses/{analysis_id}/functions/{function_id}/data-types | Get data types for a single function | | [**listAnalysisFunctionsDataTypes**](FunctionsDataTypesApi.md#listAnalysisFunctionsDataTypes) | **GET** /v3/analyses/{analysis_id}/functions/data-types | List data types for all functions in an analysis | -| [**listFunctionDataTypesForAnalysis**](FunctionsDataTypesApi.md#listFunctionDataTypesForAnalysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types | -| [**listFunctionDataTypesForFunctions**](FunctionsDataTypesApi.md#listFunctionDataTypesForFunctions) | **GET** /v2/functions/data_types | List Function Data Types | | [**listFunctionsDataTypes**](FunctionsDataTypesApi.md#listFunctionsDataTypes) | **GET** /v3/functions/data-types | Get data types for many functions | | [**updateFunctionDataTypes**](FunctionsDataTypesApi.md#updateFunctionDataTypes) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update function data types | @@ -95,156 +91,6 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **generateFunctionDataTypesForAnalysis** -> BaseResponseGenerateFunctionDataTypes generateFunctionDataTypesForAnalysis(analysisId, functionDataTypesParams) - -Generate Function Data Types - -Submits a request to generate the function data types - -### 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.FunctionsDataTypesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); - Integer analysisId = 56; // Integer | - FunctionDataTypesParams functionDataTypesParams = new FunctionDataTypesParams(); // FunctionDataTypesParams | - try { - BaseResponseGenerateFunctionDataTypes result = apiInstance.generateFunctionDataTypesForAnalysis(analysisId, functionDataTypesParams); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#generateFunctionDataTypesForAnalysis"); - 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**| | | -| **functionDataTypesParams** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | | - -### Return type - -[**BaseResponseGenerateFunctionDataTypes**](BaseResponseGenerateFunctionDataTypes.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **generateFunctionDataTypesForFunctions** -> BaseResponseGenerationStatusList generateFunctionDataTypesForFunctions(functionDataTypesParams) - -Generate Function Data Types for an arbitrary list of functions - -Submits a request to generate the function data types - -### 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.FunctionsDataTypesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); - FunctionDataTypesParams functionDataTypesParams = new FunctionDataTypesParams(); // FunctionDataTypesParams | - try { - BaseResponseGenerationStatusList result = apiInstance.generateFunctionDataTypesForFunctions(functionDataTypesParams); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#generateFunctionDataTypesForFunctions"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **functionDataTypesParams** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | | - -### Return type - -[**BaseResponseGenerationStatusList**](BaseResponseGenerationStatusList.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **getFunctionDataTypes** > DataTypesEntry getFunctionDataTypes(analysisId, functionId) @@ -405,156 +251,6 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **listFunctionDataTypesForAnalysis** -> BaseResponseFunctionDataTypesList listFunctionDataTypesForAnalysis(analysisId, functionIds) - -List Function Data Types - -Returns data types for multiple functions with optional function ID filtering - -### 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.FunctionsDataTypesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); - Integer analysisId = 56; // Integer | - List functionIds = Arrays.asList(); // List | - try { - BaseResponseFunctionDataTypesList result = apiInstance.listFunctionDataTypesForAnalysis(analysisId, functionIds); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#listFunctionDataTypesForAnalysis"); - 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**| | | -| **functionIds** | [**List<Integer>**](Integer.md)| | [optional] | - -### Return type - -[**BaseResponseFunctionDataTypesList**](BaseResponseFunctionDataTypesList.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **listFunctionDataTypesForFunctions** -> BaseResponseFunctionDataTypesList listFunctionDataTypesForFunctions(functionIds) - -List Function Data Types - -Returns data types for multiple function IDs - -### 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.FunctionsDataTypesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); - List functionIds = Arrays.asList(); // List | - try { - BaseResponseFunctionDataTypesList result = apiInstance.listFunctionDataTypesForFunctions(functionIds); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#listFunctionDataTypesForFunctions"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **functionIds** | [**List<Integer>**](Integer.md)| | [optional] | - -### Return type - -[**BaseResponseFunctionDataTypesList**](BaseResponseFunctionDataTypesList.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **listFunctionsDataTypes** > ListFunctionsDataTypesOutputBody listFunctionsDataTypes(functionIds) diff --git a/docs/FunctionsDetailResponse.md b/docs/FunctionsDetailResponse.md deleted file mode 100644 index 6b90c7a..0000000 --- a/docs/FunctionsDetailResponse.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# FunctionsDetailResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | Function id | | -|**functionName** | **String** | | | -|**functionNameMangled** | **String** | | | -|**functionVaddr** | **Long** | | | -|**functionSize** | **Integer** | | | -|**analysisId** | **Integer** | | | -|**binaryId** | **Integer** | | | -|**binaryName** | **String** | | | -|**sha256Hash** | **String** | | | -|**debugHash** | **String** | | | -|**debug** | **Boolean** | | | - - - diff --git a/docs/FunctionsListRename.md b/docs/FunctionsListRename.md deleted file mode 100644 index 53afcdc..0000000 --- a/docs/FunctionsListRename.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# FunctionsListRename - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functions** | [**List<FunctionRenameMap>**](FunctionRenameMap.md) | A list of functions to rename | | - - - diff --git a/docs/FunctionsRenamingHistoryApi.md b/docs/FunctionsRenamingHistoryApi.md index 2cc5e7a..5356b1f 100644 --- a/docs/FunctionsRenamingHistoryApi.md +++ b/docs/FunctionsRenamingHistoryApi.md @@ -4,90 +4,12 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**batchRenameFunction**](FunctionsRenamingHistoryApi.md#batchRenameFunction) | **POST** /v2/functions/rename/batch | Batch Rename Functions | | [**batchRenameFunctions**](FunctionsRenamingHistoryApi.md#batchRenameFunctions) | **POST** /v3/functions/rename | Batch rename functions | | [**getFunctionHistory**](FunctionsRenamingHistoryApi.md#getFunctionHistory) | **GET** /v3/functions/{function_id}/history | Get function name history | -| [**getFunctionNameHistory**](FunctionsRenamingHistoryApi.md#getFunctionNameHistory) | **GET** /v2/functions/history/{function_id} | Get Function Name History | | [**renameFunction**](FunctionsRenamingHistoryApi.md#renameFunction) | **POST** /v3/functions/{function_id}/rename | Rename a function | -| [**renameFunctionId**](FunctionsRenamingHistoryApi.md#renameFunctionId) | **POST** /v2/functions/rename/{function_id} | Rename Function | -| [**revertFunctionName**](FunctionsRenamingHistoryApi.md#revertFunctionName) | **POST** /v2/functions/history/{function_id}/{history_id} | Revert the function name | -| [**revertFunctionName_0**](FunctionsRenamingHistoryApi.md#revertFunctionName_0) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name | +| [**revertFunctionName**](FunctionsRenamingHistoryApi.md#revertFunctionName) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name | - -# **batchRenameFunction** -> BaseResponse batchRenameFunction(functionsListRename) - -Batch Rename Functions - -Renames a list of functions using the function IDs Will record name changes in history - -### 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.FunctionsRenamingHistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsRenamingHistoryApi apiInstance = new FunctionsRenamingHistoryApi(defaultClient); - FunctionsListRename functionsListRename = new FunctionsListRename(); // FunctionsListRename | - try { - BaseResponse result = apiInstance.batchRenameFunction(functionsListRename); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsRenamingHistoryApi#batchRenameFunction"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **functionsListRename** | [**FunctionsListRename**](FunctionsListRename.md)| | | - -### Return type - -[**BaseResponse**](BaseResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **batchRenameFunctions** > BatchRenameOutputBody batchRenameFunctions(batchRenameInputBody) @@ -242,80 +164,6 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **getFunctionNameHistory** -> BaseResponseListFunctionNameHistory getFunctionNameHistory(functionId) - -Get Function Name History - -Gets the name history of a function using the function ID - -### 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.FunctionsRenamingHistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsRenamingHistoryApi apiInstance = new FunctionsRenamingHistoryApi(defaultClient); - Integer functionId = 56; // Integer | - try { - BaseResponseListFunctionNameHistory result = apiInstance.getFunctionNameHistory(functionId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsRenamingHistoryApi#getFunctionNameHistory"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Integer**| | | - -### Return type - -[**BaseResponseListFunctionNameHistory**](BaseResponseListFunctionNameHistory.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **renameFunction** > RenameOutputBody renameFunction(functionId, renameInputBody) @@ -395,161 +243,9 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **renameFunctionId** -> BaseResponse renameFunctionId(functionId, functionRename) - -Rename Function - -Renames a function using the function ID Will record name change history - -### 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.FunctionsRenamingHistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsRenamingHistoryApi apiInstance = new FunctionsRenamingHistoryApi(defaultClient); - Integer functionId = 56; // Integer | - FunctionRename functionRename = new FunctionRename(); // FunctionRename | - try { - BaseResponse result = apiInstance.renameFunctionId(functionId, functionRename); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsRenamingHistoryApi#renameFunctionId"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Integer**| | | -| **functionRename** | [**FunctionRename**](FunctionRename.md)| | | - -### Return type - -[**BaseResponse**](BaseResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **revertFunctionName** -> BaseResponse revertFunctionName(functionId, historyId) - -Revert the function name - -Reverts the function name to a previous name using the function ID and history ID - -### 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.FunctionsRenamingHistoryApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsRenamingHistoryApi apiInstance = new FunctionsRenamingHistoryApi(defaultClient); - Integer functionId = 56; // Integer | - Integer historyId = 56; // Integer | - try { - BaseResponse result = apiInstance.revertFunctionName(functionId, historyId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsRenamingHistoryApi#revertFunctionName"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **functionId** | **Integer**| | | -| **historyId** | **Integer**| | | - -### Return type - -[**BaseResponse**](BaseResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **revertFunctionName_0** -> Object revertFunctionName_0(functionId, historyId) +> Object revertFunctionName(functionId, historyId) Revert function name @@ -584,10 +280,10 @@ public class Example { Long functionId = 56L; // Long | Function ID Long historyId = 56L; // Long | History ID to revert to try { - Object result = apiInstance.revertFunctionName_0(functionId, historyId); + Object result = apiInstance.revertFunctionName(functionId, historyId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsRenamingHistoryApi#revertFunctionName_0"); + System.err.println("Exception when calling FunctionsRenamingHistoryApi#revertFunctionName"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); diff --git a/docs/GenerateFunctionDataTypes.md b/docs/GenerateFunctionDataTypes.md deleted file mode 100644 index 9329468..0000000 --- a/docs/GenerateFunctionDataTypes.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# GenerateFunctionDataTypes - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**queued** | **Boolean** | [DEPRECATED] This value has been replaced with the `data_types_list` field | | -|**reference** | **String** | [DEPRECATED] This value has been replaced with the `data_types_list` field | | -|**dataTypesList** | [**GenerationStatusList**](GenerationStatusList.md) | List of function data types information that are either already generated, or now queued for generation | | - - - diff --git a/docs/GenerationStatusList.md b/docs/GenerationStatusList.md deleted file mode 100644 index 7f35256..0000000 --- a/docs/GenerationStatusList.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# GenerationStatusList - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**totalCount** | **Integer** | Total number of functions in analysis | [optional] | -|**totalDataTypesCount** | **Integer** | Total number of functions with data types | [optional] | -|**items** | [**List<FunctionDataTypesStatus>**](FunctionDataTypesStatus.md) | List of function data types information | | - - - diff --git a/docs/GetAiDecompilationRatingResponse.md b/docs/GetAiDecompilationRatingResponse.md deleted file mode 100644 index 22100b6..0000000 --- a/docs/GetAiDecompilationRatingResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetAiDecompilationRatingResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rating** | **AiDecompilationRating** | The rating the user has given to the AI decompilation response | | -|**reason** | **String** | The optional reason the user has given for the rating | | - - - diff --git a/docs/GetPublicUserResponse.md b/docs/GetPublicUserResponse.md deleted file mode 100644 index a44dae2..0000000 --- a/docs/GetPublicUserResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetPublicUserResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**username** | **String** | | | -|**userId** | **Integer** | | | - - - diff --git a/docs/GlobalVariable.md b/docs/GlobalVariable.md deleted file mode 100644 index 8ff5946..0000000 --- a/docs/GlobalVariable.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GlobalVariable - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this global variable | [optional] | -|**addr** | **Integer** | Memory address of the global variable | | -|**name** | **String** | Name of the global variable | | -|**type** | **String** | Data type of the global variable | | -|**size** | **Integer** | Size of the global variable in bytes | | -|**artifactType** | **String** | Type of artifact that the global variable is associated with | [optional] | - - - diff --git a/docs/IOC.md b/docs/IOC.md deleted file mode 100644 index 4b5ac0c..0000000 --- a/docs/IOC.md +++ /dev/null @@ -1,49 +0,0 @@ - - -# IOC - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**type** | [**TypeEnum**](#TypeEnum) | Type of the IOC | | -|**value** | **String** | Value of the IOC | | -|**description** | **String** | Description of the IOC | | -|**source** | **String** | The source address where the IOC can be found in the binary if possible. | [optional] | -|**functionId** | **Integer** | Unique identifier of the function containing the IOC | [optional] | -|**functionName** | **String** | Name of the function containing the IOC | [optional] | - - - -## Enum: TypeEnum - -| Name | Value | -|---- | -----| -| IP | "ip" | -| DOMAIN | "domain" | -| URL | "url" | -| USERNAMES | "usernames" | -| PASSWORDS | "passwords" | -| FILE_HASH | "file_hash" | -| MUTEX | "mutex" | -| REGISTRY_KEY | "registry_key" | -| FILENAME | "filename" | -| EMAIL | "email" | -| C2_ENDPOINT | "c2_endpoint" | -| USER_AGENT | "user_agent" | -| PEM_KEY | "pem_key" | -| SSH_KEY | "ssh_key" | -| NETWORK_PORT | "network_port" | -| JA3 | "ja3" | -| SSL_CERT_FINGERPRINT | "ssl_cert_fingerprint" | -| HTTP_HEADER | "http_header" | -| SERVICE | "service" | -| SCHEDULED_TASK | "scheduled_task" | -| PE_HEADER | "pe_header" | -| ENTROPY | "entropy" | -| OTHER | "other" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - diff --git a/docs/ISA.md b/docs/ISA.md deleted file mode 100644 index 5360ed0..0000000 --- a/docs/ISA.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# ISA - -## Enum - - -* `X86` (value: `"x86"`) - -* `X86_64` (value: `"x86_64"`) - -* `ARM` (value: `"arm"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/IconModel.md b/docs/IconModel.md deleted file mode 100644 index 0ec75d9..0000000 --- a/docs/IconModel.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# IconModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**content** | **String** | | | - - - diff --git a/docs/ImportModel.md b/docs/ImportModel.md deleted file mode 100644 index c49fb71..0000000 --- a/docs/ImportModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# ImportModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**numberOfImports** | **Integer** | | | -|**imports** | **List<Map<String, Map<String, Integer>>>** | | | - - - diff --git a/docs/InsertAnalysisLogRequest.md b/docs/InsertAnalysisLogRequest.md deleted file mode 100644 index 55c5473..0000000 --- a/docs/InsertAnalysisLogRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# InsertAnalysisLogRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**log** | **String** | The log message to insert for the analysis | | - - - diff --git a/docs/ListCollectionResults.md b/docs/ListCollectionResults.md deleted file mode 100644 index 6bc411a..0000000 --- a/docs/ListCollectionResults.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ListCollectionResults - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**results** | [**List<CollectionListItem>**](CollectionListItem.md) | Page containing the results of the collections search | | - - - diff --git a/docs/Logs.md b/docs/Logs.md deleted file mode 100644 index b27e61c..0000000 --- a/docs/Logs.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# Logs - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**logs** | **String** | Full logs of an analysis of an analysis_id | | - - - diff --git a/docs/MITRETechnique.md b/docs/MITRETechnique.md deleted file mode 100644 index 7c66e7c..0000000 --- a/docs/MITRETechnique.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# MITRETechnique - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**startAddr** | **String** | Starting address of the technique | | -|**endAddr** | **String** | Ending address of the technique | | -|**functionAddr** | **String** | Function address where the technique is found | | -|**techniqueId** | **String** | MITRE technique identifier | | -|**techniqueName** | **String** | Name of the MITRE technique | | -|**description** | **String** | Description of the technique | | -|**functionId** | **Integer** | Unique identifier of the function containing the technique | | -|**functionName** | **String** | Name of the function containing the technique | | -|**techniqueUrl** | **String** | URL to the MITRE ATT&CK technique page | | -|**techniqueDescription** | **String** | Full description of the MITRE technique from ATT&CK | | - - - diff --git a/docs/MetaModel.md b/docs/MetaModel.md deleted file mode 100644 index 1dd8c14..0000000 --- a/docs/MetaModel.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# MetaModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**pagination** | [**PaginationModel**](PaginationModel.md) | | [optional] | - - - diff --git a/docs/ModelName.md b/docs/ModelName.md deleted file mode 100644 index d3a9966..0000000 --- a/docs/ModelName.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# ModelName - -## Enum - - -* `BINNET_0_7_X86_64_WINDOWS` (value: `"binnet-0.7-x86-64-windows"`) - -* `BINNET_0_7_X86_64_LINUX` (value: `"binnet-0.7-x86-64-linux"`) - -* `BINNET_0_7_X86_32_WINDOWS` (value: `"binnet-0.7-x86-32-windows"`) - -* `BINNET_0_7_X86_32_LINUX` (value: `"binnet-0.7-x86-32-linux"`) - -* `BINNET_0_7_ARM_64_WINDOWS` (value: `"binnet-0.7-arm-64-windows"`) - -* `BINNET_0_7_ARM_64_LINUX` (value: `"binnet-0.7-arm-64-linux"`) - -* `BINNET_0_7_X86_64_ANDROID` (value: `"binnet-0.7-x86-64-android"`) - -* `BINNET_0_7_X86_32_ANDROID` (value: `"binnet-0.7-x86-32-android"`) - -* `BINNET_0_7_ARM_64_ANDROID` (value: `"binnet-0.7-arm-64-android"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/ModelsApi.md b/docs/ModelsApi.md deleted file mode 100644 index c952fb0..0000000 --- a/docs/ModelsApi.md +++ /dev/null @@ -1,79 +0,0 @@ -# ModelsApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getModels**](ModelsApi.md#getModels) | **GET** /v2/models | Gets models | - - - -# **getModels** -> BaseResponseModelsResponse getModels() - -Gets models - -Gets active models available for analysis. - -### 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.ModelsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - ModelsApi apiInstance = new ModelsApi(defaultClient); - try { - BaseResponseModelsResponse result = apiInstance.getModels(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ModelsApi#getModels"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**BaseResponseModelsResponse**](BaseResponseModelsResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - diff --git a/docs/ModelsResponse.md b/docs/ModelsResponse.md deleted file mode 100644 index 8d4d2cd..0000000 --- a/docs/ModelsResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ModelsResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**models** | **List<String>** | List of active models available analysis. | | - - - diff --git a/docs/NameSourceType.md b/docs/NameSourceType.md deleted file mode 100644 index 28c40f8..0000000 --- a/docs/NameSourceType.md +++ /dev/null @@ -1,30 +0,0 @@ - - -# NameSourceType - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**type** | [**TypeEnum**](#TypeEnum) | The source (process) the function name came from | | -|**functionId** | **Integer** | The function id of the function the function name was copied from. | [optional] | -|**binaryId** | **Integer** | The binary id of the function that the function name was copied from. | [optional] | -|**analysisId** | **Integer** | The analysis id of the function that the function name was copied from. | [optional] | - - - -## Enum: TypeEnum - -| Name | Value | -|---- | -----| -| SYSTEM | "SYSTEM" | -| USER | "USER" | -| AUTO_UNSTRIP | "AUTO_UNSTRIP" | -| EXTERNAL | "EXTERNAL" | -| AI_UNSTRIP | "AI_UNSTRIP" | -| AI_AGENT | "AI_AGENT" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - diff --git a/docs/Order.md b/docs/Order.md deleted file mode 100644 index fe18638..0000000 --- a/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# Order - -## Enum - - -* `ASC` (value: `"ASC"`) - -* `DESC` (value: `"DESC"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/Organisation.md b/docs/Organisation.md index e9d1a99..21d52bb 100644 --- a/docs/Organisation.md +++ b/docs/Organisation.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**createdAt** | **OffsetDateTime** | | | -|**name** | **String** | Search is applied to string value | | +|**name** | **String** | | | |**organisationId** | **Long** | | | |**updatedAt** | **OffsetDateTime** | | | diff --git a/docs/OrganisationGroup.md b/docs/OrganisationGroup.md index b584747..9aa2c28 100644 --- a/docs/OrganisationGroup.md +++ b/docs/OrganisationGroup.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**createdAt** | **OffsetDateTime** | | | -|**name** | **String** | Search is applied to string value | | +|**name** | **String** | | | |**organisationGroupId** | **Long** | | | |**organisationId** | **Long** | | | |**teamId** | **Long** | | | diff --git a/docs/OrganisationIssuer.md b/docs/OrganisationIssuer.md index 0e55e83..f9c5824 100644 --- a/docs/OrganisationIssuer.md +++ b/docs/OrganisationIssuer.md @@ -10,7 +10,7 @@ |**clientId** | **String** | OIDC client ID registered with the identity provider. Used to validate the audience (aud) claim in JWTs. | [optional] | |**createdAt** | **OffsetDateTime** | | | |**enabled** | **Boolean** | | | -|**issuerUrl** | **String** | Search is applied to string value | | +|**issuerUrl** | **String** | | | |**jwksUri** | **String** | JSON Web Key Set URI discovered from the issuer's OIDC configuration. Populated automatically during issuer registration. | [optional] | |**organisationId** | **Long** | | | |**organisationIssuerId** | **Long** | | | diff --git a/docs/PDBDebugModel.md b/docs/PDBDebugModel.md deleted file mode 100644 index 5643f05..0000000 --- a/docs/PDBDebugModel.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# PDBDebugModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**debugEntries** | [**List<SinglePDBEntryModel>**](SinglePDBEntryModel.md) | | | - - - diff --git a/docs/PEModel.md b/docs/PEModel.md deleted file mode 100644 index 0d4c38e..0000000 --- a/docs/PEModel.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# PEModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**type** | **String** | | | -|**timestamps** | [**TimestampModel**](TimestampModel.md) | | | -|**architecture** | **String** | | | -|**checksum** | **Integer** | | | -|**imageBase** | **Integer** | | | -|**security** | [**SecurityModel**](SecurityModel.md) | | | -|**versionInfo** | **Map<String, Object>** | | | -|**debugInfo** | [**PDBDebugModel**](PDBDebugModel.md) | | | -|**numberOfResources** | **Integer** | | | -|**entryPoint** | [**EntrypointModel**](EntrypointModel.md) | | | -|**signature** | [**CodeSignatureModel**](CodeSignatureModel.md) | | | -|**dotnet** | **Boolean** | | | -|**debugStripped** | **Boolean** | | | -|**importHash** | **String** | | | -|**exportHash** | **String** | | | -|**richHeaderHash** | **String** | | | -|**sections** | [**SectionModel**](SectionModel.md) | | | -|**imports** | [**ImportModel**](ImportModel.md) | | | -|**exports** | [**ExportModel**](ExportModel.md) | | | -|**iconData** | [**IconModel**](IconModel.md) | | | - - - diff --git a/docs/PaginationModel.md b/docs/PaginationModel.md deleted file mode 100644 index 61e6f13..0000000 --- a/docs/PaginationModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# PaginationModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**pageSize** | **Integer** | | | -|**pageNumber** | **Integer** | | | -|**hasNextPage** | **Boolean** | | | - - - diff --git a/docs/Params.md b/docs/Params.md deleted file mode 100644 index 8a64d20..0000000 --- a/docs/Params.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# Params - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**debugHash** | **String** | The debug hash, if one was supplied | | -|**binarySize** | **Integer** | The size of the binary data | | -|**architecture** | **String** | The architecture of the binary data | | -|**binaryType** | **String** | The type of binary data | | -|**binaryFormat** | **String** | The format of the binary data | | -|**binaryDynamic** | **Boolean** | Whether the binary data is dynamic | | -|**modelName** | **String** | The name of the model | | - - - diff --git a/docs/Platform.md b/docs/Platform.md deleted file mode 100644 index 39e0e24..0000000 --- a/docs/Platform.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# Platform - -## Enum - - -* `LINUX` (value: `"linux"`) - -* `WINDOWS` (value: `"windows"`) - -* `ANDROID` (value: `"android"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/PutAnalysisStringsRequest.md b/docs/PutAnalysisStringsRequest.md deleted file mode 100644 index b9f2669..0000000 --- a/docs/PutAnalysisStringsRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# PutAnalysisStringsRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**strings** | [**List<AnalysisStringInput>**](AnalysisStringInput.md) | The strings to add to the analysis | | - - - diff --git a/docs/QueuedWorkflowTaskResponse.md b/docs/QueuedWorkflowTaskResponse.md deleted file mode 100644 index e371e56..0000000 --- a/docs/QueuedWorkflowTaskResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# QueuedWorkflowTaskResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**taskId** | **String** | | | - - - diff --git a/docs/ReAnalysisForm.md b/docs/ReAnalysisForm.md deleted file mode 100644 index 894a06a..0000000 --- a/docs/ReAnalysisForm.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# ReAnalysisForm - -Form Model for receiving the analysis request - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tags** | **List<String>** | Tags associated with the analysis | [optional] | -|**commandLineArgs** | **String** | Command line arguments for dynamic execution | [optional] | -|**priority** | **Integer** | Priority of the analysis | [optional] | -|**essential** | **Boolean** | Only runs essential parts of the analysis, skips tags/sbom/cves etc. | [optional] | -|**modelName** | **String** | Model name allows reprocessing using a different model | [optional] | -|**noCache** | **Boolean** | When enabled, skips using cached data within the processing. | [optional] | - - - diff --git a/docs/Recent.md b/docs/Recent.md deleted file mode 100644 index c933202..0000000 --- a/docs/Recent.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# Recent - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**results** | [**List<AnalysisRecord>**](AnalysisRecord.md) | 2D List containing the results of the analysis | | - - - diff --git a/docs/RelativeBinaryResponse.md b/docs/RelativeBinaryResponse.md deleted file mode 100644 index 7c9fd53..0000000 --- a/docs/RelativeBinaryResponse.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# RelativeBinaryResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaryId** | **Integer** | ID of the relative binary | | -|**analysisId** | **Integer** | ID of the active analysis for this binary | [optional] | -|**name** | **String** | Name of the relative binary | | -|**sha256** | **String** | SHA256 hash of the relative binary | | - - - diff --git a/docs/ReportAnalysisResponse.md b/docs/ReportAnalysisResponse.md deleted file mode 100644 index 258f343..0000000 --- a/docs/ReportAnalysisResponse.md +++ /dev/null @@ -1,33 +0,0 @@ - - -# ReportAnalysisResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**summary** | **String** | A markdown summary of the report | | -|**softwareType** | [**SoftwareTypeEnum**](#SoftwareTypeEnum) | The type of software being analyzed | | -|**totalNumberOfFunctions** | **Integer** | The total number of functions identified in the binary | | -|**numberOfAnalysedFunctions** | **Integer** | The number of functions that were analyzed in the binary | | -|**attackFlowSummary** | **String** | A summary in markdown format of the attack flow | | -|**ioCs** | [**List<IOC>**](IOC.md) | A list of IOCs (Indicators of Compromise) found in the analysis | | -|**executableTechniques** | [**List<MITRETechnique>**](MITRETechnique.md) | A series of MITRE Techniques found | | -|**yaraRule** | **String** | The YARA rule generated for the binary | | - - - -## Enum: SoftwareTypeEnum - -| Name | Value | -|---- | -----| -| MALICIOUS | "Malicious" | -| BENIGN | "Benign" | -| POTENTIALLY_UNWANTED_APPLICATION_PUA_ | "Potentially Unwanted Application (PUA)" | -| LEGITIMATE | "Legitimate" | -| BACKDOORED_LEGITIMATE_SOFTWARE | "Backdoored Legitimate Software" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - diff --git a/docs/SBOM.md b/docs/SBOM.md deleted file mode 100644 index e3c41a4..0000000 --- a/docs/SBOM.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# SBOM - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**packages** | [**List<SBOMPackage>**](SBOMPackage.md) | The packages found | | -|**importedLibs** | **List<String>** | The import libraries found | | - - - diff --git a/docs/SBOMPackage.md b/docs/SBOMPackage.md deleted file mode 100644 index 304e783..0000000 --- a/docs/SBOMPackage.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# SBOMPackage - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The name of the package | | -|**version** | **String** | The version of the package | | - - - diff --git a/docs/SandboxOptions.md b/docs/SandboxOptions.md deleted file mode 100644 index 4fb46e7..0000000 --- a/docs/SandboxOptions.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# SandboxOptions - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**enabled** | **Boolean** | | [optional] | -|**commandLineArgs** | **String** | The command line parameters to pass to the dynamic execution sandbox. Requires `sandbox` to be True. | [optional] | -|**startMethod** | **SandboxStartMethod** | The method used by the sandbox to launch the sample. | [optional] | -|**timeout** | **SandboxTimeout** | Maximum execution time for the sandbox run, in seconds. Allowed values: 120 (2m), 180 (3m), 300 (5m), 600 (10m). | [optional] | -|**archiveSha256Hash** | **String** | Hash of the uploaded archive to run in the sandbox. Set this when submitting an archive. | [optional] | -|**archiveEntryPath** | **String** | Path of the file inside the archive to execute. | [optional] | -|**archivePassword** | **String** | Password required to extract the archive, if any. | [optional] | - - - diff --git a/docs/SandboxStartMethod.md b/docs/SandboxStartMethod.md deleted file mode 100644 index fa0b907..0000000 --- a/docs/SandboxStartMethod.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# SandboxStartMethod - -## Enum - - -* `STANDARD_USER_PROCESS` (value: `"standard_user_process"`) - -* `ADMINISTRATOR_PROCESS` (value: `"administrator_process"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/SandboxTimeout.md b/docs/SandboxTimeout.md deleted file mode 100644 index 106e21e..0000000 --- a/docs/SandboxTimeout.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# SandboxTimeout - -## Enum - - -* `NUMBER_120` (value: `120`) - -* `NUMBER_180` (value: `180`) - -* `NUMBER_300` (value: `300`) - -* `NUMBER_600` (value: `600`) - -* `NUMBER_unknown_default_open_api` (value: `11184809`) - - - diff --git a/docs/ScrapeThirdPartyConfig.md b/docs/ScrapeThirdPartyConfig.md deleted file mode 100644 index fbc96ce..0000000 --- a/docs/ScrapeThirdPartyConfig.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# ScrapeThirdPartyConfig - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**enabled** | **Boolean** | | [optional] | - - - diff --git a/docs/SearchApi.md b/docs/SearchApi.md deleted file mode 100644 index feaf96d..0000000 --- a/docs/SearchApi.md +++ /dev/null @@ -1,352 +0,0 @@ -# SearchApi - -All URIs are relative to *https://api.reveng.ai* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**searchBinaries**](SearchApi.md#searchBinaries) | **GET** /v2/search/binaries | Binaries search | -| [**searchCollections**](SearchApi.md#searchCollections) | **GET** /v2/search/collections | Collections search | -| [**searchFunctions**](SearchApi.md#searchFunctions) | **GET** /v2/search/functions | Functions search | -| [**searchTags**](SearchApi.md#searchTags) | **GET** /v2/search/tags | Tags search | - - - -# **searchBinaries** -> BaseResponseBinarySearchResponse searchBinaries(page, pageSize, partialName, partialSha256, tags, modelName, userFilesOnly, excludeBinaryId, userIds) - -Binaries search - -Searches for a specific binary - -### 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.SearchApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - SearchApi apiInstance = new SearchApi(defaultClient); - Integer page = 1; // Integer | The page number to retrieve. - Integer pageSize = 10; // Integer | Number of items per page. - String partialName = "partialName_example"; // String | The partial or full name of the binary being searched - String partialSha256 = "partialSha256_example"; // String | The partial or full sha256 of the binary being searched - List tags = Arrays.asList(); // List | The tags to be searched for - String modelName = "modelName_example"; // String | The name of the model used to analyze the binary the function belongs to - Boolean userFilesOnly = false; // Boolean | Whether to only search user's uploaded files - Integer excludeBinaryId = 56; // Integer | A binary ID to exclude from the results - List userIds = Arrays.asList(); // List | Restrict the search to binaries owned by these user IDs - try { - BaseResponseBinarySearchResponse result = apiInstance.searchBinaries(page, pageSize, partialName, partialSha256, tags, modelName, userFilesOnly, excludeBinaryId, userIds); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SearchApi#searchBinaries"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **page** | **Integer**| The page number to retrieve. | [optional] [default to 1] | -| **pageSize** | **Integer**| Number of items per page. | [optional] [default to 10] | -| **partialName** | **String**| The partial or full name of the binary being searched | [optional] | -| **partialSha256** | **String**| The partial or full sha256 of the binary being searched | [optional] | -| **tags** | [**List<String>**](String.md)| The tags to be searched for | [optional] | -| **modelName** | **String**| The name of the model used to analyze the binary the function belongs to | [optional] | -| **userFilesOnly** | **Boolean**| Whether to only search user's uploaded files | [optional] [default to false] | -| **excludeBinaryId** | **Integer**| A binary ID to exclude from the results | [optional] | -| **userIds** | [**List<Integer>**](Integer.md)| Restrict the search to binaries owned by these user IDs | [optional] | - -### Return type - -[**BaseResponseBinarySearchResponse**](BaseResponseBinarySearchResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | You must provide at least one of the filters; partial_name, partial_sha256, tags or model_name to search | - | - - -# **searchCollections** -> BaseResponseCollectionSearchResponse searchCollections(page, pageSize, partialCollectionName, partialBinaryName, partialBinarySha256, tags, filters, orderBy, orderByDirection, userIds) - -Collections search - -Searches for a specific collection - -### 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.SearchApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - SearchApi apiInstance = new SearchApi(defaultClient); - Integer page = 1; // Integer | The page number to retrieve. - Integer pageSize = 10; // Integer | Number of items per page. - String partialCollectionName = "partialCollectionName_example"; // String | The partial or full name of the collection being searched - String partialBinaryName = "partialBinaryName_example"; // String | The partial or full name of the binary belonging to the collection - String partialBinarySha256 = "partialBinarySha256_example"; // String | The partial or full sha256 of the binary belonging to the collection - List tags = Arrays.asList(); // List | The tags to be searched for - List filters = Arrays.asList(); // List | The filters to be used for the search - AppApiRestV2CollectionsEnumsOrderBy orderBy = AppApiRestV2CollectionsEnumsOrderBy.fromValue("created"); // AppApiRestV2CollectionsEnumsOrderBy | The field to sort the order by in the results - Order orderByDirection = Order.fromValue("ASC"); // Order | The order direction in which to return results - List userIds = Arrays.asList(); // List | Restrict the search to collections owned by these user IDs - try { - BaseResponseCollectionSearchResponse result = apiInstance.searchCollections(page, pageSize, partialCollectionName, partialBinaryName, partialBinarySha256, tags, filters, orderBy, orderByDirection, userIds); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SearchApi#searchCollections"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **page** | **Integer**| The page number to retrieve. | [optional] [default to 1] | -| **pageSize** | **Integer**| Number of items per page. | [optional] [default to 10] | -| **partialCollectionName** | **String**| The partial or full name of the collection being searched | [optional] | -| **partialBinaryName** | **String**| The partial or full name of the binary belonging to the collection | [optional] | -| **partialBinarySha256** | **String**| The partial or full sha256 of the binary belonging to the collection | [optional] | -| **tags** | [**List<String>**](String.md)| The tags to be searched for | [optional] | -| **filters** | [**List<Filters>**](Filters.md)| The filters to be used for the search | [optional] | -| **orderBy** | [**AppApiRestV2CollectionsEnumsOrderBy**](.md)| The field to sort the order by in the results | [optional] [default to created] [enum: created, collection, owner, collection_size, updated] | -| **orderByDirection** | [**Order**](.md)| The order direction in which to return results | [optional] [default to DESC] [enum: ASC, DESC] | -| **userIds** | [**List<Integer>**](Integer.md)| Restrict the search to collections owned by these user IDs | [optional] | - -### Return type - -[**BaseResponseCollectionSearchResponse**](BaseResponseCollectionSearchResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | You must provide at least one of the filters; partial_collection_name, partial_binary_name, partial_binary_sha256 or tags to search | - | - - -# **searchFunctions** -> BaseResponseFunctionSearchResponse searchFunctions(page, pageSize, partialName, modelName) - -Functions search - -Searches for a specific function - -### 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.SearchApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - SearchApi apiInstance = new SearchApi(defaultClient); - Integer page = 1; // Integer | The page number to retrieve. - Integer pageSize = 10; // Integer | Number of items per page. - String partialName = "partialName_example"; // String | The partial or full name of the function being searched - String modelName = "modelName_example"; // String | The name of the model used to analyze the binary the function belongs to - try { - BaseResponseFunctionSearchResponse result = apiInstance.searchFunctions(page, pageSize, partialName, modelName); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SearchApi#searchFunctions"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **page** | **Integer**| The page number to retrieve. | [optional] [default to 1] | -| **pageSize** | **Integer**| Number of items per page. | [optional] [default to 10] | -| **partialName** | **String**| The partial or full name of the function being searched | [optional] | -| **modelName** | **String**| The name of the model used to analyze the binary the function belongs to | [optional] | - -### Return type - -[**BaseResponseFunctionSearchResponse**](BaseResponseFunctionSearchResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | You must provide at least one of the filters; partial_name, or model_name to search | - | - - -# **searchTags** -> BaseResponseTagSearchResponse searchTags(partialName, page, pageSize) - -Tags search - -Searches for tags by there name - -### 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.SearchApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - SearchApi apiInstance = new SearchApi(defaultClient); - String partialName = "partialName_example"; // String | The partial or full name of the tag to search for - Integer page = 1; // Integer | The page number to retrieve. - Integer pageSize = 10; // Integer | Number of items per page. - try { - BaseResponseTagSearchResponse result = apiInstance.searchTags(partialName, page, pageSize); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SearchApi#searchTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **partialName** | **String**| The partial or full name of the tag to search for | | -| **page** | **Integer**| The page number to retrieve. | [optional] [default to 1] | -| **pageSize** | **Integer**| Number of items per page. | [optional] [default to 10] | - -### Return type - -[**BaseResponseTagSearchResponse**](BaseResponseTagSearchResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | You must provide a partial_name to search and it must be greater than 3 characters | - | - diff --git a/docs/SectionModel.md b/docs/SectionModel.md deleted file mode 100644 index 8209956..0000000 --- a/docs/SectionModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# SectionModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**numberOfSections** | **Integer** | | | -|**sections** | [**List<SingleSectionModel>**](SingleSectionModel.md) | | | - - - diff --git a/docs/SecurityModel.md b/docs/SecurityModel.md deleted file mode 100644 index 331d4c0..0000000 --- a/docs/SecurityModel.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# SecurityModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**aslr** | **Boolean** | | | -|**dep** | **Boolean** | | | -|**cfg** | **Boolean** | | | -|**driverModel** | **Boolean** | | | -|**appContainer** | **Boolean** | | | -|**terminalServerAware** | **Boolean** | | | -|**imageIsolation** | **Boolean** | | | -|**codeIntegrity** | **Boolean** | | | -|**highEntropy** | **Boolean** | | | -|**seh** | **Boolean** | | | -|**boundImage** | **Boolean** | | | - - - diff --git a/docs/SegmentInfo.md b/docs/SegmentInfo.md deleted file mode 100644 index 21a968b..0000000 --- a/docs/SegmentInfo.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# SegmentInfo - -Represents the information about a segment. Attributes: name: The name of the segment. r: Determines if the segment has read permission. w: Determines if the segment has write permission. x: Determines if the segment has execute permission. start: The start address of the segment. end: The end address of the segment. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | | [optional] | -|**r** | **Boolean** | | [optional] | -|**w** | **Boolean** | | [optional] | -|**x** | **Boolean** | | [optional] | -|**start** | **Integer** | | [optional] | -|**end** | **Integer** | | [optional] | - - - diff --git a/docs/SingleCodeCertificateModel.md b/docs/SingleCodeCertificateModel.md deleted file mode 100644 index 9affba5..0000000 --- a/docs/SingleCodeCertificateModel.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# SingleCodeCertificateModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**version** | **Integer** | | | -|**issuedOn** | **String** | | | -|**expiresOn** | **String** | | | -|**issuerName** | **String** | | | -|**serialNumber** | **String** | | | -|**subjectName** | **String** | | | - - - diff --git a/docs/SingleCodeSignatureModel.md b/docs/SingleCodeSignatureModel.md deleted file mode 100644 index 87fc573..0000000 --- a/docs/SingleCodeSignatureModel.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# SingleCodeSignatureModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**certificates** | [**List<SingleCodeCertificateModel>**](SingleCodeCertificateModel.md) | | | -|**authenticodeDigest** | **String** | | | - - - diff --git a/docs/SinglePDBEntryModel.md b/docs/SinglePDBEntryModel.md deleted file mode 100644 index 79d4ef8..0000000 --- a/docs/SinglePDBEntryModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# SinglePDBEntryModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**guid** | **String** | | | -|**age** | **Integer** | | | -|**path** | **String** | | | - - - diff --git a/docs/SingleSectionModel.md b/docs/SingleSectionModel.md deleted file mode 100644 index 729afef..0000000 --- a/docs/SingleSectionModel.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# SingleSectionModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | | | -|**virtualAddress** | **Integer** | | | -|**virtualSize** | **Integer** | | | -|**characteristics** | **String** | | | -|**rawSize** | **Integer** | | | -|**entropy** | **BigDecimal** | | | -|**sha3256** | **String** | | | - - - diff --git a/docs/StackVariable.md b/docs/StackVariable.md deleted file mode 100644 index 2e7c9b8..0000000 --- a/docs/StackVariable.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# StackVariable - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this stack variable | [optional] | -|**offset** | **Integer** | Offset of the stack variable | | -|**name** | **String** | Name of the stack variable | | -|**type** | **String** | Data type of the stack variable | | -|**size** | **Integer** | Size of the stack variable in bytes | | -|**addr** | **Integer** | Memory address of the stack variable | | - - - diff --git a/docs/StatusInput.md b/docs/StatusInput.md deleted file mode 100644 index d458081..0000000 --- a/docs/StatusInput.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# StatusInput - -## Enum - - -* `UPLOADED` (value: `"Uploaded"`) - -* `QUEUED` (value: `"Queued"`) - -* `COMPLETE` (value: `"Complete"`) - -* `ERROR` (value: `"Error"`) - -* `PROCESSING` (value: `"Processing"`) - -* `ALL` (value: `"All"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/StatusOutput.md b/docs/StatusOutput.md deleted file mode 100644 index 840c74c..0000000 --- a/docs/StatusOutput.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# StatusOutput - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**analysisId** | **Integer** | The ID corresponding to the checked status | | -|**analysisStatus** | **String** | The status of the checked analysis | | - - - diff --git a/docs/StringFunctions.md b/docs/StringFunctions.md deleted file mode 100644 index dff7184..0000000 --- a/docs/StringFunctions.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# StringFunctions - -This is a string with the functions where the string is used. A function string is a string literal referenced within a function. When analyzing stripped or obfuscated binaries, function strings can help identify the function’s purpose. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**value** | **String** | The value of the string literal | | -|**functions** | [**List<AppApiRestV2FunctionsResponsesFunction>**](AppApiRestV2FunctionsResponsesFunction.md) | The function ids the string literal was found within | | -|**source** | **StringSource** | The source of the string | [optional] | - - - diff --git a/docs/StringSource.md b/docs/StringSource.md deleted file mode 100644 index 196b58d..0000000 --- a/docs/StringSource.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# StringSource - -## Enum - - -* `SYSTEM` (value: `"SYSTEM"`) - -* `USER` (value: `"USER"`) - -* `AI_AGENT` (value: `"AI_AGENT"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/Structure.md b/docs/Structure.md deleted file mode 100644 index fee259b..0000000 --- a/docs/Structure.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# Structure - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this structure | [optional] | -|**name** | **String** | Name of the structure | | -|**size** | **Integer** | Total size of the structure in bytes | [optional] | -|**members** | [**Map<String, StructureMember>**](StructureMember.md) | Dictionary of structure members | | -|**artifactType** | **String** | Type of artifact that the structure is associated with | [optional] | - - - diff --git a/docs/StructureMember.md b/docs/StructureMember.md deleted file mode 100644 index 43ec1c2..0000000 --- a/docs/StructureMember.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# StructureMember - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this structure member | [optional] | -|**name** | **String** | Name of the structure member | | -|**offset** | **Integer** | Offset of the member within the structure | | -|**type** | **String** | Data type of the structure member | | -|**size** | **Integer** | Size of the structure member in bytes | | - - - diff --git a/docs/SubmitUserFeedbackRequest.md b/docs/SubmitUserFeedbackRequest.md deleted file mode 100644 index 6d7f6e9..0000000 --- a/docs/SubmitUserFeedbackRequest.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# SubmitUserFeedbackRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**currentRoute** | **String** | The route from where the feedback was submitted | | -|**feedback** | **String** | The user's feedback | | -|**screenCaptureUrl** | **String** | An optional URL to a screen capture related to the feedback | [optional] | - - - diff --git a/docs/Symbols.md b/docs/Symbols.md deleted file mode 100644 index aa0f0dc..0000000 --- a/docs/Symbols.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# Symbols - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**baseAddress** | **BigInteger** | The starting address of the execution | | -|**functionBoundaries** | [**List<FunctionBoundary>**](FunctionBoundary.md) | List of user defined function boundaries | [optional] | - - - diff --git a/docs/Tag.md b/docs/Tag.md deleted file mode 100644 index 80e7495..0000000 --- a/docs/Tag.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# Tag - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | | | - - - diff --git a/docs/TagItem.md b/docs/TagItem.md deleted file mode 100644 index 84a374d..0000000 --- a/docs/TagItem.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# TagItem - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | | | -|**origin** | **String** | | | -|**collectionId** | **Integer** | The ID of the analysis owner's associated collection | [optional] | - - - diff --git a/docs/TagResponse.md b/docs/TagResponse.md deleted file mode 100644 index d5fc6c2..0000000 --- a/docs/TagResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TagResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | Name of the tag | | -|**origin** | **String** | Origin of tag | | - - - diff --git a/docs/TagSearchResponse.md b/docs/TagSearchResponse.md deleted file mode 100644 index a72fa2c..0000000 --- a/docs/TagSearchResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# TagSearchResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**results** | [**List<TagSearchResult>**](TagSearchResult.md) | The results of the search | | - - - diff --git a/docs/TagSearchResult.md b/docs/TagSearchResult.md deleted file mode 100644 index 18392e7..0000000 --- a/docs/TagSearchResult.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TagSearchResult - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tagId** | **Integer** | The ID of the tag | | -|**tag** | **String** | The name of the tag | | - - - diff --git a/docs/TaskResponse.md b/docs/TaskResponse.md deleted file mode 100644 index 7fb87e2..0000000 --- a/docs/TaskResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TaskResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **TaskStatus** | | [optional] | -|**errorMessage** | **String** | | [optional] | - - - diff --git a/docs/TaskStatus.md b/docs/TaskStatus.md deleted file mode 100644 index d9ca551..0000000 --- a/docs/TaskStatus.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# TaskStatus - -## Enum - - -* `UNINITIALISED` (value: `"UNINITIALISED"`) - -* `PENDING` (value: `"PENDING"`) - -* `RUNNING` (value: `"RUNNING"`) - -* `COMPLETED` (value: `"COMPLETED"`) - -* `FAILED` (value: `"FAILED"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/TaskStatusResponse.md b/docs/TaskStatusResponse.md deleted file mode 100644 index c73e462..0000000 --- a/docs/TaskStatusResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TaskStatusResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**status** | **BinaryTaskStatus** | | | -|**logHistory** | **List<List<Object>>** | | [optional] | - - - diff --git a/docs/TeamMember.md b/docs/TeamMember.md index a9ee3a3..fa7be54 100644 --- a/docs/TeamMember.md +++ b/docs/TeamMember.md @@ -7,11 +7,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**email** | **String** | Search is applied to string value | | +|**email** | **String** | | | |**isAdmin** | **Boolean** | | | |**role** | [**RoleEnum**](#RoleEnum) | | | |**userId** | **Long** | | | -|**username** | **String** | Search is applied to string value | | +|**username** | **String** | | | diff --git a/docs/TimestampModel.md b/docs/TimestampModel.md deleted file mode 100644 index fb6cdfe..0000000 --- a/docs/TimestampModel.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# TimestampModel - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**peTimestamp** | **Integer** | | | -|**exportTimestamp** | **Integer** | | | -|**debugTimestamp** | **Integer** | | | - - - diff --git a/docs/TriageFunctionResponse.md b/docs/TriageFunctionResponse.md deleted file mode 100644 index e950b36..0000000 --- a/docs/TriageFunctionResponse.md +++ /dev/null @@ -1,36 +0,0 @@ - - -# TriageFunctionResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **Integer** | Unique identifier of the function | | -|**address** | **Integer** | Address of the function in the binary | | -|**summary** | **String** | Summary of the function's behaviour | | -|**score** | **BigDecimal** | Score indicating the function's relevance | | -|**capabilities** | [**List<CapabilitiesEnum>**](#List<CapabilitiesEnum>) | List of capabilities exhibited by the function | | - - - -## Enum: List<CapabilitiesEnum> - -| Name | Value | -|---- | -----| -| PACKING_AND_OBFUSCATION | "packing_and_obfuscation" | -| DEFENSE_EVASION | "defense_evasion" | -| PRIVILEGE_ESCALATION | "privilege_escalation" | -| PERSISTENCE_MECHANISMS | "persistence_mechanisms" | -| DISCOVERY_AND_RECONNAISSANCE | "discovery_and_reconnaissance" | -| CREDENTIAL_AND_DATA_COLLECTION | "credential_and_data_collection" | -| COMMUNICATION_AND_C2 | "communication_and_c2" | -| CRYPTOGRAPHIC_OPERATIONS | "cryptographic_operations" | -| PROCESS_AND_MEMORY_MANIPULATION | "process_and_memory_manipulation" | -| PROCESS_AND_COMMAND_EXECUTION | "process_and_command_execution" | -| FILE_ACTIVITY | "file_activity" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - diff --git a/docs/TriageReportResponse.md b/docs/TriageReportResponse.md deleted file mode 100644 index bb2f34f..0000000 --- a/docs/TriageReportResponse.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# TriageReportResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**softwareScore** | **BigDecimal** | Overall triage score for the software | | -|**summary** | **String** | Summary of the triage analysis | | -|**functions** | [**List<TriageFunctionResponse>**](TriageFunctionResponse.md) | List of triaged functions | | - - - diff --git a/docs/TypeDefinition.md b/docs/TypeDefinition.md deleted file mode 100644 index 3aa1e79..0000000 --- a/docs/TypeDefinition.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# TypeDefinition - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this type definition | [optional] | -|**name** | **String** | Name of the type definition | | -|**type** | **String** | Underlying type of the type definition | | -|**artifactType** | **String** | Type of artifact the type definition is associated with | [optional] | - - - diff --git a/docs/UploadFileType.md b/docs/UploadFileType.md deleted file mode 100644 index 4f293b3..0000000 --- a/docs/UploadFileType.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# UploadFileType - -## Enum - - -* `BINARY` (value: `"BINARY"`) - -* `DEBUG` (value: `"DEBUG"`) - -* `PACKED` (value: `"PACKED"`) - -* `FIRMWARE` (value: `"FIRMWARE"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/UploadResponse.md b/docs/UploadResponse.md deleted file mode 100644 index 9acab80..0000000 --- a/docs/UploadResponse.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# UploadResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**sha256Hash** | **String** | | | -|**fileType** | **UploadFileType** | | | -|**filename** | **String** | | | -|**mime** | **String** | | | -|**isArchive** | **Boolean** | | | -|**canSandbox** | **Boolean** | | | -|**canExtract** | **Boolean** | | | - - - diff --git a/docs/UpsertAiDecomplationRatingRequest.md b/docs/UpsertAiDecomplationRatingRequest.md deleted file mode 100644 index f01df24..0000000 --- a/docs/UpsertAiDecomplationRatingRequest.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# UpsertAiDecomplationRatingRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rating** | **AiDecompilationRating** | The rating for the AI decompilation response | | -|**reason** | **String** | An optional reason for the rating | | - - - diff --git a/docs/UserActivityResponse.md b/docs/UserActivityResponse.md deleted file mode 100644 index 6520d5d..0000000 --- a/docs/UserActivityResponse.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# UserActivityResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**actions** | **String** | | | -|**activityScope** | **String** | | | -|**creation** | **OffsetDateTime** | | | -|**message** | **String** | | | -|**sources** | **String** | | | -|**username** | **String** | | | - - - diff --git a/docs/UserIdentity.md b/docs/UserIdentity.md index f5db973..035ab48 100644 --- a/docs/UserIdentity.md +++ b/docs/UserIdentity.md @@ -8,8 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**createdAt** | **OffsetDateTime** | | | -|**issuerUrl** | **String** | Search is applied to string value | | -|**subject** | **String** | Search is applied to string value | | +|**issuerUrl** | **String** | | | +|**subject** | **String** | | | |**updatedAt** | **OffsetDateTime** | | | |**userId** | **Long** | | | |**userIdentityId** | **Long** | | | diff --git a/docs/V2FunctionHeader.md b/docs/V2FunctionHeader.md deleted file mode 100644 index 99d8b8e..0000000 --- a/docs/V2FunctionHeader.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# V2FunctionHeader - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this function header | [optional] | -|**name** | **String** | Name of the function | | -|**addr** | **Integer** | Memory address of the function | | -|**type** | **String** | Return type of the function | | -|**args** | [**Map<String, Argument>**](Argument.md) | Dictionary of function arguments | | - - - diff --git a/docs/V2FunctionInfo.md b/docs/V2FunctionInfo.md deleted file mode 100644 index ff8ab54..0000000 --- a/docs/V2FunctionInfo.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# V2FunctionInfo - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**funcTypes** | [**V2FunctionType**](V2FunctionType.md) | Function type information | [optional] | -|**funcDeps** | [**List<FuncDepsInner>**](FuncDepsInner.md) | List of function dependencies | | - - - diff --git a/docs/V2FunctionType.md b/docs/V2FunctionType.md deleted file mode 100644 index 6f6c086..0000000 --- a/docs/V2FunctionType.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# V2FunctionType - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**lastChange** | **String** | Timestamp of the last change to this function type | [optional] | -|**addr** | **Integer** | Memory address of the function | | -|**size** | **Integer** | Size of the function in bytes | | -|**header** | [**V2FunctionHeader**](V2FunctionHeader.md) | Function header information | | -|**stackVars** | [**Map<String, StackVariable>**](StackVariable.md) | Dictionary of stack variables | [optional] | -|**name** | **String** | Name of the function | | -|**type** | **String** | Return type of the function | | -|**artifactType** | **String** | Type of artifact that the structure is associated with | [optional] | - - - diff --git a/docs/Vulnerabilities.md b/docs/Vulnerabilities.md deleted file mode 100644 index 5ae407b..0000000 --- a/docs/Vulnerabilities.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# Vulnerabilities - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**vulnerabilities** | [**List<Vulnerability>**](Vulnerability.md) | | | - - - diff --git a/docs/Vulnerability.md b/docs/Vulnerability.md deleted file mode 100644 index 99be091..0000000 --- a/docs/Vulnerability.md +++ /dev/null @@ -1,36 +0,0 @@ - - -# Vulnerability - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**vendor** | **String** | | | -|**product** | **String** | | | -|**version** | **String** | | | -|**cveNumber** | **String** | | | -|**severity** | [**SeverityEnum**](#SeverityEnum) | | | -|**source** | **String** | | | -|**cvssVersion** | **String** | | | -|**cvssVector** | **String** | | | -|**remarks** | **String** | | | -|**score** | **BigDecimal** | | | -|**isUnknown** | **Boolean** | | [optional] | - - - -## Enum: SeverityEnum - -| Name | Value | -|---- | -----| -| CRITICAL | "CRITICAL" | -| HIGH | "HIGH" | -| MEDIUM | "MEDIUM" | -| LOW | "LOW" | -| UNKNOWN | "UNKNOWN" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - diff --git a/docs/Workspace.md b/docs/Workspace.md deleted file mode 100644 index 899f071..0000000 --- a/docs/Workspace.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# Workspace - -## Enum - - -* `PERSONAL` (value: `"personal"`) - -* `TEAM` (value: `"team"`) - -* `PUBLIC` (value: `"public"`) - -* `UNKNOWN_DEFAULT_OPEN_API` (value: `"unknown_default_open_api"`) - - - diff --git a/docs/XrefFromResponse.md b/docs/XrefFromResponse.md deleted file mode 100644 index 5bfab71..0000000 --- a/docs/XrefFromResponse.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# XrefFromResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**value** | **String** | | | -|**isScalar** | **Boolean** | | [optional] | -|**isCall** | **Boolean** | | [optional] | -|**isData** | **Boolean** | | [optional] | -|**isString** | **Boolean** | | [optional] | -|**rawData** | **File** | | [optional] | -|**segment** | [**SegmentInfo**](SegmentInfo.md) | | [optional] | -|**origStrEncoding** | **String** | | [optional] | -|**xrefTo** | **String** | | | - - - diff --git a/docs/XrefResponse.md b/docs/XrefResponse.md deleted file mode 100644 index 905083f..0000000 --- a/docs/XrefResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# XrefResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**xrefToList** | [**List<XrefToResponse>**](XrefToResponse.md) | | | -|**xrefFromList** | [**List<XrefFromResponse>**](XrefFromResponse.md) | | | - - - diff --git a/docs/XrefToResponse.md b/docs/XrefToResponse.md deleted file mode 100644 index 040234b..0000000 --- a/docs/XrefToResponse.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# XrefToResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**value** | **String** | | | -|**isScalar** | **Boolean** | | [optional] | -|**isCall** | **Boolean** | | [optional] | -|**isData** | **Boolean** | | [optional] | -|**isString** | **Boolean** | | [optional] | -|**rawData** | **File** | | [optional] | -|**segment** | [**SegmentInfo**](SegmentInfo.md) | | [optional] | -|**origStrEncoding** | **String** | | [optional] | -|**xrefFrom** | **String** | | | - - - diff --git a/src/main/java/ai/reveng/api/AgentApi.java b/src/main/java/ai/reveng/api/AgentApi.java deleted file mode 100644 index 028f792..0000000 --- a/src/main/java/ai/reveng/api/AgentApi.java +++ /dev/null @@ -1,1264 +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.BaseResponseCapabilitiesAgentResponse; -import ai.reveng.model.BaseResponseQueuedWorkflowTaskResponse; -import ai.reveng.model.BaseResponseReportAnalysisResponse; -import ai.reveng.model.BaseResponseTriageReportResponse; -import ai.reveng.model.ErrorModel; -import ai.reveng.model.QueuedWorkflowTaskResponse; -import ai.reveng.model.TaskStatusResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AgentApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AgentApi() { - this(Configuration.getDefaultApiClient()); - } - - public AgentApi(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 checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet - * @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 checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGetCall(@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}/agent/capabilities/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGetValidateBeforeCall(@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 checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet(Async)"); - } - - return checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGetCall(analysisId, _callback); - - } - - /** - * Check the status of a capabilities analysis workflow - * - * @param analysisId (required) - * @return TaskStatusResponse - * @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 TaskStatusResponse checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGet(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGetWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Check the status of a capabilities analysis workflow - * - * @param analysisId (required) - * @return ApiResponse<TaskStatusResponse> - * @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 checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGetWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGetValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Check the status of a capabilities analysis workflow (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 checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGetAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = checkCapabilitiesTaskStatusV2AnalysesAnalysisIdAgentCapabilitiesStatusGetValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet - * @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 checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGetCall(@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}/agent/report-analysis/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGetValidateBeforeCall(@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 checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet(Async)"); - } - - return checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGetCall(analysisId, _callback); - - } - - /** - * Check the status of a report analysis workflow - * - * @param analysisId (required) - * @return TaskStatusResponse - * @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 TaskStatusResponse checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGet(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGetWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Check the status of a report analysis workflow - * - * @param analysisId (required) - * @return ApiResponse<TaskStatusResponse> - * @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 checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGetWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGetValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Check the status of a report analysis workflow (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 checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGetAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = checkReportAnalysisTaskStatusV2AnalysesAnalysisIdAgentReportAnalysisStatusGetValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet - * @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 checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGetCall(@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}/agent/triage/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGetValidateBeforeCall(@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 checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet(Async)"); - } - - return checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGetCall(analysisId, _callback); - - } - - /** - * Check the status of a triage analysis workflow - * - * @param analysisId (required) - * @return TaskStatusResponse - * @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 TaskStatusResponse checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGet(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGetWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Check the status of a triage analysis workflow - * - * @param analysisId (required) - * @return ApiResponse<TaskStatusResponse> - * @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 checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGetWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGetValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Check the status of a triage analysis workflow (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 checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGetAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = checkTriageTaskStatusV2AnalysesAnalysisIdAgentTriageStatusGetValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPostCall(@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}/agent/capabilities" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPostValidateBeforeCall(@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 createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost(Async)"); - } - - return createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPostCall(analysisId, _callback); - - } - - /** - * Queues a capabilities analysis workflow process - * - * @param analysisId (required) - * @return BaseResponseQueuedWorkflowTaskResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponseQueuedWorkflowTaskResponse createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPost(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPostWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Queues a capabilities analysis workflow process - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseQueuedWorkflowTaskResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPostWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPostValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Queues a capabilities analysis workflow process (asynchronously) - * - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPostAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createCapabilitiesTaskV2AnalysesAnalysisIdAgentCapabilitiesPostValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
409 Task already completed or queued -
- */ - public okhttp3.Call createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPostCall(@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}/agent/report-analysis" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPostValidateBeforeCall(@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 createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost(Async)"); - } - - return createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPostCall(analysisId, _callback); - - } - - /** - * Queues a combined report analysis workflow process - * - * @param analysisId (required) - * @return QueuedWorkflowTaskResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
409 Task already completed or queued -
- */ - public QueuedWorkflowTaskResponse createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPost(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPostWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Queues a combined report analysis workflow process - * - * @param analysisId (required) - * @return ApiResponse<QueuedWorkflowTaskResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
409 Task already completed or queued -
- */ - public ApiResponse createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPostWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPostValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Queues a combined report analysis workflow process (asynchronously) - * - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
409 Task already completed or queued -
- */ - public okhttp3.Call createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPostAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createReportAnalysisTaskV2AnalysesAnalysisIdAgentReportAnalysisPostValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for createTriageTaskV2AnalysesAnalysisIdAgentTriagePost - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call createTriageTaskV2AnalysesAnalysisIdAgentTriagePostCall(@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}/agent/triage" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createTriageTaskV2AnalysesAnalysisIdAgentTriagePostValidateBeforeCall(@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 createTriageTaskV2AnalysesAnalysisIdAgentTriagePost(Async)"); - } - - return createTriageTaskV2AnalysesAnalysisIdAgentTriagePostCall(analysisId, _callback); - - } - - /** - * Queues a triage analysis workflow process - * - * @param analysisId (required) - * @return BaseResponseQueuedWorkflowTaskResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponseQueuedWorkflowTaskResponse createTriageTaskV2AnalysesAnalysisIdAgentTriagePost(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = createTriageTaskV2AnalysesAnalysisIdAgentTriagePostWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Queues a triage analysis workflow process - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseQueuedWorkflowTaskResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse createTriageTaskV2AnalysesAnalysisIdAgentTriagePostWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = createTriageTaskV2AnalysesAnalysisIdAgentTriagePostValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Queues a triage analysis workflow process (asynchronously) - * - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call createTriageTaskV2AnalysesAnalysisIdAgentTriagePostAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createTriageTaskV2AnalysesAnalysisIdAgentTriagePostValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet - * @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 getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGetCall(@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}/agent/capabilities" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGetValidateBeforeCall(@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 getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet(Async)"); - } - - return getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGetCall(analysisId, _callback); - - } - - /** - * Get Capabilities Result - * - * @param analysisId (required) - * @return BaseResponseCapabilitiesAgentResponse - * @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 BaseResponseCapabilitiesAgentResponse getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGet(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGetWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get Capabilities Result - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseCapabilitiesAgentResponse> - * @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 getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGetWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGetValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Capabilities Result (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 getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGetAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getCapabilitiesResultV2AnalysesAnalysisIdAgentCapabilitiesGetValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet - * @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 getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGetCall(@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}/agent/report-analysis" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGetValidateBeforeCall(@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 getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet(Async)"); - } - - return getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGetCall(analysisId, _callback); - - } - - /** - * Get Report Analysis Result - * Returns: - A summary of the analysis - The software type of the binary - An attack flow summary - List of IOCs - List of MITRE executable techniques - A YARA rule - * @param analysisId (required) - * @return BaseResponseReportAnalysisResponse - * @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 BaseResponseReportAnalysisResponse getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGet(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGetWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get Report Analysis Result - * Returns: - A summary of the analysis - The software type of the binary - An attack flow summary - List of IOCs - List of MITRE executable techniques - A YARA rule - * @param analysisId (required) - * @return ApiResponse<BaseResponseReportAnalysisResponse> - * @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 getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGetWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGetValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Report Analysis Result (asynchronously) - * Returns: - A summary of the analysis - The software type of the binary - An attack flow summary - List of IOCs - List of MITRE executable techniques - A YARA rule - * @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 getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGetAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getReportAnalysisResultV2AnalysesAnalysisIdAgentReportAnalysisGetValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getTriageResultV2AnalysesAnalysisIdAgentTriageGet - * @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 getTriageResultV2AnalysesAnalysisIdAgentTriageGetCall(@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}/agent/triage" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getTriageResultV2AnalysesAnalysisIdAgentTriageGetValidateBeforeCall(@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 getTriageResultV2AnalysesAnalysisIdAgentTriageGet(Async)"); - } - - return getTriageResultV2AnalysesAnalysisIdAgentTriageGetCall(analysisId, _callback); - - } - - /** - * Get Triage Result - * - * @param analysisId (required) - * @return BaseResponseTriageReportResponse - * @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 BaseResponseTriageReportResponse getTriageResultV2AnalysesAnalysisIdAgentTriageGet(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getTriageResultV2AnalysesAnalysisIdAgentTriageGetWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get Triage Result - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseTriageReportResponse> - * @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 getTriageResultV2AnalysesAnalysisIdAgentTriageGetWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getTriageResultV2AnalysesAnalysisIdAgentTriageGetValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Triage Result (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 getTriageResultV2AnalysesAnalysisIdAgentTriageGetAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getTriageResultV2AnalysesAnalysisIdAgentTriageGetValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/AnalysesBulkActionsApi.java b/src/main/java/ai/reveng/api/AnalysesBulkActionsApi.java deleted file mode 100644 index f853ef4..0000000 --- a/src/main/java/ai/reveng/api/AnalysesBulkActionsApi.java +++ /dev/null @@ -1,348 +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.AnalysisBulkAddTagsRequest; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseAnalysisBulkAddTagsResponse; -import ai.reveng.model.BaseResponseDict; -import ai.reveng.model.BulkDeleteAnalysesRequest; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AnalysesBulkActionsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AnalysesBulkActionsApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnalysesBulkActionsApi(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 bulkAddAnalysisTags - * @param analysisBulkAddTagsRequest (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 bulkAddAnalysisTagsCall(@javax.annotation.Nonnull AnalysisBulkAddTagsRequest analysisBulkAddTagsRequest, 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 = analysisBulkAddTagsRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/tags/add"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call bulkAddAnalysisTagsValidateBeforeCall(@javax.annotation.Nonnull AnalysisBulkAddTagsRequest analysisBulkAddTagsRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisBulkAddTagsRequest' is set - if (analysisBulkAddTagsRequest == null) { - throw new ApiException("Missing the required parameter 'analysisBulkAddTagsRequest' when calling bulkAddAnalysisTags(Async)"); - } - - return bulkAddAnalysisTagsCall(analysisBulkAddTagsRequest, _callback); - - } - - /** - * Bulk Add Analysis Tags - * Updates analysis tags for multiple analyses. User must be the owner. - * @param analysisBulkAddTagsRequest (required) - * @return BaseResponseAnalysisBulkAddTagsResponse - * @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 BaseResponseAnalysisBulkAddTagsResponse bulkAddAnalysisTags(@javax.annotation.Nonnull AnalysisBulkAddTagsRequest analysisBulkAddTagsRequest) throws ApiException { - ApiResponse localVarResp = bulkAddAnalysisTagsWithHttpInfo(analysisBulkAddTagsRequest); - return localVarResp.getData(); - } - - /** - * Bulk Add Analysis Tags - * Updates analysis tags for multiple analyses. User must be the owner. - * @param analysisBulkAddTagsRequest (required) - * @return ApiResponse<BaseResponseAnalysisBulkAddTagsResponse> - * @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 bulkAddAnalysisTagsWithHttpInfo(@javax.annotation.Nonnull AnalysisBulkAddTagsRequest analysisBulkAddTagsRequest) throws ApiException { - okhttp3.Call localVarCall = bulkAddAnalysisTagsValidateBeforeCall(analysisBulkAddTagsRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Bulk Add Analysis Tags (asynchronously) - * Updates analysis tags for multiple analyses. User must be the owner. - * @param analysisBulkAddTagsRequest (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 bulkAddAnalysisTagsAsync(@javax.annotation.Nonnull AnalysisBulkAddTagsRequest analysisBulkAddTagsRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = bulkAddAnalysisTagsValidateBeforeCall(analysisBulkAddTagsRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for bulkDeleteAnalyses - * @param bulkDeleteAnalysesRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
403 Forbidden -
- */ - public okhttp3.Call bulkDeleteAnalysesCall(@javax.annotation.Nonnull BulkDeleteAnalysesRequest bulkDeleteAnalysesRequest, 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 = bulkDeleteAnalysesRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/delete"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call bulkDeleteAnalysesValidateBeforeCall(@javax.annotation.Nonnull BulkDeleteAnalysesRequest bulkDeleteAnalysesRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'bulkDeleteAnalysesRequest' is set - if (bulkDeleteAnalysesRequest == null) { - throw new ApiException("Missing the required parameter 'bulkDeleteAnalysesRequest' when calling bulkDeleteAnalyses(Async)"); - } - - return bulkDeleteAnalysesCall(bulkDeleteAnalysesRequest, _callback); - - } - - /** - * Bulk Delete Analyses - * Deletes multiple analyses. User must be the owner of all analyses. - * @param bulkDeleteAnalysesRequest (required) - * @return BaseResponseDict - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
403 Forbidden -
- */ - public BaseResponseDict bulkDeleteAnalyses(@javax.annotation.Nonnull BulkDeleteAnalysesRequest bulkDeleteAnalysesRequest) throws ApiException { - ApiResponse localVarResp = bulkDeleteAnalysesWithHttpInfo(bulkDeleteAnalysesRequest); - return localVarResp.getData(); - } - - /** - * Bulk Delete Analyses - * Deletes multiple analyses. User must be the owner of all analyses. - * @param bulkDeleteAnalysesRequest (required) - * @return ApiResponse<BaseResponseDict> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
403 Forbidden -
- */ - public ApiResponse bulkDeleteAnalysesWithHttpInfo(@javax.annotation.Nonnull BulkDeleteAnalysesRequest bulkDeleteAnalysesRequest) throws ApiException { - okhttp3.Call localVarCall = bulkDeleteAnalysesValidateBeforeCall(bulkDeleteAnalysesRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Bulk Delete Analyses (asynchronously) - * Deletes multiple analyses. User must be the owner of all analyses. - * @param bulkDeleteAnalysesRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
403 Forbidden -
- */ - public okhttp3.Call bulkDeleteAnalysesAsync(@javax.annotation.Nonnull BulkDeleteAnalysesRequest bulkDeleteAnalysesRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = bulkDeleteAnalysesValidateBeforeCall(bulkDeleteAnalysesRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/AnalysesCommentsApi.java b/src/main/java/ai/reveng/api/AnalysesCommentsApi.java deleted file mode 100644 index 1cd6414..0000000 --- a/src/main/java/ai/reveng/api/AnalysesCommentsApi.java +++ /dev/null @@ -1,663 +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.BaseResponseBool; -import ai.reveng.model.BaseResponseCommentResponse; -import ai.reveng.model.BaseResponseListCommentResponse; -import ai.reveng.model.CommentBase; -import ai.reveng.model.CommentUpdateRequest; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AnalysesCommentsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AnalysesCommentsApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnalysesCommentsApi(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 createAnalysisComment - * @param analysisId (required) - * @param commentBase (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 Successful Response -
422 Invalid request parameters -
400 Bad Request -
- */ - public okhttp3.Call createAnalysisCommentCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentBase commentBase, 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 = commentBase; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/comments" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createAnalysisCommentValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentBase commentBase, 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 createAnalysisComment(Async)"); - } - - // verify the required parameter 'commentBase' is set - if (commentBase == null) { - throw new ApiException("Missing the required parameter 'commentBase' when calling createAnalysisComment(Async)"); - } - - return createAnalysisCommentCall(analysisId, commentBase, _callback); - - } - - /** - * Create a comment for this analysis - * Creates a comment associated with a specified analysis). - * @param analysisId (required) - * @param commentBase (required) - * @return BaseResponseCommentResponse - * @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 Successful Response -
422 Invalid request parameters -
400 Bad Request -
- */ - public BaseResponseCommentResponse createAnalysisComment(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentBase commentBase) throws ApiException { - ApiResponse localVarResp = createAnalysisCommentWithHttpInfo(analysisId, commentBase); - return localVarResp.getData(); - } - - /** - * Create a comment for this analysis - * Creates a comment associated with a specified analysis). - * @param analysisId (required) - * @param commentBase (required) - * @return ApiResponse<BaseResponseCommentResponse> - * @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 Successful Response -
422 Invalid request parameters -
400 Bad Request -
- */ - public ApiResponse createAnalysisCommentWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentBase commentBase) throws ApiException { - okhttp3.Call localVarCall = createAnalysisCommentValidateBeforeCall(analysisId, commentBase, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create a comment for this analysis (asynchronously) - * Creates a comment associated with a specified analysis). - * @param analysisId (required) - * @param commentBase (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 Successful Response -
422 Invalid request parameters -
400 Bad Request -
- */ - public okhttp3.Call createAnalysisCommentAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentBase commentBase, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createAnalysisCommentValidateBeforeCall(analysisId, commentBase, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteAnalysisComment - * @param commentId (required) - * @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 -
403 You can only delete your own comments -
400 Bad Request -
- */ - public okhttp3.Call deleteAnalysisCommentCall(@javax.annotation.Nonnull Integer commentId, @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}/comments/{comment_id}" - .replace("{" + "comment_id" + "}", localVarApiClient.escapeString(commentId.toString())) - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteAnalysisCommentValidateBeforeCall(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'commentId' is set - if (commentId == null) { - throw new ApiException("Missing the required parameter 'commentId' when calling deleteAnalysisComment(Async)"); - } - - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling deleteAnalysisComment(Async)"); - } - - return deleteAnalysisCommentCall(commentId, analysisId, _callback); - - } - - /** - * Delete a comment - * Deletes an existing comment. Users can only delete their own comments. - * @param commentId (required) - * @param analysisId (required) - * @return BaseResponseBool - * @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 -
403 You can only delete your own comments -
400 Bad Request -
- */ - public BaseResponseBool deleteAnalysisComment(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = deleteAnalysisCommentWithHttpInfo(commentId, analysisId); - return localVarResp.getData(); - } - - /** - * Delete a comment - * Deletes an existing comment. Users can only delete their own comments. - * @param commentId (required) - * @param analysisId (required) - * @return ApiResponse<BaseResponseBool> - * @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 -
403 You can only delete your own comments -
400 Bad Request -
- */ - public ApiResponse deleteAnalysisCommentWithHttpInfo(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = deleteAnalysisCommentValidateBeforeCall(commentId, analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Delete a comment (asynchronously) - * Deletes an existing comment. Users can only delete their own comments. - * @param commentId (required) - * @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 -
403 You can only delete your own comments -
400 Bad Request -
- */ - public okhttp3.Call deleteAnalysisCommentAsync(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteAnalysisCommentValidateBeforeCall(commentId, analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getAnalysisComments - * @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 getAnalysisCommentsCall(@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}/comments" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisCommentsValidateBeforeCall(@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 getAnalysisComments(Async)"); - } - - return getAnalysisCommentsCall(analysisId, _callback); - - } - - /** - * Get comments for this analysis - * Retrieves all comments created for a specific analysis. Only returns comments for resources the requesting user has access to. - * @param analysisId (required) - * @return BaseResponseListCommentResponse - * @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 BaseResponseListCommentResponse getAnalysisComments(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisCommentsWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get comments for this analysis - * Retrieves all comments created for a specific analysis. Only returns comments for resources the requesting user has access to. - * @param analysisId (required) - * @return ApiResponse<BaseResponseListCommentResponse> - * @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 getAnalysisCommentsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisCommentsValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get comments for this analysis (asynchronously) - * Retrieves all comments created for a specific analysis. Only returns comments for resources the requesting user has access to. - * @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 getAnalysisCommentsAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisCommentsValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateAnalysisComment - * @param commentId (required) - * @param analysisId (required) - * @param commentUpdateRequest (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 -
403 You can only update your own comments -
400 Bad Request -
- */ - public okhttp3.Call updateAnalysisCommentCall(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentUpdateRequest commentUpdateRequest, 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 = commentUpdateRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/comments/{comment_id}" - .replace("{" + "comment_id" + "}", localVarApiClient.escapeString(commentId.toString())) - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateAnalysisCommentValidateBeforeCall(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentUpdateRequest commentUpdateRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'commentId' is set - if (commentId == null) { - throw new ApiException("Missing the required parameter 'commentId' when calling updateAnalysisComment(Async)"); - } - - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling updateAnalysisComment(Async)"); - } - - // verify the required parameter 'commentUpdateRequest' is set - if (commentUpdateRequest == null) { - throw new ApiException("Missing the required parameter 'commentUpdateRequest' when calling updateAnalysisComment(Async)"); - } - - return updateAnalysisCommentCall(commentId, analysisId, commentUpdateRequest, _callback); - - } - - /** - * Update a comment - * Updates the content of an existing comment. Users can only update their own comments. - * @param commentId (required) - * @param analysisId (required) - * @param commentUpdateRequest (required) - * @return BaseResponseCommentResponse - * @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 -
403 You can only update your own comments -
400 Bad Request -
- */ - public BaseResponseCommentResponse updateAnalysisComment(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentUpdateRequest commentUpdateRequest) throws ApiException { - ApiResponse localVarResp = updateAnalysisCommentWithHttpInfo(commentId, analysisId, commentUpdateRequest); - return localVarResp.getData(); - } - - /** - * Update a comment - * Updates the content of an existing comment. Users can only update their own comments. - * @param commentId (required) - * @param analysisId (required) - * @param commentUpdateRequest (required) - * @return ApiResponse<BaseResponseCommentResponse> - * @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 -
403 You can only update your own comments -
400 Bad Request -
- */ - public ApiResponse updateAnalysisCommentWithHttpInfo(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentUpdateRequest commentUpdateRequest) throws ApiException { - okhttp3.Call localVarCall = updateAnalysisCommentValidateBeforeCall(commentId, analysisId, commentUpdateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update a comment (asynchronously) - * Updates the content of an existing comment. Users can only update their own comments. - * @param commentId (required) - * @param analysisId (required) - * @param commentUpdateRequest (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 -
403 You can only update your own comments -
400 Bad Request -
- */ - public okhttp3.Call updateAnalysisCommentAsync(@javax.annotation.Nonnull Integer commentId, @javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull CommentUpdateRequest commentUpdateRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateAnalysisCommentValidateBeforeCall(commentId, analysisId, commentUpdateRequest, _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 b973532..cc37a6c 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -29,44 +29,17 @@ import ai.reveng.model.APIError; import ai.reveng.model.AddUserStringInputBody; import ai.reveng.model.AnalysisBasicInfoOutputBody; -import ai.reveng.model.AnalysisCreateRequest; import ai.reveng.model.AnalysisReport; -import ai.reveng.model.AnalysisUpdateRequest; -import ai.reveng.model.AnalysisUpdateTagsRequest; -import ai.reveng.model.AppApiRestV2AnalysesEnumsOrderBy; import ai.reveng.model.AutoUnstripStatusOutputBody; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseAnalysisCreateResponse; -import ai.reveng.model.BaseResponseAnalysisDetailResponse; -import ai.reveng.model.BaseResponseAnalysisFunctionMapping; -import ai.reveng.model.BaseResponseAnalysisUpdateTagsResponse; -import ai.reveng.model.BaseResponseBasic; -import ai.reveng.model.BaseResponseCreated; -import ai.reveng.model.BaseResponseDict; -import ai.reveng.model.BaseResponseLogs; -import ai.reveng.model.BaseResponseParams; -import ai.reveng.model.BaseResponseRecent; -import ai.reveng.model.BaseResponseStatus; -import ai.reveng.model.BaseResponseUploadResponse; -import ai.reveng.model.DynamicExecutionStatus; import ai.reveng.model.DynamicExecutionStatusResponse; -import java.io.File; import ai.reveng.model.GetAnalysisStringsStatusOutputBody; import ai.reveng.model.GetMatchesOutputBody; import ai.reveng.model.GetMatchesStatusOutputBody; -import ai.reveng.model.InsertAnalysisLogRequest; import ai.reveng.model.ListAnalysesOutputBody; import ai.reveng.model.ListAnalysisStringsOutputBody; import ai.reveng.model.ListExampleAnalysesOutputBody; -import ai.reveng.model.ModelName; -import ai.reveng.model.Order; -import ai.reveng.model.PutAnalysisStringsRequest; -import ai.reveng.model.ReAnalysisForm; import ai.reveng.model.StartMatchingForAnalysisInputBody; import ai.reveng.model.StartMatchingOutputBody; -import ai.reveng.model.StatusInput; -import ai.reveng.model.UploadFileType; -import ai.reveng.model.Workspace; import java.lang.reflect.Type; import java.util.ArrayList; @@ -265,9 +238,8 @@ public okhttp3.Call addUserStringToAnalysisAsync(@javax.annotation.Nonnull Long return localVarCall; } /** - * Build call for createAnalysis - * @param analysisCreateRequest (required) - * @param xRevEngApplication (optional) + * Build call for getAnalysisBasicInfo + * @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 @@ -275,13 +247,14 @@ public okhttp3.Call addUserStringToAnalysisAsync(@javax.annotation.Nonnull Long - - + + - + +
Response Details
Status Code Description Response Headers
201 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call createAnalysisCall(@javax.annotation.Nonnull AnalysisCreateRequest analysisCreateRequest, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAnalysisBasicInfoCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -295,10 +268,11 @@ public okhttp3.Call createAnalysisCall(@javax.annotation.Nonnull AnalysisCreateR basePath = null; } - Object localVarPostBody = analysisCreateRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/analyses"; + String localVarPath = "/v3/analyses/{analysis_id}/basic" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -315,83 +289,76 @@ public okhttp3.Call createAnalysisCall(@javax.annotation.Nonnull AnalysisCreateR } final String[] localVarContentTypes = { - "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - if (xRevEngApplication != null) { - localVarHeaderParams.put("X-RevEng-Application", localVarApiClient.parameterToString(xRevEngApplication)); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createAnalysisValidateBeforeCall(@javax.annotation.Nonnull AnalysisCreateRequest analysisCreateRequest, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisCreateRequest' is set - if (analysisCreateRequest == null) { - throw new ApiException("Missing the required parameter 'analysisCreateRequest' when calling createAnalysis(Async)"); + private okhttp3.Call getAnalysisBasicInfoValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'analysisId' is set + if (analysisId == null) { + throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisBasicInfo(Async)"); } - return createAnalysisCall(analysisCreateRequest, xRevEngApplication, _callback); + return getAnalysisBasicInfoCall(analysisId, _callback); } /** - * Create Analysis - * Begins an analysis - * @param analysisCreateRequest (required) - * @param xRevEngApplication (optional) - * @return BaseResponseAnalysisCreateResponse + * Get basic analysis information + * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return AnalysisBasicInfoOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + - + +
Response Details
Status Code Description Response Headers
201 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public BaseResponseAnalysisCreateResponse createAnalysis(@javax.annotation.Nonnull AnalysisCreateRequest analysisCreateRequest, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { - ApiResponse localVarResp = createAnalysisWithHttpInfo(analysisCreateRequest, xRevEngApplication); + public AnalysisBasicInfoOutputBody getAnalysisBasicInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = getAnalysisBasicInfoWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * Create Analysis - * Begins an analysis - * @param analysisCreateRequest (required) - * @param xRevEngApplication (optional) - * @return ApiResponse<BaseResponseAnalysisCreateResponse> + * Get basic analysis information + * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) + * @return ApiResponse<AnalysisBasicInfoOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + - + +
Response Details
Status Code Description Response Headers
201 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse createAnalysisWithHttpInfo(@javax.annotation.Nonnull AnalysisCreateRequest analysisCreateRequest, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { - okhttp3.Call localVarCall = createAnalysisValidateBeforeCall(analysisCreateRequest, xRevEngApplication, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getAnalysisBasicInfoWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = getAnalysisBasicInfoValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Analysis (asynchronously) - * Begins an analysis - * @param analysisCreateRequest (required) - * @param xRevEngApplication (optional) + * Get basic analysis information (asynchronously) + * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param analysisId Analysis ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -399,22 +366,24 @@ public ApiResponse createAnalysisWithHttpInf - - + + - + +
Response Details
Status Code Description Response Headers
201 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
400 Bad Request -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call createAnalysisAsync(@javax.annotation.Nonnull AnalysisCreateRequest analysisCreateRequest, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAnalysisBasicInfoAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createAnalysisValidateBeforeCall(analysisCreateRequest, xRevEngApplication, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getAnalysisBasicInfoValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteAnalysis - * @param analysisId (required) + * Build call for getAnalysisBytes + * @param analysisId Analysis ID (required) + * @param page 64kb page of binary data (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -422,13 +391,15 @@ public okhttp3.Call createAnalysisAsync(@javax.annotation.Nonnull AnalysisCreate - - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call deleteAnalysisCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAnalysisBytesCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -445,7 +416,7 @@ public okhttp3.Call deleteAnalysisCall(@javax.annotation.Nonnull Integer analysi Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}" + String localVarPath = "/v3/analyses/{analysis_id}/bytes" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -454,6 +425,10 @@ public okhttp3.Call deleteAnalysisCall(@javax.annotation.Nonnull Integer analysi Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + final String[] localVarAccepts = { "application/json" }; @@ -470,67 +445,71 @@ public okhttp3.Call deleteAnalysisCall(@javax.annotation.Nonnull Integer analysi } String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAnalysisBytesValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, 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 deleteAnalysis(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisBytes(Async)"); } - return deleteAnalysisCall(analysisId, _callback); + return getAnalysisBytesCall(analysisId, page, _callback); } /** - * Delete Analysis - * Deletes an analysis based on the provided analysis ID. - * @param analysisId (required) - * @return BaseResponseDict + * Get the bytes of a binary + * Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param page 64kb page of binary data (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public BaseResponseDict deleteAnalysis(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = deleteAnalysisWithHttpInfo(analysisId); - return localVarResp.getData(); + public void getAnalysisBytes(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page) throws ApiException { + getAnalysisBytesWithHttpInfo(analysisId, page); } /** - * Delete Analysis - * Deletes an analysis based on the provided analysis ID. - * @param analysisId (required) - * @return ApiResponse<BaseResponseDict> + * Get the bytes of a binary + * Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param page 64kb page of binary data (optional) + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse deleteAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = deleteAnalysisValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse getAnalysisBytesWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page) throws ApiException { + okhttp3.Call localVarCall = getAnalysisBytesValidateBeforeCall(analysisId, page, null); + return localVarApiClient.execute(localVarCall); } /** - * Delete Analysis (asynchronously) - * Deletes an analysis based on the provided analysis ID. - * @param analysisId (required) + * Get the bytes of a binary (asynchronously) + * Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param page 64kb page of binary data (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 @@ -538,22 +517,24 @@ public ApiResponse deleteAnalysisWithHttpInfo(@javax.annotatio - - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public okhttp3.Call deleteAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAnalysisBytesAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteAnalysisValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = getAnalysisBytesValidateBeforeCall(analysisId, page, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getAnalysisBasicInfo - * @param analysisId (required) + * Build call for getAnalysisFunctionMatches + * @param analysisId Analysis ID (required) + * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -561,13 +542,15 @@ public okhttp3.Call deleteAnalysisAsync(@javax.annotation.Nonnull Integer analys - - + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call getAnalysisBasicInfoCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAnalysisFunctionMatchesCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -584,7 +567,7 @@ public okhttp3.Call getAnalysisBasicInfoCall(@javax.annotation.Nonnull Integer a Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/basic" + String localVarPath = "/v3/analyses/{analysis_id}/functions/matches" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -593,6 +576,10 @@ public okhttp3.Call getAnalysisBasicInfoCall(@javax.annotation.Nonnull Integer a Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (matchId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("match_id", matchId)); + } + final String[] localVarAccepts = { "application/json" }; @@ -612,65 +599,71 @@ public okhttp3.Call getAnalysisBasicInfoCall(@javax.annotation.Nonnull Integer a return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisBasicInfoValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAnalysisFunctionMatchesValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisBasicInfo(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisFunctionMatches(Async)"); } - return getAnalysisBasicInfoCall(analysisId, _callback); + return getAnalysisFunctionMatchesCall(analysisId, matchId, _callback); } /** - * Gets basic analysis information - * Returns basic analysis information for an analysis - * @param analysisId (required) - * @return BaseResponseBasic + * Get function-matching results for an analysis + * Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) + * @return GetMatchesOutputBody * @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 -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public BaseResponseBasic getAnalysisBasicInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisBasicInfoWithHttpInfo(analysisId); + public GetMatchesOutputBody getAnalysisFunctionMatches(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId) throws ApiException { + ApiResponse localVarResp = getAnalysisFunctionMatchesWithHttpInfo(analysisId, matchId); return localVarResp.getData(); } /** - * Gets basic analysis information - * Returns basic analysis information for an analysis - * @param analysisId (required) - * @return ApiResponse<BaseResponseBasic> + * Get function-matching results for an analysis + * Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) + * @return ApiResponse<GetMatchesOutputBody> * @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 -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public ApiResponse getAnalysisBasicInfoWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisBasicInfoValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getAnalysisFunctionMatchesWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId) throws ApiException { + okhttp3.Call localVarCall = getAnalysisFunctionMatchesValidateBeforeCall(analysisId, matchId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Gets basic analysis information (asynchronously) - * Returns basic analysis information for an analysis - * @param analysisId (required) + * Get function-matching results for an analysis (asynchronously) + * Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (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 @@ -678,22 +671,25 @@ public ApiResponse getAnalysisBasicInfoWithHttpInfo(@javax.an - - + + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call getAnalysisBasicInfoAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAnalysisFunctionMatchesAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAnalysisBasicInfoValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getAnalysisFunctionMatchesValidateBeforeCall(analysisId, matchId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getAnalysisBasicInfo_0 + * Build call for getAnalysisFunctionMatchingStatus * @param analysisId Analysis ID (required) + * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -702,13 +698,14 @@ public okhttp3.Call getAnalysisBasicInfoAsync(@javax.annotation.Nonnull Integer Response Details Status Code Description Response Headers 200 OK - + 400 Bad Request - 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call getAnalysisBasicInfo_0Call(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAnalysisFunctionMatchingStatusCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -725,7 +722,7 @@ public okhttp3.Call getAnalysisBasicInfo_0Call(@javax.annotation.Nonnull Long an Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/basic" + String localVarPath = "/v3/analyses/{analysis_id}/functions/matches/status" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -734,6 +731,10 @@ public okhttp3.Call getAnalysisBasicInfo_0Call(@javax.annotation.Nonnull Long an Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (matchId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("match_id", matchId)); + } + final String[] localVarAccepts = { "application/json" }; @@ -754,65 +755,70 @@ public okhttp3.Call getAnalysisBasicInfo_0Call(@javax.annotation.Nonnull Long an } @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisBasicInfo_0ValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAnalysisFunctionMatchingStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisBasicInfo_0(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisFunctionMatchingStatus(Async)"); } - return getAnalysisBasicInfo_0Call(analysisId, _callback); + return getAnalysisFunctionMatchingStatusCall(analysisId, matchId, _callback); } /** - * Get basic analysis information - * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get function-matching status for an analysis + * Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request * @param analysisId Analysis ID (required) - * @return AnalysisBasicInfoOutputBody + * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) + * @return GetMatchesStatusOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public AnalysisBasicInfoOutputBody getAnalysisBasicInfo_0(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisBasicInfo_0WithHttpInfo(analysisId); + public GetMatchesStatusOutputBody getAnalysisFunctionMatchingStatus(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId) throws ApiException { + ApiResponse localVarResp = getAnalysisFunctionMatchingStatusWithHttpInfo(analysisId, matchId); return localVarResp.getData(); } /** - * Get basic analysis information - * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get function-matching status for an analysis + * Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request * @param analysisId Analysis ID (required) - * @return ApiResponse<AnalysisBasicInfoOutputBody> + * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) + * @return ApiResponse<GetMatchesStatusOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse getAnalysisBasicInfo_0WithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisBasicInfo_0ValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getAnalysisFunctionMatchingStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId) throws ApiException { + okhttp3.Call localVarCall = getAnalysisFunctionMatchingStatusValidateBeforeCall(analysisId, matchId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get basic analysis information (asynchronously) - * Returns basic metadata for the given analysis including binary details, model, owner, and function count. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * Get function-matching status for an analysis (asynchronously) + * Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request * @param analysisId Analysis ID (required) + * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (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 @@ -821,23 +827,23 @@ public ApiResponse getAnalysisBasicInfo_0WithHttpIn Response Details Status Code Description Response Headers 200 OK - + 400 Bad Request - 403 Forbidden - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call getAnalysisBasicInfo_0Async(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAnalysisFunctionMatchingStatusAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAnalysisBasicInfo_0ValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getAnalysisFunctionMatchingStatusValidateBeforeCall(analysisId, matchId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getAnalysisBytes + * Build call for getDynamicExecutionReport * @param analysisId Analysis ID (required) - * @param page 64kb page of binary data (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -846,14 +852,13 @@ public okhttp3.Call getAnalysisBasicInfo_0Async(@javax.annotation.Nonnull Long a Response Details Status Code Description Response Headers 200 OK - - 400 Bad Request - 403 Forbidden - - 404 Not Found - + 409 Conflict - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call getAnalysisBytesCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDynamicExecutionReportCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -870,7 +875,7 @@ public okhttp3.Call getAnalysisBytesCall(@javax.annotation.Nonnull Long analysis Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/bytes" + String localVarPath = "/v2/analyses/{analysis_id}/dynamic-execution/report" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -879,10 +884,6 @@ public okhttp3.Call getAnalysisBytesCall(@javax.annotation.Nonnull Long analysis Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - final String[] localVarAccepts = { "application/json" }; @@ -903,67 +904,65 @@ public okhttp3.Call getAnalysisBytesCall(@javax.annotation.Nonnull Long analysis } @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisBytesValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getDynamicExecutionReportValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisBytes(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling getDynamicExecutionReport(Async)"); } - return getAnalysisBytesCall(analysisId, page, _callback); + return getDynamicExecutionReportCall(analysisId, _callback); } /** - * Get the bytes of a binary - * Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Get dynamic execution report + * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete * @param analysisId Analysis ID (required) - * @param page 64kb page of binary data (optional) + * @return AnalysisReport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public void getAnalysisBytes(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page) throws ApiException { - getAnalysisBytesWithHttpInfo(analysisId, page); + public AnalysisReport getDynamicExecutionReport(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = getDynamicExecutionReportWithHttpInfo(analysisId); + return localVarResp.getData(); } /** - * Get the bytes of a binary - * Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - * @param analysisId Analysis ID (required) - * @param page 64kb page of binary data (optional) - * @return ApiResponse<Void> + * Get dynamic execution report + * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + * @param analysisId Analysis ID (required) + * @return ApiResponse<AnalysisReport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse getAnalysisBytesWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page) throws ApiException { - okhttp3.Call localVarCall = getAnalysisBytesValidateBeforeCall(analysisId, page, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse getDynamicExecutionReportWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = getDynamicExecutionReportValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get the bytes of a binary (asynchronously) - * Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Get dynamic execution report (asynchronously) + * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete * @param analysisId Analysis ID (required) - * @param page 64kb page of binary data (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 @@ -972,154 +971,22 @@ public ApiResponse getAnalysisBytesWithHttpInfo(@javax.annotation.Nonnull Response Details Status Code Description Response Headers 200 OK - - 400 Bad Request - 403 Forbidden - - 404 Not Found - + 409 Conflict - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call getAnalysisBytesAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisBytesValidateBeforeCall(analysisId, page, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getAnalysisFunctionMap - * @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 getAnalysisFunctionMapCall(@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}/func_maps" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisFunctionMapValidateBeforeCall(@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 getAnalysisFunctionMap(Async)"); - } - - return getAnalysisFunctionMapCall(analysisId, _callback); - - } - - /** - * Get Analysis Function Map - * Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. - * @param analysisId (required) - * @return BaseResponseAnalysisFunctionMapping - * @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 BaseResponseAnalysisFunctionMapping getAnalysisFunctionMap(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisFunctionMapWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get Analysis Function Map - * Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. - * @param analysisId (required) - * @return ApiResponse<BaseResponseAnalysisFunctionMapping> - * @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 getAnalysisFunctionMapWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisFunctionMapValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Analysis Function Map (asynchronously) - * Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. - * @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 getAnalysisFunctionMapAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDynamicExecutionReportAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAnalysisFunctionMapValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getDynamicExecutionReportValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getAnalysisFunctionMatches + * Build call for getDynamicExecutionStatus * @param analysisId Analysis ID (required) - * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1128,14 +995,12 @@ public okhttp3.Call getAnalysisFunctionMapAsync(@javax.annotation.Nonnull Intege Response Details Status Code Description Response Headers 200 OK - - 400 Bad Request - 403 Forbidden - - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call getAnalysisFunctionMatchesCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDynamicExecutionStatusCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1152,7 +1017,7 @@ public okhttp3.Call getAnalysisFunctionMatchesCall(@javax.annotation.Nonnull Lon Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/functions/matches" + String localVarPath = "/v2/analyses/{analysis_id}/dynamic-execution/status" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -1161,10 +1026,6 @@ public okhttp3.Call getAnalysisFunctionMatchesCall(@javax.annotation.Nonnull Lon Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (matchId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("match_id", matchId)); - } - final String[] localVarAccepts = { "application/json" }; @@ -1185,70 +1046,63 @@ public okhttp3.Call getAnalysisFunctionMatchesCall(@javax.annotation.Nonnull Lon } @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisFunctionMatchesValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getDynamicExecutionStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisFunctionMatches(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling getDynamicExecutionStatus(Async)"); } - return getAnalysisFunctionMatchesCall(analysisId, matchId, _callback); + return getDynamicExecutionStatusCall(analysisId, _callback); } /** - * Get function-matching results for an analysis - * Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Get dynamic execution status + * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) - * @return GetMatchesOutputBody + * @return DynamicExecutionStatusResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - -
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public GetMatchesOutputBody getAnalysisFunctionMatches(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId) throws ApiException { - ApiResponse localVarResp = getAnalysisFunctionMatchesWithHttpInfo(analysisId, matchId); + public DynamicExecutionStatusResponse getDynamicExecutionStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = getDynamicExecutionStatusWithHttpInfo(analysisId); return localVarResp.getData(); } /** - * Get function-matching results for an analysis - * Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Get dynamic execution status + * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) - * @return ApiResponse<GetMatchesOutputBody> + * @return ApiResponse<DynamicExecutionStatusResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - -
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse getAnalysisFunctionMatchesWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisFunctionMatchesValidateBeforeCall(analysisId, matchId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getDynamicExecutionStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = getDynamicExecutionStatusValidateBeforeCall(analysisId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get function-matching results for an analysis (asynchronously) - * Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Get dynamic execution status (asynchronously) + * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied * @param analysisId Analysis ID (required) - * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (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 @@ -1257,24 +1111,22 @@ public ApiResponse getAnalysisFunctionMatchesWithHttpInfo( Response Details Status Code Description Response Headers 200 OK - - 400 Bad Request - 403 Forbidden - - 404 Not Found - 422 Unprocessable Entity - 500 Internal Server Error - */ - public okhttp3.Call getAnalysisFunctionMatchesAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDynamicExecutionStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAnalysisFunctionMatchesValidateBeforeCall(analysisId, matchId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getDynamicExecutionStatusValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getAnalysisFunctionMatchingStatus + * Build call for startAnalysisFunctionMatching * @param analysisId Analysis ID (required) - * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) + * @param startMatchingForAnalysisInputBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1282,7 +1134,7 @@ public okhttp3.Call getAnalysisFunctionMatchesAsync(@javax.annotation.Nonnull Lo - + @@ -1290,7 +1142,7 @@ public okhttp3.Call getAnalysisFunctionMatchesAsync(@javax.annotation.Nonnull Lo
Response Details
Status Code Description Response Headers
200 OK -
202 Accepted -
400 Bad Request -
403 Forbidden -
404 Not Found -
500 Internal Server Error -
*/ - public okhttp3.Call getAnalysisFunctionMatchingStatusCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call startAnalysisFunctionMatchingCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1304,10 +1156,10 @@ public okhttp3.Call getAnalysisFunctionMatchingStatusCall(@javax.annotation.Nonn basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = startMatchingForAnalysisInputBody; // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/functions/matches/status" + String localVarPath = "/v3/analyses/{analysis_id}/functions/matches" .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); List localVarQueryParams = new ArrayList(); @@ -1316,10 +1168,6 @@ public okhttp3.Call getAnalysisFunctionMatchingStatusCall(@javax.annotation.Nonn Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (matchId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("match_id", matchId)); - } - final String[] localVarAccepts = { "application/json" }; @@ -1329,6 +1177,7 @@ public okhttp3.Call getAnalysisFunctionMatchingStatusCall(@javax.annotation.Nonn } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1336,32 +1185,37 @@ public okhttp3.Call getAnalysisFunctionMatchingStatusCall(@javax.annotation.Nonn } String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisFunctionMatchingStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call startAnalysisFunctionMatchingValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody, 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 getAnalysisFunctionMatchingStatus(Async)"); + throw new ApiException("Missing the required parameter 'analysisId' when calling startAnalysisFunctionMatching(Async)"); } - return getAnalysisFunctionMatchingStatusCall(analysisId, matchId, _callback); + // verify the required parameter 'startMatchingForAnalysisInputBody' is set + if (startMatchingForAnalysisInputBody == null) { + throw new ApiException("Missing the required parameter 'startMatchingForAnalysisInputBody' when calling startAnalysisFunctionMatching(Async)"); + } + + return startAnalysisFunctionMatchingCall(analysisId, startMatchingForAnalysisInputBody, _callback); } /** - * Get function-matching status for an analysis - * Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Start function matching for an analysis + * Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request * @param analysisId Analysis ID (required) - * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) - * @return GetMatchesStatusOutputBody + * @param startMatchingForAnalysisInputBody (required) + * @return StartMatchingOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + @@ -1369,23 +1223,23 @@ private okhttp3.Call getAnalysisFunctionMatchingStatusValidateBeforeCall(@javax.
Response Details
Status Code Description Response Headers
200 OK -
202 Accepted -
400 Bad Request -
403 Forbidden -
404 Not Found -
500 Internal Server Error -
*/ - public GetMatchesStatusOutputBody getAnalysisFunctionMatchingStatus(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId) throws ApiException { - ApiResponse localVarResp = getAnalysisFunctionMatchingStatusWithHttpInfo(analysisId, matchId); + public StartMatchingOutputBody startAnalysisFunctionMatching(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody) throws ApiException { + ApiResponse localVarResp = startAnalysisFunctionMatchingWithHttpInfo(analysisId, startMatchingForAnalysisInputBody); return localVarResp.getData(); } /** - * Get function-matching status for an analysis - * Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Start function matching for an analysis + * Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request * @param analysisId Analysis ID (required) - * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) - * @return ApiResponse<GetMatchesStatusOutputBody> + * @param startMatchingForAnalysisInputBody (required) + * @return ApiResponse<StartMatchingOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + @@ -1393,17 +1247,17 @@ public GetMatchesStatusOutputBody getAnalysisFunctionMatchingStatus(@javax.annot
Response Details
Status Code Description Response Headers
200 OK -
202 Accepted -
400 Bad Request -
403 Forbidden -
404 Not Found -
500 Internal Server Error -
*/ - public ApiResponse getAnalysisFunctionMatchingStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisFunctionMatchingStatusValidateBeforeCall(analysisId, matchId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse startAnalysisFunctionMatchingWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody) throws ApiException { + okhttp3.Call localVarCall = startAnalysisFunctionMatchingValidateBeforeCall(analysisId, startMatchingForAnalysisInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get function-matching status for an analysis (asynchronously) - * Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * Start function matching for an analysis (asynchronously) + * Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request * @param analysisId Analysis ID (required) - * @param matchId Opaque token from a start-matching response. When supplied, returns that specific run instead of the latest. (optional) + * @param startMatchingForAnalysisInputBody (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 @@ -1411,7 +1265,7 @@ public ApiResponse getAnalysisFunctionMatchingStatus - + @@ -1419,2068 +1273,10 @@ public ApiResponse getAnalysisFunctionMatchingStatus
Response Details
Status Code Description Response Headers
200 OK -
202 Accepted -
400 Bad Request -
403 Forbidden -
404 Not Found -
500 Internal Server Error -
*/ - public okhttp3.Call getAnalysisFunctionMatchingStatusAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable String matchId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call startAnalysisFunctionMatchingAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAnalysisFunctionMatchingStatusValidateBeforeCall(analysisId, matchId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getAnalysisLogs - * @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 getAnalysisLogsCall(@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}/logs" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisLogsValidateBeforeCall(@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 getAnalysisLogs(Async)"); - } - - return getAnalysisLogsCall(analysisId, _callback); - - } - - /** - * Gets the logs of an analysis - * Given an analysis ID gets the current logs of an analysis - * @param analysisId (required) - * @return BaseResponseLogs - * @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 BaseResponseLogs getAnalysisLogs(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisLogsWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Gets the logs of an analysis - * Given an analysis ID gets the current logs of an analysis - * @param analysisId (required) - * @return ApiResponse<BaseResponseLogs> - * @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 getAnalysisLogsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisLogsValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the logs of an analysis (asynchronously) - * Given an analysis ID gets the current logs of an analysis - * @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 getAnalysisLogsAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisLogsValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getAnalysisParams - * @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 getAnalysisParamsCall(@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}/params" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisParamsValidateBeforeCall(@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 getAnalysisParams(Async)"); - } - - return getAnalysisParamsCall(analysisId, _callback); - - } - - /** - * Gets analysis param information - * Gets the params that the analysis was run with - * @param analysisId (required) - * @return BaseResponseParams - * @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 BaseResponseParams getAnalysisParams(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisParamsWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Gets analysis param information - * Gets the params that the analysis was run with - * @param analysisId (required) - * @return ApiResponse<BaseResponseParams> - * @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 getAnalysisParamsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisParamsValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets analysis param information (asynchronously) - * Gets the params that the analysis was run with - * @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 getAnalysisParamsAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisParamsValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getAnalysisStatus - * @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 getAnalysisStatusCall(@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}/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisStatusValidateBeforeCall(@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 getAnalysisStatus(Async)"); - } - - return getAnalysisStatusCall(analysisId, _callback); - - } - - /** - * Gets the status of an analysis - * Given an analysis ID gets the current status of the analysis - * @param analysisId (required) - * @return BaseResponseStatus - * @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 BaseResponseStatus getAnalysisStatus(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisStatusWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Gets the status of an analysis - * Given an analysis ID gets the current status of the analysis - * @param analysisId (required) - * @return ApiResponse<BaseResponseStatus> - * @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 getAnalysisStatusWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the status of an analysis (asynchronously) - * Given an analysis ID gets the current status of the analysis - * @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 getAnalysisStatusAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getDynamicExecutionReport - * @param analysisId Analysis ID (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getDynamicExecutionReportCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/dynamic-execution/report" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getDynamicExecutionReportValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getDynamicExecutionReport(Async)"); - } - - return getDynamicExecutionReportCall(analysisId, _callback); - - } - - /** - * Get dynamic execution report - * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete - * @param analysisId Analysis ID (required) - * @return AnalysisReport - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public AnalysisReport getDynamicExecutionReport(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = getDynamicExecutionReportWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get dynamic execution report - * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete - * @param analysisId Analysis ID (required) - * @return ApiResponse<AnalysisReport> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse getDynamicExecutionReportWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = getDynamicExecutionReportValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get dynamic execution report (asynchronously) - * Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete - * @param analysisId Analysis ID (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getDynamicExecutionReportAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDynamicExecutionReportValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getDynamicExecutionStatus - * @param analysisId Analysis ID (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getDynamicExecutionStatusCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/dynamic-execution/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getDynamicExecutionStatusValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getDynamicExecutionStatus(Async)"); - } - - return getDynamicExecutionStatusCall(analysisId, _callback); - - } - - /** - * Get dynamic execution status - * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @return DynamicExecutionStatusResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public DynamicExecutionStatusResponse getDynamicExecutionStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = getDynamicExecutionStatusWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get dynamic execution status - * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @return ApiResponse<DynamicExecutionStatusResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse getDynamicExecutionStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = getDynamicExecutionStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get dynamic execution status (asynchronously) - * Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getDynamicExecutionStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDynamicExecutionStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for insertAnalysisLog - * @param analysisId (required) - * @param insertAnalysisLogRequest (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call insertAnalysisLogCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, 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 = insertAnalysisLogRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/logs" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call insertAnalysisLogValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, 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 insertAnalysisLog(Async)"); - } - - // verify the required parameter 'insertAnalysisLogRequest' is set - if (insertAnalysisLogRequest == null) { - throw new ApiException("Missing the required parameter 'insertAnalysisLogRequest' when calling insertAnalysisLog(Async)"); - } - - return insertAnalysisLogCall(analysisId, insertAnalysisLogRequest, _callback); - - } - - /** - * Insert a log entry for an analysis - * Inserts a log record for an analysis. Only the analysis owner can insert logs. - * @param analysisId (required) - * @param insertAnalysisLogRequest (required) - * @return BaseResponse - * @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 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponse insertAnalysisLog(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest) throws ApiException { - ApiResponse localVarResp = insertAnalysisLogWithHttpInfo(analysisId, insertAnalysisLogRequest); - return localVarResp.getData(); - } - - /** - * Insert a log entry for an analysis - * Inserts a log record for an analysis. Only the analysis owner can insert logs. - * @param analysisId (required) - * @param insertAnalysisLogRequest (required) - * @return ApiResponse<BaseResponse> - * @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 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse insertAnalysisLogWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest) throws ApiException { - okhttp3.Call localVarCall = insertAnalysisLogValidateBeforeCall(analysisId, insertAnalysisLogRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Insert a log entry for an analysis (asynchronously) - * Inserts a log record for an analysis. Only the analysis owner can insert logs. - * @param analysisId (required) - * @param insertAnalysisLogRequest (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call insertAnalysisLogAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull InsertAnalysisLogRequest insertAnalysisLogRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = insertAnalysisLogValidateBeforeCall(analysisId, insertAnalysisLogRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for listAnalyses - * @param searchTerm (optional, default to ) - * @param workspace The workspace to be viewed (optional) - * @param status The status of the analysis (optional) - * @param modelName Show analysis belonging to the model (optional) - * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) - * @param usernames Show analysis belonging to the user (optional) - * @param sha256Hash (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional, default to created) - * @param order (optional, default to DESC) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
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 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[] { }; - - // 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/list"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (searchTerm != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_term", searchTerm)); - } - - if (workspace != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "workspace", workspace)); - } - - if (status != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status)); - } - - if (modelName != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "model_name", modelName)); - } - - if (dynamicExecutionStatus != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("dynamic_execution_status", dynamicExecutionStatus)); - } - - if (usernames != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usernames", usernames)); - } - - if (sha256Hash != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sha256_hash", sha256Hash)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); - } - - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } - - if (order != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call 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); - - } - - /** - * Gets the most recent analyses - * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit - * @param searchTerm (optional, default to ) - * @param workspace The workspace to be viewed (optional) - * @param status The status of the analysis (optional) - * @param modelName Show analysis belonging to the model (optional) - * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) - * @param usernames Show analysis belonging to the user (optional) - * @param sha256Hash (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional, default to created) - * @param order (optional, default to DESC) - * @return BaseResponseRecent - * @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 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(); - } - - /** - * Gets the most recent analyses - * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit - * @param searchTerm (optional, default to ) - * @param workspace The workspace to be viewed (optional) - * @param status The status of the analysis (optional) - * @param modelName Show analysis belonging to the model (optional) - * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) - * @param usernames Show analysis belonging to the user (optional) - * @param sha256Hash (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional, default to created) - * @param order (optional, default to DESC) - * @return ApiResponse<BaseResponseRecent> - * @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 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); - } - - /** - * Gets the most recent analyses (asynchronously) - * Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit - * @param searchTerm (optional, default to ) - * @param workspace The workspace to be viewed (optional) - * @param status The status of the analysis (optional) - * @param modelName Show analysis belonging to the model (optional) - * @param dynamicExecutionStatus Show analysis that have a dynamic execution with the given status (optional) - * @param usernames Show analysis belonging to the user (optional) - * @param sha256Hash (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional, default to created) - * @param order (optional, default to DESC) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
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 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(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for lookupBinaryId - * @param binaryId (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 lookupBinaryIdCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/lookup/{binary_id}" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call lookupBinaryIdValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling lookupBinaryId(Async)"); - } - - return lookupBinaryIdCall(binaryId, _callback); - - } - - /** - * Gets the analysis ID from binary ID - * Given an binary ID gets the ID of an analysis - * @param binaryId (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 lookupBinaryId(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = lookupBinaryIdWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Gets the analysis ID from binary ID - * Given an binary ID gets the ID of an analysis - * @param binaryId (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 lookupBinaryIdWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = lookupBinaryIdValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the analysis ID from binary ID (asynchronously) - * Given an binary ID gets the ID of an analysis - * @param binaryId (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 lookupBinaryIdAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = lookupBinaryIdValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for putAnalysisStrings - * @param analysisId (required) - * @param putAnalysisStringsRequest (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call putAnalysisStringsCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, 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 = putAnalysisStringsRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/strings" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call putAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, 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 putAnalysisStrings(Async)"); - } - - // verify the required parameter 'putAnalysisStringsRequest' is set - if (putAnalysisStringsRequest == null) { - throw new ApiException("Missing the required parameter 'putAnalysisStringsRequest' when calling putAnalysisStrings(Async)"); - } - - return putAnalysisStringsCall(analysisId, putAnalysisStringsRequest, _callback); - - } - - /** - * Add strings to the analysis - * Add strings to the analysis. Rejects if any string already exists at the given vaddr. - * @param analysisId (required) - * @param putAnalysisStringsRequest (required) - * @return BaseResponse - * @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 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponse putAnalysisStrings(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest) throws ApiException { - ApiResponse localVarResp = putAnalysisStringsWithHttpInfo(analysisId, putAnalysisStringsRequest); - return localVarResp.getData(); - } - - /** - * Add strings to the analysis - * Add strings to the analysis. Rejects if any string already exists at the given vaddr. - * @param analysisId (required) - * @param putAnalysisStringsRequest (required) - * @return ApiResponse<BaseResponse> - * @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 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse putAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest) throws ApiException { - okhttp3.Call localVarCall = putAnalysisStringsValidateBeforeCall(analysisId, putAnalysisStringsRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Add strings to the analysis (asynchronously) - * Add strings to the analysis. Rejects if any string already exists at the given vaddr. - * @param analysisId (required) - * @param putAnalysisStringsRequest (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call putAnalysisStringsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull PutAnalysisStringsRequest putAnalysisStringsRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = putAnalysisStringsValidateBeforeCall(analysisId, putAnalysisStringsRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for requeueAnalysis - * @param analysisId (required) - * @param reAnalysisForm (required) - * @param xRevEngApplication (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
201 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
- */ - public okhttp3.Call requeueAnalysisCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, 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 = reAnalysisForm; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/requeue" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - if (xRevEngApplication != null) { - localVarHeaderParams.put("X-RevEng-Application", localVarApiClient.parameterToString(xRevEngApplication)); - } - - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call requeueAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, 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 requeueAnalysis(Async)"); - } - - // verify the required parameter 'reAnalysisForm' is set - if (reAnalysisForm == null) { - throw new ApiException("Missing the required parameter 'reAnalysisForm' when calling requeueAnalysis(Async)"); - } - - return requeueAnalysisCall(analysisId, reAnalysisForm, xRevEngApplication, _callback); - - } - - /** - * Requeue Analysis - * Re-queues an already uploaded analysis - * @param analysisId (required) - * @param reAnalysisForm (required) - * @param xRevEngApplication (optional) - * @return BaseResponseCreated - * @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 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
- */ - public BaseResponseCreated requeueAnalysis(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { - ApiResponse localVarResp = requeueAnalysisWithHttpInfo(analysisId, reAnalysisForm, xRevEngApplication); - return localVarResp.getData(); - } - - /** - * Requeue Analysis - * Re-queues an already uploaded analysis - * @param analysisId (required) - * @param reAnalysisForm (required) - * @param xRevEngApplication (optional) - * @return ApiResponse<BaseResponseCreated> - * @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 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
- */ - public ApiResponse requeueAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication) throws ApiException { - okhttp3.Call localVarCall = requeueAnalysisValidateBeforeCall(analysisId, reAnalysisForm, xRevEngApplication, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Requeue Analysis (asynchronously) - * Re-queues an already uploaded analysis - * @param analysisId (required) - * @param reAnalysisForm (required) - * @param xRevEngApplication (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
201 Successful Response -
422 Invalid request parameters -
404 Not Found -
400 Bad Request -
- */ - public okhttp3.Call requeueAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull ReAnalysisForm reAnalysisForm, @javax.annotation.Nullable String xRevEngApplication, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = requeueAnalysisValidateBeforeCall(analysisId, reAnalysisForm, xRevEngApplication, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for startAnalysisFunctionMatching - * @param analysisId Analysis ID (required) - * @param startMatchingForAnalysisInputBody (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 -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call startAnalysisFunctionMatchingCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody, 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 = startMatchingForAnalysisInputBody; - - // create path and map variables - String localVarPath = "/v3/analyses/{analysis_id}/functions/matches" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call startAnalysisFunctionMatchingValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody, 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 startAnalysisFunctionMatching(Async)"); - } - - // verify the required parameter 'startMatchingForAnalysisInputBody' is set - if (startMatchingForAnalysisInputBody == null) { - throw new ApiException("Missing the required parameter 'startMatchingForAnalysisInputBody' when calling startAnalysisFunctionMatching(Async)"); - } - - return startAnalysisFunctionMatchingCall(analysisId, startMatchingForAnalysisInputBody, _callback); - - } - - /** - * Start function matching for an analysis - * Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - * @param analysisId Analysis ID (required) - * @param startMatchingForAnalysisInputBody (required) - * @return StartMatchingOutputBody - * @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 -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public StartMatchingOutputBody startAnalysisFunctionMatching(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody) throws ApiException { - ApiResponse localVarResp = startAnalysisFunctionMatchingWithHttpInfo(analysisId, startMatchingForAnalysisInputBody); - return localVarResp.getData(); - } - - /** - * Start function matching for an analysis - * Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - * @param analysisId Analysis ID (required) - * @param startMatchingForAnalysisInputBody (required) - * @return ApiResponse<StartMatchingOutputBody> - * @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 -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse startAnalysisFunctionMatchingWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody) throws ApiException { - okhttp3.Call localVarCall = startAnalysisFunctionMatchingValidateBeforeCall(analysisId, startMatchingForAnalysisInputBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Start function matching for an analysis (asynchronously) - * Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - * @param analysisId Analysis ID (required) - * @param startMatchingForAnalysisInputBody (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 -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call startAnalysisFunctionMatchingAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = startAnalysisFunctionMatchingValidateBeforeCall(analysisId, startMatchingForAnalysisInputBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateAnalysis - * @param analysisId (required) - * @param analysisUpdateRequest (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 updateAnalysisCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, 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 = analysisUpdateRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, 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 updateAnalysis(Async)"); - } - - // verify the required parameter 'analysisUpdateRequest' is set - if (analysisUpdateRequest == null) { - throw new ApiException("Missing the required parameter 'analysisUpdateRequest' when calling updateAnalysis(Async)"); - } - - return updateAnalysisCall(analysisId, analysisUpdateRequest, _callback); - - } - - /** - * Update Analysis - * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. - * @param analysisId (required) - * @param analysisUpdateRequest (required) - * @return BaseResponseAnalysisDetailResponse - * @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 BaseResponseAnalysisDetailResponse updateAnalysis(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest) throws ApiException { - ApiResponse localVarResp = updateAnalysisWithHttpInfo(analysisId, analysisUpdateRequest); - return localVarResp.getData(); - } - - /** - * Update Analysis - * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. - * @param analysisId (required) - * @param analysisUpdateRequest (required) - * @return ApiResponse<BaseResponseAnalysisDetailResponse> - * @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 updateAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest) throws ApiException { - okhttp3.Call localVarCall = updateAnalysisValidateBeforeCall(analysisId, analysisUpdateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Analysis (asynchronously) - * Updates analysis attributes (binary_name, analysis_scope). User must be the owner. - * @param analysisId (required) - * @param analysisUpdateRequest (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 updateAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateRequest analysisUpdateRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateAnalysisValidateBeforeCall(analysisId, analysisUpdateRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateAnalysisTags - * @param analysisId (required) - * @param analysisUpdateTagsRequest (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 updateAnalysisTagsCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, 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 = analysisUpdateTagsRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/tags" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateAnalysisTagsValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, 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 updateAnalysisTags(Async)"); - } - - // verify the required parameter 'analysisUpdateTagsRequest' is set - if (analysisUpdateTagsRequest == null) { - throw new ApiException("Missing the required parameter 'analysisUpdateTagsRequest' when calling updateAnalysisTags(Async)"); - } - - return updateAnalysisTagsCall(analysisId, analysisUpdateTagsRequest, _callback); - - } - - /** - * Update Analysis Tags - * Updates analysis tags. User must be the owner. - * @param analysisId (required) - * @param analysisUpdateTagsRequest (required) - * @return BaseResponseAnalysisUpdateTagsResponse - * @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 BaseResponseAnalysisUpdateTagsResponse updateAnalysisTags(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest) throws ApiException { - ApiResponse localVarResp = updateAnalysisTagsWithHttpInfo(analysisId, analysisUpdateTagsRequest); - return localVarResp.getData(); - } - - /** - * Update Analysis Tags - * Updates analysis tags. User must be the owner. - * @param analysisId (required) - * @param analysisUpdateTagsRequest (required) - * @return ApiResponse<BaseResponseAnalysisUpdateTagsResponse> - * @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 updateAnalysisTagsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest) throws ApiException { - okhttp3.Call localVarCall = updateAnalysisTagsValidateBeforeCall(analysisId, analysisUpdateTagsRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Analysis Tags (asynchronously) - * Updates analysis tags. User must be the owner. - * @param analysisId (required) - * @param analysisUpdateTagsRequest (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 updateAnalysisTagsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisUpdateTagsRequest analysisUpdateTagsRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateAnalysisTagsValidateBeforeCall(analysisId, analysisUpdateTagsRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for uploadFile - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call uploadFileCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/upload"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (uploadFileType != null) { - localVarFormParams.put("upload_file_type", uploadFileType); - } - - if (_file != null) { - localVarFormParams.put("file", _file); - } - - if (forceOverwrite != null) { - localVarFormParams.put("force_overwrite", forceOverwrite); - } - - if (packedPassword != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("packed_password", packedPassword)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call uploadFileValidateBeforeCall(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'uploadFileType' is set - if (uploadFileType == null) { - throw new ApiException("Missing the required parameter 'uploadFileType' when calling uploadFile(Async)"); - } - - // verify the required parameter '_file' is set - if (_file == null) { - throw new ApiException("Missing the required parameter '_file' when calling uploadFile(Async)"); - } - - return uploadFileCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); - - } - - /** - * Upload File - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) - * @return BaseResponseUploadResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponseUploadResponse uploadFile(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { - ApiResponse localVarResp = uploadFileWithHttpInfo(uploadFileType, _file, packedPassword, forceOverwrite); - return localVarResp.getData(); - } - - /** - * Upload File - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) - * @return ApiResponse<BaseResponseUploadResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite) throws ApiException { - okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Upload File (asynchronously) - * - * @param uploadFileType (required) - * @param _file (required) - * @param packedPassword (optional) - * @param forceOverwrite (optional, default to false) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call uploadFileAsync(@javax.annotation.Nonnull UploadFileType uploadFileType, @javax.annotation.Nonnull File _file, @javax.annotation.Nullable String packedPassword, @javax.annotation.Nullable Boolean forceOverwrite, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = uploadFileValidateBeforeCall(uploadFileType, _file, packedPassword, forceOverwrite, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = startAnalysisFunctionMatchingValidateBeforeCall(analysisId, startMatchingForAnalysisInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java b/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java deleted file mode 100644 index 8fce41a..0000000 --- a/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java +++ /dev/null @@ -1,948 +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.BaseResponseAnalysisFunctions; -import ai.reveng.model.BaseResponseAnalysisFunctionsList; -import ai.reveng.model.BaseResponseAnalysisTags; -import ai.reveng.model.BaseResponseCapabilities; -import ai.reveng.model.BaseResponseListSBOM; -import ai.reveng.model.BaseResponseVulnerabilities; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AnalysesResultsMetadataApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AnalysesResultsMetadataApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnalysesResultsMetadataApi(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 getAnalysisFunctionsPaginated - * @param analysisId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 1000) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getAnalysisFunctionsPaginatedCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisFunctionsPaginatedValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisFunctionsPaginated(Async)"); - } - - return getAnalysisFunctionsPaginatedCall(analysisId, page, pageSize, _callback); - - } - - /** - * Get functions from analysis - * Returns a paginated list of functions identified during analysis - * @param analysisId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 1000) - * @return BaseResponseAnalysisFunctionsList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseAnalysisFunctionsList getAnalysisFunctionsPaginated(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize) throws ApiException { - ApiResponse localVarResp = getAnalysisFunctionsPaginatedWithHttpInfo(analysisId, page, pageSize); - return localVarResp.getData(); - } - - /** - * Get functions from analysis - * Returns a paginated list of functions identified during analysis - * @param analysisId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 1000) - * @return ApiResponse<BaseResponseAnalysisFunctionsList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getAnalysisFunctionsPaginatedWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = getAnalysisFunctionsPaginatedValidateBeforeCall(analysisId, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get functions from analysis (asynchronously) - * Returns a paginated list of functions identified during analysis - * @param analysisId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 1000) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getAnalysisFunctionsPaginatedAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisFunctionsPaginatedValidateBeforeCall(analysisId, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getCapabilities - * @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 getCapabilitiesCall(@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}/capabilities" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getCapabilitiesValidateBeforeCall(@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 getCapabilities(Async)"); - } - - return getCapabilitiesCall(analysisId, _callback); - - } - - /** - * Gets the capabilities from the analysis - * - * @param analysisId (required) - * @return BaseResponseCapabilities - * @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 BaseResponseCapabilities getCapabilities(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getCapabilitiesWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Gets the capabilities from the analysis - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseCapabilities> - * @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 getCapabilitiesWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getCapabilitiesValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the capabilities from the analysis (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 getCapabilitiesAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getCapabilitiesValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getFunctionsList - * @param analysisId (required) - * @param searchTerm (optional) - * @param minVAddr (optional) - * @param maxVAddr (optional) - * @param includeEmbeddings (optional, default to true) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 1000) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionsListCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable Integer minVAddr, @javax.annotation.Nullable Integer maxVAddr, @javax.annotation.Nullable Boolean includeEmbeddings, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions/list" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (searchTerm != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_term", searchTerm)); - } - - if (minVAddr != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("min_v_addr", minVAddr)); - } - - if (maxVAddr != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("max_v_addr", maxVAddr)); - } - - if (includeEmbeddings != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_embeddings", includeEmbeddings)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionsListValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable Integer minVAddr, @javax.annotation.Nullable Integer maxVAddr, @javax.annotation.Nullable Boolean includeEmbeddings, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getFunctionsList(Async)"); - } - - return getFunctionsListCall(analysisId, searchTerm, minVAddr, maxVAddr, includeEmbeddings, page, pageSize, _callback); - - } - - /** - * Gets functions from analysis - * Gets the functions identified during analysis - * @param analysisId (required) - * @param searchTerm (optional) - * @param minVAddr (optional) - * @param maxVAddr (optional) - * @param includeEmbeddings (optional, default to true) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 1000) - * @return BaseResponseAnalysisFunctions - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseAnalysisFunctions getFunctionsList(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable Integer minVAddr, @javax.annotation.Nullable Integer maxVAddr, @javax.annotation.Nullable Boolean includeEmbeddings, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize) throws ApiException { - ApiResponse localVarResp = getFunctionsListWithHttpInfo(analysisId, searchTerm, minVAddr, maxVAddr, includeEmbeddings, page, pageSize); - return localVarResp.getData(); - } - - /** - * Gets functions from analysis - * Gets the functions identified during analysis - * @param analysisId (required) - * @param searchTerm (optional) - * @param minVAddr (optional) - * @param maxVAddr (optional) - * @param includeEmbeddings (optional, default to true) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 1000) - * @return ApiResponse<BaseResponseAnalysisFunctions> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getFunctionsListWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable Integer minVAddr, @javax.annotation.Nullable Integer maxVAddr, @javax.annotation.Nullable Boolean includeEmbeddings, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = getFunctionsListValidateBeforeCall(analysisId, searchTerm, minVAddr, maxVAddr, includeEmbeddings, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets functions from analysis (asynchronously) - * Gets the functions identified during analysis - * @param analysisId (required) - * @param searchTerm (optional) - * @param minVAddr (optional) - * @param maxVAddr (optional) - * @param includeEmbeddings (optional, default to true) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 1000) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionsListAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable Integer minVAddr, @javax.annotation.Nullable Integer maxVAddr, @javax.annotation.Nullable Boolean includeEmbeddings, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFunctionsListValidateBeforeCall(analysisId, searchTerm, minVAddr, maxVAddr, includeEmbeddings, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getSbom - * @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 getSbomCall(@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}/sbom" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSbomValidateBeforeCall(@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 getSbom(Async)"); - } - - return getSbomCall(analysisId, _callback); - - } - - /** - * Gets the software-bill-of-materials (SBOM) found in the analysis - * - * @param analysisId (required) - * @return BaseResponseListSBOM - * @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 BaseResponseListSBOM getSbom(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getSbomWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Gets the software-bill-of-materials (SBOM) found in the analysis - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseListSBOM> - * @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 getSbomWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getSbomValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the software-bill-of-materials (SBOM) found in the analysis (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 getSbomAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSbomValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getTags - * @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 getTagsCall(@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}/tags" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getTagsValidateBeforeCall(@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 getTags(Async)"); - } - - return getTagsCall(analysisId, _callback); - - } - - /** - * Get function tags with maliciousness score - * - * @param analysisId (required) - * @return BaseResponseAnalysisTags - * @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 BaseResponseAnalysisTags getTags(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getTagsWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get function tags with maliciousness score - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseAnalysisTags> - * @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 getTagsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getTagsValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get function tags with maliciousness score (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 getTagsAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getTagsValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getVulnerabilities - * @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 getVulnerabilitiesCall(@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}/vulnerabilities" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getVulnerabilitiesValidateBeforeCall(@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 getVulnerabilities(Async)"); - } - - return getVulnerabilitiesCall(analysisId, _callback); - - } - - /** - * Gets the vulnerabilities found in the analysis - * - * @param analysisId (required) - * @return BaseResponseVulnerabilities - * @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 BaseResponseVulnerabilities getVulnerabilities(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getVulnerabilitiesWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Gets the vulnerabilities found in the analysis - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseVulnerabilities> - * @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 getVulnerabilitiesWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getVulnerabilitiesValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the vulnerabilities found in the analysis (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 getVulnerabilitiesAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getVulnerabilitiesValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/AnalysesXRefsApi.java b/src/main/java/ai/reveng/api/AnalysesXRefsApi.java deleted file mode 100644 index afa1005..0000000 --- a/src/main/java/ai/reveng/api/AnalysesXRefsApi.java +++ /dev/null @@ -1,221 +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.BaseResponseXrefResponse; -import ai.reveng.model.ErrorModel; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AnalysesXRefsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AnalysesXRefsApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnalysesXRefsApi(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 getXrefByVaddr - * @param analysisId (required) - * @param vaddr Virtual address to match against xrefs (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Xref or analysis cache not found -
- */ - public okhttp3.Call getXrefByVaddrCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer vaddr, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/xrefs/{vaddr}" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) - .replace("{" + "vaddr" + "}", localVarApiClient.escapeString(vaddr.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getXrefByVaddrValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer vaddr, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getXrefByVaddr(Async)"); - } - - // verify the required parameter 'vaddr' is set - if (vaddr == null) { - throw new ApiException("Missing the required parameter 'vaddr' when calling getXrefByVaddr(Async)"); - } - - return getXrefByVaddrCall(analysisId, vaddr, _callback); - - } - - /** - * [Beta] Look up xrefs by virtual address - * **This endpoint is in beta and may change without notice.** - * @param analysisId (required) - * @param vaddr Virtual address to match against xrefs (required) - * @return BaseResponseXrefResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Xref or analysis cache not found -
- */ - public BaseResponseXrefResponse getXrefByVaddr(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer vaddr) throws ApiException { - ApiResponse localVarResp = getXrefByVaddrWithHttpInfo(analysisId, vaddr); - return localVarResp.getData(); - } - - /** - * [Beta] Look up xrefs by virtual address - * **This endpoint is in beta and may change without notice.** - * @param analysisId (required) - * @param vaddr Virtual address to match against xrefs (required) - * @return ApiResponse<BaseResponseXrefResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Xref or analysis cache not found -
- */ - public ApiResponse getXrefByVaddrWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer vaddr) throws ApiException { - okhttp3.Call localVarCall = getXrefByVaddrValidateBeforeCall(analysisId, vaddr, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * [Beta] Look up xrefs by virtual address (asynchronously) - * **This endpoint is in beta and may change without notice.** - * @param analysisId (required) - * @param vaddr Virtual address to match against xrefs (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Xref or analysis cache not found -
- */ - public okhttp3.Call getXrefByVaddrAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer vaddr, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getXrefByVaddrValidateBeforeCall(analysisId, vaddr, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/AuthenticationUsersApi.java b/src/main/java/ai/reveng/api/AuthenticationUsersApi.java deleted file mode 100644 index b996fb8..0000000 --- a/src/main/java/ai/reveng/api/AuthenticationUsersApi.java +++ /dev/null @@ -1,460 +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.BaseResponseGetPublicUserResponse; -import ai.reveng.model.BaseResponseListUserActivityResponse; -import ai.reveng.model.SubmitUserFeedbackRequest; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AuthenticationUsersApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AuthenticationUsersApi() { - this(Configuration.getDefaultApiClient()); - } - - public AuthenticationUsersApi(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 getUser - * @param userId (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 getUserCall(@javax.annotation.Nonnull Integer userId, 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/users/{user_id}" - .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getUserValidateBeforeCall(@javax.annotation.Nonnull Integer userId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userId' is set - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling getUser(Async)"); - } - - return getUserCall(userId, _callback); - - } - - /** - * Get a user's public information - * - * @param userId (required) - * @return BaseResponseGetPublicUserResponse - * @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 BaseResponseGetPublicUserResponse getUser(@javax.annotation.Nonnull Integer userId) throws ApiException { - ApiResponse localVarResp = getUserWithHttpInfo(userId); - return localVarResp.getData(); - } - - /** - * Get a user's public information - * - * @param userId (required) - * @return ApiResponse<BaseResponseGetPublicUserResponse> - * @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 getUserWithHttpInfo(@javax.annotation.Nonnull Integer userId) throws ApiException { - okhttp3.Call localVarCall = getUserValidateBeforeCall(userId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get a user's public information (asynchronously) - * - * @param userId (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 getUserAsync(@javax.annotation.Nonnull Integer userId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getUserValidateBeforeCall(userId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getUserActivity - * @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 getUserActivityCall(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/users/activity"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getUserActivityValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return getUserActivityCall(_callback); - - } - - /** - * Get auth user activity - * - * @return BaseResponseListUserActivityResponse - * @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 BaseResponseListUserActivityResponse getUserActivity() throws ApiException { - ApiResponse localVarResp = getUserActivityWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Get auth user activity - * - * @return ApiResponse<BaseResponseListUserActivityResponse> - * @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 getUserActivityWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getUserActivityValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get auth user activity (asynchronously) - * - * @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 getUserActivityAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getUserActivityValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for submitUserFeedback - * @param submitUserFeedbackRequest (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 submitUserFeedbackCall(@javax.annotation.Nonnull SubmitUserFeedbackRequest submitUserFeedbackRequest, 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 = submitUserFeedbackRequest; - - // create path and map variables - String localVarPath = "/v2/users/feedback"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call submitUserFeedbackValidateBeforeCall(@javax.annotation.Nonnull SubmitUserFeedbackRequest submitUserFeedbackRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'submitUserFeedbackRequest' is set - if (submitUserFeedbackRequest == null) { - throw new ApiException("Missing the required parameter 'submitUserFeedbackRequest' when calling submitUserFeedback(Async)"); - } - - return submitUserFeedbackCall(submitUserFeedbackRequest, _callback); - - } - - /** - * Submit feedback about the application - * Submits feedback about the application and forwards it to the RevEng.ai project management tool. - * @param submitUserFeedbackRequest (required) - * @return BaseResponse - * @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 BaseResponse submitUserFeedback(@javax.annotation.Nonnull SubmitUserFeedbackRequest submitUserFeedbackRequest) throws ApiException { - ApiResponse localVarResp = submitUserFeedbackWithHttpInfo(submitUserFeedbackRequest); - return localVarResp.getData(); - } - - /** - * Submit feedback about the application - * Submits feedback about the application and forwards it to the RevEng.ai project management tool. - * @param submitUserFeedbackRequest (required) - * @return ApiResponse<BaseResponse> - * @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 submitUserFeedbackWithHttpInfo(@javax.annotation.Nonnull SubmitUserFeedbackRequest submitUserFeedbackRequest) throws ApiException { - okhttp3.Call localVarCall = submitUserFeedbackValidateBeforeCall(submitUserFeedbackRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Submit feedback about the application (asynchronously) - * Submits feedback about the application and forwards it to the RevEng.ai project management tool. - * @param submitUserFeedbackRequest (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 submitUserFeedbackAsync(@javax.annotation.Nonnull SubmitUserFeedbackRequest submitUserFeedbackRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = submitUserFeedbackValidateBeforeCall(submitUserFeedbackRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/BinariesApi.java b/src/main/java/ai/reveng/api/BinariesApi.java index e532d65..6dd84f0 100644 --- a/src/main/java/ai/reveng/api/BinariesApi.java +++ b/src/main/java/ai/reveng/api/BinariesApi.java @@ -27,15 +27,6 @@ import ai.reveng.model.APIError; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseAdditionalDetailsStatusResponse; -import ai.reveng.model.BaseResponseBinariesRelatedStatusResponse; -import ai.reveng.model.BaseResponseBinaryAdditionalResponse; -import ai.reveng.model.BaseResponseBinaryDetailsResponse; -import ai.reveng.model.BaseResponseBinaryExternalsResponse; -import ai.reveng.model.BaseResponseChildBinariesResponse; -import ai.reveng.model.BaseResponseListDieMatch; -import java.io.File; import ai.reveng.model.GetAdditionalDetailsOutputBody; import ai.reveng.model.GetAdditionalDetailsStatusOutputBody; @@ -82,141 +73,9 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } - /** - * Build call for downloadZippedBinary - * @param binaryId (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 Download file -
422 Invalid request parameters -
- */ - public okhttp3.Call downloadZippedBinaryCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/binaries/{binary_id}/download-zipped" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/zip", - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call downloadZippedBinaryValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling downloadZippedBinary(Async)"); - } - - return downloadZippedBinaryCall(binaryId, _callback); - - } - - /** - * Downloads a zipped binary with password protection - * - * @param binaryId (required) - * @return File - * @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 Download file -
422 Invalid request parameters -
- */ - public File downloadZippedBinary(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = downloadZippedBinaryWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Downloads a zipped binary with password protection - * - * @param binaryId (required) - * @return ApiResponse<File> - * @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 Download file -
422 Invalid request parameters -
- */ - public ApiResponse downloadZippedBinaryWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = downloadZippedBinaryValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Downloads a zipped binary with password protection (asynchronously) - * - * @param binaryId (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 Download file -
422 Invalid request parameters -
- */ - public okhttp3.Call downloadZippedBinaryAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = downloadZippedBinaryValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getBinaryAdditionalDetails - * @param binaryId (required) + * @param binaryId Binary ID (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -224,13 +83,14 @@ public okhttp3.Call downloadZippedBinaryAsync(@javax.annotation.Nonnull Integer - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call getBinaryAdditionalDetailsCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getBinaryAdditionalDetailsCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -247,7 +107,7 @@ public okhttp3.Call getBinaryAdditionalDetailsCall(@javax.annotation.Nonnull Int Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/binaries/{binary_id}/additional-details" + String localVarPath = "/v3/binaries/{binary_id}/additional-details" .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); List localVarQueryParams = new ArrayList(); @@ -275,9 +135,8 @@ public okhttp3.Call getBinaryAdditionalDetailsCall(@javax.annotation.Nonnull Int return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryAdditionalDetailsValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getBinaryAdditionalDetailsValidateBeforeCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'binaryId' is set if (binaryId == null) { throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryAdditionalDetails(Async)"); @@ -288,52 +147,54 @@ private okhttp3.Call getBinaryAdditionalDetailsValidateBeforeCall(@javax.annotat } /** - * Gets the additional details of a binary - * - * @param binaryId (required) - * @return BaseResponseBinaryAdditionalResponse + * Get additional details for a binary. + * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param binaryId Binary ID (required) + * @return GetAdditionalDetailsOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public BaseResponseBinaryAdditionalResponse getBinaryAdditionalDetails(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryAdditionalDetailsWithHttpInfo(binaryId); + public GetAdditionalDetailsOutputBody getBinaryAdditionalDetails(@javax.annotation.Nonnull Long binaryId) throws ApiException { + ApiResponse localVarResp = getBinaryAdditionalDetailsWithHttpInfo(binaryId); return localVarResp.getData(); } /** - * Gets the additional details of a binary - * - * @param binaryId (required) - * @return ApiResponse<BaseResponseBinaryAdditionalResponse> + * Get additional details for a binary. + * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param binaryId Binary ID (required) + * @return ApiResponse<GetAdditionalDetailsOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public ApiResponse getBinaryAdditionalDetailsWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { + public ApiResponse getBinaryAdditionalDetailsWithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { okhttp3.Call localVarCall = getBinaryAdditionalDetailsValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Gets the additional details of a binary (asynchronously) - * - * @param binaryId (required) + * Get additional details for a binary. (asynchronously) + * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @param binaryId Binary ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -341,161 +202,22 @@ public ApiResponse getBinaryAdditionalDeta - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call getBinaryAdditionalDetailsAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getBinaryAdditionalDetailsAsync(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getBinaryAdditionalDetailsValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getBinaryAdditionalDetailsStatus - * @param binaryId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getBinaryAdditionalDetailsStatusCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/binaries/{binary_id}/additional-details/status" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryAdditionalDetailsStatusValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryAdditionalDetailsStatus(Async)"); - } - - return getBinaryAdditionalDetailsStatusCall(binaryId, _callback); - - } - - /** - * Gets the status of the additional details task for a binary - * - * @param binaryId (required) - * @return BaseResponseAdditionalDetailsStatusResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseAdditionalDetailsStatusResponse getBinaryAdditionalDetailsStatus(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryAdditionalDetailsStatusWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Gets the status of the additional details task for a binary - * - * @param binaryId (required) - * @return ApiResponse<BaseResponseAdditionalDetailsStatusResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getBinaryAdditionalDetailsStatusWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatusValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the status of the additional details task for a binary (asynchronously) - * - * @param binaryId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getBinaryAdditionalDetailsStatusAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatusValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getBinaryAdditionalDetailsStatus_0 * @param binaryId Binary ID (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -511,7 +233,7 @@ public okhttp3.Call getBinaryAdditionalDetailsStatusAsync(@javax.annotation.Nonn 500 Internal Server Error - */ - public okhttp3.Call getBinaryAdditionalDetailsStatus_0Call(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getBinaryAdditionalDetailsStatusCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -557,13 +279,13 @@ public okhttp3.Call getBinaryAdditionalDetailsStatus_0Call(@javax.annotation.Non } @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryAdditionalDetailsStatus_0ValidateBeforeCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getBinaryAdditionalDetailsStatusValidateBeforeCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'binaryId' is set if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryAdditionalDetailsStatus_0(Async)"); + throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryAdditionalDetailsStatus(Async)"); } - return getBinaryAdditionalDetailsStatus_0Call(binaryId, _callback); + return getBinaryAdditionalDetailsStatusCall(binaryId, _callback); } @@ -584,8 +306,8 @@ private okhttp3.Call getBinaryAdditionalDetailsStatus_0ValidateBeforeCall(@javax 500 Internal Server Error - */ - public GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus_0(@javax.annotation.Nonnull Long binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryAdditionalDetailsStatus_0WithHttpInfo(binaryId); + public GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus(@javax.annotation.Nonnull Long binaryId) throws ApiException { + ApiResponse localVarResp = getBinaryAdditionalDetailsStatusWithHttpInfo(binaryId); return localVarResp.getData(); } @@ -606,8 +328,8 @@ public GetAdditionalDetailsStatusOutputBody getBinaryAdditionalDetailsStatus_0(@ 500 Internal Server Error - */ - public ApiResponse getBinaryAdditionalDetailsStatus_0WithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatus_0ValidateBeforeCall(binaryId, null); + public ApiResponse getBinaryAdditionalDetailsStatusWithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { + okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatusValidateBeforeCall(binaryId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -630,813 +352,11 @@ public ApiResponse getBinaryAdditionalDeta 500 Internal Server Error - */ - public okhttp3.Call getBinaryAdditionalDetailsStatus_0Async(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getBinaryAdditionalDetailsStatusAsync(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatus_0ValidateBeforeCall(binaryId, _callback); + okhttp3.Call localVarCall = getBinaryAdditionalDetailsStatusValidateBeforeCall(binaryId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for getBinaryAdditionalDetails_0 - * @param binaryId Binary ID (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getBinaryAdditionalDetails_0Call(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v3/binaries/{binary_id}/additional-details" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryAdditionalDetails_0ValidateBeforeCall(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryAdditionalDetails_0(Async)"); - } - - return getBinaryAdditionalDetails_0Call(binaryId, _callback); - - } - - /** - * Get additional details for a binary. - * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param binaryId Binary ID (required) - * @return GetAdditionalDetailsOutputBody - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public GetAdditionalDetailsOutputBody getBinaryAdditionalDetails_0(@javax.annotation.Nonnull Long binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryAdditionalDetails_0WithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Get additional details for a binary. - * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param binaryId Binary ID (required) - * @return ApiResponse<GetAdditionalDetailsOutputBody> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse getBinaryAdditionalDetails_0WithHttpInfo(@javax.annotation.Nonnull Long binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryAdditionalDetails_0ValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get additional details for a binary. (asynchronously) - * Returns structured metadata extracted by the additional-details pipeline for the given binary. Returns `null` for `details` when the pipeline has not yet run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param binaryId Binary ID (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getBinaryAdditionalDetails_0Async(@javax.annotation.Nonnull Long binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinaryAdditionalDetails_0ValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getBinaryDetails - * @param binaryId (required) - * @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 getBinaryDetailsCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/binaries/{binary_id}/details" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryDetailsValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryDetails(Async)"); - } - - return getBinaryDetailsCall(binaryId, _callback); - - } - - /** - * Gets the details of a binary - * - * @param binaryId (required) - * @return BaseResponseBinaryDetailsResponse - * @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 BaseResponseBinaryDetailsResponse getBinaryDetails(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryDetailsWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Gets the details of a binary - * - * @param binaryId (required) - * @return ApiResponse<BaseResponseBinaryDetailsResponse> - * @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 getBinaryDetailsWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryDetailsValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the details of a binary (asynchronously) - * - * @param binaryId (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 getBinaryDetailsAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinaryDetailsValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getBinaryDieInfo - * @param binaryId (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 getBinaryDieInfoCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/binaries/{binary_id}/die-info" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryDieInfoValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryDieInfo(Async)"); - } - - return getBinaryDieInfoCall(binaryId, _callback); - - } - - /** - * Gets the die info of a binary - * - * @param binaryId (required) - * @return BaseResponseListDieMatch - * @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 BaseResponseListDieMatch getBinaryDieInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryDieInfoWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Gets the die info of a binary - * - * @param binaryId (required) - * @return ApiResponse<BaseResponseListDieMatch> - * @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 getBinaryDieInfoWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryDieInfoValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the die info of a binary (asynchronously) - * - * @param binaryId (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 getBinaryDieInfoAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinaryDieInfoValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getBinaryExternals - * @param binaryId (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 getBinaryExternalsCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/binaries/{binary_id}/externals" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryExternalsValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryExternals(Async)"); - } - - return getBinaryExternalsCall(binaryId, _callback); - - } - - /** - * Gets the external details of a binary - * - * @param binaryId (required) - * @return BaseResponseBinaryExternalsResponse - * @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 BaseResponseBinaryExternalsResponse getBinaryExternals(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryExternalsWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Gets the external details of a binary - * - * @param binaryId (required) - * @return ApiResponse<BaseResponseBinaryExternalsResponse> - * @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 getBinaryExternalsWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryExternalsValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the external details of a binary (asynchronously) - * - * @param binaryId (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 getBinaryExternalsAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinaryExternalsValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getBinaryRelatedStatus - * @param binaryId (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 getBinaryRelatedStatusCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/binaries/{binary_id}/related/status" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinaryRelatedStatusValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling getBinaryRelatedStatus(Async)"); - } - - return getBinaryRelatedStatusCall(binaryId, _callback); - - } - - /** - * Gets the status of the unpack binary task for a binary - * - * @param binaryId (required) - * @return BaseResponseBinariesRelatedStatusResponse - * @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 BaseResponseBinariesRelatedStatusResponse getBinaryRelatedStatus(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = getBinaryRelatedStatusWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Gets the status of the unpack binary task for a binary - * - * @param binaryId (required) - * @return ApiResponse<BaseResponseBinariesRelatedStatusResponse> - * @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 getBinaryRelatedStatusWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = getBinaryRelatedStatusValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the status of the unpack binary task for a binary (asynchronously) - * - * @param binaryId (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 getBinaryRelatedStatusAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinaryRelatedStatusValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getRelatedBinaries - * @param binaryId (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 -
403 Forbidden -
- */ - public okhttp3.Call getRelatedBinariesCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/binaries/{binary_id}/related" - .replace("{" + "binary_id" + "}", localVarApiClient.escapeString(binaryId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getRelatedBinariesValidateBeforeCall(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'binaryId' is set - if (binaryId == null) { - throw new ApiException("Missing the required parameter 'binaryId' when calling getRelatedBinaries(Async)"); - } - - return getRelatedBinariesCall(binaryId, _callback); - - } - - /** - * Gets the related binaries of a binary. - * - * @param binaryId (required) - * @return BaseResponseChildBinariesResponse - * @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 -
403 Forbidden -
- */ - public BaseResponseChildBinariesResponse getRelatedBinaries(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - ApiResponse localVarResp = getRelatedBinariesWithHttpInfo(binaryId); - return localVarResp.getData(); - } - - /** - * Gets the related binaries of a binary. - * - * @param binaryId (required) - * @return ApiResponse<BaseResponseChildBinariesResponse> - * @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 -
403 Forbidden -
- */ - public ApiResponse getRelatedBinariesWithHttpInfo(@javax.annotation.Nonnull Integer binaryId) throws ApiException { - okhttp3.Call localVarCall = getRelatedBinariesValidateBeforeCall(binaryId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets the related binaries of a binary. (asynchronously) - * - * @param binaryId (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 -
403 Forbidden -
- */ - public okhttp3.Call getRelatedBinariesAsync(@javax.annotation.Nonnull Integer binaryId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getRelatedBinariesValidateBeforeCall(binaryId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } } diff --git a/src/main/java/ai/reveng/api/CollectionsApi.java b/src/main/java/ai/reveng/api/CollectionsApi.java index 0e2274c..7348bb5 100644 --- a/src/main/java/ai/reveng/api/CollectionsApi.java +++ b/src/main/java/ai/reveng/api/CollectionsApi.java @@ -27,23 +27,10 @@ import ai.reveng.model.APIError; -import ai.reveng.model.AppApiRestV2CollectionsEnumsOrderBy; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseBool; -import ai.reveng.model.BaseResponseCollectionBinariesUpdateResponse; -import ai.reveng.model.BaseResponseCollectionResponse; -import ai.reveng.model.BaseResponseCollectionTagsUpdateResponse; -import ai.reveng.model.BaseResponseListCollectionResults; -import ai.reveng.model.CollectionBinariesUpdateRequest; -import ai.reveng.model.CollectionCreateRequest; -import ai.reveng.model.CollectionTagsUpdateRequest; -import ai.reveng.model.CollectionUpdateRequest; import ai.reveng.model.CreateCollectionInputBody; import ai.reveng.model.CreateCollectionOutputBody; -import ai.reveng.model.Filters; import ai.reveng.model.GetCollectionOutputBody; import ai.reveng.model.ListCollectionsOutputBody; -import ai.reveng.model.Order; import ai.reveng.model.PatchCollectionBinariesInputBody; import ai.reveng.model.PatchCollectionBinariesOutputBody; import ai.reveng.model.PatchCollectionInputBody; @@ -94,1094 +81,6 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } - /** - * Build call for createCollection - * @param collectionCreateRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call createCollectionCall(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest, 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 = collectionCreateRequest; - - // create path and map variables - String localVarPath = "/v2/collections"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call createCollectionValidateBeforeCall(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'collectionCreateRequest' is set - if (collectionCreateRequest == null) { - throw new ApiException("Missing the required parameter 'collectionCreateRequest' when calling createCollection(Async)"); - } - - return createCollectionCall(collectionCreateRequest, _callback); - - } - - /** - * Creates new collection information - * A collection is a group of binaries that are related in some way. This endpoint creates a new collection and allows you to add tags and binaries to it. If you add tags or binaries to the collection, they will be returned in the response. - * @param collectionCreateRequest (required) - * @return BaseResponseCollectionResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseCollectionResponse createCollection(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest) throws ApiException { - ApiResponse localVarResp = createCollectionWithHttpInfo(collectionCreateRequest); - return localVarResp.getData(); - } - - /** - * Creates new collection information - * A collection is a group of binaries that are related in some way. This endpoint creates a new collection and allows you to add tags and binaries to it. If you add tags or binaries to the collection, they will be returned in the response. - * @param collectionCreateRequest (required) - * @return ApiResponse<BaseResponseCollectionResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse createCollectionWithHttpInfo(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest) throws ApiException { - okhttp3.Call localVarCall = createCollectionValidateBeforeCall(collectionCreateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Creates new collection information (asynchronously) - * A collection is a group of binaries that are related in some way. This endpoint creates a new collection and allows you to add tags and binaries to it. If you add tags or binaries to the collection, they will be returned in the response. - * @param collectionCreateRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call createCollectionAsync(@javax.annotation.Nonnull CollectionCreateRequest collectionCreateRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createCollectionValidateBeforeCall(collectionCreateRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteCollection - * @param collectionId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call deleteCollectionCall(@javax.annotation.Nonnull Integer collectionId, 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/collections/{collection_id}" - .replace("{" + "collection_id" + "}", localVarApiClient.escapeString(collectionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteCollectionValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new ApiException("Missing the required parameter 'collectionId' when calling deleteCollection(Async)"); - } - - return deleteCollectionCall(collectionId, _callback); - - } - - /** - * Deletes a collection - * Deletes a collection - * @param collectionId (required) - * @return BaseResponseBool - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseBool deleteCollection(@javax.annotation.Nonnull Integer collectionId) throws ApiException { - ApiResponse localVarResp = deleteCollectionWithHttpInfo(collectionId); - return localVarResp.getData(); - } - - /** - * Deletes a collection - * Deletes a collection - * @param collectionId (required) - * @return ApiResponse<BaseResponseBool> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse deleteCollectionWithHttpInfo(@javax.annotation.Nonnull Integer collectionId) throws ApiException { - okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Deletes a collection (asynchronously) - * Deletes a collection - * @param collectionId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call deleteCollectionAsync(@javax.annotation.Nonnull Integer collectionId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getCollection - * @param collectionId (required) - * @param includeTags (optional, default to false) - * @param includeBinaries (optional, default to false) - * @param pageSize (optional, default to 10) - * @param pageNumber (optional, default to 1) - * @param binarySearchStr (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getCollectionCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr, 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/collections/{collection_id}" - .replace("{" + "collection_id" + "}", localVarApiClient.escapeString(collectionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (includeTags != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_tags", includeTags)); - } - - if (includeBinaries != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_binaries", includeBinaries)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (pageNumber != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_number", pageNumber)); - } - - if (binarySearchStr != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("binary_search_str", binarySearchStr)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getCollectionValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new ApiException("Missing the required parameter 'collectionId' when calling getCollection(Async)"); - } - - return getCollectionCall(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr, _callback); - - } - - /** - * Returns a collection - * Gets a single collection. The collection can include binaries and tags if requested. You can specify whether to include tags and binaries in the response by using the query string parameters defined. - * @param collectionId (required) - * @param includeTags (optional, default to false) - * @param includeBinaries (optional, default to false) - * @param pageSize (optional, default to 10) - * @param pageNumber (optional, default to 1) - * @param binarySearchStr (optional) - * @return BaseResponseCollectionResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseCollectionResponse getCollection(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr) throws ApiException { - ApiResponse localVarResp = getCollectionWithHttpInfo(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr); - return localVarResp.getData(); - } - - /** - * Returns a collection - * Gets a single collection. The collection can include binaries and tags if requested. You can specify whether to include tags and binaries in the response by using the query string parameters defined. - * @param collectionId (required) - * @param includeTags (optional, default to false) - * @param includeBinaries (optional, default to false) - * @param pageSize (optional, default to 10) - * @param pageNumber (optional, default to 1) - * @param binarySearchStr (optional) - * @return ApiResponse<BaseResponseCollectionResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getCollectionWithHttpInfo(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr) throws ApiException { - okhttp3.Call localVarCall = getCollectionValidateBeforeCall(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Returns a collection (asynchronously) - * Gets a single collection. The collection can include binaries and tags if requested. You can specify whether to include tags and binaries in the response by using the query string parameters defined. - * @param collectionId (required) - * @param includeTags (optional, default to false) - * @param includeBinaries (optional, default to false) - * @param pageSize (optional, default to 10) - * @param pageNumber (optional, default to 1) - * @param binarySearchStr (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getCollectionAsync(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable String binarySearchStr, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getCollectionValidateBeforeCall(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for listCollections - * @param searchTerm (optional, default to ) - * @param filters (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional, default to collection) - * @param order (optional, default to ASC) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call listCollectionsCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/collections"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (searchTerm != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_term", searchTerm)); - } - - if (filters != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filters", filters)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); - } - - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } - - if (order != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call listCollectionsValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { - return listCollectionsCall(searchTerm, filters, limit, offset, orderBy, order, _callback); - - } - - /** - * Gets basic collections information - * Returns a list of collections - * @param searchTerm (optional, default to ) - * @param filters (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional, default to collection) - * @param order (optional, default to ASC) - * @return BaseResponseListCollectionResults - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseListCollectionResults listCollections(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { - ApiResponse localVarResp = listCollectionsWithHttpInfo(searchTerm, filters, limit, offset, orderBy, order); - return localVarResp.getData(); - } - - /** - * Gets basic collections information - * Returns a list of collections - * @param searchTerm (optional, default to ) - * @param filters (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional, default to collection) - * @param order (optional, default to ASC) - * @return ApiResponse<BaseResponseListCollectionResults> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse listCollectionsWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order) throws ApiException { - okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(searchTerm, filters, limit, offset, orderBy, order, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets basic collections information (asynchronously) - * Returns a list of collections - * @param searchTerm (optional, default to ) - * @param filters (optional) - * @param limit (optional, default to 20) - * @param offset (optional, default to 0) - * @param orderBy (optional, default to collection) - * @param order (optional, default to ASC) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call listCollectionsAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Integer limit, @javax.annotation.Nullable Integer offset, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order order, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(searchTerm, filters, limit, offset, orderBy, order, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateCollection - * @param collectionId (required) - * @param collectionUpdateRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call updateCollectionCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest, 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 = collectionUpdateRequest; - - // create path and map variables - String localVarPath = "/v2/collections/{collection_id}" - .replace("{" + "collection_id" + "}", localVarApiClient.escapeString(collectionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call updateCollectionValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new ApiException("Missing the required parameter 'collectionId' when calling updateCollection(Async)"); - } - - // verify the required parameter 'collectionUpdateRequest' is set - if (collectionUpdateRequest == null) { - throw new ApiException("Missing the required parameter 'collectionUpdateRequest' when calling updateCollection(Async)"); - } - - return updateCollectionCall(collectionId, collectionUpdateRequest, _callback); - - } - - /** - * Updates a collection - * Updates a collection, you can update the collection name, description, and scope - * @param collectionId (required) - * @param collectionUpdateRequest (required) - * @return BaseResponseCollectionResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseCollectionResponse updateCollection(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest) throws ApiException { - ApiResponse localVarResp = updateCollectionWithHttpInfo(collectionId, collectionUpdateRequest); - return localVarResp.getData(); - } - - /** - * Updates a collection - * Updates a collection, you can update the collection name, description, and scope - * @param collectionId (required) - * @param collectionUpdateRequest (required) - * @return ApiResponse<BaseResponseCollectionResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse updateCollectionWithHttpInfo(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest) throws ApiException { - okhttp3.Call localVarCall = updateCollectionValidateBeforeCall(collectionId, collectionUpdateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Updates a collection (asynchronously) - * Updates a collection, you can update the collection name, description, and scope - * @param collectionId (required) - * @param collectionUpdateRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call updateCollectionAsync(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionUpdateRequest collectionUpdateRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateCollectionValidateBeforeCall(collectionId, collectionUpdateRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateCollectionBinaries - * @param collectionId (required) - * @param collectionBinariesUpdateRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call updateCollectionBinariesCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest, 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 = collectionBinariesUpdateRequest; - - // create path and map variables - String localVarPath = "/v2/collections/{collection_id}/binaries" - .replace("{" + "collection_id" + "}", localVarApiClient.escapeString(collectionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call updateCollectionBinariesValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new ApiException("Missing the required parameter 'collectionId' when calling updateCollectionBinaries(Async)"); - } - - // verify the required parameter 'collectionBinariesUpdateRequest' is set - if (collectionBinariesUpdateRequest == null) { - throw new ApiException("Missing the required parameter 'collectionBinariesUpdateRequest' when calling updateCollectionBinaries(Async)"); - } - - return updateCollectionBinariesCall(collectionId, collectionBinariesUpdateRequest, _callback); - - } - - /** - * Updates a collection binaries - * Updates/changes a collection binaries to whatever is provided in the request. After this update the collection will only contain the binaries provided in the request. - * @param collectionId (required) - * @param collectionBinariesUpdateRequest (required) - * @return BaseResponseCollectionBinariesUpdateResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseCollectionBinariesUpdateResponse updateCollectionBinaries(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest) throws ApiException { - ApiResponse localVarResp = updateCollectionBinariesWithHttpInfo(collectionId, collectionBinariesUpdateRequest); - return localVarResp.getData(); - } - - /** - * Updates a collection binaries - * Updates/changes a collection binaries to whatever is provided in the request. After this update the collection will only contain the binaries provided in the request. - * @param collectionId (required) - * @param collectionBinariesUpdateRequest (required) - * @return ApiResponse<BaseResponseCollectionBinariesUpdateResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse updateCollectionBinariesWithHttpInfo(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest) throws ApiException { - okhttp3.Call localVarCall = updateCollectionBinariesValidateBeforeCall(collectionId, collectionBinariesUpdateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Updates a collection binaries (asynchronously) - * Updates/changes a collection binaries to whatever is provided in the request. After this update the collection will only contain the binaries provided in the request. - * @param collectionId (required) - * @param collectionBinariesUpdateRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call updateCollectionBinariesAsync(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionBinariesUpdateRequest collectionBinariesUpdateRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateCollectionBinariesValidateBeforeCall(collectionId, collectionBinariesUpdateRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateCollectionTags - * @param collectionId (required) - * @param collectionTagsUpdateRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call updateCollectionTagsCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest, 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 = collectionTagsUpdateRequest; - - // create path and map variables - String localVarPath = "/v2/collections/{collection_id}/tags" - .replace("{" + "collection_id" + "}", localVarApiClient.escapeString(collectionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call updateCollectionTagsValidateBeforeCall(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'collectionId' is set - if (collectionId == null) { - throw new ApiException("Missing the required parameter 'collectionId' when calling updateCollectionTags(Async)"); - } - - // verify the required parameter 'collectionTagsUpdateRequest' is set - if (collectionTagsUpdateRequest == null) { - throw new ApiException("Missing the required parameter 'collectionTagsUpdateRequest' when calling updateCollectionTags(Async)"); - } - - return updateCollectionTagsCall(collectionId, collectionTagsUpdateRequest, _callback); - - } - - /** - * Updates a collection tags - * Updates/changes a collection tags to whatever is provided in the request. After this update the collection will only contain the tags provided in the request. - * @param collectionId (required) - * @param collectionTagsUpdateRequest (required) - * @return BaseResponseCollectionTagsUpdateResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseCollectionTagsUpdateResponse updateCollectionTags(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest) throws ApiException { - ApiResponse localVarResp = updateCollectionTagsWithHttpInfo(collectionId, collectionTagsUpdateRequest); - return localVarResp.getData(); - } - - /** - * Updates a collection tags - * Updates/changes a collection tags to whatever is provided in the request. After this update the collection will only contain the tags provided in the request. - * @param collectionId (required) - * @param collectionTagsUpdateRequest (required) - * @return ApiResponse<BaseResponseCollectionTagsUpdateResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse updateCollectionTagsWithHttpInfo(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest) throws ApiException { - okhttp3.Call localVarCall = updateCollectionTagsValidateBeforeCall(collectionId, collectionTagsUpdateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Updates a collection tags (asynchronously) - * Updates/changes a collection tags to whatever is provided in the request. After this update the collection will only contain the tags provided in the request. - * @param collectionId (required) - * @param collectionTagsUpdateRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call updateCollectionTagsAsync(@javax.annotation.Nonnull Integer collectionId, @javax.annotation.Nonnull CollectionTagsUpdateRequest collectionTagsUpdateRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateCollectionTagsValidateBeforeCall(collectionId, collectionTagsUpdateRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for v3CreateCollection * @param createCollectionInputBody (required) diff --git a/src/main/java/ai/reveng/api/ConfigApi.java b/src/main/java/ai/reveng/api/ConfigApi.java deleted file mode 100644 index 207e5e1..0000000 --- a/src/main/java/ai/reveng/api/ConfigApi.java +++ /dev/null @@ -1,196 +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.BaseResponseConfigResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ConfigApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ConfigApi() { - this(Configuration.getDefaultApiClient()); - } - - public ConfigApi(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 getConfig - * @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 getConfigCall(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/config"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return getConfigCall(_callback); - - } - - /** - * Get Config - * General configuration endpoint - * @return BaseResponseConfigResponse - * @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 BaseResponseConfigResponse getConfig() throws ApiException { - ApiResponse localVarResp = getConfigWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Get Config - * General configuration endpoint - * @return ApiResponse<BaseResponseConfigResponse> - * @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 getConfigWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getConfigValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Config (asynchronously) - * General configuration endpoint - * @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 getConfigAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getConfigValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/ExternalSourcesApi.java b/src/main/java/ai/reveng/api/ExternalSourcesApi.java deleted file mode 100644 index 475633f..0000000 --- a/src/main/java/ai/reveng/api/ExternalSourcesApi.java +++ /dev/null @@ -1,478 +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.BaseResponseExternalResponse; -import ai.reveng.model.BaseResponseStr; -import ai.reveng.model.BaseResponseTaskResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ExternalSourcesApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ExternalSourcesApi() { - this(Configuration.getDefaultApiClient()); - } - - public ExternalSourcesApi(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 createExternalTaskVt - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
409 Request already queued -
- */ - public okhttp3.Call createExternalTaskVtCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analysis/{analysis_id}/external/vt" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createExternalTaskVtValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling createExternalTaskVt(Async)"); - } - - return createExternalTaskVtCall(analysisId, _callback); - - } - - /** - * Pulls data from VirusTotal - * - * @param analysisId (required) - * @return BaseResponseStr - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
409 Request already queued -
- */ - public BaseResponseStr createExternalTaskVt(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = createExternalTaskVtWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Pulls data from VirusTotal - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseStr> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
409 Request already queued -
- */ - public ApiResponse createExternalTaskVtWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = createExternalTaskVtValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Pulls data from VirusTotal (asynchronously) - * - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
202 Successful Response -
422 Invalid request parameters -
409 Request already queued -
- */ - public okhttp3.Call createExternalTaskVtAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createExternalTaskVtValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getVtData - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 No data retrieved from VirusTotal for the given analysis_id -
- */ - public okhttp3.Call getVtDataCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analysis/{analysis_id}/external/vt" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getVtDataValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getVtData(Async)"); - } - - return getVtDataCall(analysisId, _callback); - - } - - /** - * Get VirusTotal data - * - * @param analysisId (required) - * @return BaseResponseExternalResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 No data retrieved from VirusTotal for the given analysis_id -
- */ - public BaseResponseExternalResponse getVtData(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getVtDataWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get VirusTotal data - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseExternalResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 No data retrieved from VirusTotal for the given analysis_id -
- */ - public ApiResponse getVtDataWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getVtDataValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get VirusTotal data (asynchronously) - * - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 No data retrieved from VirusTotal for the given analysis_id -
- */ - public okhttp3.Call getVtDataAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getVtDataValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getVtTaskStatus - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call getVtTaskStatusCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analysis/{analysis_id}/external/vt/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getVtTaskStatusValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getVtTaskStatus(Async)"); - } - - return getVtTaskStatusCall(analysisId, _callback); - - } - - /** - * Check the status of VirusTotal data retrieval - * - * @param analysisId (required) - * @return BaseResponseTaskResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponseTaskResponse getVtTaskStatus(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getVtTaskStatusWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Check the status of VirusTotal data retrieval - * - * @param analysisId (required) - * @return ApiResponse<BaseResponseTaskResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse getVtTaskStatusWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getVtTaskStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Check the status of VirusTotal data retrieval (asynchronously) - * - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call getVtTaskStatusAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getVtTaskStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/FirmwareApi.java b/src/main/java/ai/reveng/api/FirmwareApi.java deleted file mode 100644 index f20d8d6..0000000 --- a/src/main/java/ai/reveng/api/FirmwareApi.java +++ /dev/null @@ -1,353 +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 java.io.File; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FirmwareApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public FirmwareApi() { - this(Configuration.getDefaultApiClient()); - } - - public FirmwareApi(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 getBinariesForFirmwareTask - * @param taskId (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 getBinariesForFirmwareTaskCall(@javax.annotation.Nonnull String taskId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/firmware/get-binaries/{task_id}" - .replace("{" + "task_id" + "}", localVarApiClient.escapeString(taskId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getBinariesForFirmwareTaskValidateBeforeCall(@javax.annotation.Nonnull String taskId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'taskId' is set - if (taskId == null) { - throw new ApiException("Missing the required parameter 'taskId' when calling getBinariesForFirmwareTask(Async)"); - } - - return getBinariesForFirmwareTaskCall(taskId, _callback); - - } - - /** - * Upload firmware for unpacking - * Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response. - * @param taskId (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 getBinariesForFirmwareTask(@javax.annotation.Nonnull String taskId) throws ApiException { - ApiResponse localVarResp = getBinariesForFirmwareTaskWithHttpInfo(taskId); - return localVarResp.getData(); - } - - /** - * Upload firmware for unpacking - * Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response. - * @param taskId (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 getBinariesForFirmwareTaskWithHttpInfo(@javax.annotation.Nonnull String taskId) throws ApiException { - okhttp3.Call localVarCall = getBinariesForFirmwareTaskValidateBeforeCall(taskId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Upload firmware for unpacking (asynchronously) - * Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response. - * @param taskId (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 getBinariesForFirmwareTaskAsync(@javax.annotation.Nonnull String taskId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getBinariesForFirmwareTaskValidateBeforeCall(taskId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for uploadFirmware - * @param _file (required) - * @param password (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
201 Successful Response -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call uploadFirmwareCall(@javax.annotation.Nonnull File _file, @javax.annotation.Nullable String password, 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/firmware"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (_file != null) { - localVarFormParams.put("file", _file); - } - - if (password != null) { - localVarFormParams.put("password", password); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call uploadFirmwareValidateBeforeCall(@javax.annotation.Nonnull File _file, @javax.annotation.Nullable String password, final ApiCallback _callback) throws ApiException { - // verify the required parameter '_file' is set - if (_file == null) { - throw new ApiException("Missing the required parameter '_file' when calling uploadFirmware(Async)"); - } - - return uploadFirmwareCall(_file, password, _callback); - - } - - /** - * Upload firmware for unpacking - * Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response. - * @param _file (required) - * @param password (optional) - * @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
201 Successful Response -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public Object uploadFirmware(@javax.annotation.Nonnull File _file, @javax.annotation.Nullable String password) throws ApiException { - ApiResponse localVarResp = uploadFirmwareWithHttpInfo(_file, password); - return localVarResp.getData(); - } - - /** - * Upload firmware for unpacking - * Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response. - * @param _file (required) - * @param password (optional) - * @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
201 Successful Response -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse uploadFirmwareWithHttpInfo(@javax.annotation.Nonnull File _file, @javax.annotation.Nullable String password) throws ApiException { - okhttp3.Call localVarCall = uploadFirmwareValidateBeforeCall(_file, password, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Upload firmware for unpacking (asynchronously) - * Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response. - * @param _file (required) - * @param password (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
201 Successful Response -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call uploadFirmwareAsync(@javax.annotation.Nonnull File _file, @javax.annotation.Nullable String password, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = uploadFirmwareValidateBeforeCall(_file, password, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java b/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java index 82b6100..8135fb3 100644 --- a/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java +++ b/src/main/java/ai/reveng/api/FunctionsAiDecompilationApi.java @@ -27,8 +27,6 @@ import ai.reveng.model.APIError; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseUnionGetAiDecompilationRatingResponseNoneType; import ai.reveng.model.CommentsData; import ai.reveng.model.CreateAIDecompOutputBody; import ai.reveng.model.DecompilationData; @@ -37,7 +35,6 @@ import ai.reveng.model.ServerSentEventsInner1; import ai.reveng.model.SummaryData; import ai.reveng.model.TokenisedData; -import ai.reveng.model.UpsertAiDecomplationRatingRequest; import ai.reveng.model.UpsertOverridesData; import ai.reveng.model.UpsertOverridesInputBody; import ai.reveng.model.WorkflowProgress; @@ -834,137 +831,6 @@ public okhttp3.Call getAiDecompilationInlineCommentsStatusAsync(@javax.annotatio localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for getAiDecompilationRating - * @param functionId The ID of the function for which to get the rating (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 getAiDecompilationRatingCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/functions/{function_id}/ai-decompilation/rating" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAiDecompilationRatingValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getAiDecompilationRating(Async)"); - } - - return getAiDecompilationRatingCall(functionId, _callback); - - } - - /** - * Get rating for AI decompilation - * - * @param functionId The ID of the function for which to get the rating (required) - * @return BaseResponseUnionGetAiDecompilationRatingResponseNoneType - * @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 BaseResponseUnionGetAiDecompilationRatingResponseNoneType getAiDecompilationRating(@javax.annotation.Nonnull Long functionId) throws ApiException { - ApiResponse localVarResp = getAiDecompilationRatingWithHttpInfo(functionId); - return localVarResp.getData(); - } - - /** - * Get rating for AI decompilation - * - * @param functionId The ID of the function for which to get the rating (required) - * @return ApiResponse<BaseResponseUnionGetAiDecompilationRatingResponseNoneType> - * @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 getAiDecompilationRatingWithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { - okhttp3.Call localVarCall = getAiDecompilationRatingValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get rating for AI decompilation (asynchronously) - * - * @param functionId The ID of the function for which to get the rating (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 getAiDecompilationRatingAsync(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAiDecompilationRatingValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getAiDecompilationStatus * @param functionId Function ID (required) @@ -2265,145 +2131,4 @@ public okhttp3.Call upsertAiDecompilationOverridesAsync(@javax.annotation.Nonnul localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for upsertAiDecompilationRating - * @param functionId The ID of the function being rated (required) - * @param upsertAiDecomplationRatingRequest (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call upsertAiDecompilationRatingCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull UpsertAiDecomplationRatingRequest upsertAiDecomplationRatingRequest, 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 = upsertAiDecomplationRatingRequest; - - // create path and map variables - String localVarPath = "/v2/functions/{function_id}/ai-decompilation/rating" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call upsertAiDecompilationRatingValidateBeforeCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull UpsertAiDecomplationRatingRequest upsertAiDecomplationRatingRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling upsertAiDecompilationRating(Async)"); - } - - // verify the required parameter 'upsertAiDecomplationRatingRequest' is set - if (upsertAiDecomplationRatingRequest == null) { - throw new ApiException("Missing the required parameter 'upsertAiDecomplationRatingRequest' when calling upsertAiDecompilationRating(Async)"); - } - - return upsertAiDecompilationRatingCall(functionId, upsertAiDecomplationRatingRequest, _callback); - - } - - /** - * Upsert rating for AI decompilation - * - * @param functionId The ID of the function being rated (required) - * @param upsertAiDecomplationRatingRequest (required) - * @return BaseResponse - * @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 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponse upsertAiDecompilationRating(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull UpsertAiDecomplationRatingRequest upsertAiDecomplationRatingRequest) throws ApiException { - ApiResponse localVarResp = upsertAiDecompilationRatingWithHttpInfo(functionId, upsertAiDecomplationRatingRequest); - return localVarResp.getData(); - } - - /** - * Upsert rating for AI decompilation - * - * @param functionId The ID of the function being rated (required) - * @param upsertAiDecomplationRatingRequest (required) - * @return ApiResponse<BaseResponse> - * @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 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse upsertAiDecompilationRatingWithHttpInfo(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull UpsertAiDecomplationRatingRequest upsertAiDecomplationRatingRequest) throws ApiException { - okhttp3.Call localVarCall = upsertAiDecompilationRatingValidateBeforeCall(functionId, upsertAiDecomplationRatingRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Upsert rating for AI decompilation (asynchronously) - * - * @param functionId The ID of the function being rated (required) - * @param upsertAiDecomplationRatingRequest (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call upsertAiDecompilationRatingAsync(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull UpsertAiDecomplationRatingRequest upsertAiDecomplationRatingRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = upsertAiDecompilationRatingValidateBeforeCall(functionId, upsertAiDecomplationRatingRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } } diff --git a/src/main/java/ai/reveng/api/FunctionsCoreApi.java b/src/main/java/ai/reveng/api/FunctionsCoreApi.java index fa15ebe..06d5dc6 100644 --- a/src/main/java/ai/reveng/api/FunctionsCoreApi.java +++ b/src/main/java/ai/reveng/api/FunctionsCoreApi.java @@ -29,15 +29,6 @@ import ai.reveng.model.APIError; import ai.reveng.model.AddCalleeInputBody; import ai.reveng.model.AddUserStringToFunctionInputBody; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseAnalysisStringsResponse; -import ai.reveng.model.BaseResponseAnalysisStringsStatusResponse; -import ai.reveng.model.BaseResponseCalleesCallerFunctionsResponse; -import ai.reveng.model.BaseResponseFunctionBlocksResponse; -import ai.reveng.model.BaseResponseFunctionCapabilityResponse; -import ai.reveng.model.BaseResponseFunctionStringsResponse; -import ai.reveng.model.BaseResponseFunctionsDetailResponse; -import ai.reveng.model.BaseResponseListCalleesCallerFunctionsResponse; import ai.reveng.model.CallEdgesOutputBody; import ai.reveng.model.CanonicalizeNamesInputBody; import ai.reveng.model.CanonicalizeNamesOutputBody; @@ -408,1028 +399,11 @@ public okhttp3.Call addUserStringToFunctionAsync(@javax.annotation.Nonnull Long return localVarCall; } /** - * Build call for getAnalysisStrings - * @param analysisId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 100) - * @param search Search is applied to string value (optional) - * @param functionSearch Search is applied to function names (optional) - * @param orderBy Order by field (optional, default to value) - * @param sortOrder Sort order for the results (optional, default to ASC) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getAnalysisStringsCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - 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}/functions/strings" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (search != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); - } - - if (functionSearch != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("function_search", functionSearch)); - } - - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } - - if (sortOrder != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort_order", sortOrder)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisStrings(Async)"); - } - - return getAnalysisStringsCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); - - } - - /** - * Get string information found in the Analysis - * Get string information found in the analysis - * @param analysisId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 100) - * @param search Search is applied to string value (optional) - * @param functionSearch Search is applied to function names (optional) - * @param orderBy Order by field (optional, default to value) - * @param sortOrder Sort order for the results (optional, default to ASC) - * @return BaseResponseAnalysisStringsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseAnalysisStringsResponse getAnalysisStrings(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { - ApiResponse localVarResp = getAnalysisStringsWithHttpInfo(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder); - return localVarResp.getData(); - } - - /** - * Get string information found in the Analysis - * Get string information found in the analysis - * @param analysisId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 100) - * @param search Search is applied to string value (optional) - * @param functionSearch Search is applied to function names (optional) - * @param orderBy Order by field (optional, default to value) - * @param sortOrder Sort order for the results (optional, default to ASC) - * @return ApiResponse<BaseResponseAnalysisStringsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { - okhttp3.Call localVarCall = getAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get string information found in the Analysis (asynchronously) - * Get string information found in the analysis - * @param analysisId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 100) - * @param search Search is applied to string value (optional) - * @param functionSearch Search is applied to function names (optional) - * @param orderBy Order by field (optional, default to value) - * @param sortOrder Sort order for the results (optional, default to ASC) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getAnalysisStringsAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getAnalysisStringsStatus - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getAnalysisStringsStatusCall(@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}/functions/strings/status" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisStringsStatusValidateBeforeCall(@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 getAnalysisStringsStatus(Async)"); - } - - return getAnalysisStringsStatusCall(analysisId, _callback); - - } - - /** - * Get string processing state for the Analysis - * Get string processing state for the Analysis - * @param analysisId (required) - * @return BaseResponseAnalysisStringsStatusResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseAnalysisStringsStatusResponse getAnalysisStringsStatus(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisStringsStatusWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get string processing state for the Analysis - * Get string processing state for the Analysis - * @param analysisId (required) - * @return ApiResponse<BaseResponseAnalysisStringsStatusResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getAnalysisStringsStatusWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisStringsStatusValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get string processing state for the Analysis (asynchronously) - * Get string processing state for the Analysis - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getAnalysisStringsStatusAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisStringsStatusValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getFunctionBlocks - * @param functionId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionBlocksCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/functions/{function_id}/blocks" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionBlocksValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionBlocks(Async)"); - } - - return getFunctionBlocksCall(functionId, _callback); - - } - - /** - * Get disassembly blocks related to the function - * Get disassembly blocks related to the function - * @param functionId (required) - * @return BaseResponseFunctionBlocksResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
- * @deprecated - */ - @Deprecated - public BaseResponseFunctionBlocksResponse getFunctionBlocks(@javax.annotation.Nonnull Integer functionId) throws ApiException { - ApiResponse localVarResp = getFunctionBlocksWithHttpInfo(functionId); - return localVarResp.getData(); - } - - /** - * Get disassembly blocks related to the function - * Get disassembly blocks related to the function - * @param functionId (required) - * @return ApiResponse<BaseResponseFunctionBlocksResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
- * @deprecated - */ - @Deprecated - public ApiResponse getFunctionBlocksWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionBlocksValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get disassembly blocks related to the function (asynchronously) - * Get disassembly blocks related to the function - * @param functionId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionBlocksAsync(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFunctionBlocksValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getFunctionBlocks_0 - * @param functionId Function ID (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getFunctionBlocks_0Call(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v3/functions/{function_id}/blocks" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionBlocks_0ValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionBlocks_0(Async)"); - } - - return getFunctionBlocks_0Call(functionId, _callback); - - } - - /** - * Get function disassembly - * Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - * @param functionId Function ID (required) - * @return DisassemblyOutputBody - * @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 DisassemblyOutputBody getFunctionBlocks_0(@javax.annotation.Nonnull Long functionId) throws ApiException { - ApiResponse localVarResp = getFunctionBlocks_0WithHttpInfo(functionId); - return localVarResp.getData(); - } - - /** - * Get function disassembly - * Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - * @param functionId Function ID (required) - * @return ApiResponse<DisassemblyOutputBody> - * @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 getFunctionBlocks_0WithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionBlocks_0ValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get function disassembly (asynchronously) - * Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - * @param functionId Function ID (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getFunctionBlocks_0Async(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFunctionBlocks_0ValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getFunctionCalleesCallers - * @param functionId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionCalleesCallersCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/functions/{function_id}/callees_callers" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionCalleesCallersValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionCalleesCallers(Async)"); - } - - return getFunctionCalleesCallersCall(functionId, _callback); - - } - - /** - * Get list of functions that call or are called by the specified function - * - * @param functionId (required) - * @return BaseResponseCalleesCallerFunctionsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseCalleesCallerFunctionsResponse getFunctionCalleesCallers(@javax.annotation.Nonnull Integer functionId) throws ApiException { - ApiResponse localVarResp = getFunctionCalleesCallersWithHttpInfo(functionId); - return localVarResp.getData(); - } - - /** - * Get list of functions that call or are called by the specified function - * - * @param functionId (required) - * @return ApiResponse<BaseResponseCalleesCallerFunctionsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getFunctionCalleesCallersWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionCalleesCallersValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get list of functions that call or are called by the specified function (asynchronously) - * - * @param functionId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionCalleesCallersAsync(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFunctionCalleesCallersValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getFunctionCalleesCallersBulk - * @param functionIds (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionCalleesCallersBulkCall(@javax.annotation.Nonnull List functionIds, 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/functions/callees_callers"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (functionIds != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "function_ids", functionIds)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionCalleesCallersBulkValidateBeforeCall(@javax.annotation.Nonnull List functionIds, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionIds' is set - if (functionIds == null) { - throw new ApiException("Missing the required parameter 'functionIds' when calling getFunctionCalleesCallersBulk(Async)"); - } - - return getFunctionCalleesCallersBulkCall(functionIds, _callback); - - } - - /** - * Get list of functions that call or are called for a list of functions - * - * @param functionIds (required) - * @return BaseResponseListCalleesCallerFunctionsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseListCalleesCallerFunctionsResponse getFunctionCalleesCallersBulk(@javax.annotation.Nonnull List functionIds) throws ApiException { - ApiResponse localVarResp = getFunctionCalleesCallersBulkWithHttpInfo(functionIds); - return localVarResp.getData(); - } - - /** - * Get list of functions that call or are called for a list of functions - * - * @param functionIds (required) - * @return ApiResponse<BaseResponseListCalleesCallerFunctionsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getFunctionCalleesCallersBulkWithHttpInfo(@javax.annotation.Nonnull List functionIds) throws ApiException { - okhttp3.Call localVarCall = getFunctionCalleesCallersBulkValidateBeforeCall(functionIds, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get list of functions that call or are called for a list of functions (asynchronously) - * - * @param functionIds (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionCalleesCallersBulkAsync(@javax.annotation.Nonnull List functionIds, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFunctionCalleesCallersBulkValidateBeforeCall(functionIds, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getFunctionCalleesCallers_0 - * @param functionId Function ID (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getFunctionCalleesCallers_0Call(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v3/functions/{function_id}/callees-callers" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionCalleesCallers_0ValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionCalleesCallers_0(Async)"); - } - - return getFunctionCalleesCallers_0Call(functionId, _callback); - - } - - /** - * Get callees and callers for a function - * Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - * @param functionId Function ID (required) - * @return CallEdgesOutputBody - * @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 CallEdgesOutputBody getFunctionCalleesCallers_0(@javax.annotation.Nonnull Long functionId) throws ApiException { - ApiResponse localVarResp = getFunctionCalleesCallers_0WithHttpInfo(functionId); - return localVarResp.getData(); - } - - /** - * Get callees and callers for a function - * Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - * @param functionId Function ID (required) - * @return ApiResponse<CallEdgesOutputBody> - * @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 getFunctionCalleesCallers_0WithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionCalleesCallers_0ValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get callees and callers for a function (asynchronously) - * Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Build call for getFunctionBlocks * @param functionId Function ID (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1441,31 +415,7 @@ public ApiResponse getFunctionCalleesCallers_0WithHttpInfo(
Response Details
500 Internal Server Error -
*/ - public okhttp3.Call getFunctionCalleesCallers_0Async(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFunctionCalleesCallers_0ValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getFunctionCapabilities - * @param functionId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionCapabilitiesCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionBlocksCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1482,7 +432,7 @@ public okhttp3.Call getFunctionCapabilitiesCall(@javax.annotation.Nonnull Intege Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/functions/{function_id}/capabilities" + String localVarPath = "/v3/functions/{function_id}/blocks" .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -1510,67 +460,66 @@ public okhttp3.Call getFunctionCapabilitiesCall(@javax.annotation.Nonnull Intege return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionCapabilitiesValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getFunctionBlocksValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionCapabilities(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionBlocks(Async)"); } - return getFunctionCapabilitiesCall(functionId, _callback); + return getFunctionBlocksCall(functionId, _callback); } /** - * Retrieve a functions capabilities - * - * @param functionId (required) - * @return BaseResponseFunctionCapabilityResponse + * Get function disassembly + * Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param functionId Function ID (required) + * @return DisassemblyOutputBody * @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 -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public BaseResponseFunctionCapabilityResponse getFunctionCapabilities(@javax.annotation.Nonnull Integer functionId) throws ApiException { - ApiResponse localVarResp = getFunctionCapabilitiesWithHttpInfo(functionId); + public DisassemblyOutputBody getFunctionBlocks(@javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = getFunctionBlocksWithHttpInfo(functionId); return localVarResp.getData(); } /** - * Retrieve a functions capabilities - * - * @param functionId (required) - * @return ApiResponse<BaseResponseFunctionCapabilityResponse> + * Get function disassembly + * Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param functionId Function ID (required) + * @return ApiResponse<DisassemblyOutputBody> * @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 -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public ApiResponse getFunctionCapabilitiesWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionCapabilitiesValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getFunctionBlocksWithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionBlocksValidateBeforeCall(functionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Retrieve a functions capabilities (asynchronously) - * - * @param functionId (required) + * Get function disassembly (asynchronously) + * Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param functionId Function ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1578,22 +527,22 @@ public ApiResponse getFunctionCapabiliti - - + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call getFunctionCapabilitiesAsync(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionBlocksAsync(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFunctionCapabilitiesValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getFunctionBlocksValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getFunctionCapabilities_0 + * Build call for getFunctionCalleesCallers * @param functionId Function ID (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1609,7 +558,7 @@ public okhttp3.Call getFunctionCapabilitiesAsync(@javax.annotation.Nonnull Integ 500 Internal Server Error - */ - public okhttp3.Call getFunctionCapabilities_0Call(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionCalleesCallersCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1626,7 +575,7 @@ public okhttp3.Call getFunctionCapabilities_0Call(@javax.annotation.Nonnull Long Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/functions/{function_id}/capabilities" + String localVarPath = "/v3/functions/{function_id}/callees-callers" .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -1655,21 +604,21 @@ public okhttp3.Call getFunctionCapabilities_0Call(@javax.annotation.Nonnull Long } @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionCapabilities_0ValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getFunctionCalleesCallersValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionCapabilities_0(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionCalleesCallers(Async)"); } - return getFunctionCapabilities_0Call(functionId, _callback); + return getFunctionCalleesCallersCall(functionId, _callback); } /** - * Get capabilities for a function - * Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Get callees and callers for a function + * Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) - * @return CapabilitiesOutputBody + * @return CallEdgesOutputBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1682,16 +631,16 @@ private okhttp3.Call getFunctionCapabilities_0ValidateBeforeCall(@javax.annotati
500 Internal Server Error -
*/ - public CapabilitiesOutputBody getFunctionCapabilities_0(@javax.annotation.Nonnull Long functionId) throws ApiException { - ApiResponse localVarResp = getFunctionCapabilities_0WithHttpInfo(functionId); + public CallEdgesOutputBody getFunctionCalleesCallers(@javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = getFunctionCalleesCallersWithHttpInfo(functionId); return localVarResp.getData(); } /** - * Get capabilities for a function - * Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Get callees and callers for a function + * Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) - * @return ApiResponse<CapabilitiesOutputBody> + * @return ApiResponse<CallEdgesOutputBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1704,15 +653,15 @@ public CapabilitiesOutputBody getFunctionCapabilities_0(@javax.annotation.Nonnul
500 Internal Server Error -
*/ - public ApiResponse getFunctionCapabilities_0WithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionCapabilities_0ValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getFunctionCalleesCallersWithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionCalleesCallersValidateBeforeCall(functionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get capabilities for a function (asynchronously) - * Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * Get callees and callers for a function (asynchronously) + * Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found * @param functionId Function ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -1728,16 +677,16 @@ public ApiResponse getFunctionCapabilities_0WithHttpInfo 500 Internal Server Error - */ - public okhttp3.Call getFunctionCapabilities_0Async(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionCalleesCallersAsync(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFunctionCapabilities_0ValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getFunctionCalleesCallersValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getFunctionDetails - * @param functionId (required) + * Build call for getFunctionCapabilities + * @param functionId Function ID (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1745,13 +694,14 @@ public okhttp3.Call getFunctionCapabilities_0Async(@javax.annotation.Nonnull Lon - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call getFunctionDetailsCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionCapabilitiesCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1768,7 +718,7 @@ public okhttp3.Call getFunctionDetailsCall(@javax.annotation.Nonnull Integer fun Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/functions/{function_id}" + String localVarPath = "/v3/functions/{function_id}/capabilities" .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -1796,65 +746,66 @@ public okhttp3.Call getFunctionDetailsCall(@javax.annotation.Nonnull Integer fun return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionDetailsValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getFunctionCapabilitiesValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionDetails(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionCapabilities(Async)"); } - return getFunctionDetailsCall(functionId, _callback); + return getFunctionCapabilitiesCall(functionId, _callback); } /** - * Get function details - * - * @param functionId (required) - * @return BaseResponseFunctionsDetailResponse + * Get capabilities for a function + * Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param functionId Function ID (required) + * @return CapabilitiesOutputBody * @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 -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public BaseResponseFunctionsDetailResponse getFunctionDetails(@javax.annotation.Nonnull Integer functionId) throws ApiException { - ApiResponse localVarResp = getFunctionDetailsWithHttpInfo(functionId); + public CapabilitiesOutputBody getFunctionCapabilities(@javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = getFunctionCapabilitiesWithHttpInfo(functionId); return localVarResp.getData(); } /** - * Get function details - * - * @param functionId (required) - * @return ApiResponse<BaseResponseFunctionsDetailResponse> + * Get capabilities for a function + * Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param functionId Function ID (required) + * @return ApiResponse<CapabilitiesOutputBody> * @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 -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public ApiResponse getFunctionDetailsWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionDetailsValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getFunctionCapabilitiesWithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionCapabilitiesValidateBeforeCall(functionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get function details (asynchronously) - * - * @param functionId (required) + * Get capabilities for a function (asynchronously) + * Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param functionId Function ID (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1862,21 +813,22 @@ public ApiResponse getFunctionDetailsWithHt - - + + + + +
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- * @deprecated */ - @Deprecated - public okhttp3.Call getFunctionDetailsAsync(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionCapabilitiesAsync(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFunctionDetailsValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getFunctionCapabilitiesValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getFunctionDetails_0 + * Build call for getFunctionDetails * @param functionId Function ID (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1892,7 +844,7 @@ public okhttp3.Call getFunctionDetailsAsync(@javax.annotation.Nonnull Integer fu 500 Internal Server Error - */ - public okhttp3.Call getFunctionDetails_0Call(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionDetailsCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1938,13 +890,13 @@ public okhttp3.Call getFunctionDetails_0Call(@javax.annotation.Nonnull Long func } @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionDetails_0ValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getFunctionDetailsValidateBeforeCall(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionDetails_0(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionDetails(Async)"); } - return getFunctionDetails_0Call(functionId, _callback); + return getFunctionDetailsCall(functionId, _callback); } @@ -1965,8 +917,8 @@ private okhttp3.Call getFunctionDetails_0ValidateBeforeCall(@javax.annotation.No 500 Internal Server Error - */ - public FunctionDetailsOutputBody getFunctionDetails_0(@javax.annotation.Nonnull Long functionId) throws ApiException { - ApiResponse localVarResp = getFunctionDetails_0WithHttpInfo(functionId); + public FunctionDetailsOutputBody getFunctionDetails(@javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = getFunctionDetailsWithHttpInfo(functionId); return localVarResp.getData(); } @@ -1987,8 +939,8 @@ public FunctionDetailsOutputBody getFunctionDetails_0(@javax.annotation.Nonnull 500 Internal Server Error - */ - public ApiResponse getFunctionDetails_0WithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionDetails_0ValidateBeforeCall(functionId, null); + public ApiResponse getFunctionDetailsWithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionDetailsValidateBeforeCall(functionId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2011,9 +963,9 @@ public ApiResponse getFunctionDetails_0WithHttpInfo(@ 500 Internal Server Error - */ - public okhttp3.Call getFunctionDetails_0Async(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionDetailsAsync(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFunctionDetails_0ValidateBeforeCall(functionId, _callback); + okhttp3.Call localVarCall = getFunctionDetailsValidateBeforeCall(functionId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -2163,170 +1115,6 @@ public okhttp3.Call getFunctionIndirectCallSitesAsync(@javax.annotation.Nonnull } /** * Build call for getFunctionStrings - * @param functionId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 100) - * @param search Search is applied to string value (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionStringsCall(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - 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/functions/{function_id}/strings" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (search != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionStringsValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionStrings(Async)"); - } - - return getFunctionStringsCall(functionId, page, pageSize, search, _callback); - - } - - /** - * Get string information found in the function - * Get string information found in the function - * @param functionId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 100) - * @param search Search is applied to string value (optional) - * @return BaseResponseFunctionStringsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseFunctionStringsResponse getFunctionStrings(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search) throws ApiException { - ApiResponse localVarResp = getFunctionStringsWithHttpInfo(functionId, page, pageSize, search); - return localVarResp.getData(); - } - - /** - * Get string information found in the function - * Get string information found in the function - * @param functionId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 100) - * @param search Search is applied to string value (optional) - * @return ApiResponse<BaseResponseFunctionStringsResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getFunctionStringsWithHttpInfo(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search) throws ApiException { - okhttp3.Call localVarCall = getFunctionStringsValidateBeforeCall(functionId, page, pageSize, search, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get string information found in the function (asynchronously) - * Get string information found in the function - * @param functionId (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 100) - * @param search Search is applied to string value (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionStringsAsync(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFunctionStringsValidateBeforeCall(functionId, page, pageSize, search, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getFunctionStrings_0 * @param functionId Function ID (required) * @param page Page number (1-indexed). (optional, default to 1) * @param pageSize Number of results per page. (optional, default to 100) @@ -2345,7 +1133,7 @@ public okhttp3.Call getFunctionStringsAsync(@javax.annotation.Nonnull Integer fu 500 Internal Server Error - */ - public okhttp3.Call getFunctionStrings_0Call(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionStringsCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2403,13 +1191,13 @@ public okhttp3.Call getFunctionStrings_0Call(@javax.annotation.Nonnull Long func } @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionStrings_0ValidateBeforeCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getFunctionStringsValidateBeforeCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionStrings_0(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionStrings(Async)"); } - return getFunctionStrings_0Call(functionId, page, pageSize, search, _callback); + return getFunctionStringsCall(functionId, page, pageSize, search, _callback); } @@ -2433,8 +1221,8 @@ private okhttp3.Call getFunctionStrings_0ValidateBeforeCall(@javax.annotation.No 500 Internal Server Error - */ - public ListFunctionStringsOutputBody getFunctionStrings_0(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search) throws ApiException { - ApiResponse localVarResp = getFunctionStrings_0WithHttpInfo(functionId, page, pageSize, search); + public ListFunctionStringsOutputBody getFunctionStrings(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search) throws ApiException { + ApiResponse localVarResp = getFunctionStringsWithHttpInfo(functionId, page, pageSize, search); return localVarResp.getData(); } @@ -2458,8 +1246,8 @@ public ListFunctionStringsOutputBody getFunctionStrings_0(@javax.annotation.Nonn 500 Internal Server Error - */ - public ApiResponse getFunctionStrings_0WithHttpInfo(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search) throws ApiException { - okhttp3.Call localVarCall = getFunctionStrings_0ValidateBeforeCall(functionId, page, pageSize, search, null); + public ApiResponse getFunctionStringsWithHttpInfo(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search) throws ApiException { + okhttp3.Call localVarCall = getFunctionStringsValidateBeforeCall(functionId, page, pageSize, search, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2485,9 +1273,9 @@ public ApiResponse getFunctionStrings_0WithHttpIn 500 Internal Server Error - */ - public okhttp3.Call getFunctionStrings_0Async(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionStringsAsync(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFunctionStrings_0ValidateBeforeCall(functionId, page, pageSize, search, _callback); + okhttp3.Call localVarCall = getFunctionStringsValidateBeforeCall(functionId, page, pageSize, search, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java b/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java index bd8e5aa..25255ae 100644 --- a/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java +++ b/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java @@ -27,14 +27,9 @@ import ai.reveng.model.APIError; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseFunctionDataTypesList; -import ai.reveng.model.BaseResponseGenerateFunctionDataTypes; -import ai.reveng.model.BaseResponseGenerationStatusList; import ai.reveng.model.BatchUpdateDataTypesInputBody; import ai.reveng.model.BatchUpdateDataTypesOutputBody; import ai.reveng.model.DataTypesEntry; -import ai.reveng.model.FunctionDataTypesParams; import ai.reveng.model.ListAnalysisFunctionsDataTypesOutputBody; import ai.reveng.model.ListFunctionsDataTypesOutputBody; import ai.reveng.model.UpdateDataTypesInputBody; @@ -240,278 +235,6 @@ public okhttp3.Call batchUpdateFunctionDataTypesAsync(@javax.annotation.Nonnull localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for generateFunctionDataTypesForAnalysis - * @param analysisId (required) - * @param functionDataTypesParams (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call generateFunctionDataTypesForAnalysisCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams, 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 = functionDataTypesParams; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions/data_types" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call generateFunctionDataTypesForAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams, 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 generateFunctionDataTypesForAnalysis(Async)"); - } - - // verify the required parameter 'functionDataTypesParams' is set - if (functionDataTypesParams == null) { - throw new ApiException("Missing the required parameter 'functionDataTypesParams' when calling generateFunctionDataTypesForAnalysis(Async)"); - } - - return generateFunctionDataTypesForAnalysisCall(analysisId, functionDataTypesParams, _callback); - - } - - /** - * Generate Function Data Types - * Submits a request to generate the function data types - * @param analysisId (required) - * @param functionDataTypesParams (required) - * @return BaseResponseGenerateFunctionDataTypes - * @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 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponseGenerateFunctionDataTypes generateFunctionDataTypesForAnalysis(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams) throws ApiException { - ApiResponse localVarResp = generateFunctionDataTypesForAnalysisWithHttpInfo(analysisId, functionDataTypesParams); - return localVarResp.getData(); - } - - /** - * Generate Function Data Types - * Submits a request to generate the function data types - * @param analysisId (required) - * @param functionDataTypesParams (required) - * @return ApiResponse<BaseResponseGenerateFunctionDataTypes> - * @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 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse generateFunctionDataTypesForAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams) throws ApiException { - okhttp3.Call localVarCall = generateFunctionDataTypesForAnalysisValidateBeforeCall(analysisId, functionDataTypesParams, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Generate Function Data Types (asynchronously) - * Submits a request to generate the function data types - * @param analysisId (required) - * @param functionDataTypesParams (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call generateFunctionDataTypesForAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = generateFunctionDataTypesForAnalysisValidateBeforeCall(analysisId, functionDataTypesParams, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for generateFunctionDataTypesForFunctions - * @param functionDataTypesParams (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call generateFunctionDataTypesForFunctionsCall(@javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams, 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 = functionDataTypesParams; - - // create path and map variables - String localVarPath = "/v2/functions/data_types"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call generateFunctionDataTypesForFunctionsValidateBeforeCall(@javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionDataTypesParams' is set - if (functionDataTypesParams == null) { - throw new ApiException("Missing the required parameter 'functionDataTypesParams' when calling generateFunctionDataTypesForFunctions(Async)"); - } - - return generateFunctionDataTypesForFunctionsCall(functionDataTypesParams, _callback); - - } - - /** - * Generate Function Data Types for an arbitrary list of functions - * Submits a request to generate the function data types - * @param functionDataTypesParams (required) - * @return BaseResponseGenerationStatusList - * @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 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponseGenerationStatusList generateFunctionDataTypesForFunctions(@javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams) throws ApiException { - ApiResponse localVarResp = generateFunctionDataTypesForFunctionsWithHttpInfo(functionDataTypesParams); - return localVarResp.getData(); - } - - /** - * Generate Function Data Types for an arbitrary list of functions - * Submits a request to generate the function data types - * @param functionDataTypesParams (required) - * @return ApiResponse<BaseResponseGenerationStatusList> - * @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 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse generateFunctionDataTypesForFunctionsWithHttpInfo(@javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams) throws ApiException { - okhttp3.Call localVarCall = generateFunctionDataTypesForFunctionsValidateBeforeCall(functionDataTypesParams, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Generate Function Data Types for an arbitrary list of functions (asynchronously) - * Submits a request to generate the function data types - * @param functionDataTypesParams (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 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call generateFunctionDataTypesForFunctionsAsync(@javax.annotation.Nonnull FunctionDataTypesParams functionDataTypesParams, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = generateFunctionDataTypesForFunctionsValidateBeforeCall(functionDataTypesParams, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getFunctionDataTypes * @param analysisId Analysis ID (required) @@ -824,292 +547,6 @@ public okhttp3.Call listAnalysisFunctionsDataTypesAsync(@javax.annotation.Nonnul localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for listFunctionDataTypesForAnalysis - * @param analysisId (required) - * @param functionIds (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call listFunctionDataTypesForAnalysisCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable List functionIds, 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}/functions/data_types" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (functionIds != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "function_ids", functionIds)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call listFunctionDataTypesForAnalysisValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable List functionIds, 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 listFunctionDataTypesForAnalysis(Async)"); - } - - return listFunctionDataTypesForAnalysisCall(analysisId, functionIds, _callback); - - } - - /** - * List Function Data Types - * Returns data types for multiple functions with optional function ID filtering - * @param analysisId (required) - * @param functionIds (optional) - * @return BaseResponseFunctionDataTypesList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseFunctionDataTypesList listFunctionDataTypesForAnalysis(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable List functionIds) throws ApiException { - ApiResponse localVarResp = listFunctionDataTypesForAnalysisWithHttpInfo(analysisId, functionIds); - return localVarResp.getData(); - } - - /** - * List Function Data Types - * Returns data types for multiple functions with optional function ID filtering - * @param analysisId (required) - * @param functionIds (optional) - * @return ApiResponse<BaseResponseFunctionDataTypesList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse listFunctionDataTypesForAnalysisWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable List functionIds) throws ApiException { - okhttp3.Call localVarCall = listFunctionDataTypesForAnalysisValidateBeforeCall(analysisId, functionIds, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Function Data Types (asynchronously) - * Returns data types for multiple functions with optional function ID filtering - * @param analysisId (required) - * @param functionIds (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call listFunctionDataTypesForAnalysisAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nullable List functionIds, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listFunctionDataTypesForAnalysisValidateBeforeCall(analysisId, functionIds, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for listFunctionDataTypesForFunctions - * @param functionIds (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call listFunctionDataTypesForFunctionsCall(@javax.annotation.Nullable List functionIds, 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/functions/data_types"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (functionIds != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "function_ids", functionIds)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call listFunctionDataTypesForFunctionsValidateBeforeCall(@javax.annotation.Nullable List functionIds, final ApiCallback _callback) throws ApiException { - return listFunctionDataTypesForFunctionsCall(functionIds, _callback); - - } - - /** - * List Function Data Types - * Returns data types for multiple function IDs - * @param functionIds (optional) - * @return BaseResponseFunctionDataTypesList - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseFunctionDataTypesList listFunctionDataTypesForFunctions(@javax.annotation.Nullable List functionIds) throws ApiException { - ApiResponse localVarResp = listFunctionDataTypesForFunctionsWithHttpInfo(functionIds); - return localVarResp.getData(); - } - - /** - * List Function Data Types - * Returns data types for multiple function IDs - * @param functionIds (optional) - * @return ApiResponse<BaseResponseFunctionDataTypesList> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse listFunctionDataTypesForFunctionsWithHttpInfo(@javax.annotation.Nullable List functionIds) throws ApiException { - okhttp3.Call localVarCall = listFunctionDataTypesForFunctionsValidateBeforeCall(functionIds, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Function Data Types (asynchronously) - * Returns data types for multiple function IDs - * @param functionIds (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 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call listFunctionDataTypesForFunctionsAsync(@javax.annotation.Nullable List functionIds, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listFunctionDataTypesForFunctionsValidateBeforeCall(functionIds, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for listFunctionsDataTypes * @param functionIds Function IDs to fetch data-types for. (required) diff --git a/src/main/java/ai/reveng/api/FunctionsRenamingHistoryApi.java b/src/main/java/ai/reveng/api/FunctionsRenamingHistoryApi.java index e91c7cb..158e1a4 100644 --- a/src/main/java/ai/reveng/api/FunctionsRenamingHistoryApi.java +++ b/src/main/java/ai/reveng/api/FunctionsRenamingHistoryApi.java @@ -27,12 +27,8 @@ import ai.reveng.model.APIError; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseListFunctionNameHistory; import ai.reveng.model.BatchRenameInputBody; import ai.reveng.model.BatchRenameOutputBody; -import ai.reveng.model.FunctionRename; -import ai.reveng.model.FunctionsListRename; import ai.reveng.model.HistoryEntry; import ai.reveng.model.RenameInputBody; import ai.reveng.model.RenameOutputBody; @@ -80,146 +76,6 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } - /** - * Build call for batchRenameFunction - * @param functionsListRename (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call batchRenameFunctionCall(@javax.annotation.Nonnull FunctionsListRename functionsListRename, 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 = functionsListRename; - - // create path and map variables - String localVarPath = "/v2/functions/rename/batch"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call batchRenameFunctionValidateBeforeCall(@javax.annotation.Nonnull FunctionsListRename functionsListRename, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionsListRename' is set - if (functionsListRename == null) { - throw new ApiException("Missing the required parameter 'functionsListRename' when calling batchRenameFunction(Async)"); - } - - return batchRenameFunctionCall(functionsListRename, _callback); - - } - - /** - * Batch Rename Functions - * Renames a list of functions using the function IDs Will record name changes in history - * @param functionsListRename (required) - * @return BaseResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponse batchRenameFunction(@javax.annotation.Nonnull FunctionsListRename functionsListRename) throws ApiException { - ApiResponse localVarResp = batchRenameFunctionWithHttpInfo(functionsListRename); - return localVarResp.getData(); - } - - /** - * Batch Rename Functions - * Renames a list of functions using the function IDs Will record name changes in history - * @param functionsListRename (required) - * @return ApiResponse<BaseResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse batchRenameFunctionWithHttpInfo(@javax.annotation.Nonnull FunctionsListRename functionsListRename) throws ApiException { - okhttp3.Call localVarCall = batchRenameFunctionValidateBeforeCall(functionsListRename, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Batch Rename Functions (asynchronously) - * Renames a list of functions using the function IDs Will record name changes in history - * @param functionsListRename (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call batchRenameFunctionAsync(@javax.annotation.Nonnull FunctionsListRename functionsListRename, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = batchRenameFunctionValidateBeforeCall(functionsListRename, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for batchRenameFunctions * @param batchRenameInputBody (required) @@ -506,146 +362,6 @@ public okhttp3.Call getFunctionHistoryAsync(@javax.annotation.Nonnull Long funct localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for getFunctionNameHistory - * @param functionId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionNameHistoryCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/functions/history/{function_id}" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionNameHistoryValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionNameHistory(Async)"); - } - - return getFunctionNameHistoryCall(functionId, _callback); - - } - - /** - * Get Function Name History - * Gets the name history of a function using the function ID - * @param functionId (required) - * @return BaseResponseListFunctionNameHistory - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponseListFunctionNameHistory getFunctionNameHistory(@javax.annotation.Nonnull Integer functionId) throws ApiException { - ApiResponse localVarResp = getFunctionNameHistoryWithHttpInfo(functionId); - return localVarResp.getData(); - } - - /** - * Get Function Name History - * Gets the name history of a function using the function ID - * @param functionId (required) - * @return ApiResponse<BaseResponseListFunctionNameHistory> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse getFunctionNameHistoryWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionNameHistoryValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Function Name History (asynchronously) - * Gets the name history of a function using the function ID - * @param functionId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getFunctionNameHistoryAsync(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFunctionNameHistoryValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for renameFunction * @param functionId Function ID (required) @@ -799,308 +515,8 @@ public okhttp3.Call renameFunctionAsync(@javax.annotation.Nonnull Long functionI localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for renameFunctionId - * @param functionId (required) - * @param functionRename (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call renameFunctionIdCall(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull FunctionRename functionRename, 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 = functionRename; - - // create path and map variables - String localVarPath = "/v2/functions/rename/{function_id}" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call renameFunctionIdValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull FunctionRename functionRename, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling renameFunctionId(Async)"); - } - - // verify the required parameter 'functionRename' is set - if (functionRename == null) { - throw new ApiException("Missing the required parameter 'functionRename' when calling renameFunctionId(Async)"); - } - - return renameFunctionIdCall(functionId, functionRename, _callback); - - } - - /** - * Rename Function - * Renames a function using the function ID Will record name change history - * @param functionId (required) - * @param functionRename (required) - * @return BaseResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponse renameFunctionId(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull FunctionRename functionRename) throws ApiException { - ApiResponse localVarResp = renameFunctionIdWithHttpInfo(functionId, functionRename); - return localVarResp.getData(); - } - - /** - * Rename Function - * Renames a function using the function ID Will record name change history - * @param functionId (required) - * @param functionRename (required) - * @return ApiResponse<BaseResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse renameFunctionIdWithHttpInfo(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull FunctionRename functionRename) throws ApiException { - okhttp3.Call localVarCall = renameFunctionIdValidateBeforeCall(functionId, functionRename, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Rename Function (asynchronously) - * Renames a function using the function ID Will record name change history - * @param functionId (required) - * @param functionRename (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call renameFunctionIdAsync(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull FunctionRename functionRename, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = renameFunctionIdValidateBeforeCall(functionId, functionRename, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for revertFunctionName - * @param functionId (required) - * @param historyId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call revertFunctionNameCall(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull Integer historyId, 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/functions/history/{function_id}/{history_id}" - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())) - .replace("{" + "history_id" + "}", localVarApiClient.escapeString(historyId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call revertFunctionNameValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull Integer historyId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling revertFunctionName(Async)"); - } - - // verify the required parameter 'historyId' is set - if (historyId == null) { - throw new ApiException("Missing the required parameter 'historyId' when calling revertFunctionName(Async)"); - } - - return revertFunctionNameCall(functionId, historyId, _callback); - - } - - /** - * Revert the function name - * Reverts the function name to a previous name using the function ID and history ID - * @param functionId (required) - * @param historyId (required) - * @return BaseResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public BaseResponse revertFunctionName(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull Integer historyId) throws ApiException { - ApiResponse localVarResp = revertFunctionNameWithHttpInfo(functionId, historyId); - return localVarResp.getData(); - } - - /** - * Revert the function name - * Reverts the function name to a previous name using the function ID and history ID - * @param functionId (required) - * @param historyId (required) - * @return ApiResponse<BaseResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public ApiResponse revertFunctionNameWithHttpInfo(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull Integer historyId) throws ApiException { - okhttp3.Call localVarCall = revertFunctionNameValidateBeforeCall(functionId, historyId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Revert the function name (asynchronously) - * Reverts the function name to a previous name using the function ID and history ID - * @param functionId (required) - * @param historyId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call revertFunctionNameAsync(@javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull Integer historyId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = revertFunctionNameValidateBeforeCall(functionId, historyId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for revertFunctionName_0 * @param functionId Function ID (required) * @param historyId History ID to revert to (required) * @param _callback Callback for upload/download progress @@ -1117,7 +533,7 @@ public okhttp3.Call revertFunctionNameAsync(@javax.annotation.Nonnull Integer fu 500 Internal Server Error - */ - public okhttp3.Call revertFunctionName_0Call(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call revertFunctionNameCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1164,18 +580,18 @@ public okhttp3.Call revertFunctionName_0Call(@javax.annotation.Nonnull Long func } @SuppressWarnings("rawtypes") - private okhttp3.Call revertFunctionName_0ValidateBeforeCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call revertFunctionNameValidateBeforeCall(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling revertFunctionName_0(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling revertFunctionName(Async)"); } // verify the required parameter 'historyId' is set if (historyId == null) { - throw new ApiException("Missing the required parameter 'historyId' when calling revertFunctionName_0(Async)"); + throw new ApiException("Missing the required parameter 'historyId' when calling revertFunctionName(Async)"); } - return revertFunctionName_0Call(functionId, historyId, _callback); + return revertFunctionNameCall(functionId, historyId, _callback); } @@ -1197,8 +613,8 @@ private okhttp3.Call revertFunctionName_0ValidateBeforeCall(@javax.annotation.No 500 Internal Server Error - */ - public Object revertFunctionName_0(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId) throws ApiException { - ApiResponse localVarResp = revertFunctionName_0WithHttpInfo(functionId, historyId); + public Object revertFunctionName(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId) throws ApiException { + ApiResponse localVarResp = revertFunctionNameWithHttpInfo(functionId, historyId); return localVarResp.getData(); } @@ -1220,8 +636,8 @@ public Object revertFunctionName_0(@javax.annotation.Nonnull Long functionId, @j 500 Internal Server Error - */ - public ApiResponse revertFunctionName_0WithHttpInfo(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId) throws ApiException { - okhttp3.Call localVarCall = revertFunctionName_0ValidateBeforeCall(functionId, historyId, null); + public ApiResponse revertFunctionNameWithHttpInfo(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId) throws ApiException { + okhttp3.Call localVarCall = revertFunctionNameValidateBeforeCall(functionId, historyId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1245,9 +661,9 @@ public ApiResponse revertFunctionName_0WithHttpInfo(@javax.annotation.No 500 Internal Server Error - */ - public okhttp3.Call revertFunctionName_0Async(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call revertFunctionNameAsync(@javax.annotation.Nonnull Long functionId, @javax.annotation.Nonnull Long historyId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = revertFunctionName_0ValidateBeforeCall(functionId, historyId, _callback); + okhttp3.Call localVarCall = revertFunctionNameValidateBeforeCall(functionId, historyId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/ai/reveng/api/ModelsApi.java b/src/main/java/ai/reveng/api/ModelsApi.java deleted file mode 100644 index c5af367..0000000 --- a/src/main/java/ai/reveng/api/ModelsApi.java +++ /dev/null @@ -1,196 +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.BaseResponseModelsResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ModelsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ModelsApi() { - this(Configuration.getDefaultApiClient()); - } - - public ModelsApi(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 getModels - * @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 getModelsCall(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/models"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getModelsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return getModelsCall(_callback); - - } - - /** - * Gets models - * Gets active models available for analysis. - * @return BaseResponseModelsResponse - * @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 BaseResponseModelsResponse getModels() throws ApiException { - ApiResponse localVarResp = getModelsWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Gets models - * Gets active models available for analysis. - * @return ApiResponse<BaseResponseModelsResponse> - * @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 getModelsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getModelsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Gets models (asynchronously) - * Gets active models available for analysis. - * @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 getModelsAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getModelsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/api/SearchApi.java b/src/main/java/ai/reveng/api/SearchApi.java deleted file mode 100644 index 4863508..0000000 --- a/src/main/java/ai/reveng/api/SearchApi.java +++ /dev/null @@ -1,778 +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.AppApiRestV2CollectionsEnumsOrderBy; -import ai.reveng.model.BaseResponse; -import ai.reveng.model.BaseResponseBinarySearchResponse; -import ai.reveng.model.BaseResponseCollectionSearchResponse; -import ai.reveng.model.BaseResponseFunctionSearchResponse; -import ai.reveng.model.BaseResponseTagSearchResponse; -import ai.reveng.model.Filters; -import ai.reveng.model.Order; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class SearchApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public SearchApi() { - this(Configuration.getDefaultApiClient()); - } - - public SearchApi(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 searchBinaries - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialName The partial or full name of the binary being searched (optional) - * @param partialSha256 The partial or full sha256 of the binary being searched (optional) - * @param tags The tags to be searched for (optional) - * @param modelName The name of the model used to analyze the binary the function belongs to (optional) - * @param userFilesOnly Whether to only search user's uploaded files (optional, default to false) - * @param excludeBinaryId A binary ID to exclude from the results (optional) - * @param userIds Restrict the search to binaries owned by these user IDs (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 Successful Response -
422 You must provide at least one of the filters; partial_name, partial_sha256, tags or model_name to search -
- */ - public okhttp3.Call searchBinariesCall(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String partialSha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable String modelName, @javax.annotation.Nullable Boolean userFilesOnly, @javax.annotation.Nullable Integer excludeBinaryId, @javax.annotation.Nullable List userIds, 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/search/binaries"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (partialName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("partial_name", partialName)); - } - - if (partialSha256 != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("partial_sha256", partialSha256)); - } - - if (tags != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "tags", tags)); - } - - if (modelName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("model_name", modelName)); - } - - if (userFilesOnly != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_files_only", userFilesOnly)); - } - - if (excludeBinaryId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("exclude_binary_id", excludeBinaryId)); - } - - if (userIds != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "user_ids", userIds)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call searchBinariesValidateBeforeCall(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String partialSha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable String modelName, @javax.annotation.Nullable Boolean userFilesOnly, @javax.annotation.Nullable Integer excludeBinaryId, @javax.annotation.Nullable List userIds, final ApiCallback _callback) throws ApiException { - return searchBinariesCall(page, pageSize, partialName, partialSha256, tags, modelName, userFilesOnly, excludeBinaryId, userIds, _callback); - - } - - /** - * Binaries search - * Searches for a specific binary - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialName The partial or full name of the binary being searched (optional) - * @param partialSha256 The partial or full sha256 of the binary being searched (optional) - * @param tags The tags to be searched for (optional) - * @param modelName The name of the model used to analyze the binary the function belongs to (optional) - * @param userFilesOnly Whether to only search user's uploaded files (optional, default to false) - * @param excludeBinaryId A binary ID to exclude from the results (optional) - * @param userIds Restrict the search to binaries owned by these user IDs (optional) - * @return BaseResponseBinarySearchResponse - * @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 You must provide at least one of the filters; partial_name, partial_sha256, tags or model_name to search -
- */ - public BaseResponseBinarySearchResponse searchBinaries(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String partialSha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable String modelName, @javax.annotation.Nullable Boolean userFilesOnly, @javax.annotation.Nullable Integer excludeBinaryId, @javax.annotation.Nullable List userIds) throws ApiException { - ApiResponse localVarResp = searchBinariesWithHttpInfo(page, pageSize, partialName, partialSha256, tags, modelName, userFilesOnly, excludeBinaryId, userIds); - return localVarResp.getData(); - } - - /** - * Binaries search - * Searches for a specific binary - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialName The partial or full name of the binary being searched (optional) - * @param partialSha256 The partial or full sha256 of the binary being searched (optional) - * @param tags The tags to be searched for (optional) - * @param modelName The name of the model used to analyze the binary the function belongs to (optional) - * @param userFilesOnly Whether to only search user's uploaded files (optional, default to false) - * @param excludeBinaryId A binary ID to exclude from the results (optional) - * @param userIds Restrict the search to binaries owned by these user IDs (optional) - * @return ApiResponse<BaseResponseBinarySearchResponse> - * @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 You must provide at least one of the filters; partial_name, partial_sha256, tags or model_name to search -
- */ - public ApiResponse searchBinariesWithHttpInfo(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String partialSha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable String modelName, @javax.annotation.Nullable Boolean userFilesOnly, @javax.annotation.Nullable Integer excludeBinaryId, @javax.annotation.Nullable List userIds) throws ApiException { - okhttp3.Call localVarCall = searchBinariesValidateBeforeCall(page, pageSize, partialName, partialSha256, tags, modelName, userFilesOnly, excludeBinaryId, userIds, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Binaries search (asynchronously) - * Searches for a specific binary - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialName The partial or full name of the binary being searched (optional) - * @param partialSha256 The partial or full sha256 of the binary being searched (optional) - * @param tags The tags to be searched for (optional) - * @param modelName The name of the model used to analyze the binary the function belongs to (optional) - * @param userFilesOnly Whether to only search user's uploaded files (optional, default to false) - * @param excludeBinaryId A binary ID to exclude from the results (optional) - * @param userIds Restrict the search to binaries owned by these user IDs (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 Successful Response -
422 You must provide at least one of the filters; partial_name, partial_sha256, tags or model_name to search -
- */ - public okhttp3.Call searchBinariesAsync(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String partialSha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable String modelName, @javax.annotation.Nullable Boolean userFilesOnly, @javax.annotation.Nullable Integer excludeBinaryId, @javax.annotation.Nullable List userIds, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = searchBinariesValidateBeforeCall(page, pageSize, partialName, partialSha256, tags, modelName, userFilesOnly, excludeBinaryId, userIds, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for searchCollections - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialCollectionName The partial or full name of the collection being searched (optional) - * @param partialBinaryName The partial or full name of the binary belonging to the collection (optional) - * @param partialBinarySha256 The partial or full sha256 of the binary belonging to the collection (optional) - * @param tags The tags to be searched for (optional) - * @param filters The filters to be used for the search (optional) - * @param orderBy The field to sort the order by in the results (optional, default to created) - * @param orderByDirection The order direction in which to return results (optional, default to DESC) - * @param userIds Restrict the search to collections owned by these user IDs (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 Successful Response -
422 You must provide at least one of the filters; partial_collection_name, partial_binary_name, partial_binary_sha256 or tags to search -
- */ - public okhttp3.Call searchCollectionsCall(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialCollectionName, @javax.annotation.Nullable String partialBinaryName, @javax.annotation.Nullable String partialBinarySha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable List filters, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order orderByDirection, @javax.annotation.Nullable List userIds, 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/search/collections"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (partialCollectionName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("partial_collection_name", partialCollectionName)); - } - - if (partialBinaryName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("partial_binary_name", partialBinaryName)); - } - - if (partialBinarySha256 != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("partial_binary_sha256", partialBinarySha256)); - } - - if (tags != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "tags", tags)); - } - - if (filters != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filters", filters)); - } - - if (orderBy != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); - } - - if (orderByDirection != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by_direction", orderByDirection)); - } - - if (userIds != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "user_ids", userIds)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call searchCollectionsValidateBeforeCall(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialCollectionName, @javax.annotation.Nullable String partialBinaryName, @javax.annotation.Nullable String partialBinarySha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable List filters, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order orderByDirection, @javax.annotation.Nullable List userIds, final ApiCallback _callback) throws ApiException { - return searchCollectionsCall(page, pageSize, partialCollectionName, partialBinaryName, partialBinarySha256, tags, filters, orderBy, orderByDirection, userIds, _callback); - - } - - /** - * Collections search - * Searches for a specific collection - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialCollectionName The partial or full name of the collection being searched (optional) - * @param partialBinaryName The partial or full name of the binary belonging to the collection (optional) - * @param partialBinarySha256 The partial or full sha256 of the binary belonging to the collection (optional) - * @param tags The tags to be searched for (optional) - * @param filters The filters to be used for the search (optional) - * @param orderBy The field to sort the order by in the results (optional, default to created) - * @param orderByDirection The order direction in which to return results (optional, default to DESC) - * @param userIds Restrict the search to collections owned by these user IDs (optional) - * @return BaseResponseCollectionSearchResponse - * @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 You must provide at least one of the filters; partial_collection_name, partial_binary_name, partial_binary_sha256 or tags to search -
- */ - public BaseResponseCollectionSearchResponse searchCollections(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialCollectionName, @javax.annotation.Nullable String partialBinaryName, @javax.annotation.Nullable String partialBinarySha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable List filters, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order orderByDirection, @javax.annotation.Nullable List userIds) throws ApiException { - ApiResponse localVarResp = searchCollectionsWithHttpInfo(page, pageSize, partialCollectionName, partialBinaryName, partialBinarySha256, tags, filters, orderBy, orderByDirection, userIds); - return localVarResp.getData(); - } - - /** - * Collections search - * Searches for a specific collection - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialCollectionName The partial or full name of the collection being searched (optional) - * @param partialBinaryName The partial or full name of the binary belonging to the collection (optional) - * @param partialBinarySha256 The partial or full sha256 of the binary belonging to the collection (optional) - * @param tags The tags to be searched for (optional) - * @param filters The filters to be used for the search (optional) - * @param orderBy The field to sort the order by in the results (optional, default to created) - * @param orderByDirection The order direction in which to return results (optional, default to DESC) - * @param userIds Restrict the search to collections owned by these user IDs (optional) - * @return ApiResponse<BaseResponseCollectionSearchResponse> - * @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 You must provide at least one of the filters; partial_collection_name, partial_binary_name, partial_binary_sha256 or tags to search -
- */ - public ApiResponse searchCollectionsWithHttpInfo(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialCollectionName, @javax.annotation.Nullable String partialBinaryName, @javax.annotation.Nullable String partialBinarySha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable List filters, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order orderByDirection, @javax.annotation.Nullable List userIds) throws ApiException { - okhttp3.Call localVarCall = searchCollectionsValidateBeforeCall(page, pageSize, partialCollectionName, partialBinaryName, partialBinarySha256, tags, filters, orderBy, orderByDirection, userIds, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Collections search (asynchronously) - * Searches for a specific collection - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialCollectionName The partial or full name of the collection being searched (optional) - * @param partialBinaryName The partial or full name of the binary belonging to the collection (optional) - * @param partialBinarySha256 The partial or full sha256 of the binary belonging to the collection (optional) - * @param tags The tags to be searched for (optional) - * @param filters The filters to be used for the search (optional) - * @param orderBy The field to sort the order by in the results (optional, default to created) - * @param orderByDirection The order direction in which to return results (optional, default to DESC) - * @param userIds Restrict the search to collections owned by these user IDs (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 Successful Response -
422 You must provide at least one of the filters; partial_collection_name, partial_binary_name, partial_binary_sha256 or tags to search -
- */ - public okhttp3.Call searchCollectionsAsync(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialCollectionName, @javax.annotation.Nullable String partialBinaryName, @javax.annotation.Nullable String partialBinarySha256, @javax.annotation.Nullable List tags, @javax.annotation.Nullable List filters, @javax.annotation.Nullable AppApiRestV2CollectionsEnumsOrderBy orderBy, @javax.annotation.Nullable Order orderByDirection, @javax.annotation.Nullable List userIds, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = searchCollectionsValidateBeforeCall(page, pageSize, partialCollectionName, partialBinaryName, partialBinarySha256, tags, filters, orderBy, orderByDirection, userIds, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for searchFunctions - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialName The partial or full name of the function being searched (optional) - * @param modelName The name of the model used to analyze the binary the function belongs to (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 Successful Response -
422 You must provide at least one of the filters; partial_name, or model_name to search -
- */ - public okhttp3.Call searchFunctionsCall(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String modelName, 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/search/functions"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (partialName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("partial_name", partialName)); - } - - if (modelName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("model_name", modelName)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call searchFunctionsValidateBeforeCall(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String modelName, final ApiCallback _callback) throws ApiException { - return searchFunctionsCall(page, pageSize, partialName, modelName, _callback); - - } - - /** - * Functions search - * Searches for a specific function - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialName The partial or full name of the function being searched (optional) - * @param modelName The name of the model used to analyze the binary the function belongs to (optional) - * @return BaseResponseFunctionSearchResponse - * @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 You must provide at least one of the filters; partial_name, or model_name to search -
- */ - public BaseResponseFunctionSearchResponse searchFunctions(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String modelName) throws ApiException { - ApiResponse localVarResp = searchFunctionsWithHttpInfo(page, pageSize, partialName, modelName); - return localVarResp.getData(); - } - - /** - * Functions search - * Searches for a specific function - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialName The partial or full name of the function being searched (optional) - * @param modelName The name of the model used to analyze the binary the function belongs to (optional) - * @return ApiResponse<BaseResponseFunctionSearchResponse> - * @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 You must provide at least one of the filters; partial_name, or model_name to search -
- */ - public ApiResponse searchFunctionsWithHttpInfo(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String modelName) throws ApiException { - okhttp3.Call localVarCall = searchFunctionsValidateBeforeCall(page, pageSize, partialName, modelName, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Functions search (asynchronously) - * Searches for a specific function - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @param partialName The partial or full name of the function being searched (optional) - * @param modelName The name of the model used to analyze the binary the function belongs to (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 Successful Response -
422 You must provide at least one of the filters; partial_name, or model_name to search -
- */ - public okhttp3.Call searchFunctionsAsync(@javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String partialName, @javax.annotation.Nullable String modelName, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = searchFunctionsValidateBeforeCall(page, pageSize, partialName, modelName, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for searchTags - * @param partialName The partial or full name of the tag to search for (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @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 You must provide a partial_name to search and it must be greater than 3 characters -
- */ - public okhttp3.Call searchTagsCall(@javax.annotation.Nonnull String partialName, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/search/tags"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); - } - - if (partialName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("partial_name", partialName)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call searchTagsValidateBeforeCall(@javax.annotation.Nonnull String partialName, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'partialName' is set - if (partialName == null) { - throw new ApiException("Missing the required parameter 'partialName' when calling searchTags(Async)"); - } - - return searchTagsCall(partialName, page, pageSize, _callback); - - } - - /** - * Tags search - * Searches for tags by there name - * @param partialName The partial or full name of the tag to search for (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @return BaseResponseTagSearchResponse - * @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 You must provide a partial_name to search and it must be greater than 3 characters -
- */ - public BaseResponseTagSearchResponse searchTags(@javax.annotation.Nonnull String partialName, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize) throws ApiException { - ApiResponse localVarResp = searchTagsWithHttpInfo(partialName, page, pageSize); - return localVarResp.getData(); - } - - /** - * Tags search - * Searches for tags by there name - * @param partialName The partial or full name of the tag to search for (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @return ApiResponse<BaseResponseTagSearchResponse> - * @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 You must provide a partial_name to search and it must be greater than 3 characters -
- */ - public ApiResponse searchTagsWithHttpInfo(@javax.annotation.Nonnull String partialName, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = searchTagsValidateBeforeCall(partialName, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Tags search (asynchronously) - * Searches for tags by there name - * @param partialName The partial or full name of the tag to search for (required) - * @param page The page number to retrieve. (optional, default to 1) - * @param pageSize Number of items per page. (optional, default to 10) - * @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 You must provide a partial_name to search and it must be greater than 3 characters -
- */ - public okhttp3.Call searchTagsAsync(@javax.annotation.Nonnull String partialName, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = searchTagsValidateBeforeCall(partialName, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/ai/reveng/invoker/JSON.java b/src/main/java/ai/reveng/invoker/JSON.java index e9091ab..4f9e9cb 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -108,114 +108,21 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddTeamMemberInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringToFunctionInputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AdditionalDetailsStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisAccessInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBasicInfoOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBulkAddTagsRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBulkAddTagsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBulkAddTagsResponseItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisConfig.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisConfigSnapshot.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisCreateRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisCreateResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisDetailResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctionEntry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctionMapping.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctionsList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisLogMessage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisLogs.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisRecord.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisRecordBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisReport.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringFunction.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisStringsStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisTagBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisTags.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateTagsRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisUpdateTagsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ApiCall.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AppApiRestV2AgentSchemaCapability.CustomTypeAdapterFactory()); - 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.ArchiveContentEntry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Argument.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Artifact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AttemptFailedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AttemptStartedEvent.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoRunAgents.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoUnstripStatusOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAdditionalDetailsStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisBulkAddTagsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisCreateResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisDetailResponse.CustomTypeAdapterFactory()); - 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.BaseResponseAnalysisStringsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisStringsStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisTags.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAnalysisUpdateTagsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseBasic.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseBinariesRelatedStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseBinaryAdditionalResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseBinaryDetailsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseBinaryExternalsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseBinarySearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseBool.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCalleesCallerFunctionsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCapabilities.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCapabilitiesAgentResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseChildBinariesResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCollectionBinariesUpdateResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCollectionResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCollectionSearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCollectionTagsUpdateResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCommentResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseConfigResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseCreated.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseDict.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseExternalResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionBlocksResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionCapabilityResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionDataTypes.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionDataTypesList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionSearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionStringsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseFunctionsDetailResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseGenerateFunctionDataTypes.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseGenerationStatusList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseGetPublicUserResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListCalleesCallerFunctionsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListCollectionResults.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListCommentResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListDieMatch.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListFunctionNameHistory.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseListSBOM.CustomTypeAdapterFactory()); - 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.BaseResponseParams.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.BaseResponseTagSearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseTaskResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseTaskStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseTriageReportResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseUnionGetAiDecompilationRatingResponseNoneType.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseUploadResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseVulnerabilities.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseXrefResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Basic.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchBinaryMatchResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchMatchingOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchRenameInputBody.CustomTypeAdapterFactory()); @@ -225,54 +132,21 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchUpdateDataTypesItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchUpdateDataTypesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchUpdateDataTypesResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinariesRelatedStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Binary.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryAdditionalDetailsDataResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryAdditionalResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryConfig.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryDetailsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryExternalsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkCreateUserResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkCreateUsersOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BulkDeleteAnalysesRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CallEdge.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CallEdgesOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CalleeFunctionInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CalleesCallerFunctionsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CallerFunctionInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CanonicalName.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CanonicalizeNamesInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CanonicalizeNamesOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Capabilities.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CapabilitiesAgentResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CapabilitiesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CapabilityEntry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ChildBinariesResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CodeSignatureModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionBinariesUpdateRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionBinariesUpdateResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionBinaryResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionCreateRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionListItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionListItemBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionResponseBinariesInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionSearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionSearchResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionTagsUpdateRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionTagsUpdateResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionUpdateRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentBase.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentUpdateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CommentsData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConfigResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConfirmToolInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Connection.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConsoleOutputEntry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Context.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Conversation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationContext.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ConversationWithEvents.CustomTypeAdapterFactory()); @@ -288,29 +162,15 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreatePortalSessionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateTeamInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateUserInputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Created.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DataTypesEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompFailedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompFinishedEvent.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompilationCommentContext.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DecompilationData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DieMatch.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DisassemblyOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DnsQuery.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DrakvufFileMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.DynamicExecutionStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFImportModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFRelocation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFSection.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFSecurity.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFSegment.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ELFSymbol.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ElfDynamicEntry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.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.EventAttemptFailed.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventAttemptStarted.CustomTypeAdapterFactory()); @@ -339,73 +199,36 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCONFIRMATIONREQUIRED.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventWarning.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Example.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExportModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExternalResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ExtractedURL.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileActivityEntry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileHashes.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FormFile.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FuncDepsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionArgument.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlockDestinationResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlockResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBlocksResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionBoundary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionCallEdges.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionCapabilityResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDataTypes.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDataTypesList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDataTypesListItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDataTypesParams.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDataTypesStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDependency.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDetailsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionHeader.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionListItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionLocalVariableResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMapping.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMatch.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionNameHistory.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionParamResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionRename.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionRenameMap.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionSearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionSearchResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionStackVariable.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionString.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionStringItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionStringsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionType.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionsDetailResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionsListRename.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GenerateFunctionDataTypes.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GeneratePDFOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GenerationStatusList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAdditionalDetailsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAdditionalDetailsStatusOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAiDecompilationRatingResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAnalysisStringsStatusOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetCollectionOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetMatchesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetMatchesStatusOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetProductsOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetPublicUserResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetSubscriptionOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GlobalVariable.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.HistoryEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.HttpRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IOC.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IconModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedFunctionCallerEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedFunctionDetailOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportedFunctionEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IndirectCallSite.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IndirectCallSitesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InlineComment.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InsertAnalysisLogRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InviteUserInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.IssuerAllowedDomain.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysesOutputBody.CustomTypeAdapterFactory()); @@ -413,7 +236,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisFunctionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisStringsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListArchiveContentsOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionResults.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListExampleAnalysesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionStringsOutputBody.CustomTypeAdapterFactory()); @@ -422,28 +244,19 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListTeamsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListUsersOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.LocationOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Logs.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MITRETechnique.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MatchFilters.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MatchedFunction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MemdumpEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MessageBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MetaModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ModelsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ModuleLoadEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MutexEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NameConfidence.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NameSourceType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.NetworkActivity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OIDCCallbackInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Organisation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OrganisationGroup.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OrganisationIssuer.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.OrganisationOwner.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.PasswordResetInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionBinariesInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PatchCollectionBinariesOutputBody.CustomTypeAdapterFactory()); @@ -464,43 +277,26 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProductSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProgressMessage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProseEvent.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PutAnalysisStringsRequest.CustomTypeAdapterFactory()); - 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.RefreshBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RegenerateOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RegisterUserInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RegistryOperation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RelativeBinaryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameAppliedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RenameOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReplacementValue.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportAnalysisResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReportOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.RevokeBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SBOM.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SBOMPackage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SSOProvider.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SSOProvidersOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SandboxOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ScheduledTaskEntry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ScrapeThirdPartyConfig.CustomTypeAdapterFactory()); - 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.ServerSentEventsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ServerSentEventsInner1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ServiceEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SessionOutputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.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.SourceDeltaEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SourceResetEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventContextCompactedData.CustomTypeAdapterFactory()); @@ -520,39 +316,21 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.StartBatchMatchingInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StartMatchingForAnalysisInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StartMatchingForFunctionsInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StartMatchingOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StartupInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StringFunctions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Structure.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.StructureMember.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SubmitUserFeedbackRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SummaryData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Symbols.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Tag.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagSearchResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TagSearchResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TaskResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TaskStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TcpCarvedFile.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Team.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TeamMember.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TimestampModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TokenisedData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriageFunctionResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriageReportResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriggerDynamicExecutionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Ttp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TypeDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateDataTypesInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateDataTypesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateIssuerInputBody.CustomTypeAdapterFactory()); @@ -563,25 +341,14 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateUserCreditsInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateUserInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateUserPasswordInputBody.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UploadResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpsertAiDecomplationRatingRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpsertOverridesData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpsertOverridesInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.User.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserActivityResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserCredits.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserIdentity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserProfile.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2FunctionHeader.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2FunctionInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2FunctionType.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Vulnerabilities.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Vulnerability.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.WarningEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.WorkflowProgress.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.XrefFromResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.XrefResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.XrefToResponse.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/src/main/java/ai/reveng/model/AdditionalDetailsStatusResponse.java b/src/main/java/ai/reveng/model/AdditionalDetailsStatusResponse.java deleted file mode 100644 index 98559ef..0000000 --- a/src/main/java/ai/reveng/model/AdditionalDetailsStatusResponse.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AdditionalDetailsStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalDetailsStatusResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private String status; - - public AdditionalDetailsStatusResponse() { - } - - public AdditionalDetailsStatusResponse status(@javax.annotation.Nonnull String status) { - this.status = status; - return this; - } - - /** - * The current status of the additional details task - * @return status - */ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull String status) { - this.status = status; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AdditionalDetailsStatusResponse instance itself - */ - public AdditionalDetailsStatusResponse 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; - } - AdditionalDetailsStatusResponse additionalDetailsStatusResponse = (AdditionalDetailsStatusResponse) o; - return Objects.equals(this.status, additionalDetailsStatusResponse.status)&& - Objects.equals(this.additionalProperties, additionalDetailsStatusResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(status, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalDetailsStatusResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("status")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AdditionalDetailsStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AdditionalDetailsStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AdditionalDetailsStatusResponse is not found in the empty JSON string", AdditionalDetailsStatusResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AdditionalDetailsStatusResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AdditionalDetailsStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AdditionalDetailsStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AdditionalDetailsStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AdditionalDetailsStatusResponse 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 AdditionalDetailsStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AdditionalDetailsStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AdditionalDetailsStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalDetailsStatusResponse - * @throws IOException if the JSON string is invalid with respect to AdditionalDetailsStatusResponse - */ - public static AdditionalDetailsStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AdditionalDetailsStatusResponse.class); - } - - /** - * Convert an instance of AdditionalDetailsStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AiDecompilationRating.java b/src/main/java/ai/reveng/model/AiDecompilationRating.java deleted file mode 100644 index 42690d4..0000000 --- a/src/main/java/ai/reveng/model/AiDecompilationRating.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets AiDecompilationRating - */ -@JsonAdapter(AiDecompilationRating.Adapter.class) -public enum AiDecompilationRating { - - POSITIVE("POSITIVE"), - - NEGATIVE("NEGATIVE"), - - NEUTRAL("NEUTRAL"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - AiDecompilationRating(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AiDecompilationRating fromValue(String value) { - for (AiDecompilationRating b : AiDecompilationRating.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AiDecompilationRating enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AiDecompilationRating read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AiDecompilationRating.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AiDecompilationRating.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisAccessInfo.java b/src/main/java/ai/reveng/model/AnalysisAccessInfo.java deleted file mode 100644 index d219495..0000000 --- a/src/main/java/ai/reveng/model/AnalysisAccessInfo.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisAccessInfo - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisAccessInfo { - public static final String SERIALIZED_NAME_OWNER = "owner"; - @SerializedName(SERIALIZED_NAME_OWNER) - @javax.annotation.Nonnull - private Boolean owner; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - @javax.annotation.Nonnull - private String username; - - public AnalysisAccessInfo() { - } - - public AnalysisAccessInfo owner(@javax.annotation.Nonnull Boolean owner) { - this.owner = owner; - return this; - } - - /** - * Get owner - * @return owner - */ - @javax.annotation.Nonnull - public Boolean getOwner() { - return owner; - } - - public void setOwner(@javax.annotation.Nonnull Boolean owner) { - this.owner = owner; - } - - - public AnalysisAccessInfo username(@javax.annotation.Nonnull String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(@javax.annotation.Nonnull String username) { - this.username = username; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisAccessInfo instance itself - */ - public AnalysisAccessInfo 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; - } - AnalysisAccessInfo analysisAccessInfo = (AnalysisAccessInfo) o; - return Objects.equals(this.owner, analysisAccessInfo.owner) && - Objects.equals(this.username, analysisAccessInfo.username)&& - Objects.equals(this.additionalProperties, analysisAccessInfo.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(owner, username, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisAccessInfo {\n"); - sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("owner", "username")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("owner", "username")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisAccessInfo - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisAccessInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisAccessInfo is not found in the empty JSON string", AnalysisAccessInfo.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisAccessInfo.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisAccessInfo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisAccessInfo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisAccessInfo.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisAccessInfo 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 AnalysisAccessInfo read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisAccessInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisAccessInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisAccessInfo - * @throws IOException if the JSON string is invalid with respect to AnalysisAccessInfo - */ - public static AnalysisAccessInfo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisAccessInfo.class); - } - - /** - * Convert an instance of AnalysisAccessInfo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisBulkAddTagsRequest.java b/src/main/java/ai/reveng/model/AnalysisBulkAddTagsRequest.java deleted file mode 100644 index 5cd0cf5..0000000 --- a/src/main/java/ai/reveng/model/AnalysisBulkAddTagsRequest.java +++ /dev/null @@ -1,342 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisBulkAddTagsRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisBulkAddTagsRequest { - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nonnull - private List tags = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ANALYSIS_IDS = "analysis_ids"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_IDS) - @javax.annotation.Nonnull - private List analysisIds = new ArrayList<>(); - - public AnalysisBulkAddTagsRequest() { - } - - public AnalysisBulkAddTagsRequest tags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - return this; - } - - public AnalysisBulkAddTagsRequest addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @javax.annotation.Nonnull - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - } - - - public AnalysisBulkAddTagsRequest analysisIds(@javax.annotation.Nonnull List analysisIds) { - this.analysisIds = analysisIds; - return this; - } - - public AnalysisBulkAddTagsRequest addAnalysisIdsItem(Integer analysisIdsItem) { - if (this.analysisIds == null) { - this.analysisIds = new ArrayList<>(); - } - this.analysisIds.add(analysisIdsItem); - return this; - } - - /** - * Get analysisIds - * @return analysisIds - */ - @javax.annotation.Nonnull - public List getAnalysisIds() { - return analysisIds; - } - - public void setAnalysisIds(@javax.annotation.Nonnull List analysisIds) { - this.analysisIds = analysisIds; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisBulkAddTagsRequest instance itself - */ - public AnalysisBulkAddTagsRequest 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; - } - AnalysisBulkAddTagsRequest analysisBulkAddTagsRequest = (AnalysisBulkAddTagsRequest) o; - return Objects.equals(this.tags, analysisBulkAddTagsRequest.tags) && - Objects.equals(this.analysisIds, analysisBulkAddTagsRequest.analysisIds)&& - Objects.equals(this.additionalProperties, analysisBulkAddTagsRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(tags, analysisIds, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisBulkAddTagsRequest {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" analysisIds: ").append(toIndentedString(analysisIds)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("tags", "analysis_ids")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("tags", "analysis_ids")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisBulkAddTagsRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisBulkAddTagsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisBulkAddTagsRequest is not found in the empty JSON string", AnalysisBulkAddTagsRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisBulkAddTagsRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("tags") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - // ensure the required json array is present - if (jsonObj.get("analysis_ids") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("analysis_ids").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_ids` to be an array in the JSON string but got `%s`", jsonObj.get("analysis_ids").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisBulkAddTagsRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisBulkAddTagsRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisBulkAddTagsRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisBulkAddTagsRequest 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 AnalysisBulkAddTagsRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisBulkAddTagsRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisBulkAddTagsRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisBulkAddTagsRequest - * @throws IOException if the JSON string is invalid with respect to AnalysisBulkAddTagsRequest - */ - public static AnalysisBulkAddTagsRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisBulkAddTagsRequest.class); - } - - /** - * Convert an instance of AnalysisBulkAddTagsRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisBulkAddTagsResponse.java b/src/main/java/ai/reveng/model/AnalysisBulkAddTagsResponse.java deleted file mode 100644 index d8731e8..0000000 --- a/src/main/java/ai/reveng/model/AnalysisBulkAddTagsResponse.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.AnalysisBulkAddTagsResponseItem; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisBulkAddTagsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisBulkAddTagsResponse { - public static final String SERIALIZED_NAME_RESULTS = "results"; - @SerializedName(SERIALIZED_NAME_RESULTS) - @javax.annotation.Nonnull - private List results = new ArrayList<>(); - - public AnalysisBulkAddTagsResponse() { - } - - public AnalysisBulkAddTagsResponse results(@javax.annotation.Nonnull List results) { - this.results = results; - return this; - } - - public AnalysisBulkAddTagsResponse addResultsItem(AnalysisBulkAddTagsResponseItem resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Get results - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(@javax.annotation.Nonnull List results) { - this.results = results; - } - - /** - * 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 AnalysisBulkAddTagsResponse instance itself - */ - public AnalysisBulkAddTagsResponse 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; - } - AnalysisBulkAddTagsResponse analysisBulkAddTagsResponse = (AnalysisBulkAddTagsResponse) o; - return Objects.equals(this.results, analysisBulkAddTagsResponse.results)&& - Objects.equals(this.additionalProperties, analysisBulkAddTagsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(results, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisBulkAddTagsResponse {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("results")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("results")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisBulkAddTagsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisBulkAddTagsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisBulkAddTagsResponse is not found in the empty JSON string", AnalysisBulkAddTagsResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisBulkAddTagsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("results") != null) { - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); - } - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - AnalysisBulkAddTagsResponseItem.validateJsonElement(jsonArrayresults.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisBulkAddTagsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisBulkAddTagsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisBulkAddTagsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisBulkAddTagsResponse 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 AnalysisBulkAddTagsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisBulkAddTagsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisBulkAddTagsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisBulkAddTagsResponse - * @throws IOException if the JSON string is invalid with respect to AnalysisBulkAddTagsResponse - */ - public static AnalysisBulkAddTagsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisBulkAddTagsResponse.class); - } - - /** - * Convert an instance of AnalysisBulkAddTagsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisBulkAddTagsResponseItem.java b/src/main/java/ai/reveng/model/AnalysisBulkAddTagsResponseItem.java deleted file mode 100644 index 21b43db..0000000 --- a/src/main/java/ai/reveng/model/AnalysisBulkAddTagsResponseItem.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisBulkAddTagsResponseItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisBulkAddTagsResponseItem { - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - @javax.annotation.Nullable - private String message; - - public static final String SERIALIZED_NAME_ERROR = "error"; - @SerializedName(SERIALIZED_NAME_ERROR) - @javax.annotation.Nullable - private String error; - - public AnalysisBulkAddTagsResponseItem() { - } - - public AnalysisBulkAddTagsResponseItem analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * Get analysisId - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public AnalysisBulkAddTagsResponseItem message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Success message if the update was successful - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public AnalysisBulkAddTagsResponseItem error(@javax.annotation.Nullable String error) { - this.error = error; - return this; - } - - /** - * Error message if the update failed - * @return error - */ - @javax.annotation.Nullable - public String getError() { - return error; - } - - public void setError(@javax.annotation.Nullable String error) { - this.error = error; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisBulkAddTagsResponseItem instance itself - */ - public AnalysisBulkAddTagsResponseItem 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; - } - AnalysisBulkAddTagsResponseItem analysisBulkAddTagsResponseItem = (AnalysisBulkAddTagsResponseItem) o; - return Objects.equals(this.analysisId, analysisBulkAddTagsResponseItem.analysisId) && - Objects.equals(this.message, analysisBulkAddTagsResponseItem.message) && - Objects.equals(this.error, analysisBulkAddTagsResponseItem.error)&& - Objects.equals(this.additionalProperties, analysisBulkAddTagsResponseItem.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(analysisId, message, error, 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 AnalysisBulkAddTagsResponseItem {\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_id", "message", "error")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "message")); - } - - /** - * 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 AnalysisBulkAddTagsResponseItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisBulkAddTagsResponseItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisBulkAddTagsResponseItem is not found in the empty JSON string", AnalysisBulkAddTagsResponseItem.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisBulkAddTagsResponseItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisBulkAddTagsResponseItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisBulkAddTagsResponseItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisBulkAddTagsResponseItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisBulkAddTagsResponseItem 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 AnalysisBulkAddTagsResponseItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisBulkAddTagsResponseItem instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisBulkAddTagsResponseItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisBulkAddTagsResponseItem - * @throws IOException if the JSON string is invalid with respect to AnalysisBulkAddTagsResponseItem - */ - public static AnalysisBulkAddTagsResponseItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisBulkAddTagsResponseItem.class); - } - - /** - * Convert an instance of AnalysisBulkAddTagsResponseItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisConfig.java b/src/main/java/ai/reveng/model/AnalysisConfig.java deleted file mode 100644 index f01d593..0000000 --- a/src/main/java/ai/reveng/model/AnalysisConfig.java +++ /dev/null @@ -1,445 +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 ai.reveng.model.SandboxOptions; -import ai.reveng.model.ScrapeThirdPartyConfig; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisConfig - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisConfig { - public static final String SERIALIZED_NAME_SCRAPE_THIRD_PARTY_CONFIG = "scrape_third_party_config"; - @SerializedName(SERIALIZED_NAME_SCRAPE_THIRD_PARTY_CONFIG) - @javax.annotation.Nullable - private ScrapeThirdPartyConfig scrapeThirdPartyConfig; - - public static final String SERIALIZED_NAME_GENERATE_CVES = "generate_cves"; - @SerializedName(SERIALIZED_NAME_GENERATE_CVES) - @javax.annotation.Nullable - private Boolean generateCves = false; - - public static final String SERIALIZED_NAME_GENERATE_SBOM = "generate_sbom"; - @SerializedName(SERIALIZED_NAME_GENERATE_SBOM) - @javax.annotation.Nullable - private Boolean generateSbom = false; - - public static final String SERIALIZED_NAME_GENERATE_CAPABILITIES = "generate_capabilities"; - @SerializedName(SERIALIZED_NAME_GENERATE_CAPABILITIES) - @javax.annotation.Nullable - private Boolean generateCapabilities = false; - - public static final String SERIALIZED_NAME_NO_CACHE = "no_cache"; - @SerializedName(SERIALIZED_NAME_NO_CACHE) - @javax.annotation.Nullable - private Boolean noCache = false; - - public static final String SERIALIZED_NAME_ADVANCED_ANALYSIS = "advanced_analysis"; - @SerializedName(SERIALIZED_NAME_ADVANCED_ANALYSIS) - @javax.annotation.Nullable - private Boolean advancedAnalysis = false; - - public static final String SERIALIZED_NAME_SANDBOX_CONFIG = "sandbox_config"; - @SerializedName(SERIALIZED_NAME_SANDBOX_CONFIG) - @javax.annotation.Nullable - private SandboxOptions sandboxConfig; - - public AnalysisConfig() { - } - - public AnalysisConfig scrapeThirdPartyConfig(@javax.annotation.Nullable ScrapeThirdPartyConfig scrapeThirdPartyConfig) { - this.scrapeThirdPartyConfig = scrapeThirdPartyConfig; - return this; - } - - /** - * Settings to scrape third party sources - * @return scrapeThirdPartyConfig - */ - @javax.annotation.Nullable - public ScrapeThirdPartyConfig getScrapeThirdPartyConfig() { - return scrapeThirdPartyConfig; - } - - public void setScrapeThirdPartyConfig(@javax.annotation.Nullable ScrapeThirdPartyConfig scrapeThirdPartyConfig) { - this.scrapeThirdPartyConfig = scrapeThirdPartyConfig; - } - - - public AnalysisConfig generateCves(@javax.annotation.Nullable Boolean generateCves) { - this.generateCves = generateCves; - return this; - } - - /** - * A configuration option for fetching CVEs data. - * @return generateCves - */ - @javax.annotation.Nullable - public Boolean getGenerateCves() { - return generateCves; - } - - public void setGenerateCves(@javax.annotation.Nullable Boolean generateCves) { - this.generateCves = generateCves; - } - - - public AnalysisConfig generateSbom(@javax.annotation.Nullable Boolean generateSbom) { - this.generateSbom = generateSbom; - return this; - } - - /** - * A configuration option for generating software bill of materials data. - * @return generateSbom - */ - @javax.annotation.Nullable - public Boolean getGenerateSbom() { - return generateSbom; - } - - public void setGenerateSbom(@javax.annotation.Nullable Boolean generateSbom) { - this.generateSbom = generateSbom; - } - - - public AnalysisConfig generateCapabilities(@javax.annotation.Nullable Boolean generateCapabilities) { - this.generateCapabilities = generateCapabilities; - return this; - } - - /** - * A configuration option for generating capabilities of a binary - * @return generateCapabilities - */ - @javax.annotation.Nullable - public Boolean getGenerateCapabilities() { - return generateCapabilities; - } - - public void setGenerateCapabilities(@javax.annotation.Nullable Boolean generateCapabilities) { - this.generateCapabilities = generateCapabilities; - } - - - public AnalysisConfig noCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - return this; - } - - /** - * When enabled, skips using cached data within the processing. - * @return noCache - */ - @javax.annotation.Nullable - public Boolean getNoCache() { - return noCache; - } - - public void setNoCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - } - - - public AnalysisConfig advancedAnalysis(@javax.annotation.Nullable Boolean advancedAnalysis) { - this.advancedAnalysis = advancedAnalysis; - return this; - } - - /** - * Enables an advanced security analysis. - * @return advancedAnalysis - */ - @javax.annotation.Nullable - public Boolean getAdvancedAnalysis() { - return advancedAnalysis; - } - - public void setAdvancedAnalysis(@javax.annotation.Nullable Boolean advancedAnalysis) { - this.advancedAnalysis = advancedAnalysis; - } - - - public AnalysisConfig sandboxConfig(@javax.annotation.Nullable SandboxOptions sandboxConfig) { - this.sandboxConfig = sandboxConfig; - return this; - } - - /** - * Including a sandbox config enables the dynamic execution sandbox - * @return sandboxConfig - */ - @javax.annotation.Nullable - public SandboxOptions getSandboxConfig() { - return sandboxConfig; - } - - public void setSandboxConfig(@javax.annotation.Nullable SandboxOptions sandboxConfig) { - this.sandboxConfig = sandboxConfig; - } - - /** - * 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 AnalysisConfig instance itself - */ - public AnalysisConfig 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; - } - AnalysisConfig analysisConfig = (AnalysisConfig) o; - return Objects.equals(this.scrapeThirdPartyConfig, analysisConfig.scrapeThirdPartyConfig) && - Objects.equals(this.generateCves, analysisConfig.generateCves) && - Objects.equals(this.generateSbom, analysisConfig.generateSbom) && - Objects.equals(this.generateCapabilities, analysisConfig.generateCapabilities) && - Objects.equals(this.noCache, analysisConfig.noCache) && - Objects.equals(this.advancedAnalysis, analysisConfig.advancedAnalysis) && - Objects.equals(this.sandboxConfig, analysisConfig.sandboxConfig)&& - Objects.equals(this.additionalProperties, analysisConfig.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(scrapeThirdPartyConfig, generateCves, generateSbom, generateCapabilities, noCache, advancedAnalysis, sandboxConfig, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisConfig {\n"); - sb.append(" scrapeThirdPartyConfig: ").append(toIndentedString(scrapeThirdPartyConfig)).append("\n"); - sb.append(" generateCves: ").append(toIndentedString(generateCves)).append("\n"); - sb.append(" generateSbom: ").append(toIndentedString(generateSbom)).append("\n"); - sb.append(" generateCapabilities: ").append(toIndentedString(generateCapabilities)).append("\n"); - sb.append(" noCache: ").append(toIndentedString(noCache)).append("\n"); - sb.append(" advancedAnalysis: ").append(toIndentedString(advancedAnalysis)).append("\n"); - sb.append(" sandboxConfig: ").append(toIndentedString(sandboxConfig)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("scrape_third_party_config", "generate_cves", "generate_sbom", "generate_capabilities", "no_cache", "advanced_analysis", "sandbox_config")); - - // 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 AnalysisConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisConfig is not found in the empty JSON string", AnalysisConfig.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `scrape_third_party_config` - if (jsonObj.get("scrape_third_party_config") != null && !jsonObj.get("scrape_third_party_config").isJsonNull()) { - ScrapeThirdPartyConfig.validateJsonElement(jsonObj.get("scrape_third_party_config")); - } - // validate the optional field `sandbox_config` - if (jsonObj.get("sandbox_config") != null && !jsonObj.get("sandbox_config").isJsonNull()) { - SandboxOptions.validateJsonElement(jsonObj.get("sandbox_config")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisConfig 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 AnalysisConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisConfig instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisConfig - * @throws IOException if the JSON string is invalid with respect to AnalysisConfig - */ - public static AnalysisConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisConfig.class); - } - - /** - * Convert an instance of AnalysisConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisConfigSnapshot.java b/src/main/java/ai/reveng/model/AnalysisConfigSnapshot.java deleted file mode 100644 index 99ee62b..0000000 --- a/src/main/java/ai/reveng/model/AnalysisConfigSnapshot.java +++ /dev/null @@ -1,390 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Point-in-time record of which features an analysis was submitted with. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisConfigSnapshot { - public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; - @SerializedName(SERIALIZED_NAME_FUNCTIONS) - @javax.annotation.Nonnull - private Boolean functions; - - public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; - @SerializedName(SERIALIZED_NAME_SANDBOX) - @javax.annotation.Nonnull - private Boolean sandbox; - - public static final String SERIALIZED_NAME_SCRAPE = "scrape"; - @SerializedName(SERIALIZED_NAME_SCRAPE) - @javax.annotation.Nonnull - private Boolean scrape; - - public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; - @SerializedName(SERIALIZED_NAME_CAPABILITIES) - @javax.annotation.Nonnull - private Boolean capabilities; - - public static final String SERIALIZED_NAME_TRIAGE = "triage"; - @SerializedName(SERIALIZED_NAME_TRIAGE) - @javax.annotation.Nonnull - private Boolean triage; - - public AnalysisConfigSnapshot() { - } - - public AnalysisConfigSnapshot functions(@javax.annotation.Nonnull Boolean functions) { - this.functions = functions; - return this; - } - - /** - * Get functions - * @return functions - */ - @javax.annotation.Nonnull - public Boolean getFunctions() { - return functions; - } - - public void setFunctions(@javax.annotation.Nonnull Boolean functions) { - this.functions = functions; - } - - - public AnalysisConfigSnapshot sandbox(@javax.annotation.Nonnull Boolean sandbox) { - this.sandbox = sandbox; - return this; - } - - /** - * Get sandbox - * @return sandbox - */ - @javax.annotation.Nonnull - public Boolean getSandbox() { - return sandbox; - } - - public void setSandbox(@javax.annotation.Nonnull Boolean sandbox) { - this.sandbox = sandbox; - } - - - public AnalysisConfigSnapshot scrape(@javax.annotation.Nonnull Boolean scrape) { - this.scrape = scrape; - return this; - } - - /** - * Get scrape - * @return scrape - */ - @javax.annotation.Nonnull - public Boolean getScrape() { - return scrape; - } - - public void setScrape(@javax.annotation.Nonnull Boolean scrape) { - this.scrape = scrape; - } - - - public AnalysisConfigSnapshot capabilities(@javax.annotation.Nonnull Boolean capabilities) { - this.capabilities = capabilities; - return this; - } - - /** - * Get capabilities - * @return capabilities - */ - @javax.annotation.Nonnull - public Boolean getCapabilities() { - return capabilities; - } - - public void setCapabilities(@javax.annotation.Nonnull Boolean capabilities) { - this.capabilities = capabilities; - } - - - public AnalysisConfigSnapshot triage(@javax.annotation.Nonnull Boolean triage) { - this.triage = triage; - return this; - } - - /** - * Get triage - * @return triage - */ - @javax.annotation.Nonnull - public Boolean getTriage() { - return triage; - } - - public void setTriage(@javax.annotation.Nonnull Boolean triage) { - this.triage = triage; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisConfigSnapshot instance itself - */ - public AnalysisConfigSnapshot 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; - } - AnalysisConfigSnapshot analysisConfigSnapshot = (AnalysisConfigSnapshot) o; - return Objects.equals(this.functions, analysisConfigSnapshot.functions) && - Objects.equals(this.sandbox, analysisConfigSnapshot.sandbox) && - Objects.equals(this.scrape, analysisConfigSnapshot.scrape) && - Objects.equals(this.capabilities, analysisConfigSnapshot.capabilities) && - Objects.equals(this.triage, analysisConfigSnapshot.triage)&& - Objects.equals(this.additionalProperties, analysisConfigSnapshot.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functions, sandbox, scrape, capabilities, triage, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisConfigSnapshot {\n"); - sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); - sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); - sb.append(" scrape: ").append(toIndentedString(scrape)).append("\n"); - sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); - sb.append(" triage: ").append(toIndentedString(triage)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("functions", "sandbox", "scrape", "capabilities", "triage")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("functions", "sandbox", "scrape", "capabilities", "triage")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisConfigSnapshot - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisConfigSnapshot.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisConfigSnapshot is not found in the empty JSON string", AnalysisConfigSnapshot.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisConfigSnapshot.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisConfigSnapshot.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisConfigSnapshot' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisConfigSnapshot.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisConfigSnapshot 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 AnalysisConfigSnapshot read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisConfigSnapshot instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisConfigSnapshot given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisConfigSnapshot - * @throws IOException if the JSON string is invalid with respect to AnalysisConfigSnapshot - */ - public static AnalysisConfigSnapshot fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisConfigSnapshot.class); - } - - /** - * Convert an instance of AnalysisConfigSnapshot to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisCreateRequest.java b/src/main/java/ai/reveng/model/AnalysisCreateRequest.java deleted file mode 100644 index cca8999..0000000 --- a/src/main/java/ai/reveng/model/AnalysisCreateRequest.java +++ /dev/null @@ -1,565 +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 ai.reveng.model.AnalysisConfig; -import ai.reveng.model.AnalysisScope; -import ai.reveng.model.AutoRunAgents; -import ai.reveng.model.BinaryConfig; -import ai.reveng.model.Symbols; -import ai.reveng.model.Tag; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisCreateRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisCreateRequest { - public static final String SERIALIZED_NAME_FILENAME = "filename"; - @SerializedName(SERIALIZED_NAME_FILENAME) - @javax.annotation.Nonnull - private String filename; - - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nullable - private List tags = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ANALYSIS_SCOPE = "analysis_scope"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_SCOPE) - @javax.annotation.Nullable - private AnalysisScope analysisScope = AnalysisScope.PRIVATE; - - public static final String SERIALIZED_NAME_SYMBOLS = "symbols"; - @SerializedName(SERIALIZED_NAME_SYMBOLS) - @javax.annotation.Nullable - private Symbols symbols; - - public static final String SERIALIZED_NAME_DEBUG_HASH = "debug_hash"; - @SerializedName(SERIALIZED_NAME_DEBUG_HASH) - @javax.annotation.Nullable - private String debugHash; - - public static final String SERIALIZED_NAME_ANALYSIS_CONFIG = "analysis_config"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_CONFIG) - @javax.annotation.Nullable - private AnalysisConfig analysisConfig; - - public static final String SERIALIZED_NAME_BINARY_CONFIG = "binary_config"; - @SerializedName(SERIALIZED_NAME_BINARY_CONFIG) - @javax.annotation.Nullable - private BinaryConfig binaryConfig; - - public static final String SERIALIZED_NAME_AUTO_RUN_AGENTS = "auto_run_agents"; - @SerializedName(SERIALIZED_NAME_AUTO_RUN_AGENTS) - @javax.annotation.Nullable - private AutoRunAgents autoRunAgents; - - public AnalysisCreateRequest() { - } - - public AnalysisCreateRequest filename(@javax.annotation.Nonnull String filename) { - this.filename = filename; - return this; - } - - /** - * The name of the file - * @return filename - */ - @javax.annotation.Nonnull - public String getFilename() { - return filename; - } - - public void setFilename(@javax.annotation.Nonnull String filename) { - this.filename = filename; - } - - - public AnalysisCreateRequest sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * The sha256 hash of the file - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public AnalysisCreateRequest tags(@javax.annotation.Nullable List tags) { - this.tags = tags; - return this; - } - - public AnalysisCreateRequest addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * List of tags to assign to an analysis - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nullable List tags) { - this.tags = tags; - } - - - public AnalysisCreateRequest analysisScope(@javax.annotation.Nullable AnalysisScope analysisScope) { - this.analysisScope = analysisScope; - return this; - } - - /** - * The scope of the analysis determines who can access it - * @return analysisScope - */ - @javax.annotation.Nullable - public AnalysisScope getAnalysisScope() { - return analysisScope; - } - - public void setAnalysisScope(@javax.annotation.Nullable AnalysisScope analysisScope) { - this.analysisScope = analysisScope; - } - - - public AnalysisCreateRequest symbols(@javax.annotation.Nullable Symbols symbols) { - this.symbols = symbols; - return this; - } - - /** - * Symbols are user-defined properties which inform how the binary is decompiled - * @return symbols - */ - @javax.annotation.Nullable - public Symbols getSymbols() { - return symbols; - } - - public void setSymbols(@javax.annotation.Nullable Symbols symbols) { - this.symbols = symbols; - } - - - public AnalysisCreateRequest debugHash(@javax.annotation.Nullable String debugHash) { - this.debugHash = debugHash; - return this; - } - - /** - * Hash of the debug file - * @return debugHash - */ - @javax.annotation.Nullable - public String getDebugHash() { - return debugHash; - } - - public void setDebugHash(@javax.annotation.Nullable String debugHash) { - this.debugHash = debugHash; - } - - - public AnalysisCreateRequest analysisConfig(@javax.annotation.Nullable AnalysisConfig analysisConfig) { - this.analysisConfig = analysisConfig; - return this; - } - - /** - * The analysis config enables the configuration of optional analysis stages - * @return analysisConfig - */ - @javax.annotation.Nullable - public AnalysisConfig getAnalysisConfig() { - return analysisConfig; - } - - public void setAnalysisConfig(@javax.annotation.Nullable AnalysisConfig analysisConfig) { - this.analysisConfig = analysisConfig; - } - - - public AnalysisCreateRequest binaryConfig(@javax.annotation.Nullable BinaryConfig binaryConfig) { - this.binaryConfig = binaryConfig; - return this; - } - - /** - * The binary config can override automatically determined values such as ISA, Platform, File Format, etc - * @return binaryConfig - */ - @javax.annotation.Nullable - public BinaryConfig getBinaryConfig() { - return binaryConfig; - } - - public void setBinaryConfig(@javax.annotation.Nullable BinaryConfig binaryConfig) { - this.binaryConfig = binaryConfig; - } - - - public AnalysisCreateRequest autoRunAgents(@javax.annotation.Nullable AutoRunAgents autoRunAgents) { - this.autoRunAgents = autoRunAgents; - return this; - } - - /** - * Get autoRunAgents - * @return autoRunAgents - */ - @javax.annotation.Nullable - public AutoRunAgents getAutoRunAgents() { - return autoRunAgents; - } - - public void setAutoRunAgents(@javax.annotation.Nullable AutoRunAgents autoRunAgents) { - this.autoRunAgents = autoRunAgents; - } - - /** - * 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 AnalysisCreateRequest instance itself - */ - public AnalysisCreateRequest 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; - } - AnalysisCreateRequest analysisCreateRequest = (AnalysisCreateRequest) o; - return Objects.equals(this.filename, analysisCreateRequest.filename) && - Objects.equals(this.sha256Hash, analysisCreateRequest.sha256Hash) && - Objects.equals(this.tags, analysisCreateRequest.tags) && - Objects.equals(this.analysisScope, analysisCreateRequest.analysisScope) && - Objects.equals(this.symbols, analysisCreateRequest.symbols) && - Objects.equals(this.debugHash, analysisCreateRequest.debugHash) && - Objects.equals(this.analysisConfig, analysisCreateRequest.analysisConfig) && - Objects.equals(this.binaryConfig, analysisCreateRequest.binaryConfig) && - Objects.equals(this.autoRunAgents, analysisCreateRequest.autoRunAgents)&& - Objects.equals(this.additionalProperties, analysisCreateRequest.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(filename, sha256Hash, tags, analysisScope, symbols, debugHash, analysisConfig, binaryConfig, autoRunAgents, 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 AnalysisCreateRequest {\n"); - sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); - sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); - sb.append(" debugHash: ").append(toIndentedString(debugHash)).append("\n"); - sb.append(" analysisConfig: ").append(toIndentedString(analysisConfig)).append("\n"); - sb.append(" binaryConfig: ").append(toIndentedString(binaryConfig)).append("\n"); - sb.append(" autoRunAgents: ").append(toIndentedString(autoRunAgents)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("filename", "sha_256_hash", "tags", "analysis_scope", "symbols", "debug_hash", "analysis_config", "binary_config", "auto_run_agents")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("filename", "sha_256_hash")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisCreateRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisCreateRequest is not found in the empty JSON string", AnalysisCreateRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisCreateRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("filename").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); - } - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { - JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); - if (jsonArraytags != null) { - // ensure the json data is an array - if (!jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - - // validate the optional field `tags` (array) - for (int i = 0; i < jsonArraytags.size(); i++) { - Tag.validateJsonElement(jsonArraytags.get(i)); - }; - } - } - // validate the optional field `analysis_scope` - if (jsonObj.get("analysis_scope") != null && !jsonObj.get("analysis_scope").isJsonNull()) { - AnalysisScope.validateJsonElement(jsonObj.get("analysis_scope")); - } - // validate the optional field `symbols` - if (jsonObj.get("symbols") != null && !jsonObj.get("symbols").isJsonNull()) { - Symbols.validateJsonElement(jsonObj.get("symbols")); - } - if ((jsonObj.get("debug_hash") != null && !jsonObj.get("debug_hash").isJsonNull()) && !jsonObj.get("debug_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `debug_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("debug_hash").toString())); - } - // validate the optional field `analysis_config` - if (jsonObj.get("analysis_config") != null && !jsonObj.get("analysis_config").isJsonNull()) { - AnalysisConfig.validateJsonElement(jsonObj.get("analysis_config")); - } - // validate the optional field `binary_config` - if (jsonObj.get("binary_config") != null && !jsonObj.get("binary_config").isJsonNull()) { - BinaryConfig.validateJsonElement(jsonObj.get("binary_config")); - } - // validate the optional field `auto_run_agents` - if (jsonObj.get("auto_run_agents") != null && !jsonObj.get("auto_run_agents").isJsonNull()) { - AutoRunAgents.validateJsonElement(jsonObj.get("auto_run_agents")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisCreateRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisCreateRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisCreateRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisCreateRequest 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 AnalysisCreateRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisCreateRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisCreateRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisCreateRequest - * @throws IOException if the JSON string is invalid with respect to AnalysisCreateRequest - */ - public static AnalysisCreateRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisCreateRequest.class); - } - - /** - * Convert an instance of AnalysisCreateRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisCreateResponse.java b/src/main/java/ai/reveng/model/AnalysisCreateResponse.java deleted file mode 100644 index c2b5b88..0000000 --- a/src/main/java/ai/reveng/model/AnalysisCreateResponse.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 com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisCreateResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisCreateResponse { - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public AnalysisCreateResponse() { - } - - public AnalysisCreateResponse analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * ID of created analysis - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public AnalysisCreateResponse binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * ID of created binary - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - /** - * 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 AnalysisCreateResponse instance itself - */ - public AnalysisCreateResponse 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; - } - AnalysisCreateResponse analysisCreateResponse = (AnalysisCreateResponse) o; - return Objects.equals(this.analysisId, analysisCreateResponse.analysisId) && - Objects.equals(this.binaryId, analysisCreateResponse.binaryId)&& - Objects.equals(this.additionalProperties, analysisCreateResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(analysisId, binaryId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisCreateResponse {\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_id", "binary_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "binary_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 AnalysisCreateResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisCreateResponse is not found in the empty JSON string", AnalysisCreateResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisCreateResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisCreateResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisCreateResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisCreateResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisCreateResponse 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 AnalysisCreateResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisCreateResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisCreateResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisCreateResponse - * @throws IOException if the JSON string is invalid with respect to AnalysisCreateResponse - */ - public static AnalysisCreateResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisCreateResponse.class); - } - - /** - * Convert an instance of AnalysisCreateResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisDetailResponse.java b/src/main/java/ai/reveng/model/AnalysisDetailResponse.java deleted file mode 100644 index c0baba1..0000000 --- a/src/main/java/ai/reveng/model/AnalysisDetailResponse.java +++ /dev/null @@ -1,760 +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 ai.reveng.model.AnalysisAccessInfo; -import ai.reveng.model.AnalysisConfigSnapshot; -import ai.reveng.model.AutoRunAgents; -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.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisDetailResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisDetailResponse { - public static final String SERIALIZED_NAME_ACCESS = "access"; - @SerializedName(SERIALIZED_NAME_ACCESS) - @javax.annotation.Nonnull - private AnalysisAccessInfo access; - - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_ANALYSIS_SCOPE = "analysis_scope"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_SCOPE) - @javax.annotation.Nonnull - private String analysisScope; - - public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; - @SerializedName(SERIALIZED_NAME_ARCHITECTURE) - @javax.annotation.Nonnull - private String architecture; - - public static final String SERIALIZED_NAME_BINARY_DYNAMIC = "binary_dynamic"; - @SerializedName(SERIALIZED_NAME_BINARY_DYNAMIC) - @javax.annotation.Nonnull - private Boolean binaryDynamic; - - public static final String SERIALIZED_NAME_BINARY_FORMAT = "binary_format"; - @SerializedName(SERIALIZED_NAME_BINARY_FORMAT) - @javax.annotation.Nonnull - private String binaryFormat; - - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - public static final String SERIALIZED_NAME_BINARY_SIZE = "binary_size"; - @SerializedName(SERIALIZED_NAME_BINARY_SIZE) - @javax.annotation.Nonnull - private Integer binarySize; - - public static final String SERIALIZED_NAME_BINARY_TYPE = "binary_type"; - @SerializedName(SERIALIZED_NAME_BINARY_TYPE) - @javax.annotation.Nonnull - private String binaryType; - - public static final String SERIALIZED_NAME_CREATION = "creation"; - @SerializedName(SERIALIZED_NAME_CREATION) - @javax.annotation.Nonnull - private String creation; - - public static final String SERIALIZED_NAME_DASHBOARD_URL = "dashboard_url"; - @SerializedName(SERIALIZED_NAME_DASHBOARD_URL) - @javax.annotation.Nonnull - private String dashboardUrl; - - public static final String SERIALIZED_NAME_DEBUG = "debug"; - @SerializedName(SERIALIZED_NAME_DEBUG) - @javax.annotation.Nonnull - private Boolean debug; - - public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; - @SerializedName(SERIALIZED_NAME_MODEL_NAME) - @javax.annotation.Nonnull - private String modelName; - - public static final String SERIALIZED_NAME_SBOM = "sbom"; - @SerializedName(SERIALIZED_NAME_SBOM) - @javax.annotation.Nullable - private Map sbom; - - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_AUTO_RUN_AGENTS = "auto_run_agents"; - @SerializedName(SERIALIZED_NAME_AUTO_RUN_AGENTS) - @javax.annotation.Nonnull - private AutoRunAgents autoRunAgents; - - public static final String SERIALIZED_NAME_REQUESTED_CONFIG = "requested_config"; - @SerializedName(SERIALIZED_NAME_REQUESTED_CONFIG) - @javax.annotation.Nonnull - private AnalysisConfigSnapshot requestedConfig; - - public AnalysisDetailResponse() { - } - - public AnalysisDetailResponse access(@javax.annotation.Nonnull AnalysisAccessInfo access) { - this.access = access; - return this; - } - - /** - * Get access - * @return access - */ - @javax.annotation.Nonnull - public AnalysisAccessInfo getAccess() { - return access; - } - - public void setAccess(@javax.annotation.Nonnull AnalysisAccessInfo access) { - this.access = access; - } - - - public AnalysisDetailResponse analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * Get analysisId - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public AnalysisDetailResponse analysisScope(@javax.annotation.Nonnull String analysisScope) { - this.analysisScope = analysisScope; - return this; - } - - /** - * Get analysisScope - * @return analysisScope - */ - @javax.annotation.Nonnull - public String getAnalysisScope() { - return analysisScope; - } - - public void setAnalysisScope(@javax.annotation.Nonnull String analysisScope) { - this.analysisScope = analysisScope; - } - - - public AnalysisDetailResponse architecture(@javax.annotation.Nonnull String architecture) { - this.architecture = architecture; - return this; - } - - /** - * Get architecture - * @return architecture - */ - @javax.annotation.Nonnull - public String getArchitecture() { - return architecture; - } - - public void setArchitecture(@javax.annotation.Nonnull String architecture) { - this.architecture = architecture; - } - - - public AnalysisDetailResponse binaryDynamic(@javax.annotation.Nonnull Boolean binaryDynamic) { - this.binaryDynamic = binaryDynamic; - return this; - } - - /** - * Get binaryDynamic - * @return binaryDynamic - */ - @javax.annotation.Nonnull - public Boolean getBinaryDynamic() { - return binaryDynamic; - } - - public void setBinaryDynamic(@javax.annotation.Nonnull Boolean binaryDynamic) { - this.binaryDynamic = binaryDynamic; - } - - - public AnalysisDetailResponse binaryFormat(@javax.annotation.Nonnull String binaryFormat) { - this.binaryFormat = binaryFormat; - return this; - } - - /** - * Get binaryFormat - * @return binaryFormat - */ - @javax.annotation.Nonnull - public String getBinaryFormat() { - return binaryFormat; - } - - public void setBinaryFormat(@javax.annotation.Nonnull String binaryFormat) { - this.binaryFormat = binaryFormat; - } - - - public AnalysisDetailResponse binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * Get binaryName - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public AnalysisDetailResponse binarySize(@javax.annotation.Nonnull Integer binarySize) { - this.binarySize = binarySize; - return this; - } - - /** - * Get binarySize - * @return binarySize - */ - @javax.annotation.Nonnull - public Integer getBinarySize() { - return binarySize; - } - - public void setBinarySize(@javax.annotation.Nonnull Integer binarySize) { - this.binarySize = binarySize; - } - - - public AnalysisDetailResponse binaryType(@javax.annotation.Nonnull String binaryType) { - this.binaryType = binaryType; - return this; - } - - /** - * Get binaryType - * @return binaryType - */ - @javax.annotation.Nonnull - public String getBinaryType() { - return binaryType; - } - - public void setBinaryType(@javax.annotation.Nonnull String binaryType) { - this.binaryType = binaryType; - } - - - public AnalysisDetailResponse creation(@javax.annotation.Nonnull String creation) { - this.creation = creation; - return this; - } - - /** - * Get creation - * @return creation - */ - @javax.annotation.Nonnull - public String getCreation() { - return creation; - } - - public void setCreation(@javax.annotation.Nonnull String creation) { - this.creation = creation; - } - - - public AnalysisDetailResponse dashboardUrl(@javax.annotation.Nonnull String dashboardUrl) { - this.dashboardUrl = dashboardUrl; - return this; - } - - /** - * URL to view this analysis in the dashboard - * @return dashboardUrl - */ - @javax.annotation.Nonnull - public String getDashboardUrl() { - return dashboardUrl; - } - - public void setDashboardUrl(@javax.annotation.Nonnull String dashboardUrl) { - this.dashboardUrl = dashboardUrl; - } - - - public AnalysisDetailResponse debug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - return this; - } - - /** - * Get debug - * @return debug - */ - @javax.annotation.Nonnull - public Boolean getDebug() { - return debug; - } - - public void setDebug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - } - - - public AnalysisDetailResponse modelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - return this; - } - - /** - * Get modelName - * @return modelName - */ - @javax.annotation.Nonnull - public String getModelName() { - return modelName; - } - - public void setModelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - } - - - public AnalysisDetailResponse sbom(@javax.annotation.Nullable Map sbom) { - this.sbom = sbom; - return this; - } - - public AnalysisDetailResponse putSbomItem(String key, Object sbomItem) { - if (this.sbom == null) { - this.sbom = new HashMap<>(); - } - this.sbom.put(key, sbomItem); - return this; - } - - /** - * Get sbom - * @return sbom - */ - @javax.annotation.Nullable - public Map getSbom() { - return sbom; - } - - public void setSbom(@javax.annotation.Nullable Map sbom) { - this.sbom = sbom; - } - - - public AnalysisDetailResponse sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * Get sha256Hash - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public AnalysisDetailResponse autoRunAgents(@javax.annotation.Nonnull AutoRunAgents autoRunAgents) { - this.autoRunAgents = autoRunAgents; - return this; - } - - /** - * Get autoRunAgents - * @return autoRunAgents - */ - @javax.annotation.Nonnull - public AutoRunAgents getAutoRunAgents() { - return autoRunAgents; - } - - public void setAutoRunAgents(@javax.annotation.Nonnull AutoRunAgents autoRunAgents) { - this.autoRunAgents = autoRunAgents; - } - - - public AnalysisDetailResponse requestedConfig(@javax.annotation.Nonnull AnalysisConfigSnapshot requestedConfig) { - this.requestedConfig = requestedConfig; - return this; - } - - /** - * Snapshot of the configuration the analysis was submitted with. - * @return requestedConfig - */ - @javax.annotation.Nonnull - public AnalysisConfigSnapshot getRequestedConfig() { - return requestedConfig; - } - - public void setRequestedConfig(@javax.annotation.Nonnull AnalysisConfigSnapshot requestedConfig) { - this.requestedConfig = requestedConfig; - } - - /** - * 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 AnalysisDetailResponse instance itself - */ - public AnalysisDetailResponse 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; - } - AnalysisDetailResponse analysisDetailResponse = (AnalysisDetailResponse) o; - return Objects.equals(this.access, analysisDetailResponse.access) && - Objects.equals(this.analysisId, analysisDetailResponse.analysisId) && - Objects.equals(this.analysisScope, analysisDetailResponse.analysisScope) && - Objects.equals(this.architecture, analysisDetailResponse.architecture) && - Objects.equals(this.binaryDynamic, analysisDetailResponse.binaryDynamic) && - Objects.equals(this.binaryFormat, analysisDetailResponse.binaryFormat) && - Objects.equals(this.binaryName, analysisDetailResponse.binaryName) && - Objects.equals(this.binarySize, analysisDetailResponse.binarySize) && - Objects.equals(this.binaryType, analysisDetailResponse.binaryType) && - Objects.equals(this.creation, analysisDetailResponse.creation) && - Objects.equals(this.dashboardUrl, analysisDetailResponse.dashboardUrl) && - Objects.equals(this.debug, analysisDetailResponse.debug) && - Objects.equals(this.modelName, analysisDetailResponse.modelName) && - Objects.equals(this.sbom, analysisDetailResponse.sbom) && - Objects.equals(this.sha256Hash, analysisDetailResponse.sha256Hash) && - Objects.equals(this.autoRunAgents, analysisDetailResponse.autoRunAgents) && - Objects.equals(this.requestedConfig, analysisDetailResponse.requestedConfig)&& - Objects.equals(this.additionalProperties, analysisDetailResponse.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(access, analysisId, analysisScope, architecture, binaryDynamic, binaryFormat, binaryName, binarySize, binaryType, creation, dashboardUrl, debug, modelName, sbom, sha256Hash, autoRunAgents, requestedConfig, 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 AnalysisDetailResponse {\n"); - sb.append(" access: ").append(toIndentedString(access)).append("\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); - sb.append(" architecture: ").append(toIndentedString(architecture)).append("\n"); - sb.append(" binaryDynamic: ").append(toIndentedString(binaryDynamic)).append("\n"); - sb.append(" binaryFormat: ").append(toIndentedString(binaryFormat)).append("\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" binarySize: ").append(toIndentedString(binarySize)).append("\n"); - sb.append(" binaryType: ").append(toIndentedString(binaryType)).append("\n"); - sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); - sb.append(" dashboardUrl: ").append(toIndentedString(dashboardUrl)).append("\n"); - sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); - sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); - sb.append(" sbom: ").append(toIndentedString(sbom)).append("\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" autoRunAgents: ").append(toIndentedString(autoRunAgents)).append("\n"); - sb.append(" requestedConfig: ").append(toIndentedString(requestedConfig)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("access", "analysis_id", "analysis_scope", "architecture", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "creation", "dashboard_url", "debug", "model_name", "sbom", "sha_256_hash", "auto_run_agents", "requested_config")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("access", "analysis_id", "analysis_scope", "architecture", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "creation", "dashboard_url", "debug", "model_name", "sha_256_hash", "auto_run_agents", "requested_config")); - } - - /** - * 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 AnalysisDetailResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisDetailResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisDetailResponse is not found in the empty JSON string", AnalysisDetailResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisDetailResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `access` - AnalysisAccessInfo.validateJsonElement(jsonObj.get("access")); - if (!jsonObj.get("analysis_scope").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("analysis_scope").toString())); - } - if (!jsonObj.get("architecture").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `architecture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("architecture").toString())); - } - if (!jsonObj.get("binary_format").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_format").toString())); - } - if (!jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - if (!jsonObj.get("binary_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_type").toString())); - } - if (!jsonObj.get("creation").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `creation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creation").toString())); - } - if (!jsonObj.get("dashboard_url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `dashboard_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dashboard_url").toString())); - } - if (!jsonObj.get("model_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); - } - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - // validate the required field `auto_run_agents` - AutoRunAgents.validateJsonElement(jsonObj.get("auto_run_agents")); - // validate the required field `requested_config` - AnalysisConfigSnapshot.validateJsonElement(jsonObj.get("requested_config")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisDetailResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisDetailResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisDetailResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisDetailResponse 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 AnalysisDetailResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisDetailResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisDetailResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisDetailResponse - * @throws IOException if the JSON string is invalid with respect to AnalysisDetailResponse - */ - public static AnalysisDetailResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisDetailResponse.class); - } - - /** - * Convert an instance of AnalysisDetailResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisFunctionEntry.java b/src/main/java/ai/reveng/model/AnalysisFunctionEntry.java index 7007729..52c8fa2 100644 --- a/src/main/java/ai/reveng/model/AnalysisFunctionEntry.java +++ b/src/main/java/ai/reveng/model/AnalysisFunctionEntry.java @@ -20,7 +20,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -228,7 +227,7 @@ public AnalysisFunctionEntry mangledName(@javax.annotation.Nullable String mangl } /** - * Search is applied to string value + * Get mangledName * @return mangledName */ @javax.annotation.Nullable @@ -385,22 +384,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, analysisFunctionEntry.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(binaryId, debug, functionId, functionName, functionSize, functionVaddr, mangledName, sourceAnalysisId, sourceBinaryId, sourceFunctionId, sourceType, 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(); diff --git a/src/main/java/ai/reveng/model/AnalysisFunctionMapping.java b/src/main/java/ai/reveng/model/AnalysisFunctionMapping.java deleted file mode 100644 index 544c734..0000000 --- a/src/main/java/ai/reveng/model/AnalysisFunctionMapping.java +++ /dev/null @@ -1,289 +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 ai.reveng.model.FunctionMapping; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisFunctionMapping - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisFunctionMapping { - public static final String SERIALIZED_NAME_FUNCTION_MAPS = "function_maps"; - @SerializedName(SERIALIZED_NAME_FUNCTION_MAPS) - @javax.annotation.Nonnull - private FunctionMapping functionMaps; - - public AnalysisFunctionMapping() { - } - - public AnalysisFunctionMapping functionMaps(@javax.annotation.Nonnull FunctionMapping functionMaps) { - this.functionMaps = functionMaps; - return this; - } - - /** - * A map of function ids to function addresses for the analysis, and it's inverse. - * @return functionMaps - */ - @javax.annotation.Nonnull - public FunctionMapping getFunctionMaps() { - return functionMaps; - } - - public void setFunctionMaps(@javax.annotation.Nonnull FunctionMapping functionMaps) { - this.functionMaps = functionMaps; - } - - /** - * 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 AnalysisFunctionMapping instance itself - */ - public AnalysisFunctionMapping 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; - } - AnalysisFunctionMapping analysisFunctionMapping = (AnalysisFunctionMapping) o; - return Objects.equals(this.functionMaps, analysisFunctionMapping.functionMaps)&& - Objects.equals(this.additionalProperties, analysisFunctionMapping.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionMaps, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisFunctionMapping {\n"); - sb.append(" functionMaps: ").append(toIndentedString(functionMaps)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_maps")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_maps")); - } - - /** - * 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 AnalysisFunctionMapping - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisFunctionMapping.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisFunctionMapping is not found in the empty JSON string", AnalysisFunctionMapping.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisFunctionMapping.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `function_maps` - FunctionMapping.validateJsonElement(jsonObj.get("function_maps")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisFunctionMapping.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisFunctionMapping' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisFunctionMapping.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisFunctionMapping 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 AnalysisFunctionMapping read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisFunctionMapping instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisFunctionMapping given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisFunctionMapping - * @throws IOException if the JSON string is invalid with respect to AnalysisFunctionMapping - */ - public static AnalysisFunctionMapping fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisFunctionMapping.class); - } - - /** - * Convert an instance of AnalysisFunctionMapping to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisFunctions.java b/src/main/java/ai/reveng/model/AnalysisFunctions.java deleted file mode 100644 index 8e4d4a6..0000000 --- a/src/main/java/ai/reveng/model/AnalysisFunctions.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.AppApiRestV2FunctionsTypesFunction; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisFunctions - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisFunctions { - public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; - @SerializedName(SERIALIZED_NAME_FUNCTIONS) - @javax.annotation.Nonnull - private List functions = new ArrayList<>(); - - public AnalysisFunctions() { - } - - public AnalysisFunctions functions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - return this; - } - - public AnalysisFunctions addFunctionsItem(AppApiRestV2FunctionsTypesFunction functionsItem) { - if (this.functions == null) { - this.functions = new ArrayList<>(); - } - this.functions.add(functionsItem); - return this; - } - - /** - * The functions associated with the analysis - * @return functions - */ - @javax.annotation.Nonnull - public List getFunctions() { - return functions; - } - - public void setFunctions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisFunctions instance itself - */ - public AnalysisFunctions 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; - } - AnalysisFunctions analysisFunctions = (AnalysisFunctions) o; - return Objects.equals(this.functions, analysisFunctions.functions)&& - Objects.equals(this.additionalProperties, analysisFunctions.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functions, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisFunctions {\n"); - sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("functions")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("functions")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisFunctions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisFunctions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisFunctions is not found in the empty JSON string", AnalysisFunctions.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisFunctions.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("functions") != null) { - if (!jsonObj.get("functions").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `functions` to be an array in the JSON string but got `%s`", jsonObj.get("functions").toString())); - } - JsonArray jsonArrayfunctions = jsonObj.getAsJsonArray("functions"); - // validate the required field `functions` (array) - for (int i = 0; i < jsonArrayfunctions.size(); i++) { - AppApiRestV2FunctionsTypesFunction.validateJsonElement(jsonArrayfunctions.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisFunctions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisFunctions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisFunctions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisFunctions 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 AnalysisFunctions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisFunctions instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisFunctions given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisFunctions - * @throws IOException if the JSON string is invalid with respect to AnalysisFunctions - */ - public static AnalysisFunctions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisFunctions.class); - } - - /** - * Convert an instance of AnalysisFunctions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisFunctionsList.java b/src/main/java/ai/reveng/model/AnalysisFunctionsList.java deleted file mode 100644 index d51ceb7..0000000 --- a/src/main/java/ai/reveng/model/AnalysisFunctionsList.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.FunctionListItem; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * API response schema for paginated functions list - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisFunctionsList { - public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; - @SerializedName(SERIALIZED_NAME_FUNCTIONS) - @javax.annotation.Nonnull - private List functions = new ArrayList<>(); - - public AnalysisFunctionsList() { - } - - public AnalysisFunctionsList functions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - return this; - } - - public AnalysisFunctionsList addFunctionsItem(FunctionListItem functionsItem) { - if (this.functions == null) { - this.functions = new ArrayList<>(); - } - this.functions.add(functionsItem); - return this; - } - - /** - * The functions associated with the analysis - * @return functions - */ - @javax.annotation.Nonnull - public List getFunctions() { - return functions; - } - - public void setFunctions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisFunctionsList instance itself - */ - public AnalysisFunctionsList 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; - } - AnalysisFunctionsList analysisFunctionsList = (AnalysisFunctionsList) o; - return Objects.equals(this.functions, analysisFunctionsList.functions)&& - Objects.equals(this.additionalProperties, analysisFunctionsList.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functions, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisFunctionsList {\n"); - sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("functions")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("functions")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisFunctionsList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisFunctionsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisFunctionsList is not found in the empty JSON string", AnalysisFunctionsList.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisFunctionsList.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("functions") != null) { - if (!jsonObj.get("functions").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `functions` to be an array in the JSON string but got `%s`", jsonObj.get("functions").toString())); - } - JsonArray jsonArrayfunctions = jsonObj.getAsJsonArray("functions"); - // validate the required field `functions` (array) - for (int i = 0; i < jsonArrayfunctions.size(); i++) { - FunctionListItem.validateJsonElement(jsonArrayfunctions.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisFunctionsList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisFunctionsList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisFunctionsList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisFunctionsList 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 AnalysisFunctionsList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisFunctionsList instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisFunctionsList given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisFunctionsList - * @throws IOException if the JSON string is invalid with respect to AnalysisFunctionsList - */ - public static AnalysisFunctionsList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisFunctionsList.class); - } - - /** - * Convert an instance of AnalysisFunctionsList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisRecord.java b/src/main/java/ai/reveng/model/AnalysisRecord.java deleted file mode 100644 index 95d7d95..0000000 --- a/src/main/java/ai/reveng/model/AnalysisRecord.java +++ /dev/null @@ -1,767 +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 ai.reveng.model.DynamicExecutionStatus; -import ai.reveng.model.TagItem; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigInteger; -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; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisRecord - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisRecord { - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_ANALYSIS_SCOPE = "analysis_scope"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_SCOPE) - @javax.annotation.Nonnull - private String analysisScope; - - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_MODEL_ID = "model_id"; - @SerializedName(SERIALIZED_NAME_MODEL_ID) - @javax.annotation.Nonnull - private Integer modelId; - - public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; - @SerializedName(SERIALIZED_NAME_MODEL_NAME) - @javax.annotation.Nonnull - private String modelName; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private String status; - - public static final String SERIALIZED_NAME_CREATION = "creation"; - @SerializedName(SERIALIZED_NAME_CREATION) - @javax.annotation.Nonnull - private OffsetDateTime creation; - - public static final String SERIALIZED_NAME_IS_OWNER = "is_owner"; - @SerializedName(SERIALIZED_NAME_IS_OWNER) - @javax.annotation.Nonnull - private Boolean isOwner; - - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_FUNCTION_BOUNDARIES_HASH = "function_boundaries_hash"; - @SerializedName(SERIALIZED_NAME_FUNCTION_BOUNDARIES_HASH) - @javax.annotation.Nonnull - private String functionBoundariesHash; - - public static final String SERIALIZED_NAME_BINARY_SIZE = "binary_size"; - @SerializedName(SERIALIZED_NAME_BINARY_SIZE) - @javax.annotation.Nonnull - private Integer binarySize; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - @javax.annotation.Nonnull - private String username; - - public static final String SERIALIZED_NAME_DYNAMIC_EXECUTION_STATUS = "dynamic_execution_status"; - @SerializedName(SERIALIZED_NAME_DYNAMIC_EXECUTION_STATUS) - @javax.annotation.Nullable - private DynamicExecutionStatus dynamicExecutionStatus; - - public static final String SERIALIZED_NAME_DYNAMIC_EXECUTION_TASK_ID = "dynamic_execution_task_id"; - @SerializedName(SERIALIZED_NAME_DYNAMIC_EXECUTION_TASK_ID) - @javax.annotation.Nullable - private Integer dynamicExecutionTaskId; - - public static final String SERIALIZED_NAME_BASE_ADDRESS = "base_address"; - @SerializedName(SERIALIZED_NAME_BASE_ADDRESS) - @javax.annotation.Nonnull - private BigInteger baseAddress; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nullable - private List tags = new ArrayList<>(); - - public AnalysisRecord() { - } - - public AnalysisRecord analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * ID to identify analysis - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public AnalysisRecord analysisScope(@javax.annotation.Nonnull String analysisScope) { - this.analysisScope = analysisScope; - return this; - } - - /** - * Scope of the analysis - * @return analysisScope - */ - @javax.annotation.Nonnull - public String getAnalysisScope() { - return analysisScope; - } - - public void setAnalysisScope(@javax.annotation.Nonnull String analysisScope) { - this.analysisScope = analysisScope; - } - - - public AnalysisRecord binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * ID to identify the binary analyse - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public AnalysisRecord modelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - return this; - } - - /** - * ID to identify the model used for analysis - * @return modelId - */ - @javax.annotation.Nonnull - public Integer getModelId() { - return modelId; - } - - public void setModelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - } - - - public AnalysisRecord modelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - return this; - } - - /** - * Name of the model used for analysis - * @return modelName - */ - @javax.annotation.Nonnull - public String getModelName() { - return modelName; - } - - public void setModelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - } - - - public AnalysisRecord status(@javax.annotation.Nonnull String status) { - this.status = status; - return this; - } - - /** - * The current status of analysis - * @return status - */ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull String status) { - this.status = status; - } - - - public AnalysisRecord creation(@javax.annotation.Nonnull OffsetDateTime creation) { - this.creation = creation; - return this; - } - - /** - * The datetime of when the analysis was created - * @return creation - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreation() { - return creation; - } - - public void setCreation(@javax.annotation.Nonnull OffsetDateTime creation) { - this.creation = creation; - } - - - public AnalysisRecord isOwner(@javax.annotation.Nonnull Boolean isOwner) { - this.isOwner = isOwner; - return this; - } - - /** - * Whether the current user is the owner of a binary - * @return isOwner - */ - @javax.annotation.Nonnull - public Boolean getIsOwner() { - return isOwner; - } - - public void setIsOwner(@javax.annotation.Nonnull Boolean isOwner) { - this.isOwner = isOwner; - } - - - public AnalysisRecord binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * The name of the file uploaded - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public AnalysisRecord sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * The hash of the binary - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public AnalysisRecord functionBoundariesHash(@javax.annotation.Nonnull String functionBoundariesHash) { - this.functionBoundariesHash = functionBoundariesHash; - return this; - } - - /** - * The hash of the function boundaries - * @return functionBoundariesHash - */ - @javax.annotation.Nonnull - public String getFunctionBoundariesHash() { - return functionBoundariesHash; - } - - public void setFunctionBoundariesHash(@javax.annotation.Nonnull String functionBoundariesHash) { - this.functionBoundariesHash = functionBoundariesHash; - } - - - public AnalysisRecord binarySize(@javax.annotation.Nonnull Integer binarySize) { - this.binarySize = binarySize; - return this; - } - - /** - * The size of the binary - * @return binarySize - */ - @javax.annotation.Nonnull - public Integer getBinarySize() { - return binarySize; - } - - public void setBinarySize(@javax.annotation.Nonnull Integer binarySize) { - this.binarySize = binarySize; - } - - - public AnalysisRecord username(@javax.annotation.Nonnull String username) { - this.username = username; - return this; - } - - /** - * The username of the analysis owner - * @return username - */ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(@javax.annotation.Nonnull String username) { - this.username = username; - } - - - public AnalysisRecord dynamicExecutionStatus(@javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus) { - this.dynamicExecutionStatus = dynamicExecutionStatus; - return this; - } - - /** - * If searching for dynamic execution, the status of the task - * @return dynamicExecutionStatus - */ - @javax.annotation.Nullable - public DynamicExecutionStatus getDynamicExecutionStatus() { - return dynamicExecutionStatus; - } - - public void setDynamicExecutionStatus(@javax.annotation.Nullable DynamicExecutionStatus dynamicExecutionStatus) { - this.dynamicExecutionStatus = dynamicExecutionStatus; - } - - - public AnalysisRecord dynamicExecutionTaskId(@javax.annotation.Nullable Integer dynamicExecutionTaskId) { - this.dynamicExecutionTaskId = dynamicExecutionTaskId; - return this; - } - - /** - * If searching for dynamic execution, the task ID of the task - * @return dynamicExecutionTaskId - */ - @javax.annotation.Nullable - public Integer getDynamicExecutionTaskId() { - return dynamicExecutionTaskId; - } - - public void setDynamicExecutionTaskId(@javax.annotation.Nullable Integer dynamicExecutionTaskId) { - this.dynamicExecutionTaskId = dynamicExecutionTaskId; - } - - - public AnalysisRecord baseAddress(@javax.annotation.Nonnull BigInteger baseAddress) { - this.baseAddress = baseAddress; - return this; - } - - /** - * The base address of the binary - * @return baseAddress - */ - @javax.annotation.Nonnull - public BigInteger getBaseAddress() { - return baseAddress; - } - - public void setBaseAddress(@javax.annotation.Nonnull BigInteger baseAddress) { - this.baseAddress = baseAddress; - } - - - public AnalysisRecord tags(@javax.annotation.Nullable List tags) { - this.tags = tags; - return this; - } - - public AnalysisRecord addTagsItem(TagItem tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * List of tags associated with the analysis - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nullable List tags) { - this.tags = tags; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisRecord instance itself - */ - public AnalysisRecord 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; - } - AnalysisRecord analysisRecord = (AnalysisRecord) o; - return Objects.equals(this.analysisId, analysisRecord.analysisId) && - Objects.equals(this.analysisScope, analysisRecord.analysisScope) && - Objects.equals(this.binaryId, analysisRecord.binaryId) && - Objects.equals(this.modelId, analysisRecord.modelId) && - Objects.equals(this.modelName, analysisRecord.modelName) && - Objects.equals(this.status, analysisRecord.status) && - Objects.equals(this.creation, analysisRecord.creation) && - Objects.equals(this.isOwner, analysisRecord.isOwner) && - Objects.equals(this.binaryName, analysisRecord.binaryName) && - Objects.equals(this.sha256Hash, analysisRecord.sha256Hash) && - Objects.equals(this.functionBoundariesHash, analysisRecord.functionBoundariesHash) && - Objects.equals(this.binarySize, analysisRecord.binarySize) && - Objects.equals(this.username, analysisRecord.username) && - Objects.equals(this.dynamicExecutionStatus, analysisRecord.dynamicExecutionStatus) && - Objects.equals(this.dynamicExecutionTaskId, analysisRecord.dynamicExecutionTaskId) && - Objects.equals(this.baseAddress, analysisRecord.baseAddress) && - Objects.equals(this.tags, analysisRecord.tags)&& - Objects.equals(this.additionalProperties, analysisRecord.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(analysisId, analysisScope, binaryId, modelId, modelName, status, creation, isOwner, binaryName, sha256Hash, functionBoundariesHash, binarySize, username, dynamicExecutionStatus, dynamicExecutionTaskId, baseAddress, tags, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisRecord {\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); - sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); - sb.append(" isOwner: ").append(toIndentedString(isOwner)).append("\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" functionBoundariesHash: ").append(toIndentedString(functionBoundariesHash)).append("\n"); - sb.append(" binarySize: ").append(toIndentedString(binarySize)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" dynamicExecutionStatus: ").append(toIndentedString(dynamicExecutionStatus)).append("\n"); - sb.append(" dynamicExecutionTaskId: ").append(toIndentedString(dynamicExecutionTaskId)).append("\n"); - sb.append(" baseAddress: ").append(toIndentedString(baseAddress)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_id", "analysis_scope", "binary_id", "model_id", "model_name", "status", "creation", "is_owner", "binary_name", "sha_256_hash", "function_boundaries_hash", "binary_size", "username", "dynamic_execution_status", "dynamic_execution_task_id", "base_address", "tags")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "analysis_scope", "binary_id", "model_id", "model_name", "status", "creation", "is_owner", "binary_name", "sha_256_hash", "function_boundaries_hash", "binary_size", "username", "base_address")); - } - - /** - * 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 AnalysisRecord - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisRecord.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisRecord is not found in the empty JSON string", AnalysisRecord.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisRecord.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("analysis_scope").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("analysis_scope").toString())); - } - if (!jsonObj.get("model_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - if (!jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - if (!jsonObj.get("function_boundaries_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_boundaries_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_boundaries_hash").toString())); - } - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - // validate the optional field `dynamic_execution_status` - if (jsonObj.get("dynamic_execution_status") != null && !jsonObj.get("dynamic_execution_status").isJsonNull()) { - DynamicExecutionStatus.validateJsonElement(jsonObj.get("dynamic_execution_status")); - } - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { - JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); - if (jsonArraytags != null) { - // ensure the json data is an array - if (!jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - - // validate the optional field `tags` (array) - for (int i = 0; i < jsonArraytags.size(); i++) { - TagItem.validateJsonElement(jsonArraytags.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisRecord.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisRecord' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisRecord.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisRecord 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 AnalysisRecord read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisRecord instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisRecord given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisRecord - * @throws IOException if the JSON string is invalid with respect to AnalysisRecord - */ - public static AnalysisRecord fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisRecord.class); - } - - /** - * Convert an instance of AnalysisRecord to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisScope.java b/src/main/java/ai/reveng/model/AnalysisScope.java deleted file mode 100644 index e2bb9d4..0000000 --- a/src/main/java/ai/reveng/model/AnalysisScope.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets AnalysisScope - */ -@JsonAdapter(AnalysisScope.Adapter.class) -public enum AnalysisScope { - - PRIVATE("PRIVATE"), - - PUBLIC("PUBLIC"), - - TEAM("TEAM"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - AnalysisScope(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AnalysisScope fromValue(String value) { - for (AnalysisScope b : AnalysisScope.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AnalysisScope enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AnalysisScope read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AnalysisScope.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AnalysisScope.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisStringInput.java b/src/main/java/ai/reveng/model/AnalysisStringInput.java deleted file mode 100644 index d6e36a1..0000000 --- a/src/main/java/ai/reveng/model/AnalysisStringInput.java +++ /dev/null @@ -1,344 +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 ai.reveng.model.StringSource; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Input model for inserting a string into an analysis. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisStringInput { - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private String value; - - public static final String SERIALIZED_NAME_VADDR = "vaddr"; - @SerializedName(SERIALIZED_NAME_VADDR) - @javax.annotation.Nonnull - private Integer vaddr; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - @javax.annotation.Nonnull - private StringSource source; - - public AnalysisStringInput() { - } - - public AnalysisStringInput value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * The string literal value - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; - } - - - public AnalysisStringInput vaddr(@javax.annotation.Nonnull Integer vaddr) { - this.vaddr = vaddr; - return this; - } - - /** - * The virtual address of the string - * @return vaddr - */ - @javax.annotation.Nonnull - public Integer getVaddr() { - return vaddr; - } - - public void setVaddr(@javax.annotation.Nonnull Integer vaddr) { - this.vaddr = vaddr; - } - - - public AnalysisStringInput source(@javax.annotation.Nonnull StringSource source) { - this.source = source; - return this; - } - - /** - * The source of the string - * @return source - */ - @javax.annotation.Nonnull - public StringSource getSource() { - return source; - } - - public void setSource(@javax.annotation.Nonnull StringSource source) { - this.source = source; - } - - /** - * 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 AnalysisStringInput instance itself - */ - public AnalysisStringInput 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; - } - AnalysisStringInput analysisStringInput = (AnalysisStringInput) o; - return Objects.equals(this.value, analysisStringInput.value) && - Objects.equals(this.vaddr, analysisStringInput.vaddr) && - Objects.equals(this.source, analysisStringInput.source)&& - Objects.equals(this.additionalProperties, analysisStringInput.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(value, vaddr, source, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisStringInput {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" vaddr: ").append(toIndentedString(vaddr)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("value", "vaddr", "source")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("value", "vaddr", "source")); - } - - /** - * 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 AnalysisStringInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisStringInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisStringInput is not found in the empty JSON string", AnalysisStringInput.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisStringInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - // validate the required field `source` - StringSource.validateJsonElement(jsonObj.get("source")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisStringInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisStringInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisStringInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisStringInput 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 AnalysisStringInput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisStringInput instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisStringInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisStringInput - * @throws IOException if the JSON string is invalid with respect to AnalysisStringInput - */ - public static AnalysisStringInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisStringInput.class); - } - - /** - * Convert an instance of AnalysisStringInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisStringsResponse.java b/src/main/java/ai/reveng/model/AnalysisStringsResponse.java deleted file mode 100644 index c7d5db8..0000000 --- a/src/main/java/ai/reveng/model/AnalysisStringsResponse.java +++ /dev/null @@ -1,333 +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 ai.reveng.model.StringFunctions; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisStringsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisStringsResponse { - public static final String SERIALIZED_NAME_STRINGS = "strings"; - @SerializedName(SERIALIZED_NAME_STRINGS) - @javax.annotation.Nonnull - private List strings = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TOTAL_STRINGS = "total_strings"; - @SerializedName(SERIALIZED_NAME_TOTAL_STRINGS) - @javax.annotation.Nonnull - private Integer totalStrings; - - public AnalysisStringsResponse() { - } - - public AnalysisStringsResponse strings(@javax.annotation.Nonnull List strings) { - this.strings = strings; - return this; - } - - public AnalysisStringsResponse addStringsItem(StringFunctions stringsItem) { - if (this.strings == null) { - this.strings = new ArrayList<>(); - } - this.strings.add(stringsItem); - return this; - } - - /** - * The strings associated with the analysis - * @return strings - */ - @javax.annotation.Nonnull - public List getStrings() { - return strings; - } - - public void setStrings(@javax.annotation.Nonnull List strings) { - this.strings = strings; - } - - - public AnalysisStringsResponse totalStrings(@javax.annotation.Nonnull Integer totalStrings) { - this.totalStrings = totalStrings; - return this; - } - - /** - * The total number of strings associated with this analysis - * @return totalStrings - */ - @javax.annotation.Nonnull - public Integer getTotalStrings() { - return totalStrings; - } - - public void setTotalStrings(@javax.annotation.Nonnull Integer totalStrings) { - this.totalStrings = totalStrings; - } - - /** - * 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 AnalysisStringsResponse instance itself - */ - public AnalysisStringsResponse 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; - } - AnalysisStringsResponse analysisStringsResponse = (AnalysisStringsResponse) o; - return Objects.equals(this.strings, analysisStringsResponse.strings) && - Objects.equals(this.totalStrings, analysisStringsResponse.totalStrings)&& - Objects.equals(this.additionalProperties, analysisStringsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(strings, totalStrings, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisStringsResponse {\n"); - sb.append(" strings: ").append(toIndentedString(strings)).append("\n"); - sb.append(" totalStrings: ").append(toIndentedString(totalStrings)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("strings", "total_strings")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("strings", "total_strings")); - } - - /** - * 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 AnalysisStringsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisStringsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisStringsResponse is not found in the empty JSON string", AnalysisStringsResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisStringsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("strings") != null) { - if (!jsonObj.get("strings").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strings` to be an array in the JSON string but got `%s`", jsonObj.get("strings").toString())); - } - JsonArray jsonArraystrings = jsonObj.getAsJsonArray("strings"); - // validate the required field `strings` (array) - for (int i = 0; i < jsonArraystrings.size(); i++) { - StringFunctions.validateJsonElement(jsonArraystrings.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisStringsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisStringsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisStringsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisStringsResponse 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 AnalysisStringsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisStringsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisStringsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisStringsResponse - * @throws IOException if the JSON string is invalid with respect to AnalysisStringsResponse - */ - public static AnalysisStringsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisStringsResponse.class); - } - - /** - * Convert an instance of AnalysisStringsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisStringsStatusResponse.java b/src/main/java/ai/reveng/model/AnalysisStringsStatusResponse.java deleted file mode 100644 index 0bb08a2..0000000 --- a/src/main/java/ai/reveng/model/AnalysisStringsStatusResponse.java +++ /dev/null @@ -1,289 +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 ai.reveng.model.BinariesTaskStatus; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisStringsStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisStringsStatusResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private BinariesTaskStatus status; - - public AnalysisStringsStatusResponse() { - } - - public AnalysisStringsStatusResponse status(@javax.annotation.Nonnull BinariesTaskStatus status) { - this.status = status; - return this; - } - - /** - * The current status of the strings extraction task - * @return status - */ - @javax.annotation.Nonnull - public BinariesTaskStatus getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull BinariesTaskStatus status) { - this.status = status; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisStringsStatusResponse instance itself - */ - public AnalysisStringsStatusResponse 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; - } - AnalysisStringsStatusResponse analysisStringsStatusResponse = (AnalysisStringsStatusResponse) o; - return Objects.equals(this.status, analysisStringsStatusResponse.status)&& - Objects.equals(this.additionalProperties, analysisStringsStatusResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(status, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisStringsStatusResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("status")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AnalysisStringsStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisStringsStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisStringsStatusResponse is not found in the empty JSON string", AnalysisStringsStatusResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisStringsStatusResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `status` - BinariesTaskStatus.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisStringsStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisStringsStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisStringsStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisStringsStatusResponse 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 AnalysisStringsStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisStringsStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisStringsStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisStringsStatusResponse - * @throws IOException if the JSON string is invalid with respect to AnalysisStringsStatusResponse - */ - public static AnalysisStringsStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisStringsStatusResponse.class); - } - - /** - * Convert an instance of AnalysisStringsStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisTags.java b/src/main/java/ai/reveng/model/AnalysisTags.java deleted file mode 100644 index 6ada52f..0000000 --- a/src/main/java/ai/reveng/model/AnalysisTags.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.TagItem; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisTags - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisTags { - public static final String SERIALIZED_NAME_ANALYSIS_TAGS = "analysis_tags"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_TAGS) - @javax.annotation.Nonnull - private List analysisTags = new ArrayList<>(); - - public AnalysisTags() { - } - - public AnalysisTags analysisTags(@javax.annotation.Nonnull List analysisTags) { - this.analysisTags = analysisTags; - return this; - } - - public AnalysisTags addAnalysisTagsItem(TagItem analysisTagsItem) { - if (this.analysisTags == null) { - this.analysisTags = new ArrayList<>(); - } - this.analysisTags.add(analysisTagsItem); - return this; - } - - /** - * Get analysisTags - * @return analysisTags - */ - @javax.annotation.Nonnull - public List getAnalysisTags() { - return analysisTags; - } - - public void setAnalysisTags(@javax.annotation.Nonnull List analysisTags) { - this.analysisTags = analysisTags; - } - - /** - * 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 AnalysisTags instance itself - */ - public AnalysisTags 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; - } - AnalysisTags analysisTags = (AnalysisTags) o; - return Objects.equals(this.analysisTags, analysisTags.analysisTags)&& - Objects.equals(this.additionalProperties, analysisTags.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(analysisTags, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisTags {\n"); - sb.append(" analysisTags: ").append(toIndentedString(analysisTags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_tags")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_tags")); - } - - /** - * 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 AnalysisTags - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisTags.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisTags is not found in the empty JSON string", AnalysisTags.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisTags.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("analysis_tags") != null) { - if (!jsonObj.get("analysis_tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_tags` to be an array in the JSON string but got `%s`", jsonObj.get("analysis_tags").toString())); - } - JsonArray jsonArrayanalysisTags = jsonObj.getAsJsonArray("analysis_tags"); - // validate the required field `analysis_tags` (array) - for (int i = 0; i < jsonArrayanalysisTags.size(); i++) { - TagItem.validateJsonElement(jsonArrayanalysisTags.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisTags.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisTags' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisTags.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisTags 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 AnalysisTags read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisTags instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisTags given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisTags - * @throws IOException if the JSON string is invalid with respect to AnalysisTags - */ - public static AnalysisTags fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisTags.class); - } - - /** - * Convert an instance of AnalysisTags to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisUpdateRequest.java b/src/main/java/ai/reveng/model/AnalysisUpdateRequest.java deleted file mode 100644 index 3c5def9..0000000 --- a/src/main/java/ai/reveng/model/AnalysisUpdateRequest.java +++ /dev/null @@ -1,325 +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 ai.reveng.model.AnalysisScope; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisUpdateRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisUpdateRequest { - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nullable - private String binaryName; - - public static final String SERIALIZED_NAME_ANALYSIS_SCOPE = "analysis_scope"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_SCOPE) - @javax.annotation.Nullable - private AnalysisScope analysisScope; - - public AnalysisUpdateRequest() { - } - - public AnalysisUpdateRequest binaryName(@javax.annotation.Nullable String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * Get binaryName - * @return binaryName - */ - @javax.annotation.Nullable - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nullable String binaryName) { - this.binaryName = binaryName; - } - - - public AnalysisUpdateRequest analysisScope(@javax.annotation.Nullable AnalysisScope analysisScope) { - this.analysisScope = analysisScope; - return this; - } - - /** - * The scope of the analysis determines who can access it - * @return analysisScope - */ - @javax.annotation.Nullable - public AnalysisScope getAnalysisScope() { - return analysisScope; - } - - public void setAnalysisScope(@javax.annotation.Nullable AnalysisScope analysisScope) { - this.analysisScope = analysisScope; - } - - /** - * 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 AnalysisUpdateRequest instance itself - */ - public AnalysisUpdateRequest 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; - } - AnalysisUpdateRequest analysisUpdateRequest = (AnalysisUpdateRequest) o; - return Objects.equals(this.binaryName, analysisUpdateRequest.binaryName) && - Objects.equals(this.analysisScope, analysisUpdateRequest.analysisScope)&& - Objects.equals(this.additionalProperties, analysisUpdateRequest.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(binaryName, analysisScope, 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 AnalysisUpdateRequest {\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("binary_name", "analysis_scope")); - - // 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 AnalysisUpdateRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisUpdateRequest is not found in the empty JSON string", AnalysisUpdateRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("binary_name") != null && !jsonObj.get("binary_name").isJsonNull()) && !jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - // validate the optional field `analysis_scope` - if (jsonObj.get("analysis_scope") != null && !jsonObj.get("analysis_scope").isJsonNull()) { - AnalysisScope.validateJsonElement(jsonObj.get("analysis_scope")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisUpdateRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisUpdateRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisUpdateRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisUpdateRequest 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 AnalysisUpdateRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisUpdateRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisUpdateRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisUpdateRequest - * @throws IOException if the JSON string is invalid with respect to AnalysisUpdateRequest - */ - public static AnalysisUpdateRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisUpdateRequest.class); - } - - /** - * Convert an instance of AnalysisUpdateRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisUpdateTagsRequest.java b/src/main/java/ai/reveng/model/AnalysisUpdateTagsRequest.java deleted file mode 100644 index 5a15c4e..0000000 --- a/src/main/java/ai/reveng/model/AnalysisUpdateTagsRequest.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisUpdateTagsRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisUpdateTagsRequest { - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nonnull - private List tags = new ArrayList<>(); - - public AnalysisUpdateTagsRequest() { - } - - public AnalysisUpdateTagsRequest tags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - return this; - } - - public AnalysisUpdateTagsRequest addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @javax.annotation.Nonnull - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisUpdateTagsRequest instance itself - */ - public AnalysisUpdateTagsRequest 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; - } - AnalysisUpdateTagsRequest analysisUpdateTagsRequest = (AnalysisUpdateTagsRequest) o; - return Objects.equals(this.tags, analysisUpdateTagsRequest.tags)&& - Objects.equals(this.additionalProperties, analysisUpdateTagsRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(tags, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisUpdateTagsRequest {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("tags")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("tags")); - } - - /** - * 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 AnalysisUpdateTagsRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisUpdateTagsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisUpdateTagsRequest is not found in the empty JSON string", AnalysisUpdateTagsRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisUpdateTagsRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("tags") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisUpdateTagsRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisUpdateTagsRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisUpdateTagsRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisUpdateTagsRequest 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 AnalysisUpdateTagsRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisUpdateTagsRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisUpdateTagsRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisUpdateTagsRequest - * @throws IOException if the JSON string is invalid with respect to AnalysisUpdateTagsRequest - */ - public static AnalysisUpdateTagsRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisUpdateTagsRequest.class); - } - - /** - * Convert an instance of AnalysisUpdateTagsRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisUpdateTagsResponse.java b/src/main/java/ai/reveng/model/AnalysisUpdateTagsResponse.java deleted file mode 100644 index 1f44a45..0000000 --- a/src/main/java/ai/reveng/model/AnalysisUpdateTagsResponse.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.TagResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AnalysisUpdateTagsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisUpdateTagsResponse { - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nonnull - private List tags = new ArrayList<>(); - - public AnalysisUpdateTagsResponse() { - } - - public AnalysisUpdateTagsResponse tags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - return this; - } - - public AnalysisUpdateTagsResponse addTagsItem(TagResponse tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * The analysis tags after updating - * @return tags - */ - @javax.annotation.Nonnull - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisUpdateTagsResponse instance itself - */ - public AnalysisUpdateTagsResponse 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; - } - AnalysisUpdateTagsResponse analysisUpdateTagsResponse = (AnalysisUpdateTagsResponse) o; - return Objects.equals(this.tags, analysisUpdateTagsResponse.tags)&& - Objects.equals(this.additionalProperties, analysisUpdateTagsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(tags, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnalysisUpdateTagsResponse {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("tags")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("tags")); - } - - /** - * 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 AnalysisUpdateTagsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisUpdateTagsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisUpdateTagsResponse is not found in the empty JSON string", AnalysisUpdateTagsResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AnalysisUpdateTagsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("tags") != null) { - if (!jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); - // validate the required field `tags` (array) - for (int i = 0; i < jsonArraytags.size(); i++) { - TagResponse.validateJsonElement(jsonArraytags.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisUpdateTagsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisUpdateTagsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisUpdateTagsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisUpdateTagsResponse 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 AnalysisUpdateTagsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisUpdateTagsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisUpdateTagsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisUpdateTagsResponse - * @throws IOException if the JSON string is invalid with respect to AnalysisUpdateTagsResponse - */ - public static AnalysisUpdateTagsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisUpdateTagsResponse.class); - } - - /** - * Convert an instance of AnalysisUpdateTagsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AppApiRestV2AgentSchemaCapability.java b/src/main/java/ai/reveng/model/AppApiRestV2AgentSchemaCapability.java deleted file mode 100644 index 89127d2..0000000 --- a/src/main/java/ai/reveng/model/AppApiRestV2AgentSchemaCapability.java +++ /dev/null @@ -1,501 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AppApiRestV2AgentSchemaCapability - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AppApiRestV2AgentSchemaCapability { - public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr"; - @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) - @javax.annotation.Nonnull - private String functionVaddr; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_CAPABILITY = "capability"; - @SerializedName(SERIALIZED_NAME_CAPABILITY) - @javax.annotation.Nonnull - private String capability; - - /** - * Type of the capability - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EXECUTE("Execute"), - - CRYPTO("Crypto"), - - NETWORK("Network"), - - FILES("Files"), - - MEMORY("Memory"), - - STRING("String"), - - ENVIRONMENT("Environment"), - - FILE_HEADER("File Header"), - - OTHER("Other"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nonnull - private String functionName; - - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Integer functionId; - - public AppApiRestV2AgentSchemaCapability() { - } - - public AppApiRestV2AgentSchemaCapability functionVaddr(@javax.annotation.Nonnull String functionVaddr) { - this.functionVaddr = functionVaddr; - return this; - } - - /** - * Vaddr of the function containing the capability - * @return functionVaddr - */ - @javax.annotation.Nonnull - public String getFunctionVaddr() { - return functionVaddr; - } - - public void setFunctionVaddr(@javax.annotation.Nonnull String functionVaddr) { - this.functionVaddr = functionVaddr; - } - - - public AppApiRestV2AgentSchemaCapability description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * Description of the capability - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - - public AppApiRestV2AgentSchemaCapability capability(@javax.annotation.Nonnull String capability) { - this.capability = capability; - return this; - } - - /** - * Name of the capability - * @return capability - */ - @javax.annotation.Nonnull - public String getCapability() { - return capability; - } - - public void setCapability(@javax.annotation.Nonnull String capability) { - this.capability = capability; - } - - - public AppApiRestV2AgentSchemaCapability type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Type of the capability - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - - public AppApiRestV2AgentSchemaCapability functionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - return this; - } - - /** - * Name of the function containing the capability - * @return functionName - */ - @javax.annotation.Nonnull - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - } - - - public AppApiRestV2AgentSchemaCapability functionId(@javax.annotation.Nonnull Integer functionId) { - this.functionId = functionId; - return this; - } - - /** - * ID of the function containing the capability - * @return functionId - */ - @javax.annotation.Nonnull - public Integer getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Integer functionId) { - this.functionId = functionId; - } - - /** - * 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 AppApiRestV2AgentSchemaCapability instance itself - */ - public AppApiRestV2AgentSchemaCapability 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; - } - AppApiRestV2AgentSchemaCapability appApiRestV2AgentSchemaCapability = (AppApiRestV2AgentSchemaCapability) o; - return Objects.equals(this.functionVaddr, appApiRestV2AgentSchemaCapability.functionVaddr) && - Objects.equals(this.description, appApiRestV2AgentSchemaCapability.description) && - Objects.equals(this.capability, appApiRestV2AgentSchemaCapability.capability) && - Objects.equals(this.type, appApiRestV2AgentSchemaCapability.type) && - Objects.equals(this.functionName, appApiRestV2AgentSchemaCapability.functionName) && - Objects.equals(this.functionId, appApiRestV2AgentSchemaCapability.functionId)&& - Objects.equals(this.additionalProperties, appApiRestV2AgentSchemaCapability.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionVaddr, description, capability, type, functionName, functionId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AppApiRestV2AgentSchemaCapability {\n"); - sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" capability: ").append(toIndentedString(capability)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_vaddr", "description", "capability", "type", "function_name", "function_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_vaddr", "description", "capability", "type", "function_name", "function_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 AppApiRestV2AgentSchemaCapability - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AppApiRestV2AgentSchemaCapability.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AppApiRestV2AgentSchemaCapability is not found in the empty JSON string", AppApiRestV2AgentSchemaCapability.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AppApiRestV2AgentSchemaCapability.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("function_vaddr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_vaddr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_vaddr").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("capability").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `capability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capability").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - if (!jsonObj.get("function_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AppApiRestV2AgentSchemaCapability.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AppApiRestV2AgentSchemaCapability' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AppApiRestV2AgentSchemaCapability.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AppApiRestV2AgentSchemaCapability 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 AppApiRestV2AgentSchemaCapability read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AppApiRestV2AgentSchemaCapability instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AppApiRestV2AgentSchemaCapability given an JSON string - * - * @param jsonString JSON string - * @return An instance of AppApiRestV2AgentSchemaCapability - * @throws IOException if the JSON string is invalid with respect to AppApiRestV2AgentSchemaCapability - */ - public static AppApiRestV2AgentSchemaCapability fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AppApiRestV2AgentSchemaCapability.class); - } - - /** - * Convert an instance of AppApiRestV2AgentSchemaCapability to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AppApiRestV2AnalysesEnumsOrderBy.java b/src/main/java/ai/reveng/model/AppApiRestV2AnalysesEnumsOrderBy.java deleted file mode 100644 index 9ec3417..0000000 --- a/src/main/java/ai/reveng/model/AppApiRestV2AnalysesEnumsOrderBy.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets app__api__rest__v2__analyses__enums__OrderBy - */ -@JsonAdapter(AppApiRestV2AnalysesEnumsOrderBy.Adapter.class) -public enum AppApiRestV2AnalysesEnumsOrderBy { - - CREATED("created"), - - NAME("name"), - - SIZE("size"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - AppApiRestV2AnalysesEnumsOrderBy(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AppApiRestV2AnalysesEnumsOrderBy fromValue(String value) { - for (AppApiRestV2AnalysesEnumsOrderBy b : AppApiRestV2AnalysesEnumsOrderBy.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AppApiRestV2AnalysesEnumsOrderBy enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AppApiRestV2AnalysesEnumsOrderBy read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AppApiRestV2AnalysesEnumsOrderBy.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AppApiRestV2AnalysesEnumsOrderBy.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/AppApiRestV2CollectionsEnumsOrderBy.java b/src/main/java/ai/reveng/model/AppApiRestV2CollectionsEnumsOrderBy.java deleted file mode 100644 index d4bdd0d..0000000 --- a/src/main/java/ai/reveng/model/AppApiRestV2CollectionsEnumsOrderBy.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets app__api__rest__v2__collections__enums__OrderBy - */ -@JsonAdapter(AppApiRestV2CollectionsEnumsOrderBy.Adapter.class) -public enum AppApiRestV2CollectionsEnumsOrderBy { - - CREATED("created"), - - COLLECTION("collection"), - - OWNER("owner"), - - COLLECTION_SIZE("collection_size"), - - UPDATED("updated"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - AppApiRestV2CollectionsEnumsOrderBy(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AppApiRestV2CollectionsEnumsOrderBy fromValue(String value) { - for (AppApiRestV2CollectionsEnumsOrderBy b : AppApiRestV2CollectionsEnumsOrderBy.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AppApiRestV2CollectionsEnumsOrderBy enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AppApiRestV2CollectionsEnumsOrderBy read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AppApiRestV2CollectionsEnumsOrderBy.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AppApiRestV2CollectionsEnumsOrderBy.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsResponsesFunction.java b/src/main/java/ai/reveng/model/AppApiRestV2FunctionsResponsesFunction.java deleted file mode 100644 index ef0a9e9..0000000 --- a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsResponsesFunction.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Function schema used in function strings response. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AppApiRestV2FunctionsResponsesFunction { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nullable - private Integer functionId; - - public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr"; - @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) - @javax.annotation.Nonnull - private Long functionVaddr; - - public AppApiRestV2FunctionsResponsesFunction() { - } - - public AppApiRestV2FunctionsResponsesFunction functionId(@javax.annotation.Nullable Integer functionId) { - this.functionId = functionId; - return this; - } - - /** - * Get functionId - * @return functionId - */ - @javax.annotation.Nullable - public Integer getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nullable Integer functionId) { - this.functionId = functionId; - } - - - public AppApiRestV2FunctionsResponsesFunction functionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - return this; - } - - /** - * Function virtual address - * @return functionVaddr - */ - @javax.annotation.Nonnull - public Long getFunctionVaddr() { - return functionVaddr; - } - - public void setFunctionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AppApiRestV2FunctionsResponsesFunction instance itself - */ - public AppApiRestV2FunctionsResponsesFunction 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; - } - AppApiRestV2FunctionsResponsesFunction appApiRestV2FunctionsResponsesFunction = (AppApiRestV2FunctionsResponsesFunction) o; - return Objects.equals(this.functionId, appApiRestV2FunctionsResponsesFunction.functionId) && - Objects.equals(this.functionVaddr, appApiRestV2FunctionsResponsesFunction.functionVaddr)&& - Objects.equals(this.additionalProperties, appApiRestV2FunctionsResponsesFunction.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(functionId, functionVaddr, 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 AppApiRestV2FunctionsResponsesFunction {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "function_vaddr")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_vaddr")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AppApiRestV2FunctionsResponsesFunction - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AppApiRestV2FunctionsResponsesFunction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AppApiRestV2FunctionsResponsesFunction is not found in the empty JSON string", AppApiRestV2FunctionsResponsesFunction.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AppApiRestV2FunctionsResponsesFunction.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AppApiRestV2FunctionsResponsesFunction.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AppApiRestV2FunctionsResponsesFunction' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AppApiRestV2FunctionsResponsesFunction.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AppApiRestV2FunctionsResponsesFunction 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 AppApiRestV2FunctionsResponsesFunction read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AppApiRestV2FunctionsResponsesFunction instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AppApiRestV2FunctionsResponsesFunction given an JSON string - * - * @param jsonString JSON string - * @return An instance of AppApiRestV2FunctionsResponsesFunction - * @throws IOException if the JSON string is invalid with respect to AppApiRestV2FunctionsResponsesFunction - */ - public static AppApiRestV2FunctionsResponsesFunction fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AppApiRestV2FunctionsResponsesFunction.class); - } - - /** - * Convert an instance of AppApiRestV2FunctionsResponsesFunction to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java b/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java deleted file mode 100644 index 84237b5..0000000 --- a/src/main/java/ai/reveng/model/AppApiRestV2FunctionsTypesFunction.java +++ /dev/null @@ -1,422 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AppApiRestV2FunctionsTypesFunction - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AppApiRestV2FunctionsTypesFunction { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nonnull - private String functionName; - - public static final String SERIALIZED_NAME_FUNCTION_MANGLED_NAME = "function_mangled_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_MANGLED_NAME) - @javax.annotation.Nonnull - private String functionMangledName; - - public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr"; - @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) - @javax.annotation.Nonnull - private Long functionVaddr; - - public static final String SERIALIZED_NAME_FUNCTION_SIZE = "function_size"; - @SerializedName(SERIALIZED_NAME_FUNCTION_SIZE) - @javax.annotation.Nonnull - private Integer functionSize; - - public static final String SERIALIZED_NAME_DEBUG = "debug"; - @SerializedName(SERIALIZED_NAME_DEBUG) - @javax.annotation.Nonnull - private Boolean debug; - - public AppApiRestV2FunctionsTypesFunction() { - } - - public AppApiRestV2FunctionsTypesFunction functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Function id - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public AppApiRestV2FunctionsTypesFunction functionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - return this; - } - - /** - * Demangled name of the function - * @return functionName - */ - @javax.annotation.Nonnull - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - } - - - public AppApiRestV2FunctionsTypesFunction functionMangledName(@javax.annotation.Nonnull String functionMangledName) { - this.functionMangledName = functionMangledName; - return this; - } - - /** - * Mangled name of the function - * @return functionMangledName - */ - @javax.annotation.Nonnull - public String getFunctionMangledName() { - return functionMangledName; - } - - public void setFunctionMangledName(@javax.annotation.Nonnull String functionMangledName) { - this.functionMangledName = functionMangledName; - } - - - public AppApiRestV2FunctionsTypesFunction functionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - return this; - } - - /** - * Function virtual address - * @return functionVaddr - */ - @javax.annotation.Nonnull - public Long getFunctionVaddr() { - return functionVaddr; - } - - public void setFunctionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - } - - - public AppApiRestV2FunctionsTypesFunction functionSize(@javax.annotation.Nonnull Integer functionSize) { - this.functionSize = functionSize; - return this; - } - - /** - * Function size - * @return functionSize - */ - @javax.annotation.Nonnull - public Integer getFunctionSize() { - return functionSize; - } - - public void setFunctionSize(@javax.annotation.Nonnull Integer functionSize) { - this.functionSize = functionSize; - } - - - public AppApiRestV2FunctionsTypesFunction debug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - return this; - } - - /** - * Whether the function is debug - * @return debug - */ - @javax.annotation.Nonnull - public Boolean getDebug() { - return debug; - } - - public void setDebug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - } - - /** - * 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 AppApiRestV2FunctionsTypesFunction instance itself - */ - public AppApiRestV2FunctionsTypesFunction 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; - } - AppApiRestV2FunctionsTypesFunction appApiRestV2FunctionsTypesFunction = (AppApiRestV2FunctionsTypesFunction) o; - return Objects.equals(this.functionId, appApiRestV2FunctionsTypesFunction.functionId) && - Objects.equals(this.functionName, appApiRestV2FunctionsTypesFunction.functionName) && - Objects.equals(this.functionMangledName, appApiRestV2FunctionsTypesFunction.functionMangledName) && - Objects.equals(this.functionVaddr, appApiRestV2FunctionsTypesFunction.functionVaddr) && - Objects.equals(this.functionSize, appApiRestV2FunctionsTypesFunction.functionSize) && - Objects.equals(this.debug, appApiRestV2FunctionsTypesFunction.debug)&& - Objects.equals(this.additionalProperties, appApiRestV2FunctionsTypesFunction.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, functionName, functionMangledName, functionVaddr, functionSize, debug, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AppApiRestV2FunctionsTypesFunction {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" functionMangledName: ").append(toIndentedString(functionMangledName)).append("\n"); - sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); - sb.append(" functionSize: ").append(toIndentedString(functionSize)).append("\n"); - sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "function_name", "function_mangled_name", "function_vaddr", "function_size", "debug")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_name", "function_mangled_name", "function_vaddr", "function_size", "debug")); - } - - /** - * 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 AppApiRestV2FunctionsTypesFunction - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AppApiRestV2FunctionsTypesFunction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AppApiRestV2FunctionsTypesFunction is not found in the empty JSON string", AppApiRestV2FunctionsTypesFunction.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AppApiRestV2FunctionsTypesFunction.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("function_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); - } - if (!jsonObj.get("function_mangled_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_mangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_mangled_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AppApiRestV2FunctionsTypesFunction.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AppApiRestV2FunctionsTypesFunction' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AppApiRestV2FunctionsTypesFunction.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AppApiRestV2FunctionsTypesFunction 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 AppApiRestV2FunctionsTypesFunction read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AppApiRestV2FunctionsTypesFunction instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AppApiRestV2FunctionsTypesFunction given an JSON string - * - * @param jsonString JSON string - * @return An instance of AppApiRestV2FunctionsTypesFunction - * @throws IOException if the JSON string is invalid with respect to AppApiRestV2FunctionsTypesFunction - */ - public static AppApiRestV2FunctionsTypesFunction fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AppApiRestV2FunctionsTypesFunction.class); - } - - /** - * Convert an instance of AppApiRestV2FunctionsTypesFunction to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AppApiRestV2InfoTypesCapability.java b/src/main/java/ai/reveng/model/AppApiRestV2InfoTypesCapability.java deleted file mode 100644 index c72e823..0000000 --- a/src/main/java/ai/reveng/model/AppApiRestV2InfoTypesCapability.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 com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AppApiRestV2InfoTypesCapability - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AppApiRestV2InfoTypesCapability { - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nonnull - private String functionName; - - public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr"; - @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) - @javax.annotation.Nonnull - private Long functionVaddr; - - public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; - @SerializedName(SERIALIZED_NAME_CAPABILITIES) - @javax.annotation.Nonnull - private List capabilities = new ArrayList<>(); - - public AppApiRestV2InfoTypesCapability() { - } - - public AppApiRestV2InfoTypesCapability functionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - return this; - } - - /** - * The name of the function with a capability - * @return functionName - */ - @javax.annotation.Nonnull - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - } - - - public AppApiRestV2InfoTypesCapability functionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - return this; - } - - /** - * The virtual address of the function where the capability comes from - * @return functionVaddr - */ - @javax.annotation.Nonnull - public Long getFunctionVaddr() { - return functionVaddr; - } - - public void setFunctionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - } - - - public AppApiRestV2InfoTypesCapability capabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - return this; - } - - public AppApiRestV2InfoTypesCapability addCapabilitiesItem(String capabilitiesItem) { - if (this.capabilities == null) { - this.capabilities = new ArrayList<>(); - } - this.capabilities.add(capabilitiesItem); - return this; - } - - /** - * The list of capabilities associated with the function - * @return capabilities - */ - @javax.annotation.Nonnull - public List getCapabilities() { - return capabilities; - } - - public void setCapabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AppApiRestV2InfoTypesCapability instance itself - */ - public AppApiRestV2InfoTypesCapability 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; - } - AppApiRestV2InfoTypesCapability appApiRestV2InfoTypesCapability = (AppApiRestV2InfoTypesCapability) o; - return Objects.equals(this.functionName, appApiRestV2InfoTypesCapability.functionName) && - Objects.equals(this.functionVaddr, appApiRestV2InfoTypesCapability.functionVaddr) && - Objects.equals(this.capabilities, appApiRestV2InfoTypesCapability.capabilities)&& - Objects.equals(this.additionalProperties, appApiRestV2InfoTypesCapability.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionName, functionVaddr, capabilities, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AppApiRestV2InfoTypesCapability {\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); - sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_name", "function_vaddr", "capabilities")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_name", "function_vaddr", "capabilities")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AppApiRestV2InfoTypesCapability - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AppApiRestV2InfoTypesCapability.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AppApiRestV2InfoTypesCapability is not found in the empty JSON string", AppApiRestV2InfoTypesCapability.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AppApiRestV2InfoTypesCapability.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("function_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); - } - // ensure the required json array is present - if (jsonObj.get("capabilities") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("capabilities").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AppApiRestV2InfoTypesCapability.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AppApiRestV2InfoTypesCapability' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AppApiRestV2InfoTypesCapability.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AppApiRestV2InfoTypesCapability 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 AppApiRestV2InfoTypesCapability read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AppApiRestV2InfoTypesCapability instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AppApiRestV2InfoTypesCapability given an JSON string - * - * @param jsonString JSON string - * @return An instance of AppApiRestV2InfoTypesCapability - * @throws IOException if the JSON string is invalid with respect to AppApiRestV2InfoTypesCapability - */ - public static AppApiRestV2InfoTypesCapability fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AppApiRestV2InfoTypesCapability.class); - } - - /** - * Convert an instance of AppApiRestV2InfoTypesCapability to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Argument.java b/src/main/java/ai/reveng/model/Argument.java deleted file mode 100644 index 796ee04..0000000 --- a/src/main/java/ai/reveng/model/Argument.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Argument - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Argument { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_OFFSET = "offset"; - @SerializedName(SERIALIZED_NAME_OFFSET) - @javax.annotation.Nonnull - private Integer offset; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - 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 Argument() { - } - - public Argument lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this argument - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public Argument offset(@javax.annotation.Nonnull Integer offset) { - this.offset = offset; - return this; - } - - /** - * Offset of the argument in the function signature - * @return offset - */ - @javax.annotation.Nonnull - public Integer getOffset() { - return offset; - } - - public void setOffset(@javax.annotation.Nonnull Integer offset) { - this.offset = offset; - } - - - public Argument name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the argument - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public Argument type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Data type of the argument - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public Argument size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Size of the argument in bytes - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the Argument instance itself - */ - public Argument 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; - } - Argument argument = (Argument) o; - return Objects.equals(this.lastChange, argument.lastChange) && - Objects.equals(this.offset, argument.offset) && - Objects.equals(this.name, argument.name) && - Objects.equals(this.type, argument.type) && - Objects.equals(this.size, argument.size)&& - Objects.equals(this.additionalProperties, argument.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(lastChange, offset, name, type, size, 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 Argument {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).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(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "offset", "name", "type", "size")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("offset", "name", "type", "size")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Argument - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Argument.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Argument is not found in the empty JSON string", Argument.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Argument.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Argument.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Argument' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Argument.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Argument 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 Argument read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Argument instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Argument given an JSON string - * - * @param jsonString JSON string - * @return An instance of Argument - * @throws IOException if the JSON string is invalid with respect to Argument - */ - public static Argument fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Argument.class); - } - - /** - * Convert an instance of Argument to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AutoRunAgents.java b/src/main/java/ai/reveng/model/AutoRunAgents.java deleted file mode 100644 index 6395eca..0000000 --- a/src/main/java/ai/reveng/model/AutoRunAgents.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AutoRunAgents - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AutoRunAgents { - public static final String SERIALIZED_NAME_TRIAGE = "triage"; - @SerializedName(SERIALIZED_NAME_TRIAGE) - @javax.annotation.Nullable - private Boolean triage = false; - - public AutoRunAgents() { - } - - public AutoRunAgents triage(@javax.annotation.Nullable Boolean triage) { - this.triage = triage; - return this; - } - - /** - * Get triage - * @return triage - */ - @javax.annotation.Nullable - public Boolean getTriage() { - return triage; - } - - public void setTriage(@javax.annotation.Nullable Boolean triage) { - this.triage = triage; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AutoRunAgents instance itself - */ - public AutoRunAgents 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; - } - AutoRunAgents autoRunAgents = (AutoRunAgents) o; - return Objects.equals(this.triage, autoRunAgents.triage)&& - Objects.equals(this.additionalProperties, autoRunAgents.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(triage, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AutoRunAgents {\n"); - sb.append(" triage: ").append(toIndentedString(triage)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("triage")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(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 AutoRunAgents - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AutoRunAgents.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AutoRunAgents is not found in the empty JSON string", AutoRunAgents.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AutoRunAgents.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AutoRunAgents' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AutoRunAgents.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AutoRunAgents 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 AutoRunAgents read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AutoRunAgents instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AutoRunAgents given an JSON string - * - * @param jsonString JSON string - * @return An instance of AutoRunAgents - * @throws IOException if the JSON string is invalid with respect to AutoRunAgents - */ - public static AutoRunAgents fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AutoRunAgents.class); - } - - /** - * Convert an instance of AutoRunAgents to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponse.java b/src/main/java/ai/reveng/model/BaseResponse.java deleted file mode 100644 index 7e79684..0000000 --- a/src/main/java/ai/reveng/model/BaseResponse.java +++ /dev/null @@ -1,428 +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 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 ai.reveng.invoker.JSON; - -/** - * BaseResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponse { - 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 Object 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 BaseResponse() { - } - - public BaseResponse 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 BaseResponse data(@javax.annotation.Nullable Object data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Object getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Object data) { - this.data = data; - } - - - public BaseResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponse 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 BaseResponse instance itself - */ - public BaseResponse 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; - } - BaseResponse baseResponse = (BaseResponse) o; - return Objects.equals(this.status, baseResponse.status) && - Objects.equals(this.data, baseResponse.data) && - Objects.equals(this.message, baseResponse.message) && - Objects.equals(this.errors, baseResponse.errors) && - Objects.equals(this.meta, baseResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponse.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 BaseResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponse is not found in the empty JSON string", BaseResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // validate the 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 (!BaseResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponse 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 BaseResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponse - */ - public static BaseResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponse.class); - } - - /** - * Convert an instance of BaseResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAdditionalDetailsStatusResponse.java b/src/main/java/ai/reveng/model/BaseResponseAdditionalDetailsStatusResponse.java deleted file mode 100644 index fb7e08e..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAdditionalDetailsStatusResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AdditionalDetailsStatusResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAdditionalDetailsStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAdditionalDetailsStatusResponse { - 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 AdditionalDetailsStatusResponse 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 BaseResponseAdditionalDetailsStatusResponse() { - } - - public BaseResponseAdditionalDetailsStatusResponse 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 BaseResponseAdditionalDetailsStatusResponse data(@javax.annotation.Nullable AdditionalDetailsStatusResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AdditionalDetailsStatusResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AdditionalDetailsStatusResponse data) { - this.data = data; - } - - - public BaseResponseAdditionalDetailsStatusResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAdditionalDetailsStatusResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAdditionalDetailsStatusResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAdditionalDetailsStatusResponse 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 BaseResponseAdditionalDetailsStatusResponse instance itself - */ - public BaseResponseAdditionalDetailsStatusResponse 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; - } - BaseResponseAdditionalDetailsStatusResponse baseResponseAdditionalDetailsStatusResponse = (BaseResponseAdditionalDetailsStatusResponse) o; - return Objects.equals(this.status, baseResponseAdditionalDetailsStatusResponse.status) && - Objects.equals(this.data, baseResponseAdditionalDetailsStatusResponse.data) && - Objects.equals(this.message, baseResponseAdditionalDetailsStatusResponse.message) && - Objects.equals(this.errors, baseResponseAdditionalDetailsStatusResponse.errors) && - Objects.equals(this.meta, baseResponseAdditionalDetailsStatusResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseAdditionalDetailsStatusResponse.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 BaseResponseAdditionalDetailsStatusResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAdditionalDetailsStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAdditionalDetailsStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAdditionalDetailsStatusResponse is not found in the empty JSON string", BaseResponseAdditionalDetailsStatusResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AdditionalDetailsStatusResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAdditionalDetailsStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAdditionalDetailsStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAdditionalDetailsStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAdditionalDetailsStatusResponse 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 BaseResponseAdditionalDetailsStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAdditionalDetailsStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAdditionalDetailsStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAdditionalDetailsStatusResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseAdditionalDetailsStatusResponse - */ - public static BaseResponseAdditionalDetailsStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAdditionalDetailsStatusResponse.class); - } - - /** - * Convert an instance of BaseResponseAdditionalDetailsStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisBulkAddTagsResponse.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisBulkAddTagsResponse.java deleted file mode 100644 index 360c625..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisBulkAddTagsResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisBulkAddTagsResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisBulkAddTagsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisBulkAddTagsResponse { - 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 AnalysisBulkAddTagsResponse 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 BaseResponseAnalysisBulkAddTagsResponse() { - } - - public BaseResponseAnalysisBulkAddTagsResponse 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 BaseResponseAnalysisBulkAddTagsResponse data(@javax.annotation.Nullable AnalysisBulkAddTagsResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisBulkAddTagsResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisBulkAddTagsResponse data) { - this.data = data; - } - - - public BaseResponseAnalysisBulkAddTagsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisBulkAddTagsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisBulkAddTagsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisBulkAddTagsResponse 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 BaseResponseAnalysisBulkAddTagsResponse instance itself - */ - public BaseResponseAnalysisBulkAddTagsResponse 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; - } - BaseResponseAnalysisBulkAddTagsResponse baseResponseAnalysisBulkAddTagsResponse = (BaseResponseAnalysisBulkAddTagsResponse) o; - return Objects.equals(this.status, baseResponseAnalysisBulkAddTagsResponse.status) && - Objects.equals(this.data, baseResponseAnalysisBulkAddTagsResponse.data) && - Objects.equals(this.message, baseResponseAnalysisBulkAddTagsResponse.message) && - Objects.equals(this.errors, baseResponseAnalysisBulkAddTagsResponse.errors) && - Objects.equals(this.meta, baseResponseAnalysisBulkAddTagsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisBulkAddTagsResponse.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 BaseResponseAnalysisBulkAddTagsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisBulkAddTagsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisBulkAddTagsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisBulkAddTagsResponse is not found in the empty JSON string", BaseResponseAnalysisBulkAddTagsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisBulkAddTagsResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisBulkAddTagsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisBulkAddTagsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisBulkAddTagsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisBulkAddTagsResponse 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 BaseResponseAnalysisBulkAddTagsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisBulkAddTagsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisBulkAddTagsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisBulkAddTagsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisBulkAddTagsResponse - */ - public static BaseResponseAnalysisBulkAddTagsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisBulkAddTagsResponse.class); - } - - /** - * Convert an instance of BaseResponseAnalysisBulkAddTagsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisCreateResponse.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisCreateResponse.java deleted file mode 100644 index 0cb854a..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisCreateResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisCreateResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisCreateResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisCreateResponse { - 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 AnalysisCreateResponse 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 BaseResponseAnalysisCreateResponse() { - } - - public BaseResponseAnalysisCreateResponse 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 BaseResponseAnalysisCreateResponse data(@javax.annotation.Nullable AnalysisCreateResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisCreateResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisCreateResponse data) { - this.data = data; - } - - - public BaseResponseAnalysisCreateResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisCreateResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisCreateResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisCreateResponse 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 BaseResponseAnalysisCreateResponse instance itself - */ - public BaseResponseAnalysisCreateResponse 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; - } - BaseResponseAnalysisCreateResponse baseResponseAnalysisCreateResponse = (BaseResponseAnalysisCreateResponse) o; - return Objects.equals(this.status, baseResponseAnalysisCreateResponse.status) && - Objects.equals(this.data, baseResponseAnalysisCreateResponse.data) && - Objects.equals(this.message, baseResponseAnalysisCreateResponse.message) && - Objects.equals(this.errors, baseResponseAnalysisCreateResponse.errors) && - Objects.equals(this.meta, baseResponseAnalysisCreateResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisCreateResponse.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 BaseResponseAnalysisCreateResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisCreateResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisCreateResponse is not found in the empty JSON string", BaseResponseAnalysisCreateResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisCreateResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisCreateResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisCreateResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisCreateResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisCreateResponse 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 BaseResponseAnalysisCreateResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisCreateResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisCreateResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisCreateResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisCreateResponse - */ - public static BaseResponseAnalysisCreateResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisCreateResponse.class); - } - - /** - * Convert an instance of BaseResponseAnalysisCreateResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisDetailResponse.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisDetailResponse.java deleted file mode 100644 index db9527d..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisDetailResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisDetailResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisDetailResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisDetailResponse { - 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 AnalysisDetailResponse 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 BaseResponseAnalysisDetailResponse() { - } - - public BaseResponseAnalysisDetailResponse 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 BaseResponseAnalysisDetailResponse data(@javax.annotation.Nullable AnalysisDetailResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisDetailResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisDetailResponse data) { - this.data = data; - } - - - public BaseResponseAnalysisDetailResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisDetailResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisDetailResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisDetailResponse 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 BaseResponseAnalysisDetailResponse instance itself - */ - public BaseResponseAnalysisDetailResponse 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; - } - BaseResponseAnalysisDetailResponse baseResponseAnalysisDetailResponse = (BaseResponseAnalysisDetailResponse) o; - return Objects.equals(this.status, baseResponseAnalysisDetailResponse.status) && - Objects.equals(this.data, baseResponseAnalysisDetailResponse.data) && - Objects.equals(this.message, baseResponseAnalysisDetailResponse.message) && - Objects.equals(this.errors, baseResponseAnalysisDetailResponse.errors) && - Objects.equals(this.meta, baseResponseAnalysisDetailResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisDetailResponse.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 BaseResponseAnalysisDetailResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisDetailResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisDetailResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisDetailResponse is not found in the empty JSON string", BaseResponseAnalysisDetailResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisDetailResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisDetailResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisDetailResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisDetailResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisDetailResponse 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 BaseResponseAnalysisDetailResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisDetailResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisDetailResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisDetailResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisDetailResponse - */ - public static BaseResponseAnalysisDetailResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisDetailResponse.class); - } - - /** - * Convert an instance of BaseResponseAnalysisDetailResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctionMapping.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctionMapping.java deleted file mode 100644 index c8e4c20..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctionMapping.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisFunctionMapping; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisFunctionMapping - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisFunctionMapping { - 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 AnalysisFunctionMapping 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 BaseResponseAnalysisFunctionMapping() { - } - - public BaseResponseAnalysisFunctionMapping 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 BaseResponseAnalysisFunctionMapping data(@javax.annotation.Nullable AnalysisFunctionMapping data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisFunctionMapping getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisFunctionMapping data) { - this.data = data; - } - - - public BaseResponseAnalysisFunctionMapping message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisFunctionMapping errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisFunctionMapping addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisFunctionMapping 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 BaseResponseAnalysisFunctionMapping instance itself - */ - public BaseResponseAnalysisFunctionMapping 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; - } - BaseResponseAnalysisFunctionMapping baseResponseAnalysisFunctionMapping = (BaseResponseAnalysisFunctionMapping) o; - return Objects.equals(this.status, baseResponseAnalysisFunctionMapping.status) && - Objects.equals(this.data, baseResponseAnalysisFunctionMapping.data) && - Objects.equals(this.message, baseResponseAnalysisFunctionMapping.message) && - Objects.equals(this.errors, baseResponseAnalysisFunctionMapping.errors) && - Objects.equals(this.meta, baseResponseAnalysisFunctionMapping.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisFunctionMapping.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 BaseResponseAnalysisFunctionMapping {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisFunctionMapping - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisFunctionMapping.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisFunctionMapping is not found in the empty JSON string", BaseResponseAnalysisFunctionMapping.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisFunctionMapping.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisFunctionMapping.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisFunctionMapping' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisFunctionMapping.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisFunctionMapping 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 BaseResponseAnalysisFunctionMapping read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisFunctionMapping instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisFunctionMapping given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisFunctionMapping - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisFunctionMapping - */ - public static BaseResponseAnalysisFunctionMapping fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisFunctionMapping.class); - } - - /** - * Convert an instance of BaseResponseAnalysisFunctionMapping to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctions.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctions.java deleted file mode 100644 index 313e506..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctions.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisFunctions; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisFunctions - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisFunctions { - 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 AnalysisFunctions 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 BaseResponseAnalysisFunctions() { - } - - public BaseResponseAnalysisFunctions 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 BaseResponseAnalysisFunctions data(@javax.annotation.Nullable AnalysisFunctions data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisFunctions getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisFunctions data) { - this.data = data; - } - - - public BaseResponseAnalysisFunctions message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisFunctions errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisFunctions addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisFunctions 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 BaseResponseAnalysisFunctions instance itself - */ - public BaseResponseAnalysisFunctions 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; - } - BaseResponseAnalysisFunctions baseResponseAnalysisFunctions = (BaseResponseAnalysisFunctions) o; - return Objects.equals(this.status, baseResponseAnalysisFunctions.status) && - Objects.equals(this.data, baseResponseAnalysisFunctions.data) && - Objects.equals(this.message, baseResponseAnalysisFunctions.message) && - Objects.equals(this.errors, baseResponseAnalysisFunctions.errors) && - Objects.equals(this.meta, baseResponseAnalysisFunctions.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisFunctions.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 BaseResponseAnalysisFunctions {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisFunctions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisFunctions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisFunctions is not found in the empty JSON string", BaseResponseAnalysisFunctions.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisFunctions.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisFunctions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisFunctions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisFunctions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisFunctions 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 BaseResponseAnalysisFunctions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisFunctions instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisFunctions given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisFunctions - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisFunctions - */ - public static BaseResponseAnalysisFunctions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisFunctions.class); - } - - /** - * Convert an instance of BaseResponseAnalysisFunctions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctionsList.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctionsList.java deleted file mode 100644 index 6de5b77..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisFunctionsList.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisFunctionsList; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisFunctionsList - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisFunctionsList { - 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 AnalysisFunctionsList 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 BaseResponseAnalysisFunctionsList() { - } - - public BaseResponseAnalysisFunctionsList 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 BaseResponseAnalysisFunctionsList data(@javax.annotation.Nullable AnalysisFunctionsList data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisFunctionsList getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisFunctionsList data) { - this.data = data; - } - - - public BaseResponseAnalysisFunctionsList message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisFunctionsList errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisFunctionsList addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisFunctionsList 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 BaseResponseAnalysisFunctionsList instance itself - */ - public BaseResponseAnalysisFunctionsList 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; - } - BaseResponseAnalysisFunctionsList baseResponseAnalysisFunctionsList = (BaseResponseAnalysisFunctionsList) o; - return Objects.equals(this.status, baseResponseAnalysisFunctionsList.status) && - Objects.equals(this.data, baseResponseAnalysisFunctionsList.data) && - Objects.equals(this.message, baseResponseAnalysisFunctionsList.message) && - Objects.equals(this.errors, baseResponseAnalysisFunctionsList.errors) && - Objects.equals(this.meta, baseResponseAnalysisFunctionsList.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisFunctionsList.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 BaseResponseAnalysisFunctionsList {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisFunctionsList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisFunctionsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisFunctionsList is not found in the empty JSON string", BaseResponseAnalysisFunctionsList.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisFunctionsList.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisFunctionsList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisFunctionsList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisFunctionsList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisFunctionsList 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 BaseResponseAnalysisFunctionsList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisFunctionsList instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisFunctionsList given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisFunctionsList - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisFunctionsList - */ - public static BaseResponseAnalysisFunctionsList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisFunctionsList.class); - } - - /** - * Convert an instance of BaseResponseAnalysisFunctionsList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsResponse.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsResponse.java deleted file mode 100644 index 686e895..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisStringsResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisStringsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisStringsResponse { - 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 AnalysisStringsResponse 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 BaseResponseAnalysisStringsResponse() { - } - - public BaseResponseAnalysisStringsResponse 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 BaseResponseAnalysisStringsResponse data(@javax.annotation.Nullable AnalysisStringsResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisStringsResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisStringsResponse data) { - this.data = data; - } - - - public BaseResponseAnalysisStringsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisStringsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisStringsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisStringsResponse 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 BaseResponseAnalysisStringsResponse instance itself - */ - public BaseResponseAnalysisStringsResponse 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; - } - BaseResponseAnalysisStringsResponse baseResponseAnalysisStringsResponse = (BaseResponseAnalysisStringsResponse) o; - return Objects.equals(this.status, baseResponseAnalysisStringsResponse.status) && - Objects.equals(this.data, baseResponseAnalysisStringsResponse.data) && - Objects.equals(this.message, baseResponseAnalysisStringsResponse.message) && - Objects.equals(this.errors, baseResponseAnalysisStringsResponse.errors) && - Objects.equals(this.meta, baseResponseAnalysisStringsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisStringsResponse.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 BaseResponseAnalysisStringsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisStringsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisStringsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisStringsResponse is not found in the empty JSON string", BaseResponseAnalysisStringsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisStringsResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisStringsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisStringsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisStringsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisStringsResponse 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 BaseResponseAnalysisStringsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisStringsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisStringsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisStringsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisStringsResponse - */ - public static BaseResponseAnalysisStringsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisStringsResponse.class); - } - - /** - * Convert an instance of BaseResponseAnalysisStringsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponse.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponse.java deleted file mode 100644 index ff0f8b0..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisStringsStatusResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisStringsStatusResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisStringsStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisStringsStatusResponse { - 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 AnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse() { - } - - public BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse data(@javax.annotation.Nullable AnalysisStringsStatusResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisStringsStatusResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisStringsStatusResponse data) { - this.data = data; - } - - - public BaseResponseAnalysisStringsStatusResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisStringsStatusResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisStringsStatusResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse instance itself - */ - public BaseResponseAnalysisStringsStatusResponse 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; - } - BaseResponseAnalysisStringsStatusResponse baseResponseAnalysisStringsStatusResponse = (BaseResponseAnalysisStringsStatusResponse) o; - return Objects.equals(this.status, baseResponseAnalysisStringsStatusResponse.status) && - Objects.equals(this.data, baseResponseAnalysisStringsStatusResponse.data) && - Objects.equals(this.message, baseResponseAnalysisStringsStatusResponse.message) && - Objects.equals(this.errors, baseResponseAnalysisStringsStatusResponse.errors) && - Objects.equals(this.meta, baseResponseAnalysisStringsStatusResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisStringsStatusResponse.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 BaseResponseAnalysisStringsStatusResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisStringsStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisStringsStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisStringsStatusResponse is not found in the empty JSON string", BaseResponseAnalysisStringsStatusResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisStringsStatusResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisStringsStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisStringsStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisStringsStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisStringsStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisStringsStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisStringsStatusResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisStringsStatusResponse - */ - public static BaseResponseAnalysisStringsStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisStringsStatusResponse.class); - } - - /** - * Convert an instance of BaseResponseAnalysisStringsStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisTags.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisTags.java deleted file mode 100644 index b5b001b..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisTags.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisTags; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisTags - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisTags { - 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 AnalysisTags 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 BaseResponseAnalysisTags() { - } - - public BaseResponseAnalysisTags 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 BaseResponseAnalysisTags data(@javax.annotation.Nullable AnalysisTags data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisTags getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisTags data) { - this.data = data; - } - - - public BaseResponseAnalysisTags message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisTags errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisTags addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisTags 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 BaseResponseAnalysisTags instance itself - */ - public BaseResponseAnalysisTags 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; - } - BaseResponseAnalysisTags baseResponseAnalysisTags = (BaseResponseAnalysisTags) o; - return Objects.equals(this.status, baseResponseAnalysisTags.status) && - Objects.equals(this.data, baseResponseAnalysisTags.data) && - Objects.equals(this.message, baseResponseAnalysisTags.message) && - Objects.equals(this.errors, baseResponseAnalysisTags.errors) && - Objects.equals(this.meta, baseResponseAnalysisTags.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisTags.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 BaseResponseAnalysisTags {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisTags - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisTags.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisTags is not found in the empty JSON string", BaseResponseAnalysisTags.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisTags.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisTags.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisTags' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisTags.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisTags 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 BaseResponseAnalysisTags read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisTags instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisTags given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisTags - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisTags - */ - public static BaseResponseAnalysisTags fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisTags.class); - } - - /** - * Convert an instance of BaseResponseAnalysisTags to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseAnalysisUpdateTagsResponse.java b/src/main/java/ai/reveng/model/BaseResponseAnalysisUpdateTagsResponse.java deleted file mode 100644 index 09eeab0..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseAnalysisUpdateTagsResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.AnalysisUpdateTagsResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseAnalysisUpdateTagsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseAnalysisUpdateTagsResponse { - 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 AnalysisUpdateTagsResponse 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 BaseResponseAnalysisUpdateTagsResponse() { - } - - public BaseResponseAnalysisUpdateTagsResponse 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 BaseResponseAnalysisUpdateTagsResponse data(@javax.annotation.Nullable AnalysisUpdateTagsResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public AnalysisUpdateTagsResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable AnalysisUpdateTagsResponse data) { - this.data = data; - } - - - public BaseResponseAnalysisUpdateTagsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseAnalysisUpdateTagsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseAnalysisUpdateTagsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseAnalysisUpdateTagsResponse 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 BaseResponseAnalysisUpdateTagsResponse instance itself - */ - public BaseResponseAnalysisUpdateTagsResponse 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; - } - BaseResponseAnalysisUpdateTagsResponse baseResponseAnalysisUpdateTagsResponse = (BaseResponseAnalysisUpdateTagsResponse) o; - return Objects.equals(this.status, baseResponseAnalysisUpdateTagsResponse.status) && - Objects.equals(this.data, baseResponseAnalysisUpdateTagsResponse.data) && - Objects.equals(this.message, baseResponseAnalysisUpdateTagsResponse.message) && - Objects.equals(this.errors, baseResponseAnalysisUpdateTagsResponse.errors) && - Objects.equals(this.meta, baseResponseAnalysisUpdateTagsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseAnalysisUpdateTagsResponse.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 BaseResponseAnalysisUpdateTagsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseAnalysisUpdateTagsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseAnalysisUpdateTagsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseAnalysisUpdateTagsResponse is not found in the empty JSON string", BaseResponseAnalysisUpdateTagsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - AnalysisUpdateTagsResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseAnalysisUpdateTagsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseAnalysisUpdateTagsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseAnalysisUpdateTagsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseAnalysisUpdateTagsResponse 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 BaseResponseAnalysisUpdateTagsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseAnalysisUpdateTagsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseAnalysisUpdateTagsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseAnalysisUpdateTagsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseAnalysisUpdateTagsResponse - */ - public static BaseResponseAnalysisUpdateTagsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseAnalysisUpdateTagsResponse.class); - } - - /** - * Convert an instance of BaseResponseAnalysisUpdateTagsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseBasic.java b/src/main/java/ai/reveng/model/BaseResponseBasic.java deleted file mode 100644 index 2f390d7..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseBasic.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.Basic; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseBasic - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseBasic { - 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 Basic 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 BaseResponseBasic() { - } - - public BaseResponseBasic 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 BaseResponseBasic data(@javax.annotation.Nullable Basic data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Basic getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Basic data) { - this.data = data; - } - - - public BaseResponseBasic message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseBasic errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseBasic addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseBasic 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 BaseResponseBasic instance itself - */ - public BaseResponseBasic 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; - } - BaseResponseBasic baseResponseBasic = (BaseResponseBasic) o; - return Objects.equals(this.status, baseResponseBasic.status) && - Objects.equals(this.data, baseResponseBasic.data) && - Objects.equals(this.message, baseResponseBasic.message) && - Objects.equals(this.errors, baseResponseBasic.errors) && - Objects.equals(this.meta, baseResponseBasic.meta)&& - Objects.equals(this.additionalProperties, baseResponseBasic.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 BaseResponseBasic {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseBasic - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseBasic.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseBasic is not found in the empty JSON string", BaseResponseBasic.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - Basic.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseBasic.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseBasic' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseBasic.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseBasic 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 BaseResponseBasic read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseBasic instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseBasic given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseBasic - * @throws IOException if the JSON string is invalid with respect to BaseResponseBasic - */ - public static BaseResponseBasic fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseBasic.class); - } - - /** - * Convert an instance of BaseResponseBasic to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseBinariesRelatedStatusResponse.java b/src/main/java/ai/reveng/model/BaseResponseBinariesRelatedStatusResponse.java deleted file mode 100644 index 90f517a..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseBinariesRelatedStatusResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.BinariesRelatedStatusResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseBinariesRelatedStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseBinariesRelatedStatusResponse { - 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 BinariesRelatedStatusResponse 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 BaseResponseBinariesRelatedStatusResponse() { - } - - public BaseResponseBinariesRelatedStatusResponse 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 BaseResponseBinariesRelatedStatusResponse data(@javax.annotation.Nullable BinariesRelatedStatusResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public BinariesRelatedStatusResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable BinariesRelatedStatusResponse data) { - this.data = data; - } - - - public BaseResponseBinariesRelatedStatusResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseBinariesRelatedStatusResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseBinariesRelatedStatusResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseBinariesRelatedStatusResponse 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 BaseResponseBinariesRelatedStatusResponse instance itself - */ - public BaseResponseBinariesRelatedStatusResponse 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; - } - BaseResponseBinariesRelatedStatusResponse baseResponseBinariesRelatedStatusResponse = (BaseResponseBinariesRelatedStatusResponse) o; - return Objects.equals(this.status, baseResponseBinariesRelatedStatusResponse.status) && - Objects.equals(this.data, baseResponseBinariesRelatedStatusResponse.data) && - Objects.equals(this.message, baseResponseBinariesRelatedStatusResponse.message) && - Objects.equals(this.errors, baseResponseBinariesRelatedStatusResponse.errors) && - Objects.equals(this.meta, baseResponseBinariesRelatedStatusResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseBinariesRelatedStatusResponse.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 BaseResponseBinariesRelatedStatusResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseBinariesRelatedStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseBinariesRelatedStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseBinariesRelatedStatusResponse is not found in the empty JSON string", BaseResponseBinariesRelatedStatusResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - BinariesRelatedStatusResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseBinariesRelatedStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseBinariesRelatedStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseBinariesRelatedStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseBinariesRelatedStatusResponse 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 BaseResponseBinariesRelatedStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseBinariesRelatedStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseBinariesRelatedStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseBinariesRelatedStatusResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseBinariesRelatedStatusResponse - */ - public static BaseResponseBinariesRelatedStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseBinariesRelatedStatusResponse.class); - } - - /** - * Convert an instance of BaseResponseBinariesRelatedStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseBinaryAdditionalResponse.java b/src/main/java/ai/reveng/model/BaseResponseBinaryAdditionalResponse.java deleted file mode 100644 index 861dee4..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseBinaryAdditionalResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.BinaryAdditionalResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseBinaryAdditionalResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseBinaryAdditionalResponse { - 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 BinaryAdditionalResponse 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 BaseResponseBinaryAdditionalResponse() { - } - - public BaseResponseBinaryAdditionalResponse 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 BaseResponseBinaryAdditionalResponse data(@javax.annotation.Nullable BinaryAdditionalResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public BinaryAdditionalResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable BinaryAdditionalResponse data) { - this.data = data; - } - - - public BaseResponseBinaryAdditionalResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseBinaryAdditionalResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseBinaryAdditionalResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseBinaryAdditionalResponse 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 BaseResponseBinaryAdditionalResponse instance itself - */ - public BaseResponseBinaryAdditionalResponse 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; - } - BaseResponseBinaryAdditionalResponse baseResponseBinaryAdditionalResponse = (BaseResponseBinaryAdditionalResponse) o; - return Objects.equals(this.status, baseResponseBinaryAdditionalResponse.status) && - Objects.equals(this.data, baseResponseBinaryAdditionalResponse.data) && - Objects.equals(this.message, baseResponseBinaryAdditionalResponse.message) && - Objects.equals(this.errors, baseResponseBinaryAdditionalResponse.errors) && - Objects.equals(this.meta, baseResponseBinaryAdditionalResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseBinaryAdditionalResponse.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 BaseResponseBinaryAdditionalResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseBinaryAdditionalResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseBinaryAdditionalResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseBinaryAdditionalResponse is not found in the empty JSON string", BaseResponseBinaryAdditionalResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - BinaryAdditionalResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseBinaryAdditionalResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseBinaryAdditionalResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseBinaryAdditionalResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseBinaryAdditionalResponse 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 BaseResponseBinaryAdditionalResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseBinaryAdditionalResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseBinaryAdditionalResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseBinaryAdditionalResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseBinaryAdditionalResponse - */ - public static BaseResponseBinaryAdditionalResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseBinaryAdditionalResponse.class); - } - - /** - * Convert an instance of BaseResponseBinaryAdditionalResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseBinaryDetailsResponse.java b/src/main/java/ai/reveng/model/BaseResponseBinaryDetailsResponse.java deleted file mode 100644 index 4a185ef..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseBinaryDetailsResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.BinaryDetailsResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseBinaryDetailsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseBinaryDetailsResponse { - 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 BinaryDetailsResponse 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 BaseResponseBinaryDetailsResponse() { - } - - public BaseResponseBinaryDetailsResponse 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 BaseResponseBinaryDetailsResponse data(@javax.annotation.Nullable BinaryDetailsResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public BinaryDetailsResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable BinaryDetailsResponse data) { - this.data = data; - } - - - public BaseResponseBinaryDetailsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseBinaryDetailsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseBinaryDetailsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseBinaryDetailsResponse 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 BaseResponseBinaryDetailsResponse instance itself - */ - public BaseResponseBinaryDetailsResponse 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; - } - BaseResponseBinaryDetailsResponse baseResponseBinaryDetailsResponse = (BaseResponseBinaryDetailsResponse) o; - return Objects.equals(this.status, baseResponseBinaryDetailsResponse.status) && - Objects.equals(this.data, baseResponseBinaryDetailsResponse.data) && - Objects.equals(this.message, baseResponseBinaryDetailsResponse.message) && - Objects.equals(this.errors, baseResponseBinaryDetailsResponse.errors) && - Objects.equals(this.meta, baseResponseBinaryDetailsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseBinaryDetailsResponse.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 BaseResponseBinaryDetailsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseBinaryDetailsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseBinaryDetailsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseBinaryDetailsResponse is not found in the empty JSON string", BaseResponseBinaryDetailsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - BinaryDetailsResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseBinaryDetailsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseBinaryDetailsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseBinaryDetailsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseBinaryDetailsResponse 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 BaseResponseBinaryDetailsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseBinaryDetailsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseBinaryDetailsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseBinaryDetailsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseBinaryDetailsResponse - */ - public static BaseResponseBinaryDetailsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseBinaryDetailsResponse.class); - } - - /** - * Convert an instance of BaseResponseBinaryDetailsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseBinaryExternalsResponse.java b/src/main/java/ai/reveng/model/BaseResponseBinaryExternalsResponse.java deleted file mode 100644 index e3b43cc..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseBinaryExternalsResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.BinaryExternalsResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseBinaryExternalsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseBinaryExternalsResponse { - 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 BinaryExternalsResponse 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 BaseResponseBinaryExternalsResponse() { - } - - public BaseResponseBinaryExternalsResponse 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 BaseResponseBinaryExternalsResponse data(@javax.annotation.Nullable BinaryExternalsResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public BinaryExternalsResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable BinaryExternalsResponse data) { - this.data = data; - } - - - public BaseResponseBinaryExternalsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseBinaryExternalsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseBinaryExternalsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseBinaryExternalsResponse 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 BaseResponseBinaryExternalsResponse instance itself - */ - public BaseResponseBinaryExternalsResponse 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; - } - BaseResponseBinaryExternalsResponse baseResponseBinaryExternalsResponse = (BaseResponseBinaryExternalsResponse) o; - return Objects.equals(this.status, baseResponseBinaryExternalsResponse.status) && - Objects.equals(this.data, baseResponseBinaryExternalsResponse.data) && - Objects.equals(this.message, baseResponseBinaryExternalsResponse.message) && - Objects.equals(this.errors, baseResponseBinaryExternalsResponse.errors) && - Objects.equals(this.meta, baseResponseBinaryExternalsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseBinaryExternalsResponse.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 BaseResponseBinaryExternalsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseBinaryExternalsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseBinaryExternalsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseBinaryExternalsResponse is not found in the empty JSON string", BaseResponseBinaryExternalsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - BinaryExternalsResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseBinaryExternalsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseBinaryExternalsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseBinaryExternalsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseBinaryExternalsResponse 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 BaseResponseBinaryExternalsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseBinaryExternalsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseBinaryExternalsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseBinaryExternalsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseBinaryExternalsResponse - */ - public static BaseResponseBinaryExternalsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseBinaryExternalsResponse.class); - } - - /** - * Convert an instance of BaseResponseBinaryExternalsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseBinarySearchResponse.java b/src/main/java/ai/reveng/model/BaseResponseBinarySearchResponse.java deleted file mode 100644 index d7745a0..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseBinarySearchResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.BinarySearchResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseBinarySearchResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseBinarySearchResponse { - 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 BinarySearchResponse 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 BaseResponseBinarySearchResponse() { - } - - public BaseResponseBinarySearchResponse 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 BaseResponseBinarySearchResponse data(@javax.annotation.Nullable BinarySearchResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public BinarySearchResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable BinarySearchResponse data) { - this.data = data; - } - - - public BaseResponseBinarySearchResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseBinarySearchResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseBinarySearchResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseBinarySearchResponse 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 BaseResponseBinarySearchResponse instance itself - */ - public BaseResponseBinarySearchResponse 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; - } - BaseResponseBinarySearchResponse baseResponseBinarySearchResponse = (BaseResponseBinarySearchResponse) o; - return Objects.equals(this.status, baseResponseBinarySearchResponse.status) && - Objects.equals(this.data, baseResponseBinarySearchResponse.data) && - Objects.equals(this.message, baseResponseBinarySearchResponse.message) && - Objects.equals(this.errors, baseResponseBinarySearchResponse.errors) && - Objects.equals(this.meta, baseResponseBinarySearchResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseBinarySearchResponse.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 BaseResponseBinarySearchResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseBinarySearchResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseBinarySearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseBinarySearchResponse is not found in the empty JSON string", BaseResponseBinarySearchResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - BinarySearchResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseBinarySearchResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseBinarySearchResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseBinarySearchResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseBinarySearchResponse 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 BaseResponseBinarySearchResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseBinarySearchResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseBinarySearchResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseBinarySearchResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseBinarySearchResponse - */ - public static BaseResponseBinarySearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseBinarySearchResponse.class); - } - - /** - * Convert an instance of BaseResponseBinarySearchResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseBool.java b/src/main/java/ai/reveng/model/BaseResponseBool.java deleted file mode 100644 index e17baf2..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseBool.java +++ /dev/null @@ -1,428 +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 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 ai.reveng.invoker.JSON; - -/** - * BaseResponseBool - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseBool { - 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 Boolean 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 BaseResponseBool() { - } - - public BaseResponseBool 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 BaseResponseBool data(@javax.annotation.Nullable Boolean data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Boolean getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Boolean data) { - this.data = data; - } - - - public BaseResponseBool message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseBool errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseBool addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseBool 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 BaseResponseBool instance itself - */ - public BaseResponseBool 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; - } - BaseResponseBool baseResponseBool = (BaseResponseBool) o; - return Objects.equals(this.status, baseResponseBool.status) && - Objects.equals(this.data, baseResponseBool.data) && - Objects.equals(this.message, baseResponseBool.message) && - Objects.equals(this.errors, baseResponseBool.errors) && - Objects.equals(this.meta, baseResponseBool.meta)&& - Objects.equals(this.additionalProperties, baseResponseBool.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 BaseResponseBool {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseBool - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseBool.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseBool is not found in the empty JSON string", BaseResponseBool.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // validate the 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 (!BaseResponseBool.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseBool' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseBool.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseBool 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 BaseResponseBool read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseBool instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseBool given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseBool - * @throws IOException if the JSON string is invalid with respect to BaseResponseBool - */ - public static BaseResponseBool fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseBool.class); - } - - /** - * Convert an instance of BaseResponseBool to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCalleesCallerFunctionsResponse.java b/src/main/java/ai/reveng/model/BaseResponseCalleesCallerFunctionsResponse.java deleted file mode 100644 index 5f62355..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCalleesCallerFunctionsResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.CalleesCallerFunctionsResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCalleesCallerFunctionsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCalleesCallerFunctionsResponse { - 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 CalleesCallerFunctionsResponse 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 BaseResponseCalleesCallerFunctionsResponse() { - } - - public BaseResponseCalleesCallerFunctionsResponse 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 BaseResponseCalleesCallerFunctionsResponse data(@javax.annotation.Nullable CalleesCallerFunctionsResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public CalleesCallerFunctionsResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable CalleesCallerFunctionsResponse data) { - this.data = data; - } - - - public BaseResponseCalleesCallerFunctionsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCalleesCallerFunctionsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCalleesCallerFunctionsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCalleesCallerFunctionsResponse 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 BaseResponseCalleesCallerFunctionsResponse instance itself - */ - public BaseResponseCalleesCallerFunctionsResponse 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; - } - BaseResponseCalleesCallerFunctionsResponse baseResponseCalleesCallerFunctionsResponse = (BaseResponseCalleesCallerFunctionsResponse) o; - return Objects.equals(this.status, baseResponseCalleesCallerFunctionsResponse.status) && - Objects.equals(this.data, baseResponseCalleesCallerFunctionsResponse.data) && - Objects.equals(this.message, baseResponseCalleesCallerFunctionsResponse.message) && - Objects.equals(this.errors, baseResponseCalleesCallerFunctionsResponse.errors) && - Objects.equals(this.meta, baseResponseCalleesCallerFunctionsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseCalleesCallerFunctionsResponse.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 BaseResponseCalleesCallerFunctionsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCalleesCallerFunctionsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCalleesCallerFunctionsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCalleesCallerFunctionsResponse is not found in the empty JSON string", BaseResponseCalleesCallerFunctionsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CalleesCallerFunctionsResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCalleesCallerFunctionsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCalleesCallerFunctionsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCalleesCallerFunctionsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCalleesCallerFunctionsResponse 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 BaseResponseCalleesCallerFunctionsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCalleesCallerFunctionsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCalleesCallerFunctionsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCalleesCallerFunctionsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseCalleesCallerFunctionsResponse - */ - public static BaseResponseCalleesCallerFunctionsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCalleesCallerFunctionsResponse.class); - } - - /** - * Convert an instance of BaseResponseCalleesCallerFunctionsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCapabilities.java b/src/main/java/ai/reveng/model/BaseResponseCapabilities.java deleted file mode 100644 index d22206d..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCapabilities.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.Capabilities; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCapabilities - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCapabilities { - 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 Capabilities 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 BaseResponseCapabilities() { - } - - public BaseResponseCapabilities 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 BaseResponseCapabilities data(@javax.annotation.Nullable Capabilities data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Capabilities getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Capabilities data) { - this.data = data; - } - - - public BaseResponseCapabilities message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCapabilities errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCapabilities addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCapabilities 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 BaseResponseCapabilities instance itself - */ - public BaseResponseCapabilities 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; - } - BaseResponseCapabilities baseResponseCapabilities = (BaseResponseCapabilities) o; - return Objects.equals(this.status, baseResponseCapabilities.status) && - Objects.equals(this.data, baseResponseCapabilities.data) && - Objects.equals(this.message, baseResponseCapabilities.message) && - Objects.equals(this.errors, baseResponseCapabilities.errors) && - Objects.equals(this.meta, baseResponseCapabilities.meta)&& - Objects.equals(this.additionalProperties, baseResponseCapabilities.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 BaseResponseCapabilities {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCapabilities - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCapabilities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCapabilities is not found in the empty JSON string", BaseResponseCapabilities.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - Capabilities.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCapabilities.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCapabilities' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCapabilities.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCapabilities 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 BaseResponseCapabilities read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCapabilities instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCapabilities given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCapabilities - * @throws IOException if the JSON string is invalid with respect to BaseResponseCapabilities - */ - public static BaseResponseCapabilities fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCapabilities.class); - } - - /** - * Convert an instance of BaseResponseCapabilities to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCapabilitiesAgentResponse.java b/src/main/java/ai/reveng/model/BaseResponseCapabilitiesAgentResponse.java deleted file mode 100644 index e093e4b..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCapabilitiesAgentResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.CapabilitiesAgentResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCapabilitiesAgentResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCapabilitiesAgentResponse { - 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 CapabilitiesAgentResponse 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 BaseResponseCapabilitiesAgentResponse() { - } - - public BaseResponseCapabilitiesAgentResponse 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 BaseResponseCapabilitiesAgentResponse data(@javax.annotation.Nullable CapabilitiesAgentResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public CapabilitiesAgentResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable CapabilitiesAgentResponse data) { - this.data = data; - } - - - public BaseResponseCapabilitiesAgentResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCapabilitiesAgentResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCapabilitiesAgentResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCapabilitiesAgentResponse 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 BaseResponseCapabilitiesAgentResponse instance itself - */ - public BaseResponseCapabilitiesAgentResponse 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; - } - BaseResponseCapabilitiesAgentResponse baseResponseCapabilitiesAgentResponse = (BaseResponseCapabilitiesAgentResponse) o; - return Objects.equals(this.status, baseResponseCapabilitiesAgentResponse.status) && - Objects.equals(this.data, baseResponseCapabilitiesAgentResponse.data) && - Objects.equals(this.message, baseResponseCapabilitiesAgentResponse.message) && - Objects.equals(this.errors, baseResponseCapabilitiesAgentResponse.errors) && - Objects.equals(this.meta, baseResponseCapabilitiesAgentResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseCapabilitiesAgentResponse.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 BaseResponseCapabilitiesAgentResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCapabilitiesAgentResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCapabilitiesAgentResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCapabilitiesAgentResponse is not found in the empty JSON string", BaseResponseCapabilitiesAgentResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CapabilitiesAgentResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCapabilitiesAgentResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCapabilitiesAgentResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCapabilitiesAgentResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCapabilitiesAgentResponse 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 BaseResponseCapabilitiesAgentResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCapabilitiesAgentResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCapabilitiesAgentResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCapabilitiesAgentResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseCapabilitiesAgentResponse - */ - public static BaseResponseCapabilitiesAgentResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCapabilitiesAgentResponse.class); - } - - /** - * Convert an instance of BaseResponseCapabilitiesAgentResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseChildBinariesResponse.java b/src/main/java/ai/reveng/model/BaseResponseChildBinariesResponse.java deleted file mode 100644 index 766b4a4..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseChildBinariesResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ChildBinariesResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseChildBinariesResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseChildBinariesResponse { - 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 ChildBinariesResponse 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 BaseResponseChildBinariesResponse() { - } - - public BaseResponseChildBinariesResponse 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 BaseResponseChildBinariesResponse data(@javax.annotation.Nullable ChildBinariesResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public ChildBinariesResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ChildBinariesResponse data) { - this.data = data; - } - - - public BaseResponseChildBinariesResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseChildBinariesResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseChildBinariesResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseChildBinariesResponse 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 BaseResponseChildBinariesResponse instance itself - */ - public BaseResponseChildBinariesResponse 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; - } - BaseResponseChildBinariesResponse baseResponseChildBinariesResponse = (BaseResponseChildBinariesResponse) o; - return Objects.equals(this.status, baseResponseChildBinariesResponse.status) && - Objects.equals(this.data, baseResponseChildBinariesResponse.data) && - Objects.equals(this.message, baseResponseChildBinariesResponse.message) && - Objects.equals(this.errors, baseResponseChildBinariesResponse.errors) && - Objects.equals(this.meta, baseResponseChildBinariesResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseChildBinariesResponse.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 BaseResponseChildBinariesResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseChildBinariesResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseChildBinariesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseChildBinariesResponse is not found in the empty JSON string", BaseResponseChildBinariesResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ChildBinariesResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseChildBinariesResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseChildBinariesResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseChildBinariesResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseChildBinariesResponse 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 BaseResponseChildBinariesResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseChildBinariesResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseChildBinariesResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseChildBinariesResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseChildBinariesResponse - */ - public static BaseResponseChildBinariesResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseChildBinariesResponse.class); - } - - /** - * Convert an instance of BaseResponseChildBinariesResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCollectionBinariesUpdateResponse.java b/src/main/java/ai/reveng/model/BaseResponseCollectionBinariesUpdateResponse.java deleted file mode 100644 index 7afc5b0..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCollectionBinariesUpdateResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.CollectionBinariesUpdateResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCollectionBinariesUpdateResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCollectionBinariesUpdateResponse { - 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 CollectionBinariesUpdateResponse 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 BaseResponseCollectionBinariesUpdateResponse() { - } - - public BaseResponseCollectionBinariesUpdateResponse 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 BaseResponseCollectionBinariesUpdateResponse data(@javax.annotation.Nullable CollectionBinariesUpdateResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public CollectionBinariesUpdateResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable CollectionBinariesUpdateResponse data) { - this.data = data; - } - - - public BaseResponseCollectionBinariesUpdateResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCollectionBinariesUpdateResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCollectionBinariesUpdateResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCollectionBinariesUpdateResponse 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 BaseResponseCollectionBinariesUpdateResponse instance itself - */ - public BaseResponseCollectionBinariesUpdateResponse 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; - } - BaseResponseCollectionBinariesUpdateResponse baseResponseCollectionBinariesUpdateResponse = (BaseResponseCollectionBinariesUpdateResponse) o; - return Objects.equals(this.status, baseResponseCollectionBinariesUpdateResponse.status) && - Objects.equals(this.data, baseResponseCollectionBinariesUpdateResponse.data) && - Objects.equals(this.message, baseResponseCollectionBinariesUpdateResponse.message) && - Objects.equals(this.errors, baseResponseCollectionBinariesUpdateResponse.errors) && - Objects.equals(this.meta, baseResponseCollectionBinariesUpdateResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseCollectionBinariesUpdateResponse.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 BaseResponseCollectionBinariesUpdateResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCollectionBinariesUpdateResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCollectionBinariesUpdateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCollectionBinariesUpdateResponse is not found in the empty JSON string", BaseResponseCollectionBinariesUpdateResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CollectionBinariesUpdateResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCollectionBinariesUpdateResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCollectionBinariesUpdateResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCollectionBinariesUpdateResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCollectionBinariesUpdateResponse 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 BaseResponseCollectionBinariesUpdateResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCollectionBinariesUpdateResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCollectionBinariesUpdateResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCollectionBinariesUpdateResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseCollectionBinariesUpdateResponse - */ - public static BaseResponseCollectionBinariesUpdateResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCollectionBinariesUpdateResponse.class); - } - - /** - * Convert an instance of BaseResponseCollectionBinariesUpdateResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCollectionResponse.java b/src/main/java/ai/reveng/model/BaseResponseCollectionResponse.java deleted file mode 100644 index ba655d9..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCollectionResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.CollectionResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCollectionResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCollectionResponse { - 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 CollectionResponse 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 BaseResponseCollectionResponse() { - } - - public BaseResponseCollectionResponse 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 BaseResponseCollectionResponse data(@javax.annotation.Nullable CollectionResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public CollectionResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable CollectionResponse data) { - this.data = data; - } - - - public BaseResponseCollectionResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCollectionResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCollectionResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCollectionResponse 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 BaseResponseCollectionResponse instance itself - */ - public BaseResponseCollectionResponse 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; - } - BaseResponseCollectionResponse baseResponseCollectionResponse = (BaseResponseCollectionResponse) o; - return Objects.equals(this.status, baseResponseCollectionResponse.status) && - Objects.equals(this.data, baseResponseCollectionResponse.data) && - Objects.equals(this.message, baseResponseCollectionResponse.message) && - Objects.equals(this.errors, baseResponseCollectionResponse.errors) && - Objects.equals(this.meta, baseResponseCollectionResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseCollectionResponse.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 BaseResponseCollectionResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCollectionResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCollectionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCollectionResponse is not found in the empty JSON string", BaseResponseCollectionResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CollectionResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCollectionResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCollectionResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCollectionResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCollectionResponse 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 BaseResponseCollectionResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCollectionResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCollectionResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCollectionResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseCollectionResponse - */ - public static BaseResponseCollectionResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCollectionResponse.class); - } - - /** - * Convert an instance of BaseResponseCollectionResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCollectionSearchResponse.java b/src/main/java/ai/reveng/model/BaseResponseCollectionSearchResponse.java deleted file mode 100644 index cc76288..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCollectionSearchResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.CollectionSearchResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCollectionSearchResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCollectionSearchResponse { - 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 CollectionSearchResponse 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 BaseResponseCollectionSearchResponse() { - } - - public BaseResponseCollectionSearchResponse 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 BaseResponseCollectionSearchResponse data(@javax.annotation.Nullable CollectionSearchResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public CollectionSearchResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable CollectionSearchResponse data) { - this.data = data; - } - - - public BaseResponseCollectionSearchResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCollectionSearchResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCollectionSearchResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCollectionSearchResponse 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 BaseResponseCollectionSearchResponse instance itself - */ - public BaseResponseCollectionSearchResponse 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; - } - BaseResponseCollectionSearchResponse baseResponseCollectionSearchResponse = (BaseResponseCollectionSearchResponse) o; - return Objects.equals(this.status, baseResponseCollectionSearchResponse.status) && - Objects.equals(this.data, baseResponseCollectionSearchResponse.data) && - Objects.equals(this.message, baseResponseCollectionSearchResponse.message) && - Objects.equals(this.errors, baseResponseCollectionSearchResponse.errors) && - Objects.equals(this.meta, baseResponseCollectionSearchResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseCollectionSearchResponse.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 BaseResponseCollectionSearchResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCollectionSearchResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCollectionSearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCollectionSearchResponse is not found in the empty JSON string", BaseResponseCollectionSearchResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CollectionSearchResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCollectionSearchResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCollectionSearchResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCollectionSearchResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCollectionSearchResponse 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 BaseResponseCollectionSearchResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCollectionSearchResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCollectionSearchResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCollectionSearchResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseCollectionSearchResponse - */ - public static BaseResponseCollectionSearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCollectionSearchResponse.class); - } - - /** - * Convert an instance of BaseResponseCollectionSearchResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCollectionTagsUpdateResponse.java b/src/main/java/ai/reveng/model/BaseResponseCollectionTagsUpdateResponse.java deleted file mode 100644 index d743ee1..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCollectionTagsUpdateResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.CollectionTagsUpdateResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCollectionTagsUpdateResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCollectionTagsUpdateResponse { - 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 CollectionTagsUpdateResponse 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 BaseResponseCollectionTagsUpdateResponse() { - } - - public BaseResponseCollectionTagsUpdateResponse 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 BaseResponseCollectionTagsUpdateResponse data(@javax.annotation.Nullable CollectionTagsUpdateResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public CollectionTagsUpdateResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable CollectionTagsUpdateResponse data) { - this.data = data; - } - - - public BaseResponseCollectionTagsUpdateResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCollectionTagsUpdateResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCollectionTagsUpdateResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCollectionTagsUpdateResponse 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 BaseResponseCollectionTagsUpdateResponse instance itself - */ - public BaseResponseCollectionTagsUpdateResponse 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; - } - BaseResponseCollectionTagsUpdateResponse baseResponseCollectionTagsUpdateResponse = (BaseResponseCollectionTagsUpdateResponse) o; - return Objects.equals(this.status, baseResponseCollectionTagsUpdateResponse.status) && - Objects.equals(this.data, baseResponseCollectionTagsUpdateResponse.data) && - Objects.equals(this.message, baseResponseCollectionTagsUpdateResponse.message) && - Objects.equals(this.errors, baseResponseCollectionTagsUpdateResponse.errors) && - Objects.equals(this.meta, baseResponseCollectionTagsUpdateResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseCollectionTagsUpdateResponse.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 BaseResponseCollectionTagsUpdateResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCollectionTagsUpdateResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCollectionTagsUpdateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCollectionTagsUpdateResponse is not found in the empty JSON string", BaseResponseCollectionTagsUpdateResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CollectionTagsUpdateResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCollectionTagsUpdateResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCollectionTagsUpdateResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCollectionTagsUpdateResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCollectionTagsUpdateResponse 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 BaseResponseCollectionTagsUpdateResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCollectionTagsUpdateResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCollectionTagsUpdateResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCollectionTagsUpdateResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseCollectionTagsUpdateResponse - */ - public static BaseResponseCollectionTagsUpdateResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCollectionTagsUpdateResponse.class); - } - - /** - * Convert an instance of BaseResponseCollectionTagsUpdateResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCommentResponse.java b/src/main/java/ai/reveng/model/BaseResponseCommentResponse.java deleted file mode 100644 index 3a76a3b..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCommentResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.CommentResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCommentResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCommentResponse { - 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 CommentResponse 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 BaseResponseCommentResponse() { - } - - public BaseResponseCommentResponse 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 BaseResponseCommentResponse data(@javax.annotation.Nullable CommentResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public CommentResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable CommentResponse data) { - this.data = data; - } - - - public BaseResponseCommentResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCommentResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCommentResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCommentResponse 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 BaseResponseCommentResponse instance itself - */ - public BaseResponseCommentResponse 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; - } - BaseResponseCommentResponse baseResponseCommentResponse = (BaseResponseCommentResponse) o; - return Objects.equals(this.status, baseResponseCommentResponse.status) && - Objects.equals(this.data, baseResponseCommentResponse.data) && - Objects.equals(this.message, baseResponseCommentResponse.message) && - Objects.equals(this.errors, baseResponseCommentResponse.errors) && - Objects.equals(this.meta, baseResponseCommentResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseCommentResponse.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 BaseResponseCommentResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCommentResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCommentResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCommentResponse is not found in the empty JSON string", BaseResponseCommentResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CommentResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCommentResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCommentResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCommentResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCommentResponse 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 BaseResponseCommentResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCommentResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCommentResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCommentResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseCommentResponse - */ - public static BaseResponseCommentResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCommentResponse.class); - } - - /** - * Convert an instance of BaseResponseCommentResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseConfigResponse.java b/src/main/java/ai/reveng/model/BaseResponseConfigResponse.java deleted file mode 100644 index c15120a..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseConfigResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ConfigResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseConfigResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseConfigResponse { - 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 ConfigResponse 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 BaseResponseConfigResponse() { - } - - public BaseResponseConfigResponse 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 BaseResponseConfigResponse data(@javax.annotation.Nullable ConfigResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public ConfigResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ConfigResponse data) { - this.data = data; - } - - - public BaseResponseConfigResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseConfigResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseConfigResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseConfigResponse 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 BaseResponseConfigResponse instance itself - */ - public BaseResponseConfigResponse 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; - } - BaseResponseConfigResponse baseResponseConfigResponse = (BaseResponseConfigResponse) o; - return Objects.equals(this.status, baseResponseConfigResponse.status) && - Objects.equals(this.data, baseResponseConfigResponse.data) && - Objects.equals(this.message, baseResponseConfigResponse.message) && - Objects.equals(this.errors, baseResponseConfigResponse.errors) && - Objects.equals(this.meta, baseResponseConfigResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseConfigResponse.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 BaseResponseConfigResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseConfigResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseConfigResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseConfigResponse is not found in the empty JSON string", BaseResponseConfigResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ConfigResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseConfigResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseConfigResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseConfigResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseConfigResponse 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 BaseResponseConfigResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseConfigResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseConfigResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseConfigResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseConfigResponse - */ - public static BaseResponseConfigResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseConfigResponse.class); - } - - /** - * Convert an instance of BaseResponseConfigResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseCreated.java b/src/main/java/ai/reveng/model/BaseResponseCreated.java deleted file mode 100644 index ab01d74..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseCreated.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.Created; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseCreated - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseCreated { - 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 Created 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 BaseResponseCreated() { - } - - public BaseResponseCreated 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 BaseResponseCreated data(@javax.annotation.Nullable Created data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Created getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Created data) { - this.data = data; - } - - - public BaseResponseCreated message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseCreated errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseCreated addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseCreated 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 BaseResponseCreated instance itself - */ - public BaseResponseCreated 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; - } - BaseResponseCreated baseResponseCreated = (BaseResponseCreated) o; - return Objects.equals(this.status, baseResponseCreated.status) && - Objects.equals(this.data, baseResponseCreated.data) && - Objects.equals(this.message, baseResponseCreated.message) && - Objects.equals(this.errors, baseResponseCreated.errors) && - Objects.equals(this.meta, baseResponseCreated.meta)&& - Objects.equals(this.additionalProperties, baseResponseCreated.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 BaseResponseCreated {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseCreated - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseCreated.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseCreated is not found in the empty JSON string", BaseResponseCreated.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - Created.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseCreated.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseCreated' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseCreated.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseCreated 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 BaseResponseCreated read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseCreated instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseCreated given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseCreated - * @throws IOException if the JSON string is invalid with respect to BaseResponseCreated - */ - public static BaseResponseCreated fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseCreated.class); - } - - /** - * Convert an instance of BaseResponseCreated to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseDict.java b/src/main/java/ai/reveng/model/BaseResponseDict.java deleted file mode 100644 index 7b1b3a0..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseDict.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 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.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseDict - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseDict { - 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 Map 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 BaseResponseDict() { - } - - public BaseResponseDict 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 BaseResponseDict data(@javax.annotation.Nullable Map data) { - this.data = data; - return this; - } - - public BaseResponseDict putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); - } - this.data.put(key, dataItem); - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Map getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Map data) { - this.data = data; - } - - - public BaseResponseDict message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseDict errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseDict addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseDict 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 BaseResponseDict instance itself - */ - public BaseResponseDict 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; - } - BaseResponseDict baseResponseDict = (BaseResponseDict) o; - return Objects.equals(this.status, baseResponseDict.status) && - Objects.equals(this.data, baseResponseDict.data) && - Objects.equals(this.message, baseResponseDict.message) && - Objects.equals(this.errors, baseResponseDict.errors) && - Objects.equals(this.meta, baseResponseDict.meta)&& - Objects.equals(this.additionalProperties, baseResponseDict.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 BaseResponseDict {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseDict - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseDict.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseDict is not found in the empty JSON string", BaseResponseDict.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // validate the 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 (!BaseResponseDict.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseDict' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseDict.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseDict 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 BaseResponseDict read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseDict instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseDict given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseDict - * @throws IOException if the JSON string is invalid with respect to BaseResponseDict - */ - public static BaseResponseDict fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseDict.class); - } - - /** - * Convert an instance of BaseResponseDict to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseExternalResponse.java b/src/main/java/ai/reveng/model/BaseResponseExternalResponse.java deleted file mode 100644 index 923da4a..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseExternalResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.ExternalResponse; -import ai.reveng.model.MetaModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseExternalResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseExternalResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable - private Boolean status = true; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private ExternalResponse 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 BaseResponseExternalResponse() { - } - - public BaseResponseExternalResponse 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 BaseResponseExternalResponse data(@javax.annotation.Nullable ExternalResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public ExternalResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ExternalResponse data) { - this.data = data; - } - - - public BaseResponseExternalResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseExternalResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseExternalResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseExternalResponse 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 BaseResponseExternalResponse instance itself - */ - public BaseResponseExternalResponse 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; - } - BaseResponseExternalResponse baseResponseExternalResponse = (BaseResponseExternalResponse) o; - return Objects.equals(this.status, baseResponseExternalResponse.status) && - Objects.equals(this.data, baseResponseExternalResponse.data) && - Objects.equals(this.message, baseResponseExternalResponse.message) && - Objects.equals(this.errors, baseResponseExternalResponse.errors) && - Objects.equals(this.meta, baseResponseExternalResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseExternalResponse.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @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 BaseResponseExternalResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); - sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseExternalResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseExternalResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseExternalResponse is not found in the empty JSON string", BaseResponseExternalResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ExternalResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseExternalResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseExternalResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseExternalResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseExternalResponse 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 BaseResponseExternalResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseExternalResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseExternalResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseExternalResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseExternalResponse - */ - public static BaseResponseExternalResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseExternalResponse.class); - } - - /** - * Convert an instance of BaseResponseExternalResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseFunctionBlocksResponse.java b/src/main/java/ai/reveng/model/BaseResponseFunctionBlocksResponse.java deleted file mode 100644 index d3a4d30..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseFunctionBlocksResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.FunctionBlocksResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseFunctionBlocksResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseFunctionBlocksResponse { - 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 FunctionBlocksResponse 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 BaseResponseFunctionBlocksResponse() { - } - - public BaseResponseFunctionBlocksResponse 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 BaseResponseFunctionBlocksResponse data(@javax.annotation.Nullable FunctionBlocksResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public FunctionBlocksResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable FunctionBlocksResponse data) { - this.data = data; - } - - - public BaseResponseFunctionBlocksResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseFunctionBlocksResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseFunctionBlocksResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseFunctionBlocksResponse 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 BaseResponseFunctionBlocksResponse instance itself - */ - public BaseResponseFunctionBlocksResponse 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; - } - BaseResponseFunctionBlocksResponse baseResponseFunctionBlocksResponse = (BaseResponseFunctionBlocksResponse) o; - return Objects.equals(this.status, baseResponseFunctionBlocksResponse.status) && - Objects.equals(this.data, baseResponseFunctionBlocksResponse.data) && - Objects.equals(this.message, baseResponseFunctionBlocksResponse.message) && - Objects.equals(this.errors, baseResponseFunctionBlocksResponse.errors) && - Objects.equals(this.meta, baseResponseFunctionBlocksResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseFunctionBlocksResponse.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 BaseResponseFunctionBlocksResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseFunctionBlocksResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseFunctionBlocksResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseFunctionBlocksResponse is not found in the empty JSON string", BaseResponseFunctionBlocksResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - FunctionBlocksResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseFunctionBlocksResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseFunctionBlocksResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseFunctionBlocksResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseFunctionBlocksResponse 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 BaseResponseFunctionBlocksResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseFunctionBlocksResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseFunctionBlocksResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseFunctionBlocksResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseFunctionBlocksResponse - */ - public static BaseResponseFunctionBlocksResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseFunctionBlocksResponse.class); - } - - /** - * Convert an instance of BaseResponseFunctionBlocksResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseFunctionCapabilityResponse.java b/src/main/java/ai/reveng/model/BaseResponseFunctionCapabilityResponse.java deleted file mode 100644 index 42835de..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseFunctionCapabilityResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.FunctionCapabilityResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseFunctionCapabilityResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseFunctionCapabilityResponse { - 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 FunctionCapabilityResponse 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 BaseResponseFunctionCapabilityResponse() { - } - - public BaseResponseFunctionCapabilityResponse 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 BaseResponseFunctionCapabilityResponse data(@javax.annotation.Nullable FunctionCapabilityResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public FunctionCapabilityResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable FunctionCapabilityResponse data) { - this.data = data; - } - - - public BaseResponseFunctionCapabilityResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseFunctionCapabilityResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseFunctionCapabilityResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseFunctionCapabilityResponse 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 BaseResponseFunctionCapabilityResponse instance itself - */ - public BaseResponseFunctionCapabilityResponse 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; - } - BaseResponseFunctionCapabilityResponse baseResponseFunctionCapabilityResponse = (BaseResponseFunctionCapabilityResponse) o; - return Objects.equals(this.status, baseResponseFunctionCapabilityResponse.status) && - Objects.equals(this.data, baseResponseFunctionCapabilityResponse.data) && - Objects.equals(this.message, baseResponseFunctionCapabilityResponse.message) && - Objects.equals(this.errors, baseResponseFunctionCapabilityResponse.errors) && - Objects.equals(this.meta, baseResponseFunctionCapabilityResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseFunctionCapabilityResponse.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 BaseResponseFunctionCapabilityResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseFunctionCapabilityResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseFunctionCapabilityResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseFunctionCapabilityResponse is not found in the empty JSON string", BaseResponseFunctionCapabilityResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - FunctionCapabilityResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseFunctionCapabilityResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseFunctionCapabilityResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseFunctionCapabilityResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseFunctionCapabilityResponse 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 BaseResponseFunctionCapabilityResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseFunctionCapabilityResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseFunctionCapabilityResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseFunctionCapabilityResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseFunctionCapabilityResponse - */ - public static BaseResponseFunctionCapabilityResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseFunctionCapabilityResponse.class); - } - - /** - * Convert an instance of BaseResponseFunctionCapabilityResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseFunctionDataTypes.java b/src/main/java/ai/reveng/model/BaseResponseFunctionDataTypes.java deleted file mode 100644 index c705204..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseFunctionDataTypes.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.FunctionDataTypes; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseFunctionDataTypes - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseFunctionDataTypes { - 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 FunctionDataTypes 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 BaseResponseFunctionDataTypes() { - } - - public BaseResponseFunctionDataTypes 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 BaseResponseFunctionDataTypes data(@javax.annotation.Nullable FunctionDataTypes data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public FunctionDataTypes getData() { - return data; - } - - public void setData(@javax.annotation.Nullable FunctionDataTypes data) { - this.data = data; - } - - - public BaseResponseFunctionDataTypes message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseFunctionDataTypes errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseFunctionDataTypes addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseFunctionDataTypes 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 BaseResponseFunctionDataTypes instance itself - */ - public BaseResponseFunctionDataTypes 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; - } - BaseResponseFunctionDataTypes baseResponseFunctionDataTypes = (BaseResponseFunctionDataTypes) o; - return Objects.equals(this.status, baseResponseFunctionDataTypes.status) && - Objects.equals(this.data, baseResponseFunctionDataTypes.data) && - Objects.equals(this.message, baseResponseFunctionDataTypes.message) && - Objects.equals(this.errors, baseResponseFunctionDataTypes.errors) && - Objects.equals(this.meta, baseResponseFunctionDataTypes.meta)&& - Objects.equals(this.additionalProperties, baseResponseFunctionDataTypes.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 BaseResponseFunctionDataTypes {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseFunctionDataTypes - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseFunctionDataTypes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseFunctionDataTypes is not found in the empty JSON string", BaseResponseFunctionDataTypes.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - FunctionDataTypes.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseFunctionDataTypes.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseFunctionDataTypes' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseFunctionDataTypes.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseFunctionDataTypes 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 BaseResponseFunctionDataTypes read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseFunctionDataTypes instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseFunctionDataTypes given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseFunctionDataTypes - * @throws IOException if the JSON string is invalid with respect to BaseResponseFunctionDataTypes - */ - public static BaseResponseFunctionDataTypes fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseFunctionDataTypes.class); - } - - /** - * Convert an instance of BaseResponseFunctionDataTypes to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseFunctionDataTypesList.java b/src/main/java/ai/reveng/model/BaseResponseFunctionDataTypesList.java deleted file mode 100644 index 3e610c2..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseFunctionDataTypesList.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.FunctionDataTypesList; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseFunctionDataTypesList - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseFunctionDataTypesList { - 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 FunctionDataTypesList 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 BaseResponseFunctionDataTypesList() { - } - - public BaseResponseFunctionDataTypesList 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 BaseResponseFunctionDataTypesList data(@javax.annotation.Nullable FunctionDataTypesList data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public FunctionDataTypesList getData() { - return data; - } - - public void setData(@javax.annotation.Nullable FunctionDataTypesList data) { - this.data = data; - } - - - public BaseResponseFunctionDataTypesList message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseFunctionDataTypesList errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseFunctionDataTypesList addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseFunctionDataTypesList 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 BaseResponseFunctionDataTypesList instance itself - */ - public BaseResponseFunctionDataTypesList 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; - } - BaseResponseFunctionDataTypesList baseResponseFunctionDataTypesList = (BaseResponseFunctionDataTypesList) o; - return Objects.equals(this.status, baseResponseFunctionDataTypesList.status) && - Objects.equals(this.data, baseResponseFunctionDataTypesList.data) && - Objects.equals(this.message, baseResponseFunctionDataTypesList.message) && - Objects.equals(this.errors, baseResponseFunctionDataTypesList.errors) && - Objects.equals(this.meta, baseResponseFunctionDataTypesList.meta)&& - Objects.equals(this.additionalProperties, baseResponseFunctionDataTypesList.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 BaseResponseFunctionDataTypesList {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseFunctionDataTypesList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseFunctionDataTypesList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseFunctionDataTypesList is not found in the empty JSON string", BaseResponseFunctionDataTypesList.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - FunctionDataTypesList.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseFunctionDataTypesList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseFunctionDataTypesList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseFunctionDataTypesList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseFunctionDataTypesList 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 BaseResponseFunctionDataTypesList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseFunctionDataTypesList instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseFunctionDataTypesList given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseFunctionDataTypesList - * @throws IOException if the JSON string is invalid with respect to BaseResponseFunctionDataTypesList - */ - public static BaseResponseFunctionDataTypesList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseFunctionDataTypesList.class); - } - - /** - * Convert an instance of BaseResponseFunctionDataTypesList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseFunctionSearchResponse.java b/src/main/java/ai/reveng/model/BaseResponseFunctionSearchResponse.java deleted file mode 100644 index c3efc4b..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseFunctionSearchResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.FunctionSearchResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseFunctionSearchResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseFunctionSearchResponse { - 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 FunctionSearchResponse 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 BaseResponseFunctionSearchResponse() { - } - - public BaseResponseFunctionSearchResponse 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 BaseResponseFunctionSearchResponse data(@javax.annotation.Nullable FunctionSearchResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public FunctionSearchResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable FunctionSearchResponse data) { - this.data = data; - } - - - public BaseResponseFunctionSearchResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseFunctionSearchResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseFunctionSearchResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseFunctionSearchResponse 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 BaseResponseFunctionSearchResponse instance itself - */ - public BaseResponseFunctionSearchResponse 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; - } - BaseResponseFunctionSearchResponse baseResponseFunctionSearchResponse = (BaseResponseFunctionSearchResponse) o; - return Objects.equals(this.status, baseResponseFunctionSearchResponse.status) && - Objects.equals(this.data, baseResponseFunctionSearchResponse.data) && - Objects.equals(this.message, baseResponseFunctionSearchResponse.message) && - Objects.equals(this.errors, baseResponseFunctionSearchResponse.errors) && - Objects.equals(this.meta, baseResponseFunctionSearchResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseFunctionSearchResponse.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 BaseResponseFunctionSearchResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseFunctionSearchResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseFunctionSearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseFunctionSearchResponse is not found in the empty JSON string", BaseResponseFunctionSearchResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - FunctionSearchResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseFunctionSearchResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseFunctionSearchResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseFunctionSearchResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseFunctionSearchResponse 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 BaseResponseFunctionSearchResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseFunctionSearchResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseFunctionSearchResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseFunctionSearchResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseFunctionSearchResponse - */ - public static BaseResponseFunctionSearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseFunctionSearchResponse.class); - } - - /** - * Convert an instance of BaseResponseFunctionSearchResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseFunctionStringsResponse.java b/src/main/java/ai/reveng/model/BaseResponseFunctionStringsResponse.java deleted file mode 100644 index d7229e4..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseFunctionStringsResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.FunctionStringsResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseFunctionStringsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseFunctionStringsResponse { - 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 FunctionStringsResponse 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 BaseResponseFunctionStringsResponse() { - } - - public BaseResponseFunctionStringsResponse 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 BaseResponseFunctionStringsResponse data(@javax.annotation.Nullable FunctionStringsResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public FunctionStringsResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable FunctionStringsResponse data) { - this.data = data; - } - - - public BaseResponseFunctionStringsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseFunctionStringsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseFunctionStringsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseFunctionStringsResponse 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 BaseResponseFunctionStringsResponse instance itself - */ - public BaseResponseFunctionStringsResponse 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; - } - BaseResponseFunctionStringsResponse baseResponseFunctionStringsResponse = (BaseResponseFunctionStringsResponse) o; - return Objects.equals(this.status, baseResponseFunctionStringsResponse.status) && - Objects.equals(this.data, baseResponseFunctionStringsResponse.data) && - Objects.equals(this.message, baseResponseFunctionStringsResponse.message) && - Objects.equals(this.errors, baseResponseFunctionStringsResponse.errors) && - Objects.equals(this.meta, baseResponseFunctionStringsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseFunctionStringsResponse.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 BaseResponseFunctionStringsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseFunctionStringsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseFunctionStringsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseFunctionStringsResponse is not found in the empty JSON string", BaseResponseFunctionStringsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - FunctionStringsResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseFunctionStringsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseFunctionStringsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseFunctionStringsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseFunctionStringsResponse 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 BaseResponseFunctionStringsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseFunctionStringsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseFunctionStringsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseFunctionStringsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseFunctionStringsResponse - */ - public static BaseResponseFunctionStringsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseFunctionStringsResponse.class); - } - - /** - * Convert an instance of BaseResponseFunctionStringsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseFunctionsDetailResponse.java b/src/main/java/ai/reveng/model/BaseResponseFunctionsDetailResponse.java deleted file mode 100644 index b073758..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseFunctionsDetailResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.FunctionsDetailResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseFunctionsDetailResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseFunctionsDetailResponse { - 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 FunctionsDetailResponse 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 BaseResponseFunctionsDetailResponse() { - } - - public BaseResponseFunctionsDetailResponse 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 BaseResponseFunctionsDetailResponse data(@javax.annotation.Nullable FunctionsDetailResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public FunctionsDetailResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable FunctionsDetailResponse data) { - this.data = data; - } - - - public BaseResponseFunctionsDetailResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseFunctionsDetailResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseFunctionsDetailResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseFunctionsDetailResponse 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 BaseResponseFunctionsDetailResponse instance itself - */ - public BaseResponseFunctionsDetailResponse 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; - } - BaseResponseFunctionsDetailResponse baseResponseFunctionsDetailResponse = (BaseResponseFunctionsDetailResponse) o; - return Objects.equals(this.status, baseResponseFunctionsDetailResponse.status) && - Objects.equals(this.data, baseResponseFunctionsDetailResponse.data) && - Objects.equals(this.message, baseResponseFunctionsDetailResponse.message) && - Objects.equals(this.errors, baseResponseFunctionsDetailResponse.errors) && - Objects.equals(this.meta, baseResponseFunctionsDetailResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseFunctionsDetailResponse.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 BaseResponseFunctionsDetailResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseFunctionsDetailResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseFunctionsDetailResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseFunctionsDetailResponse is not found in the empty JSON string", BaseResponseFunctionsDetailResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - FunctionsDetailResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseFunctionsDetailResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseFunctionsDetailResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseFunctionsDetailResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseFunctionsDetailResponse 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 BaseResponseFunctionsDetailResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseFunctionsDetailResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseFunctionsDetailResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseFunctionsDetailResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseFunctionsDetailResponse - */ - public static BaseResponseFunctionsDetailResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseFunctionsDetailResponse.class); - } - - /** - * Convert an instance of BaseResponseFunctionsDetailResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseGenerateFunctionDataTypes.java b/src/main/java/ai/reveng/model/BaseResponseGenerateFunctionDataTypes.java deleted file mode 100644 index 256b89e..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseGenerateFunctionDataTypes.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.GenerateFunctionDataTypes; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseGenerateFunctionDataTypes - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseGenerateFunctionDataTypes { - 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 GenerateFunctionDataTypes 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 BaseResponseGenerateFunctionDataTypes() { - } - - public BaseResponseGenerateFunctionDataTypes 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 BaseResponseGenerateFunctionDataTypes data(@javax.annotation.Nullable GenerateFunctionDataTypes data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public GenerateFunctionDataTypes getData() { - return data; - } - - public void setData(@javax.annotation.Nullable GenerateFunctionDataTypes data) { - this.data = data; - } - - - public BaseResponseGenerateFunctionDataTypes message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseGenerateFunctionDataTypes errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseGenerateFunctionDataTypes addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseGenerateFunctionDataTypes 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 BaseResponseGenerateFunctionDataTypes instance itself - */ - public BaseResponseGenerateFunctionDataTypes 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; - } - BaseResponseGenerateFunctionDataTypes baseResponseGenerateFunctionDataTypes = (BaseResponseGenerateFunctionDataTypes) o; - return Objects.equals(this.status, baseResponseGenerateFunctionDataTypes.status) && - Objects.equals(this.data, baseResponseGenerateFunctionDataTypes.data) && - Objects.equals(this.message, baseResponseGenerateFunctionDataTypes.message) && - Objects.equals(this.errors, baseResponseGenerateFunctionDataTypes.errors) && - Objects.equals(this.meta, baseResponseGenerateFunctionDataTypes.meta)&& - Objects.equals(this.additionalProperties, baseResponseGenerateFunctionDataTypes.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 BaseResponseGenerateFunctionDataTypes {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseGenerateFunctionDataTypes - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseGenerateFunctionDataTypes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseGenerateFunctionDataTypes is not found in the empty JSON string", BaseResponseGenerateFunctionDataTypes.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GenerateFunctionDataTypes.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseGenerateFunctionDataTypes.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseGenerateFunctionDataTypes' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseGenerateFunctionDataTypes.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseGenerateFunctionDataTypes 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 BaseResponseGenerateFunctionDataTypes read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseGenerateFunctionDataTypes instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseGenerateFunctionDataTypes given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseGenerateFunctionDataTypes - * @throws IOException if the JSON string is invalid with respect to BaseResponseGenerateFunctionDataTypes - */ - public static BaseResponseGenerateFunctionDataTypes fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseGenerateFunctionDataTypes.class); - } - - /** - * Convert an instance of BaseResponseGenerateFunctionDataTypes to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseGenerationStatusList.java b/src/main/java/ai/reveng/model/BaseResponseGenerationStatusList.java deleted file mode 100644 index 20afcb5..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseGenerationStatusList.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.GenerationStatusList; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseGenerationStatusList - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseGenerationStatusList { - 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 GenerationStatusList 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 BaseResponseGenerationStatusList() { - } - - public BaseResponseGenerationStatusList 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 BaseResponseGenerationStatusList data(@javax.annotation.Nullable GenerationStatusList data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public GenerationStatusList getData() { - return data; - } - - public void setData(@javax.annotation.Nullable GenerationStatusList data) { - this.data = data; - } - - - public BaseResponseGenerationStatusList message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseGenerationStatusList errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseGenerationStatusList addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseGenerationStatusList 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 BaseResponseGenerationStatusList instance itself - */ - public BaseResponseGenerationStatusList 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; - } - BaseResponseGenerationStatusList baseResponseGenerationStatusList = (BaseResponseGenerationStatusList) o; - return Objects.equals(this.status, baseResponseGenerationStatusList.status) && - Objects.equals(this.data, baseResponseGenerationStatusList.data) && - Objects.equals(this.message, baseResponseGenerationStatusList.message) && - Objects.equals(this.errors, baseResponseGenerationStatusList.errors) && - Objects.equals(this.meta, baseResponseGenerationStatusList.meta)&& - Objects.equals(this.additionalProperties, baseResponseGenerationStatusList.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 BaseResponseGenerationStatusList {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseGenerationStatusList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseGenerationStatusList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseGenerationStatusList is not found in the empty JSON string", BaseResponseGenerationStatusList.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GenerationStatusList.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseGenerationStatusList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseGenerationStatusList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseGenerationStatusList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseGenerationStatusList 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 BaseResponseGenerationStatusList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseGenerationStatusList instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseGenerationStatusList given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseGenerationStatusList - * @throws IOException if the JSON string is invalid with respect to BaseResponseGenerationStatusList - */ - public static BaseResponseGenerationStatusList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseGenerationStatusList.class); - } - - /** - * Convert an instance of BaseResponseGenerationStatusList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseGetPublicUserResponse.java b/src/main/java/ai/reveng/model/BaseResponseGetPublicUserResponse.java deleted file mode 100644 index d05682c..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseGetPublicUserResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.GetPublicUserResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseGetPublicUserResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseGetPublicUserResponse { - 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 GetPublicUserResponse 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 BaseResponseGetPublicUserResponse() { - } - - public BaseResponseGetPublicUserResponse 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 BaseResponseGetPublicUserResponse data(@javax.annotation.Nullable GetPublicUserResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public GetPublicUserResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable GetPublicUserResponse data) { - this.data = data; - } - - - public BaseResponseGetPublicUserResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseGetPublicUserResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseGetPublicUserResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseGetPublicUserResponse 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 BaseResponseGetPublicUserResponse instance itself - */ - public BaseResponseGetPublicUserResponse 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; - } - BaseResponseGetPublicUserResponse baseResponseGetPublicUserResponse = (BaseResponseGetPublicUserResponse) o; - return Objects.equals(this.status, baseResponseGetPublicUserResponse.status) && - Objects.equals(this.data, baseResponseGetPublicUserResponse.data) && - Objects.equals(this.message, baseResponseGetPublicUserResponse.message) && - Objects.equals(this.errors, baseResponseGetPublicUserResponse.errors) && - Objects.equals(this.meta, baseResponseGetPublicUserResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseGetPublicUserResponse.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 BaseResponseGetPublicUserResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseGetPublicUserResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseGetPublicUserResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseGetPublicUserResponse is not found in the empty JSON string", BaseResponseGetPublicUserResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetPublicUserResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseGetPublicUserResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseGetPublicUserResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseGetPublicUserResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseGetPublicUserResponse 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 BaseResponseGetPublicUserResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseGetPublicUserResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseGetPublicUserResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseGetPublicUserResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseGetPublicUserResponse - */ - public static BaseResponseGetPublicUserResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseGetPublicUserResponse.class); - } - - /** - * Convert an instance of BaseResponseGetPublicUserResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseListCalleesCallerFunctionsResponse.java b/src/main/java/ai/reveng/model/BaseResponseListCalleesCallerFunctionsResponse.java deleted file mode 100644 index 73eb204..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseListCalleesCallerFunctionsResponse.java +++ /dev/null @@ -1,451 +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 ai.reveng.model.CalleesCallerFunctionsResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseListCalleesCallerFunctionsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseListCalleesCallerFunctionsResponse { - 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 List 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 BaseResponseListCalleesCallerFunctionsResponse() { - } - - public BaseResponseListCalleesCallerFunctionsResponse 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 BaseResponseListCalleesCallerFunctionsResponse data(@javax.annotation.Nullable List data) { - this.data = data; - return this; - } - - public BaseResponseListCalleesCallerFunctionsResponse addDataItem(CalleesCallerFunctionsResponse dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public List getData() { - return data; - } - - public void setData(@javax.annotation.Nullable List data) { - this.data = data; - } - - - public BaseResponseListCalleesCallerFunctionsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseListCalleesCallerFunctionsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseListCalleesCallerFunctionsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseListCalleesCallerFunctionsResponse 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 BaseResponseListCalleesCallerFunctionsResponse instance itself - */ - public BaseResponseListCalleesCallerFunctionsResponse 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; - } - BaseResponseListCalleesCallerFunctionsResponse baseResponseListCalleesCallerFunctionsResponse = (BaseResponseListCalleesCallerFunctionsResponse) o; - return Objects.equals(this.status, baseResponseListCalleesCallerFunctionsResponse.status) && - Objects.equals(this.data, baseResponseListCalleesCallerFunctionsResponse.data) && - Objects.equals(this.message, baseResponseListCalleesCallerFunctionsResponse.message) && - Objects.equals(this.errors, baseResponseListCalleesCallerFunctionsResponse.errors) && - Objects.equals(this.meta, baseResponseListCalleesCallerFunctionsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseListCalleesCallerFunctionsResponse.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 BaseResponseListCalleesCallerFunctionsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseListCalleesCallerFunctionsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseListCalleesCallerFunctionsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseListCalleesCallerFunctionsResponse is not found in the empty JSON string", BaseResponseListCalleesCallerFunctionsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - if (jsonArraydata != null) { - // ensure the json data is an array - if (!jsonObj.get("data").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - - // validate the optional field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - CalleesCallerFunctionsResponse.validateJsonElement(jsonArraydata.get(i)); - }; - } - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseListCalleesCallerFunctionsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseListCalleesCallerFunctionsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseListCalleesCallerFunctionsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseListCalleesCallerFunctionsResponse 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 BaseResponseListCalleesCallerFunctionsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseListCalleesCallerFunctionsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseListCalleesCallerFunctionsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseListCalleesCallerFunctionsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseListCalleesCallerFunctionsResponse - */ - public static BaseResponseListCalleesCallerFunctionsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseListCalleesCallerFunctionsResponse.class); - } - - /** - * Convert an instance of BaseResponseListCalleesCallerFunctionsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseListCollectionResults.java b/src/main/java/ai/reveng/model/BaseResponseListCollectionResults.java deleted file mode 100644 index 575e827..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseListCollectionResults.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.ListCollectionResults; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseListCollectionResults - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseListCollectionResults { - 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 ListCollectionResults 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 BaseResponseListCollectionResults() { - } - - public BaseResponseListCollectionResults 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 BaseResponseListCollectionResults data(@javax.annotation.Nullable ListCollectionResults data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public ListCollectionResults getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ListCollectionResults data) { - this.data = data; - } - - - public BaseResponseListCollectionResults message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseListCollectionResults errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseListCollectionResults addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseListCollectionResults 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 BaseResponseListCollectionResults instance itself - */ - public BaseResponseListCollectionResults 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; - } - BaseResponseListCollectionResults baseResponseListCollectionResults = (BaseResponseListCollectionResults) o; - return Objects.equals(this.status, baseResponseListCollectionResults.status) && - Objects.equals(this.data, baseResponseListCollectionResults.data) && - Objects.equals(this.message, baseResponseListCollectionResults.message) && - Objects.equals(this.errors, baseResponseListCollectionResults.errors) && - Objects.equals(this.meta, baseResponseListCollectionResults.meta)&& - Objects.equals(this.additionalProperties, baseResponseListCollectionResults.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 BaseResponseListCollectionResults {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseListCollectionResults - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseListCollectionResults.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseListCollectionResults is not found in the empty JSON string", BaseResponseListCollectionResults.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ListCollectionResults.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseListCollectionResults.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseListCollectionResults' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseListCollectionResults.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseListCollectionResults 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 BaseResponseListCollectionResults read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseListCollectionResults instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseListCollectionResults given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseListCollectionResults - * @throws IOException if the JSON string is invalid with respect to BaseResponseListCollectionResults - */ - public static BaseResponseListCollectionResults fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseListCollectionResults.class); - } - - /** - * Convert an instance of BaseResponseListCollectionResults to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseListCommentResponse.java b/src/main/java/ai/reveng/model/BaseResponseListCommentResponse.java deleted file mode 100644 index d129f22..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseListCommentResponse.java +++ /dev/null @@ -1,451 +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 ai.reveng.model.CommentResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseListCommentResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseListCommentResponse { - 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 List 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 BaseResponseListCommentResponse() { - } - - public BaseResponseListCommentResponse 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 BaseResponseListCommentResponse data(@javax.annotation.Nullable List data) { - this.data = data; - return this; - } - - public BaseResponseListCommentResponse addDataItem(CommentResponse dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public List getData() { - return data; - } - - public void setData(@javax.annotation.Nullable List data) { - this.data = data; - } - - - public BaseResponseListCommentResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseListCommentResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseListCommentResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseListCommentResponse 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 BaseResponseListCommentResponse instance itself - */ - public BaseResponseListCommentResponse 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; - } - BaseResponseListCommentResponse baseResponseListCommentResponse = (BaseResponseListCommentResponse) o; - return Objects.equals(this.status, baseResponseListCommentResponse.status) && - Objects.equals(this.data, baseResponseListCommentResponse.data) && - Objects.equals(this.message, baseResponseListCommentResponse.message) && - Objects.equals(this.errors, baseResponseListCommentResponse.errors) && - Objects.equals(this.meta, baseResponseListCommentResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseListCommentResponse.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 BaseResponseListCommentResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseListCommentResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseListCommentResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseListCommentResponse is not found in the empty JSON string", BaseResponseListCommentResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - if (jsonArraydata != null) { - // ensure the json data is an array - if (!jsonObj.get("data").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - - // validate the optional field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - CommentResponse.validateJsonElement(jsonArraydata.get(i)); - }; - } - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseListCommentResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseListCommentResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseListCommentResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseListCommentResponse 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 BaseResponseListCommentResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseListCommentResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseListCommentResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseListCommentResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseListCommentResponse - */ - public static BaseResponseListCommentResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseListCommentResponse.class); - } - - /** - * Convert an instance of BaseResponseListCommentResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseListDieMatch.java b/src/main/java/ai/reveng/model/BaseResponseListDieMatch.java deleted file mode 100644 index 1bc4e0c..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseListDieMatch.java +++ /dev/null @@ -1,451 +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 ai.reveng.model.DieMatch; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseListDieMatch - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseListDieMatch { - 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 List 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 BaseResponseListDieMatch() { - } - - public BaseResponseListDieMatch 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 BaseResponseListDieMatch data(@javax.annotation.Nullable List data) { - this.data = data; - return this; - } - - public BaseResponseListDieMatch addDataItem(DieMatch dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public List getData() { - return data; - } - - public void setData(@javax.annotation.Nullable List data) { - this.data = data; - } - - - public BaseResponseListDieMatch message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseListDieMatch errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseListDieMatch addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseListDieMatch 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 BaseResponseListDieMatch instance itself - */ - public BaseResponseListDieMatch 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; - } - BaseResponseListDieMatch baseResponseListDieMatch = (BaseResponseListDieMatch) o; - return Objects.equals(this.status, baseResponseListDieMatch.status) && - Objects.equals(this.data, baseResponseListDieMatch.data) && - Objects.equals(this.message, baseResponseListDieMatch.message) && - Objects.equals(this.errors, baseResponseListDieMatch.errors) && - Objects.equals(this.meta, baseResponseListDieMatch.meta)&& - Objects.equals(this.additionalProperties, baseResponseListDieMatch.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 BaseResponseListDieMatch {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseListDieMatch - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseListDieMatch.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseListDieMatch is not found in the empty JSON string", BaseResponseListDieMatch.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - if (jsonArraydata != null) { - // ensure the json data is an array - if (!jsonObj.get("data").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - - // validate the optional field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - DieMatch.validateJsonElement(jsonArraydata.get(i)); - }; - } - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseListDieMatch.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseListDieMatch' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseListDieMatch.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseListDieMatch 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 BaseResponseListDieMatch read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseListDieMatch instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseListDieMatch given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseListDieMatch - * @throws IOException if the JSON string is invalid with respect to BaseResponseListDieMatch - */ - public static BaseResponseListDieMatch fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseListDieMatch.class); - } - - /** - * Convert an instance of BaseResponseListDieMatch to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseListFunctionNameHistory.java b/src/main/java/ai/reveng/model/BaseResponseListFunctionNameHistory.java deleted file mode 100644 index 7ebfbb5..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseListFunctionNameHistory.java +++ /dev/null @@ -1,451 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.FunctionNameHistory; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseListFunctionNameHistory - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseListFunctionNameHistory { - 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 List 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 BaseResponseListFunctionNameHistory() { - } - - public BaseResponseListFunctionNameHistory 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 BaseResponseListFunctionNameHistory data(@javax.annotation.Nullable List data) { - this.data = data; - return this; - } - - public BaseResponseListFunctionNameHistory addDataItem(FunctionNameHistory dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public List getData() { - return data; - } - - public void setData(@javax.annotation.Nullable List data) { - this.data = data; - } - - - public BaseResponseListFunctionNameHistory message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseListFunctionNameHistory errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseListFunctionNameHistory addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseListFunctionNameHistory 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 BaseResponseListFunctionNameHistory instance itself - */ - public BaseResponseListFunctionNameHistory 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; - } - BaseResponseListFunctionNameHistory baseResponseListFunctionNameHistory = (BaseResponseListFunctionNameHistory) o; - return Objects.equals(this.status, baseResponseListFunctionNameHistory.status) && - Objects.equals(this.data, baseResponseListFunctionNameHistory.data) && - Objects.equals(this.message, baseResponseListFunctionNameHistory.message) && - Objects.equals(this.errors, baseResponseListFunctionNameHistory.errors) && - Objects.equals(this.meta, baseResponseListFunctionNameHistory.meta)&& - Objects.equals(this.additionalProperties, baseResponseListFunctionNameHistory.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 BaseResponseListFunctionNameHistory {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseListFunctionNameHistory - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseListFunctionNameHistory.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseListFunctionNameHistory is not found in the empty JSON string", BaseResponseListFunctionNameHistory.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - if (jsonArraydata != null) { - // ensure the json data is an array - if (!jsonObj.get("data").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - - // validate the optional field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - FunctionNameHistory.validateJsonElement(jsonArraydata.get(i)); - }; - } - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseListFunctionNameHistory.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseListFunctionNameHistory' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseListFunctionNameHistory.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseListFunctionNameHistory 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 BaseResponseListFunctionNameHistory read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseListFunctionNameHistory instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseListFunctionNameHistory given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseListFunctionNameHistory - * @throws IOException if the JSON string is invalid with respect to BaseResponseListFunctionNameHistory - */ - public static BaseResponseListFunctionNameHistory fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseListFunctionNameHistory.class); - } - - /** - * Convert an instance of BaseResponseListFunctionNameHistory to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseListSBOM.java b/src/main/java/ai/reveng/model/BaseResponseListSBOM.java deleted file mode 100644 index 795074f..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseListSBOM.java +++ /dev/null @@ -1,451 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.SBOM; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseListSBOM - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseListSBOM { - 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 List 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 BaseResponseListSBOM() { - } - - public BaseResponseListSBOM 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 BaseResponseListSBOM data(@javax.annotation.Nullable List data) { - this.data = data; - return this; - } - - public BaseResponseListSBOM addDataItem(SBOM dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public List getData() { - return data; - } - - public void setData(@javax.annotation.Nullable List data) { - this.data = data; - } - - - public BaseResponseListSBOM message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseListSBOM errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseListSBOM addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseListSBOM 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 BaseResponseListSBOM instance itself - */ - public BaseResponseListSBOM 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; - } - BaseResponseListSBOM baseResponseListSBOM = (BaseResponseListSBOM) o; - return Objects.equals(this.status, baseResponseListSBOM.status) && - Objects.equals(this.data, baseResponseListSBOM.data) && - Objects.equals(this.message, baseResponseListSBOM.message) && - Objects.equals(this.errors, baseResponseListSBOM.errors) && - Objects.equals(this.meta, baseResponseListSBOM.meta)&& - Objects.equals(this.additionalProperties, baseResponseListSBOM.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 BaseResponseListSBOM {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseListSBOM - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseListSBOM.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseListSBOM is not found in the empty JSON string", BaseResponseListSBOM.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - if (jsonArraydata != null) { - // ensure the json data is an array - if (!jsonObj.get("data").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - - // validate the optional field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - SBOM.validateJsonElement(jsonArraydata.get(i)); - }; - } - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseListSBOM.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseListSBOM' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseListSBOM.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseListSBOM 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 BaseResponseListSBOM read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseListSBOM instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseListSBOM given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseListSBOM - * @throws IOException if the JSON string is invalid with respect to BaseResponseListSBOM - */ - public static BaseResponseListSBOM fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseListSBOM.class); - } - - /** - * Convert an instance of BaseResponseListSBOM to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseListUserActivityResponse.java b/src/main/java/ai/reveng/model/BaseResponseListUserActivityResponse.java deleted file mode 100644 index e426cbc..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseListUserActivityResponse.java +++ /dev/null @@ -1,451 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.UserActivityResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseListUserActivityResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseListUserActivityResponse { - 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 List 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 BaseResponseListUserActivityResponse() { - } - - public BaseResponseListUserActivityResponse 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 BaseResponseListUserActivityResponse data(@javax.annotation.Nullable List data) { - this.data = data; - return this; - } - - public BaseResponseListUserActivityResponse addDataItem(UserActivityResponse dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public List getData() { - return data; - } - - public void setData(@javax.annotation.Nullable List data) { - this.data = data; - } - - - public BaseResponseListUserActivityResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseListUserActivityResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseListUserActivityResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseListUserActivityResponse 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 BaseResponseListUserActivityResponse instance itself - */ - public BaseResponseListUserActivityResponse 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; - } - BaseResponseListUserActivityResponse baseResponseListUserActivityResponse = (BaseResponseListUserActivityResponse) o; - return Objects.equals(this.status, baseResponseListUserActivityResponse.status) && - Objects.equals(this.data, baseResponseListUserActivityResponse.data) && - Objects.equals(this.message, baseResponseListUserActivityResponse.message) && - Objects.equals(this.errors, baseResponseListUserActivityResponse.errors) && - Objects.equals(this.meta, baseResponseListUserActivityResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseListUserActivityResponse.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 BaseResponseListUserActivityResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseListUserActivityResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseListUserActivityResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseListUserActivityResponse is not found in the empty JSON string", BaseResponseListUserActivityResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - if (jsonArraydata != null) { - // ensure the json data is an array - if (!jsonObj.get("data").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - - // validate the optional field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - UserActivityResponse.validateJsonElement(jsonArraydata.get(i)); - }; - } - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseListUserActivityResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseListUserActivityResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseListUserActivityResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseListUserActivityResponse 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 BaseResponseListUserActivityResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseListUserActivityResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseListUserActivityResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseListUserActivityResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseListUserActivityResponse - */ - public static BaseResponseListUserActivityResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseListUserActivityResponse.class); - } - - /** - * Convert an instance of BaseResponseListUserActivityResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseLogs.java b/src/main/java/ai/reveng/model/BaseResponseLogs.java deleted file mode 100644 index 97140c2..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseLogs.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.Logs; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseLogs - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseLogs { - 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 Logs 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 BaseResponseLogs() { - } - - public BaseResponseLogs 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 BaseResponseLogs data(@javax.annotation.Nullable Logs data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Logs getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Logs data) { - this.data = data; - } - - - public BaseResponseLogs message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseLogs errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseLogs addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseLogs 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 BaseResponseLogs instance itself - */ - public BaseResponseLogs 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; - } - BaseResponseLogs baseResponseLogs = (BaseResponseLogs) o; - return Objects.equals(this.status, baseResponseLogs.status) && - Objects.equals(this.data, baseResponseLogs.data) && - Objects.equals(this.message, baseResponseLogs.message) && - Objects.equals(this.errors, baseResponseLogs.errors) && - Objects.equals(this.meta, baseResponseLogs.meta)&& - Objects.equals(this.additionalProperties, baseResponseLogs.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 BaseResponseLogs {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseLogs - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseLogs.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseLogs is not found in the empty JSON string", BaseResponseLogs.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - Logs.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseLogs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseLogs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseLogs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseLogs 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 BaseResponseLogs read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseLogs instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseLogs given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseLogs - * @throws IOException if the JSON string is invalid with respect to BaseResponseLogs - */ - public static BaseResponseLogs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseLogs.class); - } - - /** - * Convert an instance of BaseResponseLogs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseModelsResponse.java b/src/main/java/ai/reveng/model/BaseResponseModelsResponse.java deleted file mode 100644 index 4e11d27..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseModelsResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.ModelsResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseModelsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseModelsResponse { - 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 ModelsResponse 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 BaseResponseModelsResponse() { - } - - public BaseResponseModelsResponse 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 BaseResponseModelsResponse data(@javax.annotation.Nullable ModelsResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public ModelsResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ModelsResponse data) { - this.data = data; - } - - - public BaseResponseModelsResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseModelsResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseModelsResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseModelsResponse 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 BaseResponseModelsResponse instance itself - */ - public BaseResponseModelsResponse 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; - } - BaseResponseModelsResponse baseResponseModelsResponse = (BaseResponseModelsResponse) o; - return Objects.equals(this.status, baseResponseModelsResponse.status) && - Objects.equals(this.data, baseResponseModelsResponse.data) && - Objects.equals(this.message, baseResponseModelsResponse.message) && - Objects.equals(this.errors, baseResponseModelsResponse.errors) && - Objects.equals(this.meta, baseResponseModelsResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseModelsResponse.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 BaseResponseModelsResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseModelsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseModelsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseModelsResponse is not found in the empty JSON string", BaseResponseModelsResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ModelsResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseModelsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseModelsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseModelsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseModelsResponse 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 BaseResponseModelsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseModelsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseModelsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseModelsResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseModelsResponse - */ - public static BaseResponseModelsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseModelsResponse.class); - } - - /** - * Convert an instance of BaseResponseModelsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseParams.java b/src/main/java/ai/reveng/model/BaseResponseParams.java deleted file mode 100644 index 69be76d..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseParams.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.Params; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseParams - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseParams { - 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 Params 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 BaseResponseParams() { - } - - public BaseResponseParams 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 BaseResponseParams data(@javax.annotation.Nullable Params data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Params getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Params data) { - this.data = data; - } - - - public BaseResponseParams message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseParams errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseParams addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseParams 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 BaseResponseParams instance itself - */ - public BaseResponseParams 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; - } - BaseResponseParams baseResponseParams = (BaseResponseParams) o; - return Objects.equals(this.status, baseResponseParams.status) && - Objects.equals(this.data, baseResponseParams.data) && - Objects.equals(this.message, baseResponseParams.message) && - Objects.equals(this.errors, baseResponseParams.errors) && - Objects.equals(this.meta, baseResponseParams.meta)&& - Objects.equals(this.additionalProperties, baseResponseParams.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 BaseResponseParams {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseParams - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseParams.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseParams is not found in the empty JSON string", BaseResponseParams.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - Params.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseParams.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseParams' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseParams.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseParams 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 BaseResponseParams read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseParams instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseParams given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseParams - * @throws IOException if the JSON string is invalid with respect to BaseResponseParams - */ - public static BaseResponseParams fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseParams.class); - } - - /** - * Convert an instance of BaseResponseParams to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseQueuedWorkflowTaskResponse.java b/src/main/java/ai/reveng/model/BaseResponseQueuedWorkflowTaskResponse.java deleted file mode 100644 index 5a0764f..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseQueuedWorkflowTaskResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.QueuedWorkflowTaskResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseQueuedWorkflowTaskResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseQueuedWorkflowTaskResponse { - 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 QueuedWorkflowTaskResponse 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 BaseResponseQueuedWorkflowTaskResponse() { - } - - public BaseResponseQueuedWorkflowTaskResponse 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 BaseResponseQueuedWorkflowTaskResponse data(@javax.annotation.Nullable QueuedWorkflowTaskResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public QueuedWorkflowTaskResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable QueuedWorkflowTaskResponse data) { - this.data = data; - } - - - public BaseResponseQueuedWorkflowTaskResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseQueuedWorkflowTaskResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseQueuedWorkflowTaskResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseQueuedWorkflowTaskResponse 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 BaseResponseQueuedWorkflowTaskResponse instance itself - */ - public BaseResponseQueuedWorkflowTaskResponse 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; - } - BaseResponseQueuedWorkflowTaskResponse baseResponseQueuedWorkflowTaskResponse = (BaseResponseQueuedWorkflowTaskResponse) o; - return Objects.equals(this.status, baseResponseQueuedWorkflowTaskResponse.status) && - Objects.equals(this.data, baseResponseQueuedWorkflowTaskResponse.data) && - Objects.equals(this.message, baseResponseQueuedWorkflowTaskResponse.message) && - Objects.equals(this.errors, baseResponseQueuedWorkflowTaskResponse.errors) && - Objects.equals(this.meta, baseResponseQueuedWorkflowTaskResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseQueuedWorkflowTaskResponse.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 BaseResponseQueuedWorkflowTaskResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseQueuedWorkflowTaskResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseQueuedWorkflowTaskResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseQueuedWorkflowTaskResponse is not found in the empty JSON string", BaseResponseQueuedWorkflowTaskResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - QueuedWorkflowTaskResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseQueuedWorkflowTaskResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseQueuedWorkflowTaskResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseQueuedWorkflowTaskResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseQueuedWorkflowTaskResponse 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 BaseResponseQueuedWorkflowTaskResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseQueuedWorkflowTaskResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseQueuedWorkflowTaskResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseQueuedWorkflowTaskResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseQueuedWorkflowTaskResponse - */ - public static BaseResponseQueuedWorkflowTaskResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseQueuedWorkflowTaskResponse.class); - } - - /** - * Convert an instance of BaseResponseQueuedWorkflowTaskResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseRecent.java b/src/main/java/ai/reveng/model/BaseResponseRecent.java deleted file mode 100644 index 5d5270f..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseRecent.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.Recent; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseRecent - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseRecent { - 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 Recent 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 BaseResponseRecent() { - } - - public BaseResponseRecent 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 BaseResponseRecent data(@javax.annotation.Nullable Recent data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Recent getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Recent data) { - this.data = data; - } - - - public BaseResponseRecent message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseRecent errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseRecent addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseRecent 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 BaseResponseRecent instance itself - */ - public BaseResponseRecent 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; - } - BaseResponseRecent baseResponseRecent = (BaseResponseRecent) o; - return Objects.equals(this.status, baseResponseRecent.status) && - Objects.equals(this.data, baseResponseRecent.data) && - Objects.equals(this.message, baseResponseRecent.message) && - Objects.equals(this.errors, baseResponseRecent.errors) && - Objects.equals(this.meta, baseResponseRecent.meta)&& - Objects.equals(this.additionalProperties, baseResponseRecent.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 BaseResponseRecent {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseRecent - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseRecent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseRecent is not found in the empty JSON string", BaseResponseRecent.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - Recent.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseRecent.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseRecent' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseRecent.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseRecent 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 BaseResponseRecent read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseRecent instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseRecent given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseRecent - * @throws IOException if the JSON string is invalid with respect to BaseResponseRecent - */ - public static BaseResponseRecent fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseRecent.class); - } - - /** - * Convert an instance of BaseResponseRecent to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseReportAnalysisResponse.java b/src/main/java/ai/reveng/model/BaseResponseReportAnalysisResponse.java deleted file mode 100644 index 9c8ee3d..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseReportAnalysisResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.ReportAnalysisResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseReportAnalysisResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseReportAnalysisResponse { - 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 ReportAnalysisResponse 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 BaseResponseReportAnalysisResponse() { - } - - public BaseResponseReportAnalysisResponse 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 BaseResponseReportAnalysisResponse data(@javax.annotation.Nullable ReportAnalysisResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public ReportAnalysisResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable ReportAnalysisResponse data) { - this.data = data; - } - - - public BaseResponseReportAnalysisResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseReportAnalysisResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseReportAnalysisResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseReportAnalysisResponse 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 BaseResponseReportAnalysisResponse instance itself - */ - public BaseResponseReportAnalysisResponse 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; - } - BaseResponseReportAnalysisResponse baseResponseReportAnalysisResponse = (BaseResponseReportAnalysisResponse) o; - return Objects.equals(this.status, baseResponseReportAnalysisResponse.status) && - Objects.equals(this.data, baseResponseReportAnalysisResponse.data) && - Objects.equals(this.message, baseResponseReportAnalysisResponse.message) && - Objects.equals(this.errors, baseResponseReportAnalysisResponse.errors) && - Objects.equals(this.meta, baseResponseReportAnalysisResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseReportAnalysisResponse.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 BaseResponseReportAnalysisResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseReportAnalysisResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseReportAnalysisResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseReportAnalysisResponse is not found in the empty JSON string", BaseResponseReportAnalysisResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ReportAnalysisResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseReportAnalysisResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseReportAnalysisResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseReportAnalysisResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseReportAnalysisResponse 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 BaseResponseReportAnalysisResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseReportAnalysisResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseReportAnalysisResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseReportAnalysisResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseReportAnalysisResponse - */ - public static BaseResponseReportAnalysisResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseReportAnalysisResponse.class); - } - - /** - * Convert an instance of BaseResponseReportAnalysisResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseStatus.java b/src/main/java/ai/reveng/model/BaseResponseStatus.java deleted file mode 100644 index fa22a4b..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseStatus.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.StatusOutput; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseStatus - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseStatus { - 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 StatusOutput 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 BaseResponseStatus() { - } - - public BaseResponseStatus 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 BaseResponseStatus data(@javax.annotation.Nullable StatusOutput data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public StatusOutput getData() { - return data; - } - - public void setData(@javax.annotation.Nullable StatusOutput data) { - this.data = data; - } - - - public BaseResponseStatus message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseStatus errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseStatus addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseStatus 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 BaseResponseStatus instance itself - */ - public BaseResponseStatus 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; - } - BaseResponseStatus baseResponseStatus = (BaseResponseStatus) o; - return Objects.equals(this.status, baseResponseStatus.status) && - Objects.equals(this.data, baseResponseStatus.data) && - Objects.equals(this.message, baseResponseStatus.message) && - Objects.equals(this.errors, baseResponseStatus.errors) && - Objects.equals(this.meta, baseResponseStatus.meta)&& - Objects.equals(this.additionalProperties, baseResponseStatus.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 BaseResponseStatus {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseStatus - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseStatus is not found in the empty JSON string", BaseResponseStatus.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - StatusOutput.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseStatus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseStatus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseStatus 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 BaseResponseStatus read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseStatus instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseStatus - * @throws IOException if the JSON string is invalid with respect to BaseResponseStatus - */ - public static BaseResponseStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseStatus.class); - } - - /** - * Convert an instance of BaseResponseStatus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseStr.java b/src/main/java/ai/reveng/model/BaseResponseStr.java deleted file mode 100644 index e708e56..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseStr.java +++ /dev/null @@ -1,431 +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 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 ai.reveng.invoker.JSON; - -/** - * BaseResponseStr - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseStr { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable - private Boolean status = true; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nullable - private String data; - - public 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 BaseResponseStr() { - } - - public BaseResponseStr 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 BaseResponseStr data(@javax.annotation.Nullable String data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public String getData() { - return data; - } - - public void setData(@javax.annotation.Nullable String data) { - this.data = data; - } - - - public BaseResponseStr message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseStr errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseStr addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseStr 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 BaseResponseStr instance itself - */ - public BaseResponseStr 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; - } - BaseResponseStr baseResponseStr = (BaseResponseStr) o; - return Objects.equals(this.status, baseResponseStr.status) && - Objects.equals(this.data, baseResponseStr.data) && - Objects.equals(this.message, baseResponseStr.message) && - Objects.equals(this.errors, baseResponseStr.errors) && - Objects.equals(this.meta, baseResponseStr.meta)&& - Objects.equals(this.additionalProperties, baseResponseStr.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @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 BaseResponseStr {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseStr - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseStr.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseStr is not found in the empty JSON string", BaseResponseStr.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseStr.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseStr' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseStr.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseStr 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 BaseResponseStr read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseStr instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseStr given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseStr - * @throws IOException if the JSON string is invalid with respect to BaseResponseStr - */ - public static BaseResponseStr fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseStr.class); - } - - /** - * Convert an instance of BaseResponseStr to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseTagSearchResponse.java b/src/main/java/ai/reveng/model/BaseResponseTagSearchResponse.java deleted file mode 100644 index cd9ebbc..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseTagSearchResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.TagSearchResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseTagSearchResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseTagSearchResponse { - 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 TagSearchResponse 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 BaseResponseTagSearchResponse() { - } - - public BaseResponseTagSearchResponse 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 BaseResponseTagSearchResponse data(@javax.annotation.Nullable TagSearchResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public TagSearchResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable TagSearchResponse data) { - this.data = data; - } - - - public BaseResponseTagSearchResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseTagSearchResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseTagSearchResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseTagSearchResponse 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 BaseResponseTagSearchResponse instance itself - */ - public BaseResponseTagSearchResponse 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; - } - BaseResponseTagSearchResponse baseResponseTagSearchResponse = (BaseResponseTagSearchResponse) o; - return Objects.equals(this.status, baseResponseTagSearchResponse.status) && - Objects.equals(this.data, baseResponseTagSearchResponse.data) && - Objects.equals(this.message, baseResponseTagSearchResponse.message) && - Objects.equals(this.errors, baseResponseTagSearchResponse.errors) && - Objects.equals(this.meta, baseResponseTagSearchResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseTagSearchResponse.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 BaseResponseTagSearchResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseTagSearchResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseTagSearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseTagSearchResponse is not found in the empty JSON string", BaseResponseTagSearchResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - TagSearchResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseTagSearchResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseTagSearchResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseTagSearchResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseTagSearchResponse 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 BaseResponseTagSearchResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseTagSearchResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseTagSearchResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseTagSearchResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseTagSearchResponse - */ - public static BaseResponseTagSearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseTagSearchResponse.class); - } - - /** - * Convert an instance of BaseResponseTagSearchResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseTaskResponse.java b/src/main/java/ai/reveng/model/BaseResponseTaskResponse.java deleted file mode 100644 index 5902e87..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseTaskResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.TaskResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseTaskResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseTaskResponse { - 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 TaskResponse 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 BaseResponseTaskResponse() { - } - - public BaseResponseTaskResponse 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 BaseResponseTaskResponse data(@javax.annotation.Nullable TaskResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public TaskResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable TaskResponse data) { - this.data = data; - } - - - public BaseResponseTaskResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseTaskResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseTaskResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseTaskResponse 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 BaseResponseTaskResponse instance itself - */ - public BaseResponseTaskResponse 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; - } - BaseResponseTaskResponse baseResponseTaskResponse = (BaseResponseTaskResponse) o; - return Objects.equals(this.status, baseResponseTaskResponse.status) && - Objects.equals(this.data, baseResponseTaskResponse.data) && - Objects.equals(this.message, baseResponseTaskResponse.message) && - Objects.equals(this.errors, baseResponseTaskResponse.errors) && - Objects.equals(this.meta, baseResponseTaskResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseTaskResponse.additionalProperties); - } - - 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 BaseResponseTaskResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); - sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseTaskResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseTaskResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseTaskResponse is not found in the empty JSON string", BaseResponseTaskResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - TaskResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseTaskResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseTaskResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseTaskResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseTaskResponse 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 BaseResponseTaskResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseTaskResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseTaskResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseTaskResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseTaskResponse - */ - public static BaseResponseTaskResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseTaskResponse.class); - } - - /** - * Convert an instance of BaseResponseTaskResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseTaskStatusResponse.java b/src/main/java/ai/reveng/model/BaseResponseTaskStatusResponse.java deleted file mode 100644 index b27fead..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseTaskStatusResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.TaskStatusResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseTaskStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseTaskStatusResponse { - 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 TaskStatusResponse 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 BaseResponseTaskStatusResponse() { - } - - public BaseResponseTaskStatusResponse 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 BaseResponseTaskStatusResponse data(@javax.annotation.Nullable TaskStatusResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public TaskStatusResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable TaskStatusResponse data) { - this.data = data; - } - - - public BaseResponseTaskStatusResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseTaskStatusResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseTaskStatusResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseTaskStatusResponse 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 BaseResponseTaskStatusResponse instance itself - */ - public BaseResponseTaskStatusResponse 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; - } - BaseResponseTaskStatusResponse baseResponseTaskStatusResponse = (BaseResponseTaskStatusResponse) o; - return Objects.equals(this.status, baseResponseTaskStatusResponse.status) && - Objects.equals(this.data, baseResponseTaskStatusResponse.data) && - Objects.equals(this.message, baseResponseTaskStatusResponse.message) && - Objects.equals(this.errors, baseResponseTaskStatusResponse.errors) && - Objects.equals(this.meta, baseResponseTaskStatusResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseTaskStatusResponse.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 BaseResponseTaskStatusResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseTaskStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseTaskStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseTaskStatusResponse is not found in the empty JSON string", BaseResponseTaskStatusResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - TaskStatusResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseTaskStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseTaskStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseTaskStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseTaskStatusResponse 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 BaseResponseTaskStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseTaskStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseTaskStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseTaskStatusResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseTaskStatusResponse - */ - public static BaseResponseTaskStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseTaskStatusResponse.class); - } - - /** - * Convert an instance of BaseResponseTaskStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseTriageReportResponse.java b/src/main/java/ai/reveng/model/BaseResponseTriageReportResponse.java deleted file mode 100644 index 06cbb3f..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseTriageReportResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.TriageReportResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseTriageReportResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseTriageReportResponse { - 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 TriageReportResponse 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 BaseResponseTriageReportResponse() { - } - - public BaseResponseTriageReportResponse 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 BaseResponseTriageReportResponse data(@javax.annotation.Nullable TriageReportResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public TriageReportResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable TriageReportResponse data) { - this.data = data; - } - - - public BaseResponseTriageReportResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseTriageReportResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseTriageReportResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseTriageReportResponse 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 BaseResponseTriageReportResponse instance itself - */ - public BaseResponseTriageReportResponse 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; - } - BaseResponseTriageReportResponse baseResponseTriageReportResponse = (BaseResponseTriageReportResponse) o; - return Objects.equals(this.status, baseResponseTriageReportResponse.status) && - Objects.equals(this.data, baseResponseTriageReportResponse.data) && - Objects.equals(this.message, baseResponseTriageReportResponse.message) && - Objects.equals(this.errors, baseResponseTriageReportResponse.errors) && - Objects.equals(this.meta, baseResponseTriageReportResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseTriageReportResponse.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 BaseResponseTriageReportResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseTriageReportResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseTriageReportResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseTriageReportResponse is not found in the empty JSON string", BaseResponseTriageReportResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - TriageReportResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseTriageReportResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseTriageReportResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseTriageReportResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseTriageReportResponse 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 BaseResponseTriageReportResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseTriageReportResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseTriageReportResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseTriageReportResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseTriageReportResponse - */ - public static BaseResponseTriageReportResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseTriageReportResponse.class); - } - - /** - * Convert an instance of BaseResponseTriageReportResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseUnionGetAiDecompilationRatingResponseNoneType.java b/src/main/java/ai/reveng/model/BaseResponseUnionGetAiDecompilationRatingResponseNoneType.java deleted file mode 100644 index 00240f5..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseUnionGetAiDecompilationRatingResponseNoneType.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.GetAiDecompilationRatingResponse; -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 ai.reveng.invoker.JSON; - -/** - * BaseResponseUnionGetAiDecompilationRatingResponseNoneType - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseUnionGetAiDecompilationRatingResponseNoneType { - 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 GetAiDecompilationRatingResponse 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 BaseResponseUnionGetAiDecompilationRatingResponseNoneType() { - } - - public BaseResponseUnionGetAiDecompilationRatingResponseNoneType 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 BaseResponseUnionGetAiDecompilationRatingResponseNoneType data(@javax.annotation.Nullable GetAiDecompilationRatingResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public GetAiDecompilationRatingResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable GetAiDecompilationRatingResponse data) { - this.data = data; - } - - - public BaseResponseUnionGetAiDecompilationRatingResponseNoneType message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseUnionGetAiDecompilationRatingResponseNoneType errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseUnionGetAiDecompilationRatingResponseNoneType addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseUnionGetAiDecompilationRatingResponseNoneType 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 BaseResponseUnionGetAiDecompilationRatingResponseNoneType instance itself - */ - public BaseResponseUnionGetAiDecompilationRatingResponseNoneType 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; - } - BaseResponseUnionGetAiDecompilationRatingResponseNoneType baseResponseUnionGetAiDecompilationRatingResponseNoneType = (BaseResponseUnionGetAiDecompilationRatingResponseNoneType) o; - return Objects.equals(this.status, baseResponseUnionGetAiDecompilationRatingResponseNoneType.status) && - Objects.equals(this.data, baseResponseUnionGetAiDecompilationRatingResponseNoneType.data) && - Objects.equals(this.message, baseResponseUnionGetAiDecompilationRatingResponseNoneType.message) && - Objects.equals(this.errors, baseResponseUnionGetAiDecompilationRatingResponseNoneType.errors) && - Objects.equals(this.meta, baseResponseUnionGetAiDecompilationRatingResponseNoneType.meta)&& - Objects.equals(this.additionalProperties, baseResponseUnionGetAiDecompilationRatingResponseNoneType.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 BaseResponseUnionGetAiDecompilationRatingResponseNoneType {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseUnionGetAiDecompilationRatingResponseNoneType - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseUnionGetAiDecompilationRatingResponseNoneType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseUnionGetAiDecompilationRatingResponseNoneType is not found in the empty JSON string", BaseResponseUnionGetAiDecompilationRatingResponseNoneType.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetAiDecompilationRatingResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseUnionGetAiDecompilationRatingResponseNoneType.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseUnionGetAiDecompilationRatingResponseNoneType' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseUnionGetAiDecompilationRatingResponseNoneType.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseUnionGetAiDecompilationRatingResponseNoneType 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 BaseResponseUnionGetAiDecompilationRatingResponseNoneType read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseUnionGetAiDecompilationRatingResponseNoneType instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseUnionGetAiDecompilationRatingResponseNoneType given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseUnionGetAiDecompilationRatingResponseNoneType - * @throws IOException if the JSON string is invalid with respect to BaseResponseUnionGetAiDecompilationRatingResponseNoneType - */ - public static BaseResponseUnionGetAiDecompilationRatingResponseNoneType fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseUnionGetAiDecompilationRatingResponseNoneType.class); - } - - /** - * Convert an instance of BaseResponseUnionGetAiDecompilationRatingResponseNoneType to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseUploadResponse.java b/src/main/java/ai/reveng/model/BaseResponseUploadResponse.java deleted file mode 100644 index c1c0ae9..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseUploadResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.UploadResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseUploadResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseUploadResponse { - 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 UploadResponse 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 BaseResponseUploadResponse() { - } - - public BaseResponseUploadResponse 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 BaseResponseUploadResponse data(@javax.annotation.Nullable UploadResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public UploadResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable UploadResponse data) { - this.data = data; - } - - - public BaseResponseUploadResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseUploadResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseUploadResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseUploadResponse 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 BaseResponseUploadResponse instance itself - */ - public BaseResponseUploadResponse 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; - } - BaseResponseUploadResponse baseResponseUploadResponse = (BaseResponseUploadResponse) o; - return Objects.equals(this.status, baseResponseUploadResponse.status) && - Objects.equals(this.data, baseResponseUploadResponse.data) && - Objects.equals(this.message, baseResponseUploadResponse.message) && - Objects.equals(this.errors, baseResponseUploadResponse.errors) && - Objects.equals(this.meta, baseResponseUploadResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseUploadResponse.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 BaseResponseUploadResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseUploadResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseUploadResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseUploadResponse is not found in the empty JSON string", BaseResponseUploadResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - UploadResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseUploadResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseUploadResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseUploadResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseUploadResponse 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 BaseResponseUploadResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseUploadResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseUploadResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseUploadResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseUploadResponse - */ - public static BaseResponseUploadResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseUploadResponse.class); - } - - /** - * Convert an instance of BaseResponseUploadResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseVulnerabilities.java b/src/main/java/ai/reveng/model/BaseResponseVulnerabilities.java deleted file mode 100644 index 9a55b1f..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseVulnerabilities.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.Vulnerabilities; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseVulnerabilities - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseVulnerabilities { - 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 Vulnerabilities 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 BaseResponseVulnerabilities() { - } - - public BaseResponseVulnerabilities 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 BaseResponseVulnerabilities data(@javax.annotation.Nullable Vulnerabilities data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public Vulnerabilities getData() { - return data; - } - - public void setData(@javax.annotation.Nullable Vulnerabilities data) { - this.data = data; - } - - - public BaseResponseVulnerabilities message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseVulnerabilities errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseVulnerabilities addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseVulnerabilities 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 BaseResponseVulnerabilities instance itself - */ - public BaseResponseVulnerabilities 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; - } - BaseResponseVulnerabilities baseResponseVulnerabilities = (BaseResponseVulnerabilities) o; - return Objects.equals(this.status, baseResponseVulnerabilities.status) && - Objects.equals(this.data, baseResponseVulnerabilities.data) && - Objects.equals(this.message, baseResponseVulnerabilities.message) && - Objects.equals(this.errors, baseResponseVulnerabilities.errors) && - Objects.equals(this.meta, baseResponseVulnerabilities.meta)&& - Objects.equals(this.additionalProperties, baseResponseVulnerabilities.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 BaseResponseVulnerabilities {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseVulnerabilities - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseVulnerabilities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseVulnerabilities is not found in the empty JSON string", BaseResponseVulnerabilities.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - Vulnerabilities.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseVulnerabilities.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseVulnerabilities' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseVulnerabilities.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseVulnerabilities 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 BaseResponseVulnerabilities read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseVulnerabilities instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseVulnerabilities given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseVulnerabilities - * @throws IOException if the JSON string is invalid with respect to BaseResponseVulnerabilities - */ - public static BaseResponseVulnerabilities fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseVulnerabilities.class); - } - - /** - * Convert an instance of BaseResponseVulnerabilities to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BaseResponseXrefResponse.java b/src/main/java/ai/reveng/model/BaseResponseXrefResponse.java deleted file mode 100644 index 1d77d61..0000000 --- a/src/main/java/ai/reveng/model/BaseResponseXrefResponse.java +++ /dev/null @@ -1,433 +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 ai.reveng.model.ErrorModel; -import ai.reveng.model.MetaModel; -import ai.reveng.model.XrefResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BaseResponseXrefResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseResponseXrefResponse { - 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 XrefResponse 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 BaseResponseXrefResponse() { - } - - public BaseResponseXrefResponse 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 BaseResponseXrefResponse data(@javax.annotation.Nullable XrefResponse data) { - this.data = data; - return this; - } - - /** - * Response data - * @return data - */ - @javax.annotation.Nullable - public XrefResponse getData() { - return data; - } - - public void setData(@javax.annotation.Nullable XrefResponse data) { - this.data = data; - } - - - public BaseResponseXrefResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * Response message - * @return message - */ - @javax.annotation.Nullable - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - - public BaseResponseXrefResponse errors(@javax.annotation.Nullable List errors) { - this.errors = errors; - return this; - } - - public BaseResponseXrefResponse addErrorsItem(ErrorModel errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * List of errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(@javax.annotation.Nullable List errors) { - this.errors = errors; - } - - - public BaseResponseXrefResponse 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 BaseResponseXrefResponse instance itself - */ - public BaseResponseXrefResponse 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; - } - BaseResponseXrefResponse baseResponseXrefResponse = (BaseResponseXrefResponse) o; - return Objects.equals(this.status, baseResponseXrefResponse.status) && - Objects.equals(this.data, baseResponseXrefResponse.data) && - Objects.equals(this.message, baseResponseXrefResponse.message) && - Objects.equals(this.errors, baseResponseXrefResponse.errors) && - Objects.equals(this.meta, baseResponseXrefResponse.meta)&& - Objects.equals(this.additionalProperties, baseResponseXrefResponse.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 BaseResponseXrefResponse {\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) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("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 BaseResponseXrefResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BaseResponseXrefResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BaseResponseXrefResponse is not found in the empty JSON string", BaseResponseXrefResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - XrefResponse.validateJsonElement(jsonObj.get("data")); - } - if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) { - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - if (jsonArrayerrors != null) { - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - // validate the optional field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - ErrorModel.validateJsonElement(jsonArrayerrors.get(i)); - }; - } - } - // 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 (!BaseResponseXrefResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseResponseXrefResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BaseResponseXrefResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseResponseXrefResponse 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 BaseResponseXrefResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BaseResponseXrefResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BaseResponseXrefResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseResponseXrefResponse - * @throws IOException if the JSON string is invalid with respect to BaseResponseXrefResponse - */ - public static BaseResponseXrefResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseResponseXrefResponse.class); - } - - /** - * Convert an instance of BaseResponseXrefResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Basic.java b/src/main/java/ai/reveng/model/Basic.java deleted file mode 100644 index 440ad69..0000000 --- a/src/main/java/ai/reveng/model/Basic.java +++ /dev/null @@ -1,762 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Basic - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Basic { - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - public static final String SERIALIZED_NAME_BINARY_SIZE = "binary_size"; - @SerializedName(SERIALIZED_NAME_BINARY_SIZE) - @javax.annotation.Nonnull - private Integer binarySize; - - public static final String SERIALIZED_NAME_CREATION = "creation"; - @SerializedName(SERIALIZED_NAME_CREATION) - @javax.annotation.Nonnull - private OffsetDateTime creation; - - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; - @SerializedName(SERIALIZED_NAME_MODEL_NAME) - @javax.annotation.Nonnull - private String modelName; - - public static final String SERIALIZED_NAME_MODEL_ID = "model_id"; - @SerializedName(SERIALIZED_NAME_MODEL_ID) - @javax.annotation.Nonnull - private Integer modelId; - - public static final String SERIALIZED_NAME_OWNER_USERNAME = "owner_username"; - @SerializedName(SERIALIZED_NAME_OWNER_USERNAME) - @javax.annotation.Nonnull - private String ownerUsername; - - public static final String SERIALIZED_NAME_IS_SYSTEM = "is_system"; - @SerializedName(SERIALIZED_NAME_IS_SYSTEM) - @javax.annotation.Nonnull - private Boolean isSystem; - - public static final String SERIALIZED_NAME_ANALYSIS_SCOPE = "analysis_scope"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_SCOPE) - @javax.annotation.Nonnull - private String analysisScope; - - public static final String SERIALIZED_NAME_IS_OWNER = "is_owner"; - @SerializedName(SERIALIZED_NAME_IS_OWNER) - @javax.annotation.Nonnull - private Boolean isOwner; - - public static final String SERIALIZED_NAME_DEBUG = "debug"; - @SerializedName(SERIALIZED_NAME_DEBUG) - @javax.annotation.Nonnull - private Boolean debug; - - public static final String SERIALIZED_NAME_FUNCTION_COUNT = "function_count"; - @SerializedName(SERIALIZED_NAME_FUNCTION_COUNT) - @javax.annotation.Nonnull - private Integer functionCount; - - public static final String SERIALIZED_NAME_IS_ADVANCED = "is_advanced"; - @SerializedName(SERIALIZED_NAME_IS_ADVANCED) - @javax.annotation.Nonnull - private Boolean isAdvanced; - - public static final String SERIALIZED_NAME_BASE_ADDRESS = "base_address"; - @SerializedName(SERIALIZED_NAME_BASE_ADDRESS) - @javax.annotation.Nullable - private Integer baseAddress; - - public static final String SERIALIZED_NAME_BINARY_UUID = "binary_uuid"; - @SerializedName(SERIALIZED_NAME_BINARY_UUID) - @javax.annotation.Nullable - private String binaryUuid; - - public static final String SERIALIZED_NAME_SEQUENCER_VERSION = "sequencer_version"; - @SerializedName(SERIALIZED_NAME_SEQUENCER_VERSION) - @javax.annotation.Nullable - private String sequencerVersion; - - public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; - @SerializedName(SERIALIZED_NAME_TEAM_ID) - @javax.annotation.Nonnull - private Integer teamId; - - public Basic() { - } - - public Basic binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * The ID of the binary - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public Basic binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * The name of the binary uploaded - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public Basic binarySize(@javax.annotation.Nonnull Integer binarySize) { - this.binarySize = binarySize; - return this; - } - - /** - * The size of the binary uploaded (bytes) - * @return binarySize - */ - @javax.annotation.Nonnull - public Integer getBinarySize() { - return binarySize; - } - - public void setBinarySize(@javax.annotation.Nonnull Integer binarySize) { - this.binarySize = binarySize; - } - - - public Basic creation(@javax.annotation.Nonnull OffsetDateTime creation) { - this.creation = creation; - return this; - } - - /** - * When the binary was uploaded - * @return creation - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreation() { - return creation; - } - - public void setCreation(@javax.annotation.Nonnull OffsetDateTime creation) { - this.creation = creation; - } - - - public Basic sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * The hash of the binary uploaded - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public Basic modelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - return this; - } - - /** - * The model name used for analysis - * @return modelName - */ - @javax.annotation.Nonnull - public String getModelName() { - return modelName; - } - - public void setModelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - } - - - public Basic modelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - return this; - } - - /** - * The model ID used for analysis - * @return modelId - */ - @javax.annotation.Nonnull - public Integer getModelId() { - return modelId; - } - - public void setModelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - } - - - public Basic ownerUsername(@javax.annotation.Nonnull String ownerUsername) { - this.ownerUsername = ownerUsername; - return this; - } - - /** - * The name of the owner of the binary - * @return ownerUsername - */ - @javax.annotation.Nonnull - public String getOwnerUsername() { - return ownerUsername; - } - - public void setOwnerUsername(@javax.annotation.Nonnull String ownerUsername) { - this.ownerUsername = ownerUsername; - } - - - public Basic isSystem(@javax.annotation.Nonnull Boolean isSystem) { - this.isSystem = isSystem; - return this; - } - - /** - * Whether the analysis is a system analysis - * @return isSystem - */ - @javax.annotation.Nonnull - public Boolean getIsSystem() { - return isSystem; - } - - public void setIsSystem(@javax.annotation.Nonnull Boolean isSystem) { - this.isSystem = isSystem; - } - - - public Basic analysisScope(@javax.annotation.Nonnull String analysisScope) { - this.analysisScope = analysisScope; - return this; - } - - /** - * The scope of the analysis - * @return analysisScope - */ - @javax.annotation.Nonnull - public String getAnalysisScope() { - return analysisScope; - } - - public void setAnalysisScope(@javax.annotation.Nonnull String analysisScope) { - this.analysisScope = analysisScope; - } - - - public Basic isOwner(@javax.annotation.Nonnull Boolean isOwner) { - this.isOwner = isOwner; - return this; - } - - /** - * Whether the current user is the owner - * @return isOwner - */ - @javax.annotation.Nonnull - public Boolean getIsOwner() { - return isOwner; - } - - public void setIsOwner(@javax.annotation.Nonnull Boolean isOwner) { - this.isOwner = isOwner; - } - - - public Basic debug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - return this; - } - - /** - * Whether the current analysis was analysed with debug symbols - * @return debug - */ - @javax.annotation.Nonnull - public Boolean getDebug() { - return debug; - } - - public void setDebug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - } - - - public Basic functionCount(@javax.annotation.Nonnull Integer functionCount) { - this.functionCount = functionCount; - return this; - } - - /** - * The number of functions in the binary - * @return functionCount - */ - @javax.annotation.Nonnull - public Integer getFunctionCount() { - return functionCount; - } - - public void setFunctionCount(@javax.annotation.Nonnull Integer functionCount) { - this.functionCount = functionCount; - } - - - public Basic isAdvanced(@javax.annotation.Nonnull Boolean isAdvanced) { - this.isAdvanced = isAdvanced; - return this; - } - - /** - * Whether the analysis was advanced - * @return isAdvanced - */ - @javax.annotation.Nonnull - public Boolean getIsAdvanced() { - return isAdvanced; - } - - public void setIsAdvanced(@javax.annotation.Nonnull Boolean isAdvanced) { - this.isAdvanced = isAdvanced; - } - - - public Basic baseAddress(@javax.annotation.Nullable Integer baseAddress) { - this.baseAddress = baseAddress; - return this; - } - - /** - * The base address of the binary - * @return baseAddress - */ - @javax.annotation.Nullable - public Integer getBaseAddress() { - return baseAddress; - } - - public void setBaseAddress(@javax.annotation.Nullable Integer baseAddress) { - this.baseAddress = baseAddress; - } - - - public Basic binaryUuid(@javax.annotation.Nullable String binaryUuid) { - this.binaryUuid = binaryUuid; - return this; - } - - /** - * The UUID of the binary - * @return binaryUuid - */ - @javax.annotation.Nullable - public String getBinaryUuid() { - return binaryUuid; - } - - public void setBinaryUuid(@javax.annotation.Nullable String binaryUuid) { - this.binaryUuid = binaryUuid; - } - - - public Basic sequencerVersion(@javax.annotation.Nullable String sequencerVersion) { - this.sequencerVersion = sequencerVersion; - return this; - } - - /** - * The sequencer version used for analysis - * @return sequencerVersion - */ - @javax.annotation.Nullable - public String getSequencerVersion() { - return sequencerVersion; - } - - public void setSequencerVersion(@javax.annotation.Nullable String sequencerVersion) { - this.sequencerVersion = sequencerVersion; - } - - - public Basic teamId(@javax.annotation.Nonnull Integer teamId) { - this.teamId = teamId; - return this; - } - - /** - * The team ID of the analysis - * @return teamId - */ - @javax.annotation.Nonnull - public Integer getTeamId() { - return teamId; - } - - public void setTeamId(@javax.annotation.Nonnull Integer teamId) { - this.teamId = teamId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the Basic instance itself - */ - public Basic 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; - } - Basic basic = (Basic) o; - return Objects.equals(this.binaryId, basic.binaryId) && - Objects.equals(this.binaryName, basic.binaryName) && - Objects.equals(this.binarySize, basic.binarySize) && - Objects.equals(this.creation, basic.creation) && - Objects.equals(this.sha256Hash, basic.sha256Hash) && - Objects.equals(this.modelName, basic.modelName) && - Objects.equals(this.modelId, basic.modelId) && - Objects.equals(this.ownerUsername, basic.ownerUsername) && - Objects.equals(this.isSystem, basic.isSystem) && - Objects.equals(this.analysisScope, basic.analysisScope) && - Objects.equals(this.isOwner, basic.isOwner) && - Objects.equals(this.debug, basic.debug) && - Objects.equals(this.functionCount, basic.functionCount) && - Objects.equals(this.isAdvanced, basic.isAdvanced) && - Objects.equals(this.baseAddress, basic.baseAddress) && - Objects.equals(this.binaryUuid, basic.binaryUuid) && - Objects.equals(this.sequencerVersion, basic.sequencerVersion) && - Objects.equals(this.teamId, basic.teamId)&& - Objects.equals(this.additionalProperties, basic.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(binaryId, binaryName, binarySize, creation, sha256Hash, modelName, modelId, ownerUsername, isSystem, analysisScope, isOwner, debug, functionCount, isAdvanced, baseAddress, binaryUuid, sequencerVersion, teamId, 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 Basic {\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" binarySize: ").append(toIndentedString(binarySize)).append("\n"); - sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); - sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); - sb.append(" ownerUsername: ").append(toIndentedString(ownerUsername)).append("\n"); - sb.append(" isSystem: ").append(toIndentedString(isSystem)).append("\n"); - sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n"); - sb.append(" isOwner: ").append(toIndentedString(isOwner)).append("\n"); - sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); - sb.append(" functionCount: ").append(toIndentedString(functionCount)).append("\n"); - sb.append(" isAdvanced: ").append(toIndentedString(isAdvanced)).append("\n"); - sb.append(" baseAddress: ").append(toIndentedString(baseAddress)).append("\n"); - sb.append(" binaryUuid: ").append(toIndentedString(binaryUuid)).append("\n"); - sb.append(" sequencerVersion: ").append(toIndentedString(sequencerVersion)).append("\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("binary_id", "binary_name", "binary_size", "creation", "sha_256_hash", "model_name", "model_id", "owner_username", "is_system", "analysis_scope", "is_owner", "debug", "function_count", "is_advanced", "base_address", "binary_uuid", "sequencer_version", "team_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("binary_id", "binary_name", "binary_size", "creation", "sha_256_hash", "model_name", "model_id", "owner_username", "is_system", "analysis_scope", "is_owner", "debug", "function_count", "is_advanced", "base_address", "team_id")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Basic - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Basic.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Basic is not found in the empty JSON string", Basic.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Basic.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - if (!jsonObj.get("model_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); - } - if (!jsonObj.get("owner_username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `owner_username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_username").toString())); - } - if (!jsonObj.get("analysis_scope").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("analysis_scope").toString())); - } - if ((jsonObj.get("binary_uuid") != null && !jsonObj.get("binary_uuid").isJsonNull()) && !jsonObj.get("binary_uuid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_uuid").toString())); - } - if ((jsonObj.get("sequencer_version") != null && !jsonObj.get("sequencer_version").isJsonNull()) && !jsonObj.get("sequencer_version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sequencer_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sequencer_version").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Basic.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Basic' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Basic.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Basic 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 Basic read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Basic instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Basic given an JSON string - * - * @param jsonString JSON string - * @return An instance of Basic - * @throws IOException if the JSON string is invalid with respect to Basic - */ - public static Basic fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Basic.class); - } - - /** - * Convert an instance of Basic to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinariesRelatedStatusResponse.java b/src/main/java/ai/reveng/model/BinariesRelatedStatusResponse.java deleted file mode 100644 index f7be2fb..0000000 --- a/src/main/java/ai/reveng/model/BinariesRelatedStatusResponse.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BinariesRelatedStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BinariesRelatedStatusResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private String status; - - public BinariesRelatedStatusResponse() { - } - - public BinariesRelatedStatusResponse status(@javax.annotation.Nonnull String status) { - this.status = status; - return this; - } - - /** - * The current status of the unpack binary task - * @return status - */ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull String status) { - this.status = status; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the BinariesRelatedStatusResponse instance itself - */ - public BinariesRelatedStatusResponse 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; - } - BinariesRelatedStatusResponse binariesRelatedStatusResponse = (BinariesRelatedStatusResponse) o; - return Objects.equals(this.status, binariesRelatedStatusResponse.status)&& - Objects.equals(this.additionalProperties, binariesRelatedStatusResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(status, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BinariesRelatedStatusResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("status")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BinariesRelatedStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BinariesRelatedStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinariesRelatedStatusResponse is not found in the empty JSON string", BinariesRelatedStatusResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BinariesRelatedStatusResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BinariesRelatedStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BinariesRelatedStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BinariesRelatedStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BinariesRelatedStatusResponse 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 BinariesRelatedStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BinariesRelatedStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BinariesRelatedStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BinariesRelatedStatusResponse - * @throws IOException if the JSON string is invalid with respect to BinariesRelatedStatusResponse - */ - public static BinariesRelatedStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BinariesRelatedStatusResponse.class); - } - - /** - * Convert an instance of BinariesRelatedStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinariesTaskStatus.java b/src/main/java/ai/reveng/model/BinariesTaskStatus.java deleted file mode 100644 index a988aaf..0000000 --- a/src/main/java/ai/reveng/model/BinariesTaskStatus.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets BinariesTaskStatus - */ -@JsonAdapter(BinariesTaskStatus.Adapter.class) -public enum BinariesTaskStatus { - - UNINITIALISED("UNINITIALISED"), - - PENDING("PENDING"), - - RUNNING("RUNNING"), - - COMPLETED("COMPLETED"), - - FAILED("FAILED"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - BinariesTaskStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static BinariesTaskStatus fromValue(String value) { - for (BinariesTaskStatus b : BinariesTaskStatus.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final BinariesTaskStatus enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public BinariesTaskStatus read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return BinariesTaskStatus.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - BinariesTaskStatus.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/BinaryAdditionalDetailsDataResponse.java b/src/main/java/ai/reveng/model/BinaryAdditionalDetailsDataResponse.java deleted file mode 100644 index be4f7fd..0000000 --- a/src/main/java/ai/reveng/model/BinaryAdditionalDetailsDataResponse.java +++ /dev/null @@ -1,363 +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 ai.reveng.model.ELFModel; -import ai.reveng.model.FileMetadata; -import ai.reveng.model.PEModel; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BinaryAdditionalDetailsDataResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BinaryAdditionalDetailsDataResponse { - public static final String SERIALIZED_NAME_FILE = "file"; - @SerializedName(SERIALIZED_NAME_FILE) - @javax.annotation.Nonnull - private FileMetadata _file; - - public static final String SERIALIZED_NAME_PE = "pe"; - @SerializedName(SERIALIZED_NAME_PE) - @javax.annotation.Nullable - private PEModel pe; - - public static final String SERIALIZED_NAME_ELF = "elf"; - @SerializedName(SERIALIZED_NAME_ELF) - @javax.annotation.Nullable - private ELFModel elf; - - public BinaryAdditionalDetailsDataResponse() { - } - - public BinaryAdditionalDetailsDataResponse _file(@javax.annotation.Nonnull FileMetadata _file) { - this._file = _file; - return this; - } - - /** - * Get _file - * @return _file - */ - @javax.annotation.Nonnull - public FileMetadata getFile() { - return _file; - } - - public void setFile(@javax.annotation.Nonnull FileMetadata _file) { - this._file = _file; - } - - - public BinaryAdditionalDetailsDataResponse pe(@javax.annotation.Nullable PEModel pe) { - this.pe = pe; - return this; - } - - /** - * Get pe - * @return pe - */ - @javax.annotation.Nullable - public PEModel getPe() { - return pe; - } - - public void setPe(@javax.annotation.Nullable PEModel pe) { - this.pe = pe; - } - - - public BinaryAdditionalDetailsDataResponse elf(@javax.annotation.Nullable ELFModel elf) { - this.elf = elf; - return this; - } - - /** - * Get elf - * @return elf - */ - @javax.annotation.Nullable - public ELFModel getElf() { - return elf; - } - - public void setElf(@javax.annotation.Nullable ELFModel elf) { - this.elf = elf; - } - - /** - * 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 BinaryAdditionalDetailsDataResponse instance itself - */ - public BinaryAdditionalDetailsDataResponse 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; - } - BinaryAdditionalDetailsDataResponse binaryAdditionalDetailsDataResponse = (BinaryAdditionalDetailsDataResponse) o; - return Objects.equals(this._file, binaryAdditionalDetailsDataResponse._file) && - Objects.equals(this.pe, binaryAdditionalDetailsDataResponse.pe) && - Objects.equals(this.elf, binaryAdditionalDetailsDataResponse.elf)&& - Objects.equals(this.additionalProperties, binaryAdditionalDetailsDataResponse.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(_file, pe, elf, 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 BinaryAdditionalDetailsDataResponse {\n"); - sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); - sb.append(" pe: ").append(toIndentedString(pe)).append("\n"); - sb.append(" elf: ").append(toIndentedString(elf)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("file", "pe", "elf")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("file")); - } - - /** - * 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 BinaryAdditionalDetailsDataResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BinaryAdditionalDetailsDataResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinaryAdditionalDetailsDataResponse is not found in the empty JSON string", BinaryAdditionalDetailsDataResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BinaryAdditionalDetailsDataResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `file` - FileMetadata.validateJsonElement(jsonObj.get("file")); - // validate the optional field `pe` - if (jsonObj.get("pe") != null && !jsonObj.get("pe").isJsonNull()) { - PEModel.validateJsonElement(jsonObj.get("pe")); - } - // validate the optional field `elf` - if (jsonObj.get("elf") != null && !jsonObj.get("elf").isJsonNull()) { - ELFModel.validateJsonElement(jsonObj.get("elf")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BinaryAdditionalDetailsDataResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BinaryAdditionalDetailsDataResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BinaryAdditionalDetailsDataResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BinaryAdditionalDetailsDataResponse 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 BinaryAdditionalDetailsDataResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BinaryAdditionalDetailsDataResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BinaryAdditionalDetailsDataResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BinaryAdditionalDetailsDataResponse - * @throws IOException if the JSON string is invalid with respect to BinaryAdditionalDetailsDataResponse - */ - public static BinaryAdditionalDetailsDataResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BinaryAdditionalDetailsDataResponse.class); - } - - /** - * Convert an instance of BinaryAdditionalDetailsDataResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinaryAdditionalResponse.java b/src/main/java/ai/reveng/model/BinaryAdditionalResponse.java deleted file mode 100644 index 354eeed..0000000 --- a/src/main/java/ai/reveng/model/BinaryAdditionalResponse.java +++ /dev/null @@ -1,356 +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 ai.reveng.model.BinaryAdditionalDetailsDataResponse; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BinaryAdditionalResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BinaryAdditionalResponse { - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - @SerializedName(SERIALIZED_NAME_DETAILS) - @javax.annotation.Nullable - private BinaryAdditionalDetailsDataResponse details; - - public static final String SERIALIZED_NAME_CREATION = "creation"; - @SerializedName(SERIALIZED_NAME_CREATION) - @javax.annotation.Nullable - private OffsetDateTime creation; - - public BinaryAdditionalResponse() { - } - - public BinaryAdditionalResponse binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * Get binaryId - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public BinaryAdditionalResponse details(@javax.annotation.Nullable BinaryAdditionalDetailsDataResponse details) { - this.details = details; - return this; - } - - /** - * Get details - * @return details - */ - @javax.annotation.Nullable - public BinaryAdditionalDetailsDataResponse getDetails() { - return details; - } - - public void setDetails(@javax.annotation.Nullable BinaryAdditionalDetailsDataResponse details) { - this.details = details; - } - - - public BinaryAdditionalResponse creation(@javax.annotation.Nullable OffsetDateTime creation) { - this.creation = creation; - return this; - } - - /** - * Get creation - * @return creation - */ - @javax.annotation.Nullable - public OffsetDateTime getCreation() { - return creation; - } - - public void setCreation(@javax.annotation.Nullable OffsetDateTime creation) { - this.creation = creation; - } - - /** - * 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 BinaryAdditionalResponse instance itself - */ - public BinaryAdditionalResponse 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; - } - BinaryAdditionalResponse binaryAdditionalResponse = (BinaryAdditionalResponse) o; - return Objects.equals(this.binaryId, binaryAdditionalResponse.binaryId) && - Objects.equals(this.details, binaryAdditionalResponse.details) && - Objects.equals(this.creation, binaryAdditionalResponse.creation)&& - Objects.equals(this.additionalProperties, binaryAdditionalResponse.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(binaryId, details, creation, 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 BinaryAdditionalResponse {\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("binary_id", "details", "creation")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("binary_id", "details")); - } - - /** - * 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 BinaryAdditionalResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BinaryAdditionalResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinaryAdditionalResponse is not found in the empty JSON string", BinaryAdditionalResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BinaryAdditionalResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) { - // validate the required field `details` - BinaryAdditionalDetailsDataResponse.validateJsonElement(jsonObj.get("details")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BinaryAdditionalResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BinaryAdditionalResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BinaryAdditionalResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BinaryAdditionalResponse 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 BinaryAdditionalResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BinaryAdditionalResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BinaryAdditionalResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BinaryAdditionalResponse - * @throws IOException if the JSON string is invalid with respect to BinaryAdditionalResponse - */ - public static BinaryAdditionalResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BinaryAdditionalResponse.class); - } - - /** - * Convert an instance of BinaryAdditionalResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinaryConfig.java b/src/main/java/ai/reveng/model/BinaryConfig.java deleted file mode 100644 index 34b6811..0000000 --- a/src/main/java/ai/reveng/model/BinaryConfig.java +++ /dev/null @@ -1,358 +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 ai.reveng.model.FileFormat; -import ai.reveng.model.ISA; -import ai.reveng.model.Platform; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BinaryConfig - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BinaryConfig { - public static final String SERIALIZED_NAME_ISA = "isa"; - @SerializedName(SERIALIZED_NAME_ISA) - @javax.annotation.Nullable - private ISA isa; - - public static final String SERIALIZED_NAME_PLATFORM = "platform"; - @SerializedName(SERIALIZED_NAME_PLATFORM) - @javax.annotation.Nullable - private Platform platform; - - public static final String SERIALIZED_NAME_FILE_FORMAT = "file_format"; - @SerializedName(SERIALIZED_NAME_FILE_FORMAT) - @javax.annotation.Nullable - private FileFormat fileFormat; - - public BinaryConfig() { - } - - public BinaryConfig isa(@javax.annotation.Nullable ISA isa) { - this.isa = isa; - return this; - } - - /** - * Instruction Set Architecture - * @return isa - */ - @javax.annotation.Nullable - public ISA getIsa() { - return isa; - } - - public void setIsa(@javax.annotation.Nullable ISA isa) { - this.isa = isa; - } - - - public BinaryConfig platform(@javax.annotation.Nullable Platform platform) { - this.platform = platform; - return this; - } - - /** - * Get platform - * @return platform - */ - @javax.annotation.Nullable - public Platform getPlatform() { - return platform; - } - - public void setPlatform(@javax.annotation.Nullable Platform platform) { - this.platform = platform; - } - - - public BinaryConfig fileFormat(@javax.annotation.Nullable FileFormat fileFormat) { - this.fileFormat = fileFormat; - return this; - } - - /** - * Get fileFormat - * @return fileFormat - */ - @javax.annotation.Nullable - public FileFormat getFileFormat() { - return fileFormat; - } - - public void setFileFormat(@javax.annotation.Nullable FileFormat fileFormat) { - this.fileFormat = fileFormat; - } - - /** - * 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 BinaryConfig instance itself - */ - public BinaryConfig 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; - } - BinaryConfig binaryConfig = (BinaryConfig) o; - return Objects.equals(this.isa, binaryConfig.isa) && - Objects.equals(this.platform, binaryConfig.platform) && - Objects.equals(this.fileFormat, binaryConfig.fileFormat)&& - Objects.equals(this.additionalProperties, binaryConfig.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(isa, platform, fileFormat, 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 BinaryConfig {\n"); - sb.append(" isa: ").append(toIndentedString(isa)).append("\n"); - sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); - sb.append(" fileFormat: ").append(toIndentedString(fileFormat)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("isa", "platform", "file_format")); - - // 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 BinaryConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BinaryConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinaryConfig is not found in the empty JSON string", BinaryConfig.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `isa` - if (jsonObj.get("isa") != null && !jsonObj.get("isa").isJsonNull()) { - ISA.validateJsonElement(jsonObj.get("isa")); - } - // validate the optional field `platform` - if (jsonObj.get("platform") != null && !jsonObj.get("platform").isJsonNull()) { - Platform.validateJsonElement(jsonObj.get("platform")); - } - // validate the optional field `file_format` - if (jsonObj.get("file_format") != null && !jsonObj.get("file_format").isJsonNull()) { - FileFormat.validateJsonElement(jsonObj.get("file_format")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BinaryConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BinaryConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BinaryConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BinaryConfig 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 BinaryConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BinaryConfig instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BinaryConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of BinaryConfig - * @throws IOException if the JSON string is invalid with respect to BinaryConfig - */ - public static BinaryConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BinaryConfig.class); - } - - /** - * Convert an instance of BinaryConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinaryDetailsResponse.java b/src/main/java/ai/reveng/model/BinaryDetailsResponse.java deleted file mode 100644 index 8d2a2d3..0000000 --- a/src/main/java/ai/reveng/model/BinaryDetailsResponse.java +++ /dev/null @@ -1,821 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BinaryDetailsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BinaryDetailsResponse { - public static final String SERIALIZED_NAME_ARCH = "arch"; - @SerializedName(SERIALIZED_NAME_ARCH) - @javax.annotation.Nonnull - private String arch; - - public static final String SERIALIZED_NAME_BITS = "bits"; - @SerializedName(SERIALIZED_NAME_BITS) - @javax.annotation.Nonnull - private Integer bits; - - public static final String SERIALIZED_NAME_CRC32 = "crc32"; - @SerializedName(SERIALIZED_NAME_CRC32) - @javax.annotation.Nonnull - private String crc32; - - public static final String SERIALIZED_NAME_PROPERTY_CLASS = "Class"; - @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) - @javax.annotation.Nonnull - private String propertyClass; - - public static final String SERIALIZED_NAME_ENTROPY = "entropy"; - @SerializedName(SERIALIZED_NAME_ENTROPY) - @javax.annotation.Nonnull - private BigDecimal entropy; - - public static final String SERIALIZED_NAME_FILE_SIZE = "file_size"; - @SerializedName(SERIALIZED_NAME_FILE_SIZE) - @javax.annotation.Nonnull - private Integer fileSize; - - public static final String SERIALIZED_NAME_LANGUAGE = "language"; - @SerializedName(SERIALIZED_NAME_LANGUAGE) - @javax.annotation.Nonnull - private String language; - - public static final String SERIALIZED_NAME_MD5 = "md5"; - @SerializedName(SERIALIZED_NAME_MD5) - @javax.annotation.Nonnull - private String md5; - - public static final String SERIALIZED_NAME_MACHINE = "machine"; - @SerializedName(SERIALIZED_NAME_MACHINE) - @javax.annotation.Nonnull - private String machine; - - public static final String SERIALIZED_NAME_OS = "os"; - @SerializedName(SERIALIZED_NAME_OS) - @javax.annotation.Nonnull - private String os; - - public static final String SERIALIZED_NAME_SHA1 = "sha1"; - @SerializedName(SERIALIZED_NAME_SHA1) - @javax.annotation.Nonnull - private String sha1; - - public static final String SERIALIZED_NAME_SHA256 = "sha256"; - @SerializedName(SERIALIZED_NAME_SHA256) - @javax.annotation.Nonnull - private String sha256; - - public static final String SERIALIZED_NAME_SSDEEP = "ssdeep"; - @SerializedName(SERIALIZED_NAME_SSDEEP) - @javax.annotation.Nullable - private String ssdeep; - - public static final String SERIALIZED_NAME_STATIC = "static"; - @SerializedName(SERIALIZED_NAME_STATIC) - @javax.annotation.Nonnull - private Boolean _static; - - public static final String SERIALIZED_NAME_STRIPPED = "stripped"; - @SerializedName(SERIALIZED_NAME_STRIPPED) - @javax.annotation.Nonnull - private Boolean stripped; - - public static final String SERIALIZED_NAME_SUB_SYS = "sub_sys"; - @SerializedName(SERIALIZED_NAME_SUB_SYS) - @javax.annotation.Nonnull - private String subSys; - - public static final String SERIALIZED_NAME_TLSH = "tlsh"; - @SerializedName(SERIALIZED_NAME_TLSH) - @javax.annotation.Nonnull - private String tlsh; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_DEBUG = "debug"; - @SerializedName(SERIALIZED_NAME_DEBUG) - @javax.annotation.Nonnull - private Boolean debug; - - public static final String SERIALIZED_NAME_FIRST_SEEN = "first_seen"; - @SerializedName(SERIALIZED_NAME_FIRST_SEEN) - @javax.annotation.Nonnull - private OffsetDateTime firstSeen; - - public BinaryDetailsResponse() { - } - - public BinaryDetailsResponse arch(@javax.annotation.Nonnull String arch) { - this.arch = arch; - return this; - } - - /** - * The architecture of the binary - * @return arch - */ - @javax.annotation.Nonnull - public String getArch() { - return arch; - } - - public void setArch(@javax.annotation.Nonnull String arch) { - this.arch = arch; - } - - - public BinaryDetailsResponse bits(@javax.annotation.Nonnull Integer bits) { - this.bits = bits; - return this; - } - - /** - * The size of the binary in bits - * @return bits - */ - @javax.annotation.Nonnull - public Integer getBits() { - return bits; - } - - public void setBits(@javax.annotation.Nonnull Integer bits) { - this.bits = bits; - } - - - public BinaryDetailsResponse crc32(@javax.annotation.Nonnull String crc32) { - this.crc32 = crc32; - return this; - } - - /** - * Get crc32 - * @return crc32 - */ - @javax.annotation.Nonnull - public String getCrc32() { - return crc32; - } - - public void setCrc32(@javax.annotation.Nonnull String crc32) { - this.crc32 = crc32; - } - - - public BinaryDetailsResponse propertyClass(@javax.annotation.Nonnull String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - @javax.annotation.Nonnull - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(@javax.annotation.Nonnull String propertyClass) { - this.propertyClass = propertyClass; - } - - - public BinaryDetailsResponse entropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; - return this; - } - - /** - * Get entropy - * @return entropy - */ - @javax.annotation.Nonnull - public BigDecimal getEntropy() { - return entropy; - } - - public void setEntropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; - } - - - public BinaryDetailsResponse fileSize(@javax.annotation.Nonnull Integer fileSize) { - this.fileSize = fileSize; - return this; - } - - /** - * Get fileSize - * @return fileSize - */ - @javax.annotation.Nonnull - public Integer getFileSize() { - return fileSize; - } - - public void setFileSize(@javax.annotation.Nonnull Integer fileSize) { - this.fileSize = fileSize; - } - - - public BinaryDetailsResponse language(@javax.annotation.Nonnull String language) { - this.language = language; - return this; - } - - /** - * - * @return language - */ - @javax.annotation.Nonnull - public String getLanguage() { - return language; - } - - public void setLanguage(@javax.annotation.Nonnull String language) { - this.language = language; - } - - - public BinaryDetailsResponse md5(@javax.annotation.Nonnull String md5) { - this.md5 = md5; - return this; - } - - /** - * Get md5 - * @return md5 - */ - @javax.annotation.Nonnull - public String getMd5() { - return md5; - } - - public void setMd5(@javax.annotation.Nonnull String md5) { - this.md5 = md5; - } - - - public BinaryDetailsResponse machine(@javax.annotation.Nonnull String machine) { - this.machine = machine; - return this; - } - - /** - * Get machine - * @return machine - */ - @javax.annotation.Nonnull - public String getMachine() { - return machine; - } - - public void setMachine(@javax.annotation.Nonnull String machine) { - this.machine = machine; - } - - - public BinaryDetailsResponse os(@javax.annotation.Nonnull String os) { - this.os = os; - return this; - } - - /** - * OS target of the binary - * @return os - */ - @javax.annotation.Nonnull - public String getOs() { - return os; - } - - public void setOs(@javax.annotation.Nonnull String os) { - this.os = os; - } - - - public BinaryDetailsResponse sha1(@javax.annotation.Nonnull String sha1) { - this.sha1 = sha1; - return this; - } - - /** - * SHA1 hash of the binary - * @return sha1 - */ - @javax.annotation.Nonnull - public String getSha1() { - return sha1; - } - - public void setSha1(@javax.annotation.Nonnull String sha1) { - this.sha1 = sha1; - } - - - public BinaryDetailsResponse sha256(@javax.annotation.Nonnull String sha256) { - this.sha256 = sha256; - return this; - } - - /** - * SHA256 hash of the binary - * @return sha256 - */ - @javax.annotation.Nonnull - public String getSha256() { - return sha256; - } - - public void setSha256(@javax.annotation.Nonnull String sha256) { - this.sha256 = sha256; - } - - - public BinaryDetailsResponse ssdeep(@javax.annotation.Nullable String ssdeep) { - this.ssdeep = ssdeep; - return this; - } - - /** - * Get ssdeep - * @return ssdeep - */ - @javax.annotation.Nullable - public String getSsdeep() { - return ssdeep; - } - - public void setSsdeep(@javax.annotation.Nullable String ssdeep) { - this.ssdeep = ssdeep; - } - - - public BinaryDetailsResponse _static(@javax.annotation.Nonnull Boolean _static) { - this._static = _static; - return this; - } - - /** - * Get _static - * @return _static - */ - @javax.annotation.Nonnull - public Boolean getStatic() { - return _static; - } - - public void setStatic(@javax.annotation.Nonnull Boolean _static) { - this._static = _static; - } - - - public BinaryDetailsResponse stripped(@javax.annotation.Nonnull Boolean stripped) { - this.stripped = stripped; - return this; - } - - /** - * Get stripped - * @return stripped - */ - @javax.annotation.Nonnull - public Boolean getStripped() { - return stripped; - } - - public void setStripped(@javax.annotation.Nonnull Boolean stripped) { - this.stripped = stripped; - } - - - public BinaryDetailsResponse subSys(@javax.annotation.Nonnull String subSys) { - this.subSys = subSys; - return this; - } - - /** - * Get subSys - * @return subSys - */ - @javax.annotation.Nonnull - public String getSubSys() { - return subSys; - } - - public void setSubSys(@javax.annotation.Nonnull String subSys) { - this.subSys = subSys; - } - - - public BinaryDetailsResponse tlsh(@javax.annotation.Nonnull String tlsh) { - this.tlsh = tlsh; - return this; - } - - /** - * Get tlsh - * @return tlsh - */ - @javax.annotation.Nonnull - public String getTlsh() { - return tlsh; - } - - public void setTlsh(@javax.annotation.Nonnull String tlsh) { - this.tlsh = tlsh; - } - - - public BinaryDetailsResponse type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public BinaryDetailsResponse debug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - return this; - } - - /** - * Get debug - * @return debug - */ - @javax.annotation.Nonnull - public Boolean getDebug() { - return debug; - } - - public void setDebug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - } - - - public BinaryDetailsResponse firstSeen(@javax.annotation.Nonnull OffsetDateTime firstSeen) { - this.firstSeen = firstSeen; - return this; - } - - /** - * Get firstSeen - * @return firstSeen - */ - @javax.annotation.Nonnull - public OffsetDateTime getFirstSeen() { - return firstSeen; - } - - public void setFirstSeen(@javax.annotation.Nonnull OffsetDateTime firstSeen) { - this.firstSeen = firstSeen; - } - - /** - * 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 BinaryDetailsResponse instance itself - */ - public BinaryDetailsResponse 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; - } - BinaryDetailsResponse binaryDetailsResponse = (BinaryDetailsResponse) o; - return Objects.equals(this.arch, binaryDetailsResponse.arch) && - Objects.equals(this.bits, binaryDetailsResponse.bits) && - Objects.equals(this.crc32, binaryDetailsResponse.crc32) && - Objects.equals(this.propertyClass, binaryDetailsResponse.propertyClass) && - Objects.equals(this.entropy, binaryDetailsResponse.entropy) && - Objects.equals(this.fileSize, binaryDetailsResponse.fileSize) && - Objects.equals(this.language, binaryDetailsResponse.language) && - Objects.equals(this.md5, binaryDetailsResponse.md5) && - Objects.equals(this.machine, binaryDetailsResponse.machine) && - Objects.equals(this.os, binaryDetailsResponse.os) && - Objects.equals(this.sha1, binaryDetailsResponse.sha1) && - Objects.equals(this.sha256, binaryDetailsResponse.sha256) && - Objects.equals(this.ssdeep, binaryDetailsResponse.ssdeep) && - Objects.equals(this._static, binaryDetailsResponse._static) && - Objects.equals(this.stripped, binaryDetailsResponse.stripped) && - Objects.equals(this.subSys, binaryDetailsResponse.subSys) && - Objects.equals(this.tlsh, binaryDetailsResponse.tlsh) && - Objects.equals(this.type, binaryDetailsResponse.type) && - Objects.equals(this.debug, binaryDetailsResponse.debug) && - Objects.equals(this.firstSeen, binaryDetailsResponse.firstSeen)&& - Objects.equals(this.additionalProperties, binaryDetailsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(arch, bits, crc32, propertyClass, entropy, fileSize, language, md5, machine, os, sha1, sha256, ssdeep, _static, stripped, subSys, tlsh, type, debug, firstSeen, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BinaryDetailsResponse {\n"); - sb.append(" arch: ").append(toIndentedString(arch)).append("\n"); - sb.append(" bits: ").append(toIndentedString(bits)).append("\n"); - sb.append(" crc32: ").append(toIndentedString(crc32)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append(" entropy: ").append(toIndentedString(entropy)).append("\n"); - sb.append(" fileSize: ").append(toIndentedString(fileSize)).append("\n"); - sb.append(" language: ").append(toIndentedString(language)).append("\n"); - sb.append(" md5: ").append(toIndentedString(md5)).append("\n"); - sb.append(" machine: ").append(toIndentedString(machine)).append("\n"); - sb.append(" os: ").append(toIndentedString(os)).append("\n"); - sb.append(" sha1: ").append(toIndentedString(sha1)).append("\n"); - sb.append(" sha256: ").append(toIndentedString(sha256)).append("\n"); - sb.append(" ssdeep: ").append(toIndentedString(ssdeep)).append("\n"); - sb.append(" _static: ").append(toIndentedString(_static)).append("\n"); - sb.append(" stripped: ").append(toIndentedString(stripped)).append("\n"); - sb.append(" subSys: ").append(toIndentedString(subSys)).append("\n"); - sb.append(" tlsh: ").append(toIndentedString(tlsh)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); - sb.append(" firstSeen: ").append(toIndentedString(firstSeen)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("arch", "bits", "crc32", "Class", "entropy", "file_size", "language", "md5", "machine", "os", "sha1", "sha256", "ssdeep", "static", "stripped", "sub_sys", "tlsh", "type", "debug", "first_seen")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("arch", "bits", "crc32", "Class", "entropy", "file_size", "language", "md5", "machine", "os", "sha1", "sha256", "ssdeep", "static", "stripped", "sub_sys", "tlsh", "type", "debug", "first_seen")); - } - - /** - * 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 BinaryDetailsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BinaryDetailsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinaryDetailsResponse is not found in the empty JSON string", BinaryDetailsResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BinaryDetailsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("arch").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `arch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("arch").toString())); - } - if (!jsonObj.get("crc32").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `crc32` to be a primitive type in the JSON string but got `%s`", jsonObj.get("crc32").toString())); - } - if (!jsonObj.get("Class").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `Class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Class").toString())); - } - if (!jsonObj.get("language").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); - } - if (!jsonObj.get("md5").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `md5` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md5").toString())); - } - if (!jsonObj.get("machine").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `machine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("machine").toString())); - } - if (!jsonObj.get("os").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); - } - if (!jsonObj.get("sha1").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha1").toString())); - } - if (!jsonObj.get("sha256").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.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("ssdeep") != null && !jsonObj.get("ssdeep").isJsonNull()) && !jsonObj.get("ssdeep").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ssdeep` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ssdeep").toString())); - } - if (!jsonObj.get("sub_sys").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sub_sys` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sub_sys").toString())); - } - if (!jsonObj.get("tlsh").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tlsh` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tlsh").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BinaryDetailsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BinaryDetailsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BinaryDetailsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BinaryDetailsResponse 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 BinaryDetailsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BinaryDetailsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BinaryDetailsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BinaryDetailsResponse - * @throws IOException if the JSON string is invalid with respect to BinaryDetailsResponse - */ - public static BinaryDetailsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BinaryDetailsResponse.class); - } - - /** - * Convert an instance of BinaryDetailsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinaryExternalsResponse.java b/src/main/java/ai/reveng/model/BinaryExternalsResponse.java deleted file mode 100644 index dfa3ede..0000000 --- a/src/main/java/ai/reveng/model/BinaryExternalsResponse.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 com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BinaryExternalsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BinaryExternalsResponse { - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_VT = "vt"; - @SerializedName(SERIALIZED_NAME_VT) - @javax.annotation.Nonnull - private Map vt = new HashMap<>(); - - public static final String SERIALIZED_NAME_VT_LAST_UPDATED = "vt_last_updated"; - @SerializedName(SERIALIZED_NAME_VT_LAST_UPDATED) - @javax.annotation.Nonnull - private OffsetDateTime vtLastUpdated; - - public static final String SERIALIZED_NAME_MB = "mb"; - @SerializedName(SERIALIZED_NAME_MB) - @javax.annotation.Nonnull - private Map mb = new HashMap<>(); - - public static final String SERIALIZED_NAME_MB_LAST_UPDATED = "mb_last_updated"; - @SerializedName(SERIALIZED_NAME_MB_LAST_UPDATED) - @javax.annotation.Nonnull - private OffsetDateTime mbLastUpdated; - - public BinaryExternalsResponse() { - } - - public BinaryExternalsResponse sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * SHA256 hash of the binary - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public BinaryExternalsResponse vt(@javax.annotation.Nonnull Map vt) { - this.vt = vt; - return this; - } - - public BinaryExternalsResponse putVtItem(String key, Object vtItem) { - if (this.vt == null) { - this.vt = new HashMap<>(); - } - this.vt.put(key, vtItem); - return this; - } - - /** - * VirusTotal information - * @return vt - */ - @javax.annotation.Nonnull - public Map getVt() { - return vt; - } - - public void setVt(@javax.annotation.Nonnull Map vt) { - this.vt = vt; - } - - - public BinaryExternalsResponse vtLastUpdated(@javax.annotation.Nonnull OffsetDateTime vtLastUpdated) { - this.vtLastUpdated = vtLastUpdated; - return this; - } - - /** - * VirusTotal last updated date - * @return vtLastUpdated - */ - @javax.annotation.Nonnull - public OffsetDateTime getVtLastUpdated() { - return vtLastUpdated; - } - - public void setVtLastUpdated(@javax.annotation.Nonnull OffsetDateTime vtLastUpdated) { - this.vtLastUpdated = vtLastUpdated; - } - - - public BinaryExternalsResponse mb(@javax.annotation.Nonnull Map mb) { - this.mb = mb; - return this; - } - - public BinaryExternalsResponse putMbItem(String key, Object mbItem) { - if (this.mb == null) { - this.mb = new HashMap<>(); - } - this.mb.put(key, mbItem); - return this; - } - - /** - * MalwareBazaar information - * @return mb - */ - @javax.annotation.Nonnull - public Map getMb() { - return mb; - } - - public void setMb(@javax.annotation.Nonnull Map mb) { - this.mb = mb; - } - - - public BinaryExternalsResponse mbLastUpdated(@javax.annotation.Nonnull OffsetDateTime mbLastUpdated) { - this.mbLastUpdated = mbLastUpdated; - return this; - } - - /** - * MalwareBazaar last updated date - * @return mbLastUpdated - */ - @javax.annotation.Nonnull - public OffsetDateTime getMbLastUpdated() { - return mbLastUpdated; - } - - public void setMbLastUpdated(@javax.annotation.Nonnull OffsetDateTime mbLastUpdated) { - this.mbLastUpdated = mbLastUpdated; - } - - /** - * 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 BinaryExternalsResponse instance itself - */ - public BinaryExternalsResponse 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; - } - BinaryExternalsResponse binaryExternalsResponse = (BinaryExternalsResponse) o; - return Objects.equals(this.sha256Hash, binaryExternalsResponse.sha256Hash) && - Objects.equals(this.vt, binaryExternalsResponse.vt) && - Objects.equals(this.vtLastUpdated, binaryExternalsResponse.vtLastUpdated) && - Objects.equals(this.mb, binaryExternalsResponse.mb) && - Objects.equals(this.mbLastUpdated, binaryExternalsResponse.mbLastUpdated)&& - Objects.equals(this.additionalProperties, binaryExternalsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(sha256Hash, vt, vtLastUpdated, mb, mbLastUpdated, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BinaryExternalsResponse {\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" vt: ").append(toIndentedString(vt)).append("\n"); - sb.append(" vtLastUpdated: ").append(toIndentedString(vtLastUpdated)).append("\n"); - sb.append(" mb: ").append(toIndentedString(mb)).append("\n"); - sb.append(" mbLastUpdated: ").append(toIndentedString(mbLastUpdated)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("sha_256_hash", "vt", "vt_last_updated", "mb", "mb_last_updated")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("sha_256_hash", "vt", "vt_last_updated", "mb", "mb_last_updated")); - } - - /** - * 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 BinaryExternalsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BinaryExternalsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinaryExternalsResponse is not found in the empty JSON string", BinaryExternalsResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BinaryExternalsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BinaryExternalsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BinaryExternalsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BinaryExternalsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BinaryExternalsResponse 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 BinaryExternalsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BinaryExternalsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BinaryExternalsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BinaryExternalsResponse - * @throws IOException if the JSON string is invalid with respect to BinaryExternalsResponse - */ - public static BinaryExternalsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BinaryExternalsResponse.class); - } - - /** - * Convert an instance of BinaryExternalsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinarySearchResponse.java b/src/main/java/ai/reveng/model/BinarySearchResponse.java deleted file mode 100644 index 2eb6adb..0000000 --- a/src/main/java/ai/reveng/model/BinarySearchResponse.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.BinarySearchResult; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BinarySearchResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BinarySearchResponse { - public static final String SERIALIZED_NAME_RESULTS = "results"; - @SerializedName(SERIALIZED_NAME_RESULTS) - @javax.annotation.Nonnull - private List results = new ArrayList<>(); - - public BinarySearchResponse() { - } - - public BinarySearchResponse results(@javax.annotation.Nonnull List results) { - this.results = results; - return this; - } - - public BinarySearchResponse addResultsItem(BinarySearchResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * The results of the search - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(@javax.annotation.Nonnull List results) { - this.results = results; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the BinarySearchResponse instance itself - */ - public BinarySearchResponse 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; - } - BinarySearchResponse binarySearchResponse = (BinarySearchResponse) o; - return Objects.equals(this.results, binarySearchResponse.results)&& - Objects.equals(this.additionalProperties, binarySearchResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(results, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BinarySearchResponse {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("results")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("results")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BinarySearchResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BinarySearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinarySearchResponse is not found in the empty JSON string", BinarySearchResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BinarySearchResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("results") != null) { - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); - } - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - BinarySearchResult.validateJsonElement(jsonArrayresults.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BinarySearchResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BinarySearchResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BinarySearchResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BinarySearchResponse 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 BinarySearchResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BinarySearchResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BinarySearchResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of BinarySearchResponse - * @throws IOException if the JSON string is invalid with respect to BinarySearchResponse - */ - public static BinarySearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BinarySearchResponse.class); - } - - /** - * Convert an instance of BinarySearchResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinarySearchResult.java b/src/main/java/ai/reveng/model/BinarySearchResult.java deleted file mode 100644 index 610c3e2..0000000 --- a/src/main/java/ai/reveng/model/BinarySearchResult.java +++ /dev/null @@ -1,523 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BinarySearchResult - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BinarySearchResult { - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nullable - private List tags; - - 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_MODEL_ID = "model_id"; - @SerializedName(SERIALIZED_NAME_MODEL_ID) - @javax.annotation.Nonnull - private Integer modelId; - - public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; - @SerializedName(SERIALIZED_NAME_MODEL_NAME) - @javax.annotation.Nonnull - private String modelName; - - public static final String SERIALIZED_NAME_OWNED_BY = "owned_by"; - @SerializedName(SERIALIZED_NAME_OWNED_BY) - @javax.annotation.Nonnull - private String ownedBy; - - public BinarySearchResult() { - } - - public BinarySearchResult binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * The binary ID - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public BinarySearchResult binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * The name of the binary - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public BinarySearchResult analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * The analysis ID - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public BinarySearchResult sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * The SHA-256 hash of the binary - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public BinarySearchResult tags(@javax.annotation.Nullable List tags) { - this.tags = tags; - return this; - } - - public BinarySearchResult addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * The tags of the binary - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nullable List tags) { - this.tags = tags; - } - - - public BinarySearchResult createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The creation date of the binary - * @return createdAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public BinarySearchResult modelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - return this; - } - - /** - * The model ID of the binary - * @return modelId - */ - @javax.annotation.Nonnull - public Integer getModelId() { - return modelId; - } - - public void setModelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - } - - - public BinarySearchResult modelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - return this; - } - - /** - * The name of the model - * @return modelName - */ - @javax.annotation.Nonnull - public String getModelName() { - return modelName; - } - - public void setModelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - } - - - public BinarySearchResult ownedBy(@javax.annotation.Nonnull String ownedBy) { - this.ownedBy = ownedBy; - return this; - } - - /** - * The owner of the binary - * @return ownedBy - */ - @javax.annotation.Nonnull - public String getOwnedBy() { - return ownedBy; - } - - public void setOwnedBy(@javax.annotation.Nonnull String ownedBy) { - this.ownedBy = ownedBy; - } - - /** - * 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 BinarySearchResult instance itself - */ - public BinarySearchResult 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; - } - BinarySearchResult binarySearchResult = (BinarySearchResult) o; - return Objects.equals(this.binaryId, binarySearchResult.binaryId) && - Objects.equals(this.binaryName, binarySearchResult.binaryName) && - Objects.equals(this.analysisId, binarySearchResult.analysisId) && - Objects.equals(this.sha256Hash, binarySearchResult.sha256Hash) && - Objects.equals(this.tags, binarySearchResult.tags) && - Objects.equals(this.createdAt, binarySearchResult.createdAt) && - Objects.equals(this.modelId, binarySearchResult.modelId) && - Objects.equals(this.modelName, binarySearchResult.modelName) && - Objects.equals(this.ownedBy, binarySearchResult.ownedBy)&& - Objects.equals(this.additionalProperties, binarySearchResult.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(binaryId, binaryName, analysisId, sha256Hash, tags, createdAt, modelId, modelName, ownedBy, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BinarySearchResult {\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); - sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); - sb.append(" ownedBy: ").append(toIndentedString(ownedBy)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("binary_id", "binary_name", "analysis_id", "sha_256_hash", "tags", "created_at", "model_id", "model_name", "owned_by")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("binary_id", "binary_name", "analysis_id", "sha_256_hash", "tags", "created_at", "model_id", "model_name", "owned_by")); - } - - /** - * 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 BinarySearchResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BinarySearchResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BinarySearchResult is not found in the empty JSON string", BinarySearchResult.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BinarySearchResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - // ensure the required json array is present - if (jsonObj.get("tags") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("tags").isJsonArray() && !jsonObj.get("tags").isJsonNull()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - if (!jsonObj.get("model_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); - } - if (!jsonObj.get("owned_by").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `owned_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owned_by").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BinarySearchResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BinarySearchResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BinarySearchResult.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BinarySearchResult 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 BinarySearchResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BinarySearchResult instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BinarySearchResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of BinarySearchResult - * @throws IOException if the JSON string is invalid with respect to BinarySearchResult - */ - public static BinarySearchResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BinarySearchResult.class); - } - - /** - * Convert an instance of BinarySearchResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/BinaryTaskStatus.java b/src/main/java/ai/reveng/model/BinaryTaskStatus.java deleted file mode 100644 index d4fb4f5..0000000 --- a/src/main/java/ai/reveng/model/BinaryTaskStatus.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets BinaryTaskStatus - */ -@JsonAdapter(BinaryTaskStatus.Adapter.class) -public enum BinaryTaskStatus { - - UNINITIALISED("UNINITIALISED"), - - PENDING("PENDING"), - - RUNNING("RUNNING"), - - COMPLETED("COMPLETED"), - - FAILED("FAILED"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - BinaryTaskStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static BinaryTaskStatus fromValue(String value) { - for (BinaryTaskStatus b : BinaryTaskStatus.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final BinaryTaskStatus enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public BinaryTaskStatus read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return BinaryTaskStatus.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - BinaryTaskStatus.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/BulkCreateUserResult.java b/src/main/java/ai/reveng/model/BulkCreateUserResult.java index 7e5369b..01fb8fa 100644 --- a/src/main/java/ai/reveng/model/BulkCreateUserResult.java +++ b/src/main/java/ai/reveng/model/BulkCreateUserResult.java @@ -52,7 +52,7 @@ public class BulkCreateUserResult { public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String email; public static final String SERIALIZED_NAME_ERROR = "error"; @@ -77,27 +77,27 @@ public class BulkCreateUserResult { public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String username; public BulkCreateUserResult() { } - public BulkCreateUserResult email(@javax.annotation.Nullable String email) { + public BulkCreateUserResult email(@javax.annotation.Nonnull String email) { this.email = email; return this; } /** - * Search is applied to string value + * Get email * @return email */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getEmail() { return email; } - public void setEmail(@javax.annotation.Nullable String email) { + public void setEmail(@javax.annotation.Nonnull String email) { this.email = email; } @@ -178,21 +178,21 @@ public void setUser(@javax.annotation.Nullable User user) { } - public BulkCreateUserResult username(@javax.annotation.Nullable String username) { + public BulkCreateUserResult username(@javax.annotation.Nonnull String username) { this.username = username; return this; } /** - * Search is applied to string value + * Get username * @return username */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getUsername() { return username; } - public void setUsername(@javax.annotation.Nullable String username) { + public void setUsername(@javax.annotation.Nonnull String username) { this.username = username; } @@ -320,7 +320,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + if (!jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { @@ -330,7 +330,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("user") != null && !jsonObj.get("user").isJsonNull()) { User.validateJsonElement(jsonObj.get("user")); } - if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + if (!jsonObj.get("username").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/ai/reveng/model/BulkDeleteAnalysesRequest.java b/src/main/java/ai/reveng/model/BulkDeleteAnalysesRequest.java deleted file mode 100644 index befbeed..0000000 --- a/src/main/java/ai/reveng/model/BulkDeleteAnalysesRequest.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * BulkDeleteAnalysesRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BulkDeleteAnalysesRequest { - public static final String SERIALIZED_NAME_ANALYSIS_IDS = "analysis_ids"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_IDS) - @javax.annotation.Nonnull - private List analysisIds = new ArrayList<>(); - - public BulkDeleteAnalysesRequest() { - } - - public BulkDeleteAnalysesRequest analysisIds(@javax.annotation.Nonnull List analysisIds) { - this.analysisIds = analysisIds; - return this; - } - - public BulkDeleteAnalysesRequest addAnalysisIdsItem(Integer analysisIdsItem) { - if (this.analysisIds == null) { - this.analysisIds = new ArrayList<>(); - } - this.analysisIds.add(analysisIdsItem); - return this; - } - - /** - * Get analysisIds - * @return analysisIds - */ - @javax.annotation.Nonnull - public List getAnalysisIds() { - return analysisIds; - } - - public void setAnalysisIds(@javax.annotation.Nonnull List analysisIds) { - this.analysisIds = analysisIds; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the BulkDeleteAnalysesRequest instance itself - */ - public BulkDeleteAnalysesRequest 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; - } - BulkDeleteAnalysesRequest bulkDeleteAnalysesRequest = (BulkDeleteAnalysesRequest) o; - return Objects.equals(this.analysisIds, bulkDeleteAnalysesRequest.analysisIds)&& - Objects.equals(this.additionalProperties, bulkDeleteAnalysesRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(analysisIds, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkDeleteAnalysesRequest {\n"); - sb.append(" analysisIds: ").append(toIndentedString(analysisIds)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_ids")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_ids")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BulkDeleteAnalysesRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!BulkDeleteAnalysesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BulkDeleteAnalysesRequest is not found in the empty JSON string", BulkDeleteAnalysesRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BulkDeleteAnalysesRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("analysis_ids") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("analysis_ids").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_ids` to be an array in the JSON string but got `%s`", jsonObj.get("analysis_ids").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BulkDeleteAnalysesRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BulkDeleteAnalysesRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BulkDeleteAnalysesRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BulkDeleteAnalysesRequest 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 BulkDeleteAnalysesRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - BulkDeleteAnalysesRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of BulkDeleteAnalysesRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of BulkDeleteAnalysesRequest - * @throws IOException if the JSON string is invalid with respect to BulkDeleteAnalysesRequest - */ - public static BulkDeleteAnalysesRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BulkDeleteAnalysesRequest.class); - } - - /** - * Convert an instance of BulkDeleteAnalysesRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CalleeFunctionInfo.java b/src/main/java/ai/reveng/model/CalleeFunctionInfo.java deleted file mode 100644 index c9ebc73..0000000 --- a/src/main/java/ai/reveng/model/CalleeFunctionInfo.java +++ /dev/null @@ -1,425 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CalleeFunctionInfo - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CalleeFunctionInfo { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public static final String SERIALIZED_NAME_MATCHED_FUNCTION_ID = "matched_function_id"; - @SerializedName(SERIALIZED_NAME_MATCHED_FUNCTION_ID) - @javax.annotation.Nullable - private Integer matchedFunctionId; - - public static final String SERIALIZED_NAME_DASHBOARD_URL = "dashboard_url"; - @SerializedName(SERIALIZED_NAME_DASHBOARD_URL) - @javax.annotation.Nullable - private String dashboardUrl; - - public static final String SERIALIZED_NAME_IS_EXTERNAL = "is_external"; - @SerializedName(SERIALIZED_NAME_IS_EXTERNAL) - @javax.annotation.Nullable - private Boolean isExternal = false; - - public static final String SERIALIZED_NAME_CALLEE_NAME = "callee_name"; - @SerializedName(SERIALIZED_NAME_CALLEE_NAME) - @javax.annotation.Nonnull - private String calleeName; - - public static final String SERIALIZED_NAME_CALLEE_VADDR = "callee_vaddr"; - @SerializedName(SERIALIZED_NAME_CALLEE_VADDR) - @javax.annotation.Nonnull - private String calleeVaddr; - - public CalleeFunctionInfo() { - } - - public CalleeFunctionInfo functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Unique identifier of the function - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public CalleeFunctionInfo matchedFunctionId(@javax.annotation.Nullable Integer matchedFunctionId) { - this.matchedFunctionId = matchedFunctionId; - return this; - } - - /** - * Unique identifier of the matched function - * @return matchedFunctionId - */ - @javax.annotation.Nullable - public Integer getMatchedFunctionId() { - return matchedFunctionId; - } - - public void setMatchedFunctionId(@javax.annotation.Nullable Integer matchedFunctionId) { - this.matchedFunctionId = matchedFunctionId; - } - - - public CalleeFunctionInfo dashboardUrl(@javax.annotation.Nullable String dashboardUrl) { - this.dashboardUrl = dashboardUrl; - return this; - } - - /** - * Get dashboardUrl - * @return dashboardUrl - */ - @javax.annotation.Nullable - public String getDashboardUrl() { - return dashboardUrl; - } - - public void setDashboardUrl(@javax.annotation.Nullable String dashboardUrl) { - this.dashboardUrl = dashboardUrl; - } - - - public CalleeFunctionInfo isExternal(@javax.annotation.Nullable Boolean isExternal) { - this.isExternal = isExternal; - return this; - } - - /** - * Indicates if the function is external - * @return isExternal - */ - @javax.annotation.Nullable - public Boolean getIsExternal() { - return isExternal; - } - - public void setIsExternal(@javax.annotation.Nullable Boolean isExternal) { - this.isExternal = isExternal; - } - - - public CalleeFunctionInfo calleeName(@javax.annotation.Nonnull String calleeName) { - this.calleeName = calleeName; - return this; - } - - /** - * Name of the called function - * @return calleeName - */ - @javax.annotation.Nonnull - public String getCalleeName() { - return calleeName; - } - - public void setCalleeName(@javax.annotation.Nonnull String calleeName) { - this.calleeName = calleeName; - } - - - public CalleeFunctionInfo calleeVaddr(@javax.annotation.Nonnull String calleeVaddr) { - this.calleeVaddr = calleeVaddr; - return this; - } - - /** - * Virtual address of the called function - * @return calleeVaddr - */ - @javax.annotation.Nonnull - public String getCalleeVaddr() { - return calleeVaddr; - } - - public void setCalleeVaddr(@javax.annotation.Nonnull String calleeVaddr) { - this.calleeVaddr = calleeVaddr; - } - - /** - * 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 CalleeFunctionInfo instance itself - */ - public CalleeFunctionInfo 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; - } - CalleeFunctionInfo calleeFunctionInfo = (CalleeFunctionInfo) o; - return Objects.equals(this.functionId, calleeFunctionInfo.functionId) && - Objects.equals(this.matchedFunctionId, calleeFunctionInfo.matchedFunctionId) && - Objects.equals(this.dashboardUrl, calleeFunctionInfo.dashboardUrl) && - Objects.equals(this.isExternal, calleeFunctionInfo.isExternal) && - Objects.equals(this.calleeName, calleeFunctionInfo.calleeName) && - Objects.equals(this.calleeVaddr, calleeFunctionInfo.calleeVaddr)&& - Objects.equals(this.additionalProperties, calleeFunctionInfo.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, matchedFunctionId, dashboardUrl, isExternal, calleeName, calleeVaddr, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CalleeFunctionInfo {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" matchedFunctionId: ").append(toIndentedString(matchedFunctionId)).append("\n"); - sb.append(" dashboardUrl: ").append(toIndentedString(dashboardUrl)).append("\n"); - sb.append(" isExternal: ").append(toIndentedString(isExternal)).append("\n"); - sb.append(" calleeName: ").append(toIndentedString(calleeName)).append("\n"); - sb.append(" calleeVaddr: ").append(toIndentedString(calleeVaddr)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "matched_function_id", "dashboard_url", "is_external", "callee_name", "callee_vaddr")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "matched_function_id", "dashboard_url", "callee_name", "callee_vaddr")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CalleeFunctionInfo - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CalleeFunctionInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CalleeFunctionInfo is not found in the empty JSON string", CalleeFunctionInfo.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CalleeFunctionInfo.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("dashboard_url") != null && !jsonObj.get("dashboard_url").isJsonNull()) && !jsonObj.get("dashboard_url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `dashboard_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dashboard_url").toString())); - } - if (!jsonObj.get("callee_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `callee_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("callee_name").toString())); - } - if (!jsonObj.get("callee_vaddr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `callee_vaddr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("callee_vaddr").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CalleeFunctionInfo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CalleeFunctionInfo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CalleeFunctionInfo.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CalleeFunctionInfo 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 CalleeFunctionInfo read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CalleeFunctionInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CalleeFunctionInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of CalleeFunctionInfo - * @throws IOException if the JSON string is invalid with respect to CalleeFunctionInfo - */ - public static CalleeFunctionInfo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CalleeFunctionInfo.class); - } - - /** - * Convert an instance of CalleeFunctionInfo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CalleesCallerFunctionsResponse.java b/src/main/java/ai/reveng/model/CalleesCallerFunctionsResponse.java deleted file mode 100644 index 43f1aa5..0000000 --- a/src/main/java/ai/reveng/model/CalleesCallerFunctionsResponse.java +++ /dev/null @@ -1,379 +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 ai.reveng.model.CalleeFunctionInfo; -import ai.reveng.model.CallerFunctionInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CalleesCallerFunctionsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CalleesCallerFunctionsResponse { - public static final String SERIALIZED_NAME_BASE_ADDRESS = "base_address"; - @SerializedName(SERIALIZED_NAME_BASE_ADDRESS) - @javax.annotation.Nonnull - private BigInteger baseAddress; - - public static final String SERIALIZED_NAME_CALLEES = "callees"; - @SerializedName(SERIALIZED_NAME_CALLEES) - @javax.annotation.Nonnull - private List callees = new ArrayList<>(); - - public static final String SERIALIZED_NAME_CALLERS = "callers"; - @SerializedName(SERIALIZED_NAME_CALLERS) - @javax.annotation.Nonnull - private List callers = new ArrayList<>(); - - public CalleesCallerFunctionsResponse() { - } - - public CalleesCallerFunctionsResponse baseAddress(@javax.annotation.Nonnull BigInteger baseAddress) { - this.baseAddress = baseAddress; - return this; - } - - /** - * Base address of the binary - * @return baseAddress - */ - @javax.annotation.Nonnull - public BigInteger getBaseAddress() { - return baseAddress; - } - - public void setBaseAddress(@javax.annotation.Nonnull BigInteger baseAddress) { - this.baseAddress = baseAddress; - } - - - public CalleesCallerFunctionsResponse callees(@javax.annotation.Nonnull List callees) { - this.callees = callees; - return this; - } - - public CalleesCallerFunctionsResponse addCalleesItem(CalleeFunctionInfo calleesItem) { - if (this.callees == null) { - this.callees = new ArrayList<>(); - } - this.callees.add(calleesItem); - return this; - } - - /** - * List of functions called by the target function - * @return callees - */ - @javax.annotation.Nonnull - public List getCallees() { - return callees; - } - - public void setCallees(@javax.annotation.Nonnull List callees) { - this.callees = callees; - } - - - public CalleesCallerFunctionsResponse callers(@javax.annotation.Nonnull List callers) { - this.callers = callers; - return this; - } - - public CalleesCallerFunctionsResponse addCallersItem(CallerFunctionInfo callersItem) { - if (this.callers == null) { - this.callers = new ArrayList<>(); - } - this.callers.add(callersItem); - return this; - } - - /** - * List of functions that call the target function - * @return callers - */ - @javax.annotation.Nonnull - public List getCallers() { - return callers; - } - - public void setCallers(@javax.annotation.Nonnull List callers) { - this.callers = callers; - } - - /** - * 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 CalleesCallerFunctionsResponse instance itself - */ - public CalleesCallerFunctionsResponse 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; - } - CalleesCallerFunctionsResponse calleesCallerFunctionsResponse = (CalleesCallerFunctionsResponse) o; - return Objects.equals(this.baseAddress, calleesCallerFunctionsResponse.baseAddress) && - Objects.equals(this.callees, calleesCallerFunctionsResponse.callees) && - Objects.equals(this.callers, calleesCallerFunctionsResponse.callers)&& - Objects.equals(this.additionalProperties, calleesCallerFunctionsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(baseAddress, callees, callers, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CalleesCallerFunctionsResponse {\n"); - sb.append(" baseAddress: ").append(toIndentedString(baseAddress)).append("\n"); - sb.append(" callees: ").append(toIndentedString(callees)).append("\n"); - sb.append(" callers: ").append(toIndentedString(callers)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("base_address", "callees", "callers")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("base_address", "callees", "callers")); - } - - /** - * 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 CalleesCallerFunctionsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CalleesCallerFunctionsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CalleesCallerFunctionsResponse is not found in the empty JSON string", CalleesCallerFunctionsResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CalleesCallerFunctionsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("callees") != null) { - if (!jsonObj.get("callees").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `callees` to be an array in the JSON string but got `%s`", jsonObj.get("callees").toString())); - } - JsonArray jsonArraycallees = jsonObj.getAsJsonArray("callees"); - // validate the required field `callees` (array) - for (int i = 0; i < jsonArraycallees.size(); i++) { - CalleeFunctionInfo.validateJsonElement(jsonArraycallees.get(i)); - } - } - if (jsonObj.get("callers") != null) { - if (!jsonObj.get("callers").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `callers` to be an array in the JSON string but got `%s`", jsonObj.get("callers").toString())); - } - JsonArray jsonArraycallers = jsonObj.getAsJsonArray("callers"); - // validate the required field `callers` (array) - for (int i = 0; i < jsonArraycallers.size(); i++) { - CallerFunctionInfo.validateJsonElement(jsonArraycallers.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CalleesCallerFunctionsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CalleesCallerFunctionsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CalleesCallerFunctionsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CalleesCallerFunctionsResponse 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 CalleesCallerFunctionsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CalleesCallerFunctionsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CalleesCallerFunctionsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CalleesCallerFunctionsResponse - * @throws IOException if the JSON string is invalid with respect to CalleesCallerFunctionsResponse - */ - public static CalleesCallerFunctionsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CalleesCallerFunctionsResponse.class); - } - - /** - * Convert an instance of CalleesCallerFunctionsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CallerFunctionInfo.java b/src/main/java/ai/reveng/model/CallerFunctionInfo.java deleted file mode 100644 index 6118311..0000000 --- a/src/main/java/ai/reveng/model/CallerFunctionInfo.java +++ /dev/null @@ -1,425 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CallerFunctionInfo - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CallerFunctionInfo { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public static final String SERIALIZED_NAME_MATCHED_FUNCTION_ID = "matched_function_id"; - @SerializedName(SERIALIZED_NAME_MATCHED_FUNCTION_ID) - @javax.annotation.Nullable - private Integer matchedFunctionId; - - public static final String SERIALIZED_NAME_DASHBOARD_URL = "dashboard_url"; - @SerializedName(SERIALIZED_NAME_DASHBOARD_URL) - @javax.annotation.Nullable - private String dashboardUrl; - - public static final String SERIALIZED_NAME_IS_EXTERNAL = "is_external"; - @SerializedName(SERIALIZED_NAME_IS_EXTERNAL) - @javax.annotation.Nullable - private Boolean isExternal = false; - - public static final String SERIALIZED_NAME_CALLER_NAME = "caller_name"; - @SerializedName(SERIALIZED_NAME_CALLER_NAME) - @javax.annotation.Nonnull - private String callerName; - - public static final String SERIALIZED_NAME_CALLER_VADDR = "caller_vaddr"; - @SerializedName(SERIALIZED_NAME_CALLER_VADDR) - @javax.annotation.Nonnull - private String callerVaddr; - - public CallerFunctionInfo() { - } - - public CallerFunctionInfo functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Unique identifier of the function - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public CallerFunctionInfo matchedFunctionId(@javax.annotation.Nullable Integer matchedFunctionId) { - this.matchedFunctionId = matchedFunctionId; - return this; - } - - /** - * Unique identifier of the matched function - * @return matchedFunctionId - */ - @javax.annotation.Nullable - public Integer getMatchedFunctionId() { - return matchedFunctionId; - } - - public void setMatchedFunctionId(@javax.annotation.Nullable Integer matchedFunctionId) { - this.matchedFunctionId = matchedFunctionId; - } - - - public CallerFunctionInfo dashboardUrl(@javax.annotation.Nullable String dashboardUrl) { - this.dashboardUrl = dashboardUrl; - return this; - } - - /** - * Get dashboardUrl - * @return dashboardUrl - */ - @javax.annotation.Nullable - public String getDashboardUrl() { - return dashboardUrl; - } - - public void setDashboardUrl(@javax.annotation.Nullable String dashboardUrl) { - this.dashboardUrl = dashboardUrl; - } - - - public CallerFunctionInfo isExternal(@javax.annotation.Nullable Boolean isExternal) { - this.isExternal = isExternal; - return this; - } - - /** - * Indicates if the function is external - * @return isExternal - */ - @javax.annotation.Nullable - public Boolean getIsExternal() { - return isExternal; - } - - public void setIsExternal(@javax.annotation.Nullable Boolean isExternal) { - this.isExternal = isExternal; - } - - - public CallerFunctionInfo callerName(@javax.annotation.Nonnull String callerName) { - this.callerName = callerName; - return this; - } - - /** - * Name of the calling function - * @return callerName - */ - @javax.annotation.Nonnull - public String getCallerName() { - return callerName; - } - - public void setCallerName(@javax.annotation.Nonnull String callerName) { - this.callerName = callerName; - } - - - public CallerFunctionInfo callerVaddr(@javax.annotation.Nonnull String callerVaddr) { - this.callerVaddr = callerVaddr; - return this; - } - - /** - * Virtual address of the calling function - * @return callerVaddr - */ - @javax.annotation.Nonnull - public String getCallerVaddr() { - return callerVaddr; - } - - public void setCallerVaddr(@javax.annotation.Nonnull String callerVaddr) { - this.callerVaddr = callerVaddr; - } - - /** - * 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 CallerFunctionInfo instance itself - */ - public CallerFunctionInfo 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; - } - CallerFunctionInfo callerFunctionInfo = (CallerFunctionInfo) o; - return Objects.equals(this.functionId, callerFunctionInfo.functionId) && - Objects.equals(this.matchedFunctionId, callerFunctionInfo.matchedFunctionId) && - Objects.equals(this.dashboardUrl, callerFunctionInfo.dashboardUrl) && - Objects.equals(this.isExternal, callerFunctionInfo.isExternal) && - Objects.equals(this.callerName, callerFunctionInfo.callerName) && - Objects.equals(this.callerVaddr, callerFunctionInfo.callerVaddr)&& - Objects.equals(this.additionalProperties, callerFunctionInfo.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, matchedFunctionId, dashboardUrl, isExternal, callerName, callerVaddr, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CallerFunctionInfo {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" matchedFunctionId: ").append(toIndentedString(matchedFunctionId)).append("\n"); - sb.append(" dashboardUrl: ").append(toIndentedString(dashboardUrl)).append("\n"); - sb.append(" isExternal: ").append(toIndentedString(isExternal)).append("\n"); - sb.append(" callerName: ").append(toIndentedString(callerName)).append("\n"); - sb.append(" callerVaddr: ").append(toIndentedString(callerVaddr)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "matched_function_id", "dashboard_url", "is_external", "caller_name", "caller_vaddr")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "matched_function_id", "dashboard_url", "caller_name", "caller_vaddr")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CallerFunctionInfo - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CallerFunctionInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CallerFunctionInfo is not found in the empty JSON string", CallerFunctionInfo.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CallerFunctionInfo.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("dashboard_url") != null && !jsonObj.get("dashboard_url").isJsonNull()) && !jsonObj.get("dashboard_url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `dashboard_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dashboard_url").toString())); - } - if (!jsonObj.get("caller_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `caller_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caller_name").toString())); - } - if (!jsonObj.get("caller_vaddr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `caller_vaddr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caller_vaddr").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CallerFunctionInfo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CallerFunctionInfo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CallerFunctionInfo.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CallerFunctionInfo 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 CallerFunctionInfo read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CallerFunctionInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CallerFunctionInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of CallerFunctionInfo - * @throws IOException if the JSON string is invalid with respect to CallerFunctionInfo - */ - public static CallerFunctionInfo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CallerFunctionInfo.class); - } - - /** - * Convert an instance of CallerFunctionInfo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Capabilities.java b/src/main/java/ai/reveng/model/Capabilities.java deleted file mode 100644 index 762301e..0000000 --- a/src/main/java/ai/reveng/model/Capabilities.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.AppApiRestV2InfoTypesCapability; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Capabilities - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Capabilities { - public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; - @SerializedName(SERIALIZED_NAME_CAPABILITIES) - @javax.annotation.Nonnull - private List capabilities = new ArrayList<>(); - - public Capabilities() { - } - - public Capabilities capabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - return this; - } - - public Capabilities addCapabilitiesItem(AppApiRestV2InfoTypesCapability capabilitiesItem) { - if (this.capabilities == null) { - this.capabilities = new ArrayList<>(); - } - this.capabilities.add(capabilitiesItem); - return this; - } - - /** - * List of capabilities for a given analysis - * @return capabilities - */ - @javax.annotation.Nonnull - public List getCapabilities() { - return capabilities; - } - - public void setCapabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the Capabilities instance itself - */ - public Capabilities 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; - } - Capabilities capabilities = (Capabilities) o; - return Objects.equals(this.capabilities, capabilities.capabilities)&& - Objects.equals(this.additionalProperties, capabilities.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(capabilities, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capabilities {\n"); - sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("capabilities")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("capabilities")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Capabilities - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Capabilities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Capabilities is not found in the empty JSON string", Capabilities.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Capabilities.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("capabilities") != null) { - if (!jsonObj.get("capabilities").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); - } - JsonArray jsonArraycapabilities = jsonObj.getAsJsonArray("capabilities"); - // validate the required field `capabilities` (array) - for (int i = 0; i < jsonArraycapabilities.size(); i++) { - AppApiRestV2InfoTypesCapability.validateJsonElement(jsonArraycapabilities.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Capabilities.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Capabilities' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Capabilities.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Capabilities 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 Capabilities read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Capabilities instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Capabilities given an JSON string - * - * @param jsonString JSON string - * @return An instance of Capabilities - * @throws IOException if the JSON string is invalid with respect to Capabilities - */ - public static Capabilities fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Capabilities.class); - } - - /** - * Convert an instance of Capabilities to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CapabilitiesAgentResponse.java b/src/main/java/ai/reveng/model/CapabilitiesAgentResponse.java deleted file mode 100644 index ba37185..0000000 --- a/src/main/java/ai/reveng/model/CapabilitiesAgentResponse.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.AppApiRestV2AgentSchemaCapability; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CapabilitiesAgentResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CapabilitiesAgentResponse { - public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; - @SerializedName(SERIALIZED_NAME_CAPABILITIES) - @javax.annotation.Nonnull - private List capabilities = new ArrayList<>(); - - public CapabilitiesAgentResponse() { - } - - public CapabilitiesAgentResponse capabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - return this; - } - - public CapabilitiesAgentResponse addCapabilitiesItem(AppApiRestV2AgentSchemaCapability capabilitiesItem) { - if (this.capabilities == null) { - this.capabilities = new ArrayList<>(); - } - this.capabilities.add(capabilitiesItem); - return this; - } - - /** - * List of enriched capability data - * @return capabilities - */ - @javax.annotation.Nonnull - public List getCapabilities() { - return capabilities; - } - - public void setCapabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CapabilitiesAgentResponse instance itself - */ - public CapabilitiesAgentResponse 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; - } - CapabilitiesAgentResponse capabilitiesAgentResponse = (CapabilitiesAgentResponse) o; - return Objects.equals(this.capabilities, capabilitiesAgentResponse.capabilities)&& - Objects.equals(this.additionalProperties, capabilitiesAgentResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(capabilities, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CapabilitiesAgentResponse {\n"); - sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("capabilities")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("capabilities")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CapabilitiesAgentResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CapabilitiesAgentResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CapabilitiesAgentResponse is not found in the empty JSON string", CapabilitiesAgentResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CapabilitiesAgentResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("capabilities") != null) { - if (!jsonObj.get("capabilities").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); - } - JsonArray jsonArraycapabilities = jsonObj.getAsJsonArray("capabilities"); - // validate the required field `capabilities` (array) - for (int i = 0; i < jsonArraycapabilities.size(); i++) { - AppApiRestV2AgentSchemaCapability.validateJsonElement(jsonArraycapabilities.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CapabilitiesAgentResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CapabilitiesAgentResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CapabilitiesAgentResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CapabilitiesAgentResponse 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 CapabilitiesAgentResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CapabilitiesAgentResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CapabilitiesAgentResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CapabilitiesAgentResponse - * @throws IOException if the JSON string is invalid with respect to CapabilitiesAgentResponse - */ - public static CapabilitiesAgentResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CapabilitiesAgentResponse.class); - } - - /** - * Convert an instance of CapabilitiesAgentResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ChildBinariesResponse.java b/src/main/java/ai/reveng/model/ChildBinariesResponse.java deleted file mode 100644 index 1f40ed6..0000000 --- a/src/main/java/ai/reveng/model/ChildBinariesResponse.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 ai.reveng.model.RelativeBinaryResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ChildBinariesResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ChildBinariesResponse { - public static final String SERIALIZED_NAME_CHILDREN = "children"; - @SerializedName(SERIALIZED_NAME_CHILDREN) - @javax.annotation.Nonnull - private List children = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PARENT = "parent"; - @SerializedName(SERIALIZED_NAME_PARENT) - @javax.annotation.Nullable - private RelativeBinaryResponse parent; - - public ChildBinariesResponse() { - } - - public ChildBinariesResponse children(@javax.annotation.Nonnull List children) { - this.children = children; - return this; - } - - public ChildBinariesResponse addChildrenItem(RelativeBinaryResponse childrenItem) { - if (this.children == null) { - this.children = new ArrayList<>(); - } - this.children.add(childrenItem); - return this; - } - - /** - * List of child binaries associated with the parent binary - * @return children - */ - @javax.annotation.Nonnull - public List getChildren() { - return children; - } - - public void setChildren(@javax.annotation.Nonnull List children) { - this.children = children; - } - - - public ChildBinariesResponse parent(@javax.annotation.Nullable RelativeBinaryResponse parent) { - this.parent = parent; - return this; - } - - /** - * Details of the parent binary if it exists - * @return parent - */ - @javax.annotation.Nullable - public RelativeBinaryResponse getParent() { - return parent; - } - - public void setParent(@javax.annotation.Nullable RelativeBinaryResponse parent) { - this.parent = parent; - } - - /** - * 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 ChildBinariesResponse instance itself - */ - public ChildBinariesResponse 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; - } - ChildBinariesResponse childBinariesResponse = (ChildBinariesResponse) o; - return Objects.equals(this.children, childBinariesResponse.children) && - Objects.equals(this.parent, childBinariesResponse.parent)&& - Objects.equals(this.additionalProperties, childBinariesResponse.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(children, parent, 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 ChildBinariesResponse {\n"); - sb.append(" children: ").append(toIndentedString(children)).append("\n"); - sb.append(" parent: ").append(toIndentedString(parent)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("children", "parent")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("children")); - } - - /** - * 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 ChildBinariesResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ChildBinariesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ChildBinariesResponse is not found in the empty JSON string", ChildBinariesResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ChildBinariesResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("children") != null) { - if (!jsonObj.get("children").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `children` to be an array in the JSON string but got `%s`", jsonObj.get("children").toString())); - } - JsonArray jsonArraychildren = jsonObj.getAsJsonArray("children"); - // validate the required field `children` (array) - for (int i = 0; i < jsonArraychildren.size(); i++) { - RelativeBinaryResponse.validateJsonElement(jsonArraychildren.get(i)); - } - } - // validate the optional field `parent` - if (jsonObj.get("parent") != null && !jsonObj.get("parent").isJsonNull()) { - RelativeBinaryResponse.validateJsonElement(jsonObj.get("parent")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ChildBinariesResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ChildBinariesResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ChildBinariesResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ChildBinariesResponse 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 ChildBinariesResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ChildBinariesResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ChildBinariesResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ChildBinariesResponse - * @throws IOException if the JSON string is invalid with respect to ChildBinariesResponse - */ - public static ChildBinariesResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ChildBinariesResponse.class); - } - - /** - * Convert an instance of ChildBinariesResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CodeSignatureModel.java b/src/main/java/ai/reveng/model/CodeSignatureModel.java deleted file mode 100644 index 77b984e..0000000 --- a/src/main/java/ai/reveng/model/CodeSignatureModel.java +++ /dev/null @@ -1,359 +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 ai.reveng.model.SingleCodeSignatureModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CodeSignatureModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CodeSignatureModel { - public static final String SERIALIZED_NAME_SIGNED = "signed"; - @SerializedName(SERIALIZED_NAME_SIGNED) - @javax.annotation.Nonnull - private Boolean signed; - - public static final String SERIALIZED_NAME_VALID_SIGNATURE = "valid_signature"; - @SerializedName(SERIALIZED_NAME_VALID_SIGNATURE) - @javax.annotation.Nonnull - private Boolean validSignature; - - public static final String SERIALIZED_NAME_SIGNATURES = "signatures"; - @SerializedName(SERIALIZED_NAME_SIGNATURES) - @javax.annotation.Nonnull - private List signatures = new ArrayList<>(); - - public CodeSignatureModel() { - } - - public CodeSignatureModel signed(@javax.annotation.Nonnull Boolean signed) { - this.signed = signed; - return this; - } - - /** - * Get signed - * @return signed - */ - @javax.annotation.Nonnull - public Boolean getSigned() { - return signed; - } - - public void setSigned(@javax.annotation.Nonnull Boolean signed) { - this.signed = signed; - } - - - public CodeSignatureModel validSignature(@javax.annotation.Nonnull Boolean validSignature) { - this.validSignature = validSignature; - return this; - } - - /** - * Get validSignature - * @return validSignature - */ - @javax.annotation.Nonnull - public Boolean getValidSignature() { - return validSignature; - } - - public void setValidSignature(@javax.annotation.Nonnull Boolean validSignature) { - this.validSignature = validSignature; - } - - - public CodeSignatureModel signatures(@javax.annotation.Nonnull List signatures) { - this.signatures = signatures; - return this; - } - - public CodeSignatureModel addSignaturesItem(SingleCodeSignatureModel signaturesItem) { - if (this.signatures == null) { - this.signatures = new ArrayList<>(); - } - this.signatures.add(signaturesItem); - return this; - } - - /** - * Get signatures - * @return signatures - */ - @javax.annotation.Nonnull - public List getSignatures() { - return signatures; - } - - public void setSignatures(@javax.annotation.Nonnull List signatures) { - this.signatures = signatures; - } - - /** - * 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 CodeSignatureModel instance itself - */ - public CodeSignatureModel 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; - } - CodeSignatureModel codeSignatureModel = (CodeSignatureModel) o; - return Objects.equals(this.signed, codeSignatureModel.signed) && - Objects.equals(this.validSignature, codeSignatureModel.validSignature) && - Objects.equals(this.signatures, codeSignatureModel.signatures)&& - Objects.equals(this.additionalProperties, codeSignatureModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(signed, validSignature, signatures, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CodeSignatureModel {\n"); - sb.append(" signed: ").append(toIndentedString(signed)).append("\n"); - sb.append(" validSignature: ").append(toIndentedString(validSignature)).append("\n"); - sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("signed", "valid_signature", "signatures")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("signed", "valid_signature", "signatures")); - } - - /** - * 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 CodeSignatureModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CodeSignatureModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CodeSignatureModel is not found in the empty JSON string", CodeSignatureModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CodeSignatureModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("signatures") != null) { - if (!jsonObj.get("signatures").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `signatures` to be an array in the JSON string but got `%s`", jsonObj.get("signatures").toString())); - } - JsonArray jsonArraysignatures = jsonObj.getAsJsonArray("signatures"); - // validate the required field `signatures` (array) - for (int i = 0; i < jsonArraysignatures.size(); i++) { - SingleCodeSignatureModel.validateJsonElement(jsonArraysignatures.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CodeSignatureModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CodeSignatureModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CodeSignatureModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CodeSignatureModel 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 CodeSignatureModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CodeSignatureModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CodeSignatureModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of CodeSignatureModel - * @throws IOException if the JSON string is invalid with respect to CodeSignatureModel - */ - public static CodeSignatureModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CodeSignatureModel.class); - } - - /** - * Convert an instance of CodeSignatureModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionBinariesUpdateRequest.java b/src/main/java/ai/reveng/model/CollectionBinariesUpdateRequest.java deleted file mode 100644 index 8c835af..0000000 --- a/src/main/java/ai/reveng/model/CollectionBinariesUpdateRequest.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionBinariesUpdateRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionBinariesUpdateRequest { - public static final String SERIALIZED_NAME_BINARIES = "binaries"; - @SerializedName(SERIALIZED_NAME_BINARIES) - @javax.annotation.Nonnull - private List binaries = new ArrayList<>(); - - public CollectionBinariesUpdateRequest() { - } - - public CollectionBinariesUpdateRequest binaries(@javax.annotation.Nonnull List binaries) { - this.binaries = binaries; - return this; - } - - public CollectionBinariesUpdateRequest addBinariesItem(Integer binariesItem) { - if (this.binaries == null) { - this.binaries = new ArrayList<>(); - } - this.binaries.add(binariesItem); - return this; - } - - /** - * Get binaries - * @return binaries - */ - @javax.annotation.Nonnull - public List getBinaries() { - return binaries; - } - - public void setBinaries(@javax.annotation.Nonnull List binaries) { - this.binaries = binaries; - } - - /** - * 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 CollectionBinariesUpdateRequest instance itself - */ - public CollectionBinariesUpdateRequest 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; - } - CollectionBinariesUpdateRequest collectionBinariesUpdateRequest = (CollectionBinariesUpdateRequest) o; - return Objects.equals(this.binaries, collectionBinariesUpdateRequest.binaries)&& - Objects.equals(this.additionalProperties, collectionBinariesUpdateRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(binaries, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CollectionBinariesUpdateRequest {\n"); - sb.append(" binaries: ").append(toIndentedString(binaries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("binaries")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("binaries")); - } - - /** - * 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 CollectionBinariesUpdateRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionBinariesUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionBinariesUpdateRequest is not found in the empty JSON string", CollectionBinariesUpdateRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionBinariesUpdateRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("binaries") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("binaries").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binaries` to be an array in the JSON string but got `%s`", jsonObj.get("binaries").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionBinariesUpdateRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionBinariesUpdateRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionBinariesUpdateRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionBinariesUpdateRequest 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 CollectionBinariesUpdateRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionBinariesUpdateRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionBinariesUpdateRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionBinariesUpdateRequest - * @throws IOException if the JSON string is invalid with respect to CollectionBinariesUpdateRequest - */ - public static CollectionBinariesUpdateRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionBinariesUpdateRequest.class); - } - - /** - * Convert an instance of CollectionBinariesUpdateRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionBinariesUpdateResponse.java b/src/main/java/ai/reveng/model/CollectionBinariesUpdateResponse.java deleted file mode 100644 index 94b6074..0000000 --- a/src/main/java/ai/reveng/model/CollectionBinariesUpdateResponse.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.CollectionBinaryResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionBinariesUpdateResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionBinariesUpdateResponse { - public static final String SERIALIZED_NAME_BINARIES = "binaries"; - @SerializedName(SERIALIZED_NAME_BINARIES) - @javax.annotation.Nonnull - private List binaries = new ArrayList<>(); - - public CollectionBinariesUpdateResponse() { - } - - public CollectionBinariesUpdateResponse binaries(@javax.annotation.Nonnull List binaries) { - this.binaries = binaries; - return this; - } - - public CollectionBinariesUpdateResponse addBinariesItem(CollectionBinaryResponse binariesItem) { - if (this.binaries == null) { - this.binaries = new ArrayList<>(); - } - this.binaries.add(binariesItem); - return this; - } - - /** - * Collection binaries - * @return binaries - */ - @javax.annotation.Nonnull - public List getBinaries() { - return binaries; - } - - public void setBinaries(@javax.annotation.Nonnull List binaries) { - this.binaries = binaries; - } - - /** - * 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 CollectionBinariesUpdateResponse instance itself - */ - public CollectionBinariesUpdateResponse 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; - } - CollectionBinariesUpdateResponse collectionBinariesUpdateResponse = (CollectionBinariesUpdateResponse) o; - return Objects.equals(this.binaries, collectionBinariesUpdateResponse.binaries)&& - Objects.equals(this.additionalProperties, collectionBinariesUpdateResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(binaries, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CollectionBinariesUpdateResponse {\n"); - sb.append(" binaries: ").append(toIndentedString(binaries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("binaries")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("binaries")); - } - - /** - * 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 CollectionBinariesUpdateResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionBinariesUpdateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionBinariesUpdateResponse is not found in the empty JSON string", CollectionBinariesUpdateResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionBinariesUpdateResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("binaries") != null) { - if (!jsonObj.get("binaries").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binaries` to be an array in the JSON string but got `%s`", jsonObj.get("binaries").toString())); - } - JsonArray jsonArraybinaries = jsonObj.getAsJsonArray("binaries"); - // validate the required field `binaries` (array) - for (int i = 0; i < jsonArraybinaries.size(); i++) { - CollectionBinaryResponse.validateJsonElement(jsonArraybinaries.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionBinariesUpdateResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionBinariesUpdateResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionBinariesUpdateResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionBinariesUpdateResponse 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 CollectionBinariesUpdateResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionBinariesUpdateResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionBinariesUpdateResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionBinariesUpdateResponse - * @throws IOException if the JSON string is invalid with respect to CollectionBinariesUpdateResponse - */ - public static CollectionBinariesUpdateResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionBinariesUpdateResponse.class); - } - - /** - * Convert an instance of CollectionBinariesUpdateResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionBinaryResponse.java b/src/main/java/ai/reveng/model/CollectionBinaryResponse.java deleted file mode 100644 index 4b98ba3..0000000 --- a/src/main/java/ai/reveng/model/CollectionBinaryResponse.java +++ /dev/null @@ -1,449 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionBinaryResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionBinaryResponse { - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - public static final String SERIALIZED_NAME_OWNER_ID = "owner_id"; - @SerializedName(SERIALIZED_NAME_OWNER_ID) - @javax.annotation.Nonnull - private Integer ownerId; - - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nonnull - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_IS_SYSTEM_ANALYSIS = "is_system_analysis"; - @SerializedName(SERIALIZED_NAME_IS_SYSTEM_ANALYSIS) - @javax.annotation.Nonnull - private Boolean isSystemAnalysis; - - public CollectionBinaryResponse() { - } - - public CollectionBinaryResponse analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * Analysis ID - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public CollectionBinaryResponse binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * Binary ID - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public CollectionBinaryResponse binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * Binary name - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public CollectionBinaryResponse ownerId(@javax.annotation.Nonnull Integer ownerId) { - this.ownerId = ownerId; - return this; - } - - /** - * Binary owner - * @return ownerId - */ - @javax.annotation.Nonnull - public Integer getOwnerId() { - return ownerId; - } - - public void setOwnerId(@javax.annotation.Nonnull Integer ownerId) { - this.ownerId = ownerId; - } - - - public CollectionBinaryResponse sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * Binary SHA-256 hash - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public CollectionBinaryResponse createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Binary creation date - * @return createdAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public CollectionBinaryResponse isSystemAnalysis(@javax.annotation.Nonnull Boolean isSystemAnalysis) { - this.isSystemAnalysis = isSystemAnalysis; - return this; - } - - /** - * Is the analysis owned by a RevEng.AI account - * @return isSystemAnalysis - */ - @javax.annotation.Nonnull - public Boolean getIsSystemAnalysis() { - return isSystemAnalysis; - } - - public void setIsSystemAnalysis(@javax.annotation.Nonnull Boolean isSystemAnalysis) { - this.isSystemAnalysis = isSystemAnalysis; - } - - /** - * 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 CollectionBinaryResponse instance itself - */ - public CollectionBinaryResponse 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; - } - CollectionBinaryResponse collectionBinaryResponse = (CollectionBinaryResponse) o; - return Objects.equals(this.analysisId, collectionBinaryResponse.analysisId) && - Objects.equals(this.binaryId, collectionBinaryResponse.binaryId) && - Objects.equals(this.binaryName, collectionBinaryResponse.binaryName) && - Objects.equals(this.ownerId, collectionBinaryResponse.ownerId) && - Objects.equals(this.sha256Hash, collectionBinaryResponse.sha256Hash) && - Objects.equals(this.createdAt, collectionBinaryResponse.createdAt) && - Objects.equals(this.isSystemAnalysis, collectionBinaryResponse.isSystemAnalysis)&& - Objects.equals(this.additionalProperties, collectionBinaryResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(analysisId, binaryId, binaryName, ownerId, sha256Hash, createdAt, isSystemAnalysis, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CollectionBinaryResponse {\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" isSystemAnalysis: ").append(toIndentedString(isSystemAnalysis)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "owner_id", "sha_256_hash", "created_at", "is_system_analysis")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "binary_name", "owner_id", "sha_256_hash", "created_at", "is_system_analysis")); - } - - /** - * 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 CollectionBinaryResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionBinaryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionBinaryResponse is not found in the empty JSON string", CollectionBinaryResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionBinaryResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionBinaryResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionBinaryResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionBinaryResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionBinaryResponse 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 CollectionBinaryResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionBinaryResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionBinaryResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionBinaryResponse - * @throws IOException if the JSON string is invalid with respect to CollectionBinaryResponse - */ - public static CollectionBinaryResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionBinaryResponse.class); - } - - /** - * Convert an instance of CollectionBinaryResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionCreateRequest.java b/src/main/java/ai/reveng/model/CollectionCreateRequest.java deleted file mode 100644 index bdd486d..0000000 --- a/src/main/java/ai/reveng/model/CollectionCreateRequest.java +++ /dev/null @@ -1,439 +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 ai.reveng.model.CollectionScope; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionCreateRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionCreateRequest { - public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; - @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) - @javax.annotation.Nonnull - private String collectionName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; - @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) - @javax.annotation.Nullable - private CollectionScope collectionScope = CollectionScope.PRIVATE; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nullable - private List tags; - - public static final String SERIALIZED_NAME_BINARIES = "binaries"; - @SerializedName(SERIALIZED_NAME_BINARIES) - @javax.annotation.Nullable - private List binaries; - - public CollectionCreateRequest() { - } - - public CollectionCreateRequest collectionName(@javax.annotation.Nonnull String collectionName) { - this.collectionName = collectionName; - return this; - } - - /** - * Get collectionName - * @return collectionName - */ - @javax.annotation.Nonnull - public String getCollectionName() { - return collectionName; - } - - public void setCollectionName(@javax.annotation.Nonnull String collectionName) { - this.collectionName = collectionName; - } - - - public CollectionCreateRequest description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - - public CollectionCreateRequest collectionScope(@javax.annotation.Nullable CollectionScope collectionScope) { - this.collectionScope = collectionScope; - return this; - } - - /** - * Get collectionScope - * @return collectionScope - */ - @javax.annotation.Nullable - public CollectionScope getCollectionScope() { - return collectionScope; - } - - public void setCollectionScope(@javax.annotation.Nullable CollectionScope collectionScope) { - this.collectionScope = collectionScope; - } - - - public CollectionCreateRequest tags(@javax.annotation.Nullable List tags) { - this.tags = tags; - return this; - } - - public CollectionCreateRequest addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nullable List tags) { - this.tags = tags; - } - - - public CollectionCreateRequest binaries(@javax.annotation.Nullable List binaries) { - this.binaries = binaries; - return this; - } - - public CollectionCreateRequest addBinariesItem(Integer binariesItem) { - if (this.binaries == null) { - this.binaries = new ArrayList<>(); - } - this.binaries.add(binariesItem); - return this; - } - - /** - * Get binaries - * @return binaries - */ - @javax.annotation.Nullable - public List getBinaries() { - return binaries; - } - - public void setBinaries(@javax.annotation.Nullable List binaries) { - this.binaries = binaries; - } - - /** - * 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 CollectionCreateRequest instance itself - */ - public CollectionCreateRequest 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; - } - CollectionCreateRequest collectionCreateRequest = (CollectionCreateRequest) o; - return Objects.equals(this.collectionName, collectionCreateRequest.collectionName) && - Objects.equals(this.description, collectionCreateRequest.description) && - Objects.equals(this.collectionScope, collectionCreateRequest.collectionScope) && - Objects.equals(this.tags, collectionCreateRequest.tags) && - Objects.equals(this.binaries, collectionCreateRequest.binaries)&& - Objects.equals(this.additionalProperties, collectionCreateRequest.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(collectionName, description, collectionScope, tags, binaries, 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 CollectionCreateRequest {\n"); - sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" collectionScope: ").append(toIndentedString(collectionScope)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" binaries: ").append(toIndentedString(binaries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("collection_name", "description", "collection_scope", "tags", "binaries")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("collection_name", "description")); - } - - /** - * 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 CollectionCreateRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionCreateRequest is not found in the empty JSON string", CollectionCreateRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionCreateRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("collection_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - // validate the optional field `collection_scope` - if (jsonObj.get("collection_scope") != null && !jsonObj.get("collection_scope").isJsonNull()) { - CollectionScope.validateJsonElement(jsonObj.get("collection_scope")); - } - // ensure the optional json data is an array if present - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("binaries") != null && !jsonObj.get("binaries").isJsonNull() && !jsonObj.get("binaries").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binaries` to be an array in the JSON string but got `%s`", jsonObj.get("binaries").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionCreateRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionCreateRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionCreateRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionCreateRequest 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 CollectionCreateRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionCreateRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionCreateRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionCreateRequest - * @throws IOException if the JSON string is invalid with respect to CollectionCreateRequest - */ - public static CollectionCreateRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionCreateRequest.class); - } - - /** - * Convert an instance of CollectionCreateRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionListItem.java b/src/main/java/ai/reveng/model/CollectionListItem.java deleted file mode 100644 index 2f9abae..0000000 --- a/src/main/java/ai/reveng/model/CollectionListItem.java +++ /dev/null @@ -1,559 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.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; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionListItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionListItem { - public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; - @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) - @javax.annotation.Nonnull - private String collectionName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; - @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) - @javax.annotation.Nonnull - private String collectionScope; - - public static final String SERIALIZED_NAME_COLLECTION_OWNER = "collection_owner"; - @SerializedName(SERIALIZED_NAME_COLLECTION_OWNER) - @javax.annotation.Nonnull - private String collectionOwner; - - public static final String SERIALIZED_NAME_OFFICIAL_COLLECTION = "official_collection"; - @SerializedName(SERIALIZED_NAME_OFFICIAL_COLLECTION) - @javax.annotation.Nonnull - private Boolean officialCollection; - - public static final String SERIALIZED_NAME_COLLECTION_TAGS = "collection_tags"; - @SerializedName(SERIALIZED_NAME_COLLECTION_TAGS) - @javax.annotation.Nullable - private List collectionTags = new ArrayList<>(); - - public static final String SERIALIZED_NAME_COLLECTION_SIZE = "collection_size"; - @SerializedName(SERIALIZED_NAME_COLLECTION_SIZE) - @javax.annotation.Nonnull - private Integer collectionSize; - - public static final String SERIALIZED_NAME_COLLECTION_ID = "collection_id"; - @SerializedName(SERIALIZED_NAME_COLLECTION_ID) - @javax.annotation.Nonnull - private Integer collectionId; - - public static final String SERIALIZED_NAME_CREATION = "creation"; - @SerializedName(SERIALIZED_NAME_CREATION) - @javax.annotation.Nonnull - private OffsetDateTime creation; - - public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; - @SerializedName(SERIALIZED_NAME_TEAM_ID) - @javax.annotation.Nullable - private Integer teamId; - - public CollectionListItem() { - } - - public CollectionListItem collectionName(@javax.annotation.Nonnull String collectionName) { - this.collectionName = collectionName; - return this; - } - - /** - * The name of the collection - * @return collectionName - */ - @javax.annotation.Nonnull - public String getCollectionName() { - return collectionName; - } - - public void setCollectionName(@javax.annotation.Nonnull String collectionName) { - this.collectionName = collectionName; - } - - - public CollectionListItem description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * The description of the collection - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - - public CollectionListItem collectionScope(@javax.annotation.Nonnull String collectionScope) { - this.collectionScope = collectionScope; - return this; - } - - /** - * The scope of the collection - * @return collectionScope - */ - @javax.annotation.Nonnull - public String getCollectionScope() { - return collectionScope; - } - - public void setCollectionScope(@javax.annotation.Nonnull String collectionScope) { - this.collectionScope = collectionScope; - } - - - public CollectionListItem collectionOwner(@javax.annotation.Nonnull String collectionOwner) { - this.collectionOwner = collectionOwner; - return this; - } - - /** - * The owner of the collection - * @return collectionOwner - */ - @javax.annotation.Nonnull - public String getCollectionOwner() { - return collectionOwner; - } - - public void setCollectionOwner(@javax.annotation.Nonnull String collectionOwner) { - this.collectionOwner = collectionOwner; - } - - - public CollectionListItem officialCollection(@javax.annotation.Nonnull Boolean officialCollection) { - this.officialCollection = officialCollection; - return this; - } - - /** - * Whether the collection is maintained by RevEng.AI - * @return officialCollection - */ - @javax.annotation.Nonnull - public Boolean getOfficialCollection() { - return officialCollection; - } - - public void setOfficialCollection(@javax.annotation.Nonnull Boolean officialCollection) { - this.officialCollection = officialCollection; - } - - - public CollectionListItem collectionTags(@javax.annotation.Nullable List collectionTags) { - this.collectionTags = collectionTags; - return this; - } - - public CollectionListItem addCollectionTagsItem(String collectionTagsItem) { - if (this.collectionTags == null) { - this.collectionTags = new ArrayList<>(); - } - this.collectionTags.add(collectionTagsItem); - return this; - } - - /** - * The tags of the collection - * @return collectionTags - */ - @javax.annotation.Nullable - public List getCollectionTags() { - return collectionTags; - } - - public void setCollectionTags(@javax.annotation.Nullable List collectionTags) { - this.collectionTags = collectionTags; - } - - - public CollectionListItem collectionSize(@javax.annotation.Nonnull Integer collectionSize) { - this.collectionSize = collectionSize; - return this; - } - - /** - * The size of the collection - * @return collectionSize - */ - @javax.annotation.Nonnull - public Integer getCollectionSize() { - return collectionSize; - } - - public void setCollectionSize(@javax.annotation.Nonnull Integer collectionSize) { - this.collectionSize = collectionSize; - } - - - public CollectionListItem collectionId(@javax.annotation.Nonnull Integer collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * The ID of the collection - * @return collectionId - */ - @javax.annotation.Nonnull - public Integer getCollectionId() { - return collectionId; - } - - public void setCollectionId(@javax.annotation.Nonnull Integer collectionId) { - this.collectionId = collectionId; - } - - - public CollectionListItem creation(@javax.annotation.Nonnull OffsetDateTime creation) { - this.creation = creation; - return this; - } - - /** - * The datetime of when the collection was created - * @return creation - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreation() { - return creation; - } - - public void setCreation(@javax.annotation.Nonnull OffsetDateTime creation) { - this.creation = creation; - } - - - public CollectionListItem teamId(@javax.annotation.Nullable Integer teamId) { - this.teamId = teamId; - return this; - } - - /** - * The team ID for the collection - * @return teamId - */ - @javax.annotation.Nullable - public Integer getTeamId() { - return teamId; - } - - public void setTeamId(@javax.annotation.Nullable Integer teamId) { - this.teamId = teamId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CollectionListItem instance itself - */ - public CollectionListItem 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; - } - CollectionListItem collectionListItem = (CollectionListItem) o; - return Objects.equals(this.collectionName, collectionListItem.collectionName) && - Objects.equals(this.description, collectionListItem.description) && - Objects.equals(this.collectionScope, collectionListItem.collectionScope) && - Objects.equals(this.collectionOwner, collectionListItem.collectionOwner) && - Objects.equals(this.officialCollection, collectionListItem.officialCollection) && - Objects.equals(this.collectionTags, collectionListItem.collectionTags) && - Objects.equals(this.collectionSize, collectionListItem.collectionSize) && - Objects.equals(this.collectionId, collectionListItem.collectionId) && - Objects.equals(this.creation, collectionListItem.creation) && - Objects.equals(this.teamId, collectionListItem.teamId)&& - Objects.equals(this.additionalProperties, collectionListItem.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(collectionName, description, collectionScope, collectionOwner, officialCollection, collectionTags, collectionSize, collectionId, creation, teamId, 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 CollectionListItem {\n"); - sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" collectionScope: ").append(toIndentedString(collectionScope)).append("\n"); - sb.append(" collectionOwner: ").append(toIndentedString(collectionOwner)).append("\n"); - sb.append(" officialCollection: ").append(toIndentedString(officialCollection)).append("\n"); - sb.append(" collectionTags: ").append(toIndentedString(collectionTags)).append("\n"); - sb.append(" collectionSize: ").append(toIndentedString(collectionSize)).append("\n"); - sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); - sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("collection_name", "description", "collection_scope", "collection_owner", "official_collection", "collection_tags", "collection_size", "collection_id", "creation", "team_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("collection_name", "description", "collection_scope", "collection_owner", "official_collection", "collection_size", "collection_id", "creation")); - } - - /** - * 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 CollectionListItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionListItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionListItem is not found in the empty JSON string", CollectionListItem.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionListItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("collection_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("collection_scope").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_scope").toString())); - } - if (!jsonObj.get("collection_owner").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_owner").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("collection_tags") != null && !jsonObj.get("collection_tags").isJsonNull() && !jsonObj.get("collection_tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_tags` to be an array in the JSON string but got `%s`", jsonObj.get("collection_tags").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionListItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionListItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionListItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionListItem 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 CollectionListItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionListItem instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionListItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionListItem - * @throws IOException if the JSON string is invalid with respect to CollectionListItem - */ - public static CollectionListItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionListItem.class); - } - - /** - * Convert an instance of CollectionListItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionResponse.java b/src/main/java/ai/reveng/model/CollectionResponse.java deleted file mode 100644 index 46f7b28..0000000 --- a/src/main/java/ai/reveng/model/CollectionResponse.java +++ /dev/null @@ -1,579 +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 ai.reveng.model.CollectionResponseBinariesInner; -import ai.reveng.model.CollectionScope; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionResponse { - public static final String SERIALIZED_NAME_COLLECTION_ID = "collection_id"; - @SerializedName(SERIALIZED_NAME_COLLECTION_ID) - @javax.annotation.Nonnull - private Integer collectionId; - - public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; - @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) - @javax.annotation.Nonnull - private String collectionName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_USER_ID = "user_id"; - @SerializedName(SERIALIZED_NAME_USER_ID) - @javax.annotation.Nonnull - private Integer userId; - - public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; - @SerializedName(SERIALIZED_NAME_TEAM_ID) - @javax.annotation.Nullable - private Integer teamId; - - public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; - @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) - @javax.annotation.Nonnull - private CollectionScope collectionScope; - - 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_UPDATED_AT = "updated_at"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nonnull - private OffsetDateTime updatedAt; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nullable - private List tags; - - public static final String SERIALIZED_NAME_BINARIES = "binaries"; - @SerializedName(SERIALIZED_NAME_BINARIES) - @javax.annotation.Nullable - private List binaries; - - public CollectionResponse() { - } - - public CollectionResponse collectionId(@javax.annotation.Nonnull Integer collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Collection ID - * @return collectionId - */ - @javax.annotation.Nonnull - public Integer getCollectionId() { - return collectionId; - } - - public void setCollectionId(@javax.annotation.Nonnull Integer collectionId) { - this.collectionId = collectionId; - } - - - public CollectionResponse collectionName(@javax.annotation.Nonnull String collectionName) { - this.collectionName = collectionName; - return this; - } - - /** - * Collection name - * @return collectionName - */ - @javax.annotation.Nonnull - public String getCollectionName() { - return collectionName; - } - - public void setCollectionName(@javax.annotation.Nonnull String collectionName) { - this.collectionName = collectionName; - } - - - public CollectionResponse description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * Collection description - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - - public CollectionResponse userId(@javax.annotation.Nonnull Integer userId) { - this.userId = userId; - return this; - } - - /** - * Collection user ID - * @return userId - */ - @javax.annotation.Nonnull - public Integer getUserId() { - return userId; - } - - public void setUserId(@javax.annotation.Nonnull Integer userId) { - this.userId = userId; - } - - - public CollectionResponse teamId(@javax.annotation.Nullable Integer teamId) { - this.teamId = teamId; - return this; - } - - /** - * Collection team ID - * @return teamId - */ - @javax.annotation.Nullable - public Integer getTeamId() { - return teamId; - } - - public void setTeamId(@javax.annotation.Nullable Integer teamId) { - this.teamId = teamId; - } - - - public CollectionResponse collectionScope(@javax.annotation.Nonnull CollectionScope collectionScope) { - this.collectionScope = collectionScope; - return this; - } - - /** - * Collection public status - * @return collectionScope - */ - @javax.annotation.Nonnull - public CollectionScope getCollectionScope() { - return collectionScope; - } - - public void setCollectionScope(@javax.annotation.Nonnull CollectionScope collectionScope) { - this.collectionScope = collectionScope; - } - - - public CollectionResponse createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Collection creation date - * @return createdAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public CollectionResponse updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Collection last update date - * @return updatedAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public CollectionResponse tags(@javax.annotation.Nullable List tags) { - this.tags = tags; - return this; - } - - public CollectionResponse addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Collection tags - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nullable List tags) { - this.tags = tags; - } - - - public CollectionResponse binaries(@javax.annotation.Nullable List binaries) { - this.binaries = binaries; - return this; - } - - public CollectionResponse addBinariesItem(CollectionResponseBinariesInner binariesItem) { - if (this.binaries == null) { - this.binaries = new ArrayList<>(); - } - this.binaries.add(binariesItem); - return this; - } - - /** - * Collection binaries - * @return binaries - */ - @javax.annotation.Nullable - public List getBinaries() { - return binaries; - } - - public void setBinaries(@javax.annotation.Nullable List binaries) { - this.binaries = binaries; - } - - /** - * 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 CollectionResponse instance itself - */ - public CollectionResponse 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; - } - CollectionResponse collectionResponse = (CollectionResponse) o; - return Objects.equals(this.collectionId, collectionResponse.collectionId) && - Objects.equals(this.collectionName, collectionResponse.collectionName) && - Objects.equals(this.description, collectionResponse.description) && - Objects.equals(this.userId, collectionResponse.userId) && - Objects.equals(this.teamId, collectionResponse.teamId) && - Objects.equals(this.collectionScope, collectionResponse.collectionScope) && - Objects.equals(this.createdAt, collectionResponse.createdAt) && - Objects.equals(this.updatedAt, collectionResponse.updatedAt) && - Objects.equals(this.tags, collectionResponse.tags) && - Objects.equals(this.binaries, collectionResponse.binaries)&& - Objects.equals(this.additionalProperties, collectionResponse.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(collectionId, collectionName, description, userId, teamId, collectionScope, createdAt, updatedAt, tags, binaries, 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 CollectionResponse {\n"); - sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); - sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" collectionScope: ").append(toIndentedString(collectionScope)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" binaries: ").append(toIndentedString(binaries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("collection_id", "collection_name", "description", "user_id", "team_id", "collection_scope", "created_at", "updated_at", "tags", "binaries")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("collection_id", "collection_name", "description", "user_id", "collection_scope", "created_at", "updated_at")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CollectionResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionResponse is not found in the empty JSON string", CollectionResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("collection_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - // validate the required field `collection_scope` - CollectionScope.validateJsonElement(jsonObj.get("collection_scope")); - // ensure the optional json data is an array if present - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - if (jsonObj.get("binaries") != null && !jsonObj.get("binaries").isJsonNull()) { - JsonArray jsonArraybinaries = jsonObj.getAsJsonArray("binaries"); - if (jsonArraybinaries != null) { - // ensure the json data is an array - if (!jsonObj.get("binaries").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binaries` to be an array in the JSON string but got `%s`", jsonObj.get("binaries").toString())); - } - - // validate the optional field `binaries` (array) - for (int i = 0; i < jsonArraybinaries.size(); i++) { - CollectionResponseBinariesInner.validateJsonElement(jsonArraybinaries.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionResponse 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 CollectionResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionResponse - * @throws IOException if the JSON string is invalid with respect to CollectionResponse - */ - public static CollectionResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionResponse.class); - } - - /** - * Convert an instance of CollectionResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionResponseBinariesInner.java b/src/main/java/ai/reveng/model/CollectionResponseBinariesInner.java deleted file mode 100644 index 14473f6..0000000 --- a/src/main/java/ai/reveng/model/CollectionResponseBinariesInner.java +++ /dev/null @@ -1,270 +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 ai.reveng.model.CollectionBinaryResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; - - - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonArray; -import com.google.gson.JsonParseException; - -import ai.reveng.invoker.JSON; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionResponseBinariesInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(CollectionResponseBinariesInner.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionResponseBinariesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionResponseBinariesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class)); - final TypeAdapter adapterCollectionBinaryResponse = gson.getDelegateAdapter(this, TypeToken.get(CollectionBinaryResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionResponseBinariesInner value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `Integer` - if (value.getActualInstance() instanceof Integer) { - JsonPrimitive primitive = adapterInteger.toJsonTree((Integer)value.getActualInstance()).getAsJsonPrimitive(); - elementAdapter.write(out, primitive); - return; - } - // check if the actual instance is of the type `CollectionBinaryResponse` - if (value.getActualInstance() instanceof CollectionBinaryResponse) { - JsonElement element = adapterCollectionBinaryResponse.toJsonTree((CollectionBinaryResponse)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: CollectionBinaryResponse, Integer"); - } - - @Override - public CollectionResponseBinariesInner read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize Integer - try { - // validate the JSON object to see if any exception is thrown - if (!jsonElement.getAsJsonPrimitive().isNumber()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); - } - actualAdapter = adapterInteger; - CollectionResponseBinariesInner ret = new CollectionResponseBinariesInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for Integer failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Integer'", e); - } - // deserialize CollectionBinaryResponse - try { - // validate the JSON object to see if any exception is thrown - CollectionBinaryResponse.validateJsonElement(jsonElement); - actualAdapter = adapterCollectionBinaryResponse; - CollectionResponseBinariesInner ret = new CollectionResponseBinariesInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for CollectionBinaryResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'CollectionBinaryResponse'", e); - } - - throw new IOException(String.format(java.util.Locale.ROOT, "Failed deserialization for CollectionResponseBinariesInner: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public CollectionResponseBinariesInner() { - super("anyOf", Boolean.FALSE); - } - - public CollectionResponseBinariesInner(Object o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("Integer", Integer.class); - schemas.put("CollectionBinaryResponse", CollectionBinaryResponse.class); - } - - @Override - public Map> getSchemas() { - return CollectionResponseBinariesInner.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * CollectionBinaryResponse, Integer - * - * It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof Integer) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof CollectionBinaryResponse) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be CollectionBinaryResponse, Integer"); - } - - /** - * Get the actual instance, which can be the following: - * CollectionBinaryResponse, Integer - * - * @return The actual instance (CollectionBinaryResponse, Integer) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `Integer`. If the actual instance is not `Integer`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Integer` - * @throws ClassCastException if the instance is not `Integer` - */ - public Integer getInteger() throws ClassCastException { - return (Integer)super.getActualInstance(); - } - - /** - * Get the actual instance of `CollectionBinaryResponse`. If the actual instance is not `CollectionBinaryResponse`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `CollectionBinaryResponse` - * @throws ClassCastException if the instance is not `CollectionBinaryResponse` - */ - public CollectionBinaryResponse getCollectionBinaryResponse() throws ClassCastException { - return (CollectionBinaryResponse)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 CollectionResponseBinariesInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with Integer - try { - if (!jsonElement.getAsJsonPrimitive().isNumber()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); - } - return; - } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for Integer failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with CollectionBinaryResponse - try { - CollectionBinaryResponse.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for CollectionBinaryResponse failed with `%s`.", e.getMessage())); - // continue to the next one - } - throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for CollectionResponseBinariesInner with anyOf schemas: CollectionBinaryResponse, Integer. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of CollectionResponseBinariesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionResponseBinariesInner - * @throws IOException if the JSON string is invalid with respect to CollectionResponseBinariesInner - */ - public static CollectionResponseBinariesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionResponseBinariesInner.class); - } - - /** - * Convert an instance of CollectionResponseBinariesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionScope.java b/src/main/java/ai/reveng/model/CollectionScope.java deleted file mode 100644 index 34267cb..0000000 --- a/src/main/java/ai/reveng/model/CollectionScope.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets CollectionScope - */ -@JsonAdapter(CollectionScope.Adapter.class) -public enum CollectionScope { - - PRIVATE("PRIVATE"), - - PUBLIC("PUBLIC"), - - PROTECTED("PROTECTED"), - - TEAM("TEAM"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - CollectionScope(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CollectionScope fromValue(String value) { - for (CollectionScope b : CollectionScope.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CollectionScope enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CollectionScope read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CollectionScope.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - CollectionScope.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionSearchResponse.java b/src/main/java/ai/reveng/model/CollectionSearchResponse.java deleted file mode 100644 index 15ab5b6..0000000 --- a/src/main/java/ai/reveng/model/CollectionSearchResponse.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.CollectionSearchResult; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionSearchResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionSearchResponse { - public static final String SERIALIZED_NAME_RESULTS = "results"; - @SerializedName(SERIALIZED_NAME_RESULTS) - @javax.annotation.Nonnull - private List results = new ArrayList<>(); - - public CollectionSearchResponse() { - } - - public CollectionSearchResponse results(@javax.annotation.Nonnull List results) { - this.results = results; - return this; - } - - public CollectionSearchResponse addResultsItem(CollectionSearchResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * The results of the search - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(@javax.annotation.Nonnull List results) { - this.results = results; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CollectionSearchResponse instance itself - */ - public CollectionSearchResponse 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; - } - CollectionSearchResponse collectionSearchResponse = (CollectionSearchResponse) o; - return Objects.equals(this.results, collectionSearchResponse.results)&& - Objects.equals(this.additionalProperties, collectionSearchResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(results, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CollectionSearchResponse {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("results")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("results")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CollectionSearchResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionSearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionSearchResponse is not found in the empty JSON string", CollectionSearchResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionSearchResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("results") != null) { - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); - } - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - CollectionSearchResult.validateJsonElement(jsonArrayresults.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionSearchResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionSearchResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionSearchResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionSearchResponse 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 CollectionSearchResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionSearchResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionSearchResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionSearchResponse - * @throws IOException if the JSON string is invalid with respect to CollectionSearchResponse - */ - public static CollectionSearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionSearchResponse.class); - } - - /** - * Convert an instance of CollectionSearchResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionSearchResult.java b/src/main/java/ai/reveng/model/CollectionSearchResult.java deleted file mode 100644 index 9471d58..0000000 --- a/src/main/java/ai/reveng/model/CollectionSearchResult.java +++ /dev/null @@ -1,559 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.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; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionSearchResult - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionSearchResult { - public static final String SERIALIZED_NAME_COLLECTION_ID = "collection_id"; - @SerializedName(SERIALIZED_NAME_COLLECTION_ID) - @javax.annotation.Nonnull - private Integer collectionId; - - public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; - @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) - @javax.annotation.Nonnull - private String collectionName; - - public static final String SERIALIZED_NAME_SCOPE = "scope"; - @SerializedName(SERIALIZED_NAME_SCOPE) - @javax.annotation.Nonnull - private String scope; - - public static final String SERIALIZED_NAME_LAST_UPDATED_AT = "last_updated_at"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATED_AT) - @javax.annotation.Nonnull - private OffsetDateTime lastUpdatedAt; - - 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_OWNED_BY = "owned_by"; - @SerializedName(SERIALIZED_NAME_OWNED_BY) - @javax.annotation.Nonnull - private String ownedBy; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nullable - private List tags; - - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nullable - private Integer size; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; - @SerializedName(SERIALIZED_NAME_TEAM_ID) - @javax.annotation.Nullable - private Integer teamId; - - public CollectionSearchResult() { - } - - public CollectionSearchResult collectionId(@javax.annotation.Nonnull Integer collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * The ID of the collection - * @return collectionId - */ - @javax.annotation.Nonnull - public Integer getCollectionId() { - return collectionId; - } - - public void setCollectionId(@javax.annotation.Nonnull Integer collectionId) { - this.collectionId = collectionId; - } - - - public CollectionSearchResult collectionName(@javax.annotation.Nonnull String collectionName) { - this.collectionName = collectionName; - return this; - } - - /** - * The name of the collection - * @return collectionName - */ - @javax.annotation.Nonnull - public String getCollectionName() { - return collectionName; - } - - public void setCollectionName(@javax.annotation.Nonnull String collectionName) { - this.collectionName = collectionName; - } - - - public CollectionSearchResult scope(@javax.annotation.Nonnull String scope) { - this.scope = scope; - return this; - } - - /** - * The scope of the collection - * @return scope - */ - @javax.annotation.Nonnull - public String getScope() { - return scope; - } - - public void setScope(@javax.annotation.Nonnull String scope) { - this.scope = scope; - } - - - public CollectionSearchResult lastUpdatedAt(@javax.annotation.Nonnull OffsetDateTime lastUpdatedAt) { - this.lastUpdatedAt = lastUpdatedAt; - return this; - } - - /** - * The last update date of the collection - * @return lastUpdatedAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getLastUpdatedAt() { - return lastUpdatedAt; - } - - public void setLastUpdatedAt(@javax.annotation.Nonnull OffsetDateTime lastUpdatedAt) { - this.lastUpdatedAt = lastUpdatedAt; - } - - - public CollectionSearchResult createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The creation date of the collection - * @return createdAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public CollectionSearchResult ownedBy(@javax.annotation.Nonnull String ownedBy) { - this.ownedBy = ownedBy; - return this; - } - - /** - * The owner of the collection - * @return ownedBy - */ - @javax.annotation.Nonnull - public String getOwnedBy() { - return ownedBy; - } - - public void setOwnedBy(@javax.annotation.Nonnull String ownedBy) { - this.ownedBy = ownedBy; - } - - - public CollectionSearchResult tags(@javax.annotation.Nullable List tags) { - this.tags = tags; - return this; - } - - public CollectionSearchResult addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * The tags of the collection - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nullable List tags) { - this.tags = tags; - } - - - public CollectionSearchResult size(@javax.annotation.Nullable Integer size) { - this.size = size; - return this; - } - - /** - * The number of binaries in the collection - * @return size - */ - @javax.annotation.Nullable - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nullable Integer size) { - this.size = size; - } - - - public CollectionSearchResult description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * The description of the collection - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - - public CollectionSearchResult teamId(@javax.annotation.Nullable Integer teamId) { - this.teamId = teamId; - return this; - } - - /** - * The team ID of the collection - * @return teamId - */ - @javax.annotation.Nullable - public Integer getTeamId() { - return teamId; - } - - public void setTeamId(@javax.annotation.Nullable Integer teamId) { - this.teamId = teamId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CollectionSearchResult instance itself - */ - public CollectionSearchResult 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; - } - CollectionSearchResult collectionSearchResult = (CollectionSearchResult) o; - return Objects.equals(this.collectionId, collectionSearchResult.collectionId) && - Objects.equals(this.collectionName, collectionSearchResult.collectionName) && - Objects.equals(this.scope, collectionSearchResult.scope) && - Objects.equals(this.lastUpdatedAt, collectionSearchResult.lastUpdatedAt) && - Objects.equals(this.createdAt, collectionSearchResult.createdAt) && - Objects.equals(this.ownedBy, collectionSearchResult.ownedBy) && - Objects.equals(this.tags, collectionSearchResult.tags) && - Objects.equals(this.size, collectionSearchResult.size) && - Objects.equals(this.description, collectionSearchResult.description) && - Objects.equals(this.teamId, collectionSearchResult.teamId)&& - Objects.equals(this.additionalProperties, collectionSearchResult.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(collectionId, collectionName, scope, lastUpdatedAt, createdAt, ownedBy, tags, size, description, teamId, 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 CollectionSearchResult {\n"); - sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); - sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" ownedBy: ").append(toIndentedString(ownedBy)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("collection_id", "collection_name", "scope", "last_updated_at", "created_at", "owned_by", "tags", "size", "description", "team_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("collection_id", "collection_name", "scope", "last_updated_at", "created_at", "owned_by", "description")); - } - - /** - * 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 CollectionSearchResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionSearchResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionSearchResult is not found in the empty JSON string", CollectionSearchResult.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionSearchResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("collection_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); - } - if (!jsonObj.get("scope").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); - } - if (!jsonObj.get("owned_by").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `owned_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owned_by").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionSearchResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionSearchResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionSearchResult.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionSearchResult 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 CollectionSearchResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionSearchResult instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionSearchResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionSearchResult - * @throws IOException if the JSON string is invalid with respect to CollectionSearchResult - */ - public static CollectionSearchResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionSearchResult.class); - } - - /** - * Convert an instance of CollectionSearchResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionTagsUpdateRequest.java b/src/main/java/ai/reveng/model/CollectionTagsUpdateRequest.java deleted file mode 100644 index 445f4d1..0000000 --- a/src/main/java/ai/reveng/model/CollectionTagsUpdateRequest.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionTagsUpdateRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionTagsUpdateRequest { - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nonnull - private List tags = new ArrayList<>(); - - public CollectionTagsUpdateRequest() { - } - - public CollectionTagsUpdateRequest tags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - return this; - } - - public CollectionTagsUpdateRequest addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @javax.annotation.Nonnull - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CollectionTagsUpdateRequest instance itself - */ - public CollectionTagsUpdateRequest 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; - } - CollectionTagsUpdateRequest collectionTagsUpdateRequest = (CollectionTagsUpdateRequest) o; - return Objects.equals(this.tags, collectionTagsUpdateRequest.tags)&& - Objects.equals(this.additionalProperties, collectionTagsUpdateRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(tags, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CollectionTagsUpdateRequest {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("tags")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("tags")); - } - - /** - * 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 CollectionTagsUpdateRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionTagsUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionTagsUpdateRequest is not found in the empty JSON string", CollectionTagsUpdateRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionTagsUpdateRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("tags") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionTagsUpdateRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionTagsUpdateRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionTagsUpdateRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionTagsUpdateRequest 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 CollectionTagsUpdateRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionTagsUpdateRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionTagsUpdateRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionTagsUpdateRequest - * @throws IOException if the JSON string is invalid with respect to CollectionTagsUpdateRequest - */ - public static CollectionTagsUpdateRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionTagsUpdateRequest.class); - } - - /** - * Convert an instance of CollectionTagsUpdateRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionTagsUpdateResponse.java b/src/main/java/ai/reveng/model/CollectionTagsUpdateResponse.java deleted file mode 100644 index c88441d..0000000 --- a/src/main/java/ai/reveng/model/CollectionTagsUpdateResponse.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionTagsUpdateResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionTagsUpdateResponse { - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nonnull - private List tags = new ArrayList<>(); - - public CollectionTagsUpdateResponse() { - } - - public CollectionTagsUpdateResponse tags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - return this; - } - - public CollectionTagsUpdateResponse addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Collection tags - * @return tags - */ - @javax.annotation.Nonnull - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nonnull List tags) { - this.tags = tags; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CollectionTagsUpdateResponse instance itself - */ - public CollectionTagsUpdateResponse 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; - } - CollectionTagsUpdateResponse collectionTagsUpdateResponse = (CollectionTagsUpdateResponse) o; - return Objects.equals(this.tags, collectionTagsUpdateResponse.tags)&& - Objects.equals(this.additionalProperties, collectionTagsUpdateResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(tags, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CollectionTagsUpdateResponse {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("tags")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("tags")); - } - - /** - * 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 CollectionTagsUpdateResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionTagsUpdateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionTagsUpdateResponse is not found in the empty JSON string", CollectionTagsUpdateResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CollectionTagsUpdateResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("tags") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionTagsUpdateResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionTagsUpdateResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionTagsUpdateResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionTagsUpdateResponse 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 CollectionTagsUpdateResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionTagsUpdateResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionTagsUpdateResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionTagsUpdateResponse - * @throws IOException if the JSON string is invalid with respect to CollectionTagsUpdateResponse - */ - public static CollectionTagsUpdateResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionTagsUpdateResponse.class); - } - - /** - * Convert an instance of CollectionTagsUpdateResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CollectionUpdateRequest.java b/src/main/java/ai/reveng/model/CollectionUpdateRequest.java deleted file mode 100644 index 0ab1907..0000000 --- a/src/main/java/ai/reveng/model/CollectionUpdateRequest.java +++ /dev/null @@ -1,354 +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 ai.reveng.model.CollectionScope; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CollectionUpdateRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CollectionUpdateRequest { - public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; - @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) - @javax.annotation.Nullable - private String collectionName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable - private String description; - - public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; - @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) - @javax.annotation.Nullable - private CollectionScope collectionScope; - - public CollectionUpdateRequest() { - } - - public CollectionUpdateRequest collectionName(@javax.annotation.Nullable String collectionName) { - this.collectionName = collectionName; - return this; - } - - /** - * Get collectionName - * @return collectionName - */ - @javax.annotation.Nullable - public String getCollectionName() { - return collectionName; - } - - public void setCollectionName(@javax.annotation.Nullable String collectionName) { - this.collectionName = collectionName; - } - - - public CollectionUpdateRequest description(@javax.annotation.Nullable String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nullable String description) { - this.description = description; - } - - - public CollectionUpdateRequest collectionScope(@javax.annotation.Nullable CollectionScope collectionScope) { - this.collectionScope = collectionScope; - return this; - } - - /** - * Get collectionScope - * @return collectionScope - */ - @javax.annotation.Nullable - public CollectionScope getCollectionScope() { - return collectionScope; - } - - public void setCollectionScope(@javax.annotation.Nullable CollectionScope collectionScope) { - this.collectionScope = collectionScope; - } - - /** - * 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 CollectionUpdateRequest instance itself - */ - public CollectionUpdateRequest 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; - } - CollectionUpdateRequest collectionUpdateRequest = (CollectionUpdateRequest) o; - return Objects.equals(this.collectionName, collectionUpdateRequest.collectionName) && - Objects.equals(this.description, collectionUpdateRequest.description) && - Objects.equals(this.collectionScope, collectionUpdateRequest.collectionScope)&& - Objects.equals(this.additionalProperties, collectionUpdateRequest.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(collectionName, description, collectionScope, 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 CollectionUpdateRequest {\n"); - sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" collectionScope: ").append(toIndentedString(collectionScope)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("collection_name", "description", "collection_scope")); - - // 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 CollectionUpdateRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CollectionUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CollectionUpdateRequest is not found in the empty JSON string", CollectionUpdateRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("collection_name") != null && !jsonObj.get("collection_name").isJsonNull()) && !jsonObj.get("collection_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - // validate the optional field `collection_scope` - if (jsonObj.get("collection_scope") != null && !jsonObj.get("collection_scope").isJsonNull()) { - CollectionScope.validateJsonElement(jsonObj.get("collection_scope")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CollectionUpdateRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CollectionUpdateRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CollectionUpdateRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CollectionUpdateRequest 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 CollectionUpdateRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CollectionUpdateRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CollectionUpdateRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CollectionUpdateRequest - * @throws IOException if the JSON string is invalid with respect to CollectionUpdateRequest - */ - public static CollectionUpdateRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CollectionUpdateRequest.class); - } - - /** - * Convert an instance of CollectionUpdateRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CommentBase.java b/src/main/java/ai/reveng/model/CommentBase.java deleted file mode 100644 index a4b179d..0000000 --- a/src/main/java/ai/reveng/model/CommentBase.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CommentBase - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CommentBase { - public static final String SERIALIZED_NAME_CONTENT = "content"; - @SerializedName(SERIALIZED_NAME_CONTENT) - @javax.annotation.Nonnull - private String content; - - public CommentBase() { - } - - public CommentBase content(@javax.annotation.Nonnull String content) { - this.content = content; - return this; - } - - /** - * Comment text content - * @return content - */ - @javax.annotation.Nonnull - public String getContent() { - return content; - } - - public void setContent(@javax.annotation.Nonnull String content) { - this.content = content; - } - - /** - * 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 CommentBase instance itself - */ - public CommentBase 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; - } - CommentBase commentBase = (CommentBase) o; - return Objects.equals(this.content, commentBase.content)&& - Objects.equals(this.additionalProperties, commentBase.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(content, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CommentBase {\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("content")); - - // a set of required properties/fields (JSON key names) - 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 CommentBase - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CommentBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CommentBase is not found in the empty JSON string", CommentBase.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CommentBase.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("content").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CommentBase.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CommentBase' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CommentBase.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CommentBase 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 CommentBase read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CommentBase instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CommentBase given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommentBase - * @throws IOException if the JSON string is invalid with respect to CommentBase - */ - public static CommentBase fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CommentBase.class); - } - - /** - * Convert an instance of CommentBase to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CommentResponse.java b/src/main/java/ai/reveng/model/CommentResponse.java deleted file mode 100644 index 9aaee85..0000000 --- a/src/main/java/ai/reveng/model/CommentResponse.java +++ /dev/null @@ -1,495 +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 ai.reveng.model.Context; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CommentResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CommentResponse { - public static final String SERIALIZED_NAME_CONTENT = "content"; - @SerializedName(SERIALIZED_NAME_CONTENT) - @javax.annotation.Nonnull - private String content; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private Integer id; - - public static final String SERIALIZED_NAME_USER_ID = "user_id"; - @SerializedName(SERIALIZED_NAME_USER_ID) - @javax.annotation.Nonnull - private Integer userId; - - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resource_type"; - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - @javax.annotation.Nonnull - private String resourceType; - - public static final String SERIALIZED_NAME_RESOURCE_ID = "resource_id"; - @SerializedName(SERIALIZED_NAME_RESOURCE_ID) - @javax.annotation.Nonnull - private String resourceId; - - public static final String SERIALIZED_NAME_CONTEXT = "context"; - @SerializedName(SERIALIZED_NAME_CONTEXT) - @javax.annotation.Nullable - private Context context; - - 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_UPDATED_AT = "updated_at"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nonnull - private OffsetDateTime updatedAt; - - public CommentResponse() { - } - - public CommentResponse content(@javax.annotation.Nonnull String content) { - this.content = content; - return this; - } - - /** - * Comment text content - * @return content - */ - @javax.annotation.Nonnull - public String getContent() { - return content; - } - - public void setContent(@javax.annotation.Nonnull String content) { - this.content = content; - } - - - public CommentResponse id(@javax.annotation.Nonnull Integer id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - @javax.annotation.Nonnull - public Integer getId() { - return id; - } - - public void setId(@javax.annotation.Nonnull Integer id) { - this.id = id; - } - - - public CommentResponse userId(@javax.annotation.Nonnull Integer userId) { - this.userId = userId; - return this; - } - - /** - * Get userId - * @return userId - */ - @javax.annotation.Nonnull - public Integer getUserId() { - return userId; - } - - public void setUserId(@javax.annotation.Nonnull Integer userId) { - this.userId = userId; - } - - - public CommentResponse resourceType(@javax.annotation.Nonnull String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get resourceType - * @return resourceType - */ - @javax.annotation.Nonnull - public String getResourceType() { - return resourceType; - } - - public void setResourceType(@javax.annotation.Nonnull String resourceType) { - this.resourceType = resourceType; - } - - - public CommentResponse resourceId(@javax.annotation.Nonnull String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get resourceId - * @return resourceId - */ - @javax.annotation.Nonnull - public String getResourceId() { - return resourceId; - } - - public void setResourceId(@javax.annotation.Nonnull String resourceId) { - this.resourceId = resourceId; - } - - - public CommentResponse context(@javax.annotation.Nullable Context context) { - this.context = context; - return this; - } - - /** - * Get context - * @return context - */ - @javax.annotation.Nullable - public Context getContext() { - return context; - } - - public void setContext(@javax.annotation.Nullable Context context) { - this.context = context; - } - - - public CommentResponse 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 CommentResponse updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * @return updatedAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CommentResponse instance itself - */ - public CommentResponse 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; - } - CommentResponse commentResponse = (CommentResponse) o; - return Objects.equals(this.content, commentResponse.content) && - Objects.equals(this.id, commentResponse.id) && - Objects.equals(this.userId, commentResponse.userId) && - Objects.equals(this.resourceType, commentResponse.resourceType) && - Objects.equals(this.resourceId, commentResponse.resourceId) && - Objects.equals(this.context, commentResponse.context) && - Objects.equals(this.createdAt, commentResponse.createdAt) && - Objects.equals(this.updatedAt, commentResponse.updatedAt)&& - Objects.equals(this.additionalProperties, commentResponse.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(content, id, userId, resourceType, resourceId, context, createdAt, updatedAt, 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 CommentResponse {\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); - sb.append(" context: ").append(toIndentedString(context)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("content", "id", "user_id", "resource_type", "resource_id", "context", "created_at", "updated_at")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("content", "id", "user_id", "resource_type", "resource_id", "created_at", "updated_at")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CommentResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CommentResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CommentResponse is not found in the empty JSON string", CommentResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CommentResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("content").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); - } - if (!jsonObj.get("resource_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `resource_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource_type").toString())); - } - if (!jsonObj.get("resource_id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `resource_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource_id").toString())); - } - // validate the optional field `context` - if (jsonObj.get("context") != null && !jsonObj.get("context").isJsonNull()) { - Context.validateJsonElement(jsonObj.get("context")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CommentResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CommentResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CommentResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CommentResponse 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 CommentResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CommentResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CommentResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommentResponse - * @throws IOException if the JSON string is invalid with respect to CommentResponse - */ - public static CommentResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CommentResponse.class); - } - - /** - * Convert an instance of CommentResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/CommentUpdateRequest.java b/src/main/java/ai/reveng/model/CommentUpdateRequest.java deleted file mode 100644 index 50ad24d..0000000 --- a/src/main/java/ai/reveng/model/CommentUpdateRequest.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * CommentUpdateRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CommentUpdateRequest { - public static final String SERIALIZED_NAME_CONTENT = "content"; - @SerializedName(SERIALIZED_NAME_CONTENT) - @javax.annotation.Nonnull - private String content; - - public CommentUpdateRequest() { - } - - public CommentUpdateRequest content(@javax.annotation.Nonnull String content) { - this.content = content; - return this; - } - - /** - * Updated comment text - * @return content - */ - @javax.annotation.Nonnull - public String getContent() { - return content; - } - - public void setContent(@javax.annotation.Nonnull String content) { - this.content = content; - } - - /** - * 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 CommentUpdateRequest instance itself - */ - public CommentUpdateRequest 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; - } - CommentUpdateRequest commentUpdateRequest = (CommentUpdateRequest) o; - return Objects.equals(this.content, commentUpdateRequest.content)&& - Objects.equals(this.additionalProperties, commentUpdateRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(content, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CommentUpdateRequest {\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("content")); - - // a set of required properties/fields (JSON key names) - 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 CommentUpdateRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CommentUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CommentUpdateRequest is not found in the empty JSON string", CommentUpdateRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CommentUpdateRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("content").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CommentUpdateRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CommentUpdateRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CommentUpdateRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CommentUpdateRequest 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 CommentUpdateRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CommentUpdateRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CommentUpdateRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommentUpdateRequest - * @throws IOException if the JSON string is invalid with respect to CommentUpdateRequest - */ - public static CommentUpdateRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CommentUpdateRequest.class); - } - - /** - * Convert an instance of CommentUpdateRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ConfigResponse.java b/src/main/java/ai/reveng/model/ConfigResponse.java deleted file mode 100644 index 7448c37..0000000 --- a/src/main/java/ai/reveng/model/ConfigResponse.java +++ /dev/null @@ -1,397 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ConfigResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ConfigResponse { - public static final String SERIALIZED_NAME_DASHBOARD_URL = "dashboard_url"; - @SerializedName(SERIALIZED_NAME_DASHBOARD_URL) - @javax.annotation.Nullable - private String dashboardUrl = ""; - - public static final String SERIALIZED_NAME_MAX_FILE_SIZE_BYTES = "max_file_size_bytes"; - @SerializedName(SERIALIZED_NAME_MAX_FILE_SIZE_BYTES) - @javax.annotation.Nonnull - private Integer maxFileSizeBytes; - - public static final String SERIALIZED_NAME_AI_DECOMPILER_UNSUPPORTED_LANGUAGES = "ai_decompiler_unsupported_languages"; - @SerializedName(SERIALIZED_NAME_AI_DECOMPILER_UNSUPPORTED_LANGUAGES) - @javax.annotation.Nonnull - private List aiDecompilerUnsupportedLanguages = new ArrayList<>(); - - public static final String SERIALIZED_NAME_AI_DECOMPILER_SUPPORTED_MODELS = "ai_decompiler_supported_models"; - @SerializedName(SERIALIZED_NAME_AI_DECOMPILER_SUPPORTED_MODELS) - @javax.annotation.Nonnull - private List aiDecompilerSupportedModels = new ArrayList<>(); - - public ConfigResponse() { - } - - public ConfigResponse dashboardUrl(@javax.annotation.Nullable String dashboardUrl) { - this.dashboardUrl = dashboardUrl; - return this; - } - - /** - * The domain of the RevEng.AI platform you are connected to - * @return dashboardUrl - */ - @javax.annotation.Nullable - public String getDashboardUrl() { - return dashboardUrl; - } - - public void setDashboardUrl(@javax.annotation.Nullable String dashboardUrl) { - this.dashboardUrl = dashboardUrl; - } - - - public ConfigResponse maxFileSizeBytes(@javax.annotation.Nonnull Integer maxFileSizeBytes) { - this.maxFileSizeBytes = maxFileSizeBytes; - return this; - } - - /** - * Maximum file size (in bytes) that can be uploaded for analysis - * @return maxFileSizeBytes - */ - @javax.annotation.Nonnull - public Integer getMaxFileSizeBytes() { - return maxFileSizeBytes; - } - - public void setMaxFileSizeBytes(@javax.annotation.Nonnull Integer maxFileSizeBytes) { - this.maxFileSizeBytes = maxFileSizeBytes; - } - - - public ConfigResponse aiDecompilerUnsupportedLanguages(@javax.annotation.Nonnull List aiDecompilerUnsupportedLanguages) { - this.aiDecompilerUnsupportedLanguages = aiDecompilerUnsupportedLanguages; - return this; - } - - public ConfigResponse addAiDecompilerUnsupportedLanguagesItem(String aiDecompilerUnsupportedLanguagesItem) { - if (this.aiDecompilerUnsupportedLanguages == null) { - this.aiDecompilerUnsupportedLanguages = new ArrayList<>(); - } - this.aiDecompilerUnsupportedLanguages.add(aiDecompilerUnsupportedLanguagesItem); - return this; - } - - /** - * List of programming languages that are not supported for AI decompilation - * @return aiDecompilerUnsupportedLanguages - */ - @javax.annotation.Nonnull - public List getAiDecompilerUnsupportedLanguages() { - return aiDecompilerUnsupportedLanguages; - } - - public void setAiDecompilerUnsupportedLanguages(@javax.annotation.Nonnull List aiDecompilerUnsupportedLanguages) { - this.aiDecompilerUnsupportedLanguages = aiDecompilerUnsupportedLanguages; - } - - - public ConfigResponse aiDecompilerSupportedModels(@javax.annotation.Nonnull List aiDecompilerSupportedModels) { - this.aiDecompilerSupportedModels = aiDecompilerSupportedModels; - return this; - } - - public ConfigResponse addAiDecompilerSupportedModelsItem(String aiDecompilerSupportedModelsItem) { - if (this.aiDecompilerSupportedModels == null) { - this.aiDecompilerSupportedModels = new ArrayList<>(); - } - this.aiDecompilerSupportedModels.add(aiDecompilerSupportedModelsItem); - return this; - } - - /** - * List of models that support AI decompilation - * @return aiDecompilerSupportedModels - */ - @javax.annotation.Nonnull - public List getAiDecompilerSupportedModels() { - return aiDecompilerSupportedModels; - } - - public void setAiDecompilerSupportedModels(@javax.annotation.Nonnull List aiDecompilerSupportedModels) { - this.aiDecompilerSupportedModels = aiDecompilerSupportedModels; - } - - /** - * 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 ConfigResponse instance itself - */ - public ConfigResponse 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; - } - ConfigResponse configResponse = (ConfigResponse) o; - return Objects.equals(this.dashboardUrl, configResponse.dashboardUrl) && - Objects.equals(this.maxFileSizeBytes, configResponse.maxFileSizeBytes) && - Objects.equals(this.aiDecompilerUnsupportedLanguages, configResponse.aiDecompilerUnsupportedLanguages) && - Objects.equals(this.aiDecompilerSupportedModels, configResponse.aiDecompilerSupportedModels)&& - Objects.equals(this.additionalProperties, configResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(dashboardUrl, maxFileSizeBytes, aiDecompilerUnsupportedLanguages, aiDecompilerSupportedModels, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConfigResponse {\n"); - sb.append(" dashboardUrl: ").append(toIndentedString(dashboardUrl)).append("\n"); - sb.append(" maxFileSizeBytes: ").append(toIndentedString(maxFileSizeBytes)).append("\n"); - sb.append(" aiDecompilerUnsupportedLanguages: ").append(toIndentedString(aiDecompilerUnsupportedLanguages)).append("\n"); - sb.append(" aiDecompilerSupportedModels: ").append(toIndentedString(aiDecompilerSupportedModels)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("dashboard_url", "max_file_size_bytes", "ai_decompiler_unsupported_languages", "ai_decompiler_supported_models")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("max_file_size_bytes", "ai_decompiler_unsupported_languages", "ai_decompiler_supported_models")); - } - - /** - * 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 ConfigResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConfigResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ConfigResponse is not found in the empty JSON string", ConfigResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ConfigResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("dashboard_url") != null && !jsonObj.get("dashboard_url").isJsonNull()) && !jsonObj.get("dashboard_url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `dashboard_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dashboard_url").toString())); - } - // ensure the required json array is present - if (jsonObj.get("ai_decompiler_unsupported_languages") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("ai_decompiler_unsupported_languages").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ai_decompiler_unsupported_languages` to be an array in the JSON string but got `%s`", jsonObj.get("ai_decompiler_unsupported_languages").toString())); - } - // ensure the required json array is present - if (jsonObj.get("ai_decompiler_supported_models") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("ai_decompiler_supported_models").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ai_decompiler_supported_models` to be an array in the JSON string but got `%s`", jsonObj.get("ai_decompiler_supported_models").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConfigResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConfigResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConfigResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConfigResponse 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 ConfigResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConfigResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ConfigResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConfigResponse - * @throws IOException if the JSON string is invalid with respect to ConfigResponse - */ - public static ConfigResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConfigResponse.class); - } - - /** - * Convert an instance of ConfigResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Context.java b/src/main/java/ai/reveng/model/Context.java deleted file mode 100644 index 557b1ed..0000000 --- a/src/main/java/ai/reveng/model/Context.java +++ /dev/null @@ -1,274 +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 ai.reveng.model.DecompilationCommentContext; -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 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 Context extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(Context.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Context.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Context' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterDecompilationCommentContext = gson.getDelegateAdapter(this, TypeToken.get(DecompilationCommentContext.class)); - final TypeAdapter adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Context value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `DecompilationCommentContext` - if (value.getActualInstance() instanceof DecompilationCommentContext) { - JsonElement element = adapterDecompilationCommentContext.toJsonTree((DecompilationCommentContext)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `Object` - if (value.getActualInstance() instanceof Object) { - JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); - elementAdapter.write(out, primitive); - return; - } - throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: DecompilationCommentContext, Object"); - } - - @Override - public Context read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize DecompilationCommentContext - try { - // validate the JSON object to see if any exception is thrown - DecompilationCommentContext.validateJsonElement(jsonElement); - actualAdapter = adapterDecompilationCommentContext; - Context ret = new Context(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for DecompilationCommentContext failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'DecompilationCommentContext'", e); - } - // deserialize Object - try { - // validate the JSON object to see if any exception is thrown - if (!jsonElement.getAsJsonPrimitive().isNumber()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); - } - actualAdapter = adapterObject; - Context ret = new Context(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for Object failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Object'", e); - } - - throw new IOException(String.format(java.util.Locale.ROOT, "Failed deserialization for Context: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public Context() { - super("anyOf", Boolean.TRUE); - } - - public Context(Object o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - static { - schemas.put("DecompilationCommentContext", DecompilationCommentContext.class); - schemas.put("Object", Object.class); - } - - @Override - public Map> getSchemas() { - return Context.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * DecompilationCommentContext, Object - * - * It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance == null) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof DecompilationCommentContext) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof Object) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be DecompilationCommentContext, Object"); - } - - /** - * Get the actual instance, which can be the following: - * DecompilationCommentContext, Object - * - * @return The actual instance (DecompilationCommentContext, Object) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `DecompilationCommentContext`. If the actual instance is not `DecompilationCommentContext`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `DecompilationCommentContext` - * @throws ClassCastException if the instance is not `DecompilationCommentContext` - */ - public DecompilationCommentContext getDecompilationCommentContext() throws ClassCastException { - return (DecompilationCommentContext)super.getActualInstance(); - } - - /** - * Get the actual instance of `Object`. If the actual instance is not `Object`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Object` - * @throws ClassCastException if the instance is not `Object` - */ - public Object getObject() throws ClassCastException { - return (Object)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 Context - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with DecompilationCommentContext - try { - DecompilationCommentContext.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for DecompilationCommentContext failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with Object - try { - if (!jsonElement.getAsJsonPrimitive().isNumber()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); - } - return; - } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for Object failed with `%s`.", e.getMessage())); - // continue to the next one - } - throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for Context with anyOf schemas: DecompilationCommentContext, Object. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of Context given an JSON string - * - * @param jsonString JSON string - * @return An instance of Context - * @throws IOException if the JSON string is invalid with respect to Context - */ - public static Context fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Context.class); - } - - /** - * Convert an instance of Context to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Created.java b/src/main/java/ai/reveng/model/Created.java deleted file mode 100644 index 5417e2a..0000000 --- a/src/main/java/ai/reveng/model/Created.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Created - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Created { - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_REFERENCE = "reference"; - @Deprecated - @SerializedName(SERIALIZED_NAME_REFERENCE) - @javax.annotation.Nonnull - private String reference; - - public Created() { - } - - public Created analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * The ID corresponding to the newly created analysis - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public Created binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * The ID corresponding to the binary that was created - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - @Deprecated - public Created reference(@javax.annotation.Nonnull String reference) { - this.reference = reference; - return this; - } - - /** - * Deprecated will always be empty string - * @return reference - * @deprecated - */ - @Deprecated - @javax.annotation.Nonnull - public String getReference() { - return reference; - } - - @Deprecated - public void setReference(@javax.annotation.Nonnull String reference) { - this.reference = reference; - } - - /** - * 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 Created instance itself - */ - public Created 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; - } - Created created = (Created) o; - return Objects.equals(this.analysisId, created.analysisId) && - Objects.equals(this.binaryId, created.binaryId) && - Objects.equals(this.reference, created.reference)&& - Objects.equals(this.additionalProperties, created.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(analysisId, binaryId, reference, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Created {\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "reference")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "binary_id", "reference")); - } - - /** - * 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 Created - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Created.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Created is not found in the empty JSON string", Created.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Created.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("reference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Created.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Created' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Created.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Created 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 Created read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Created instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Created given an JSON string - * - * @param jsonString JSON string - * @return An instance of Created - * @throws IOException if the JSON string is invalid with respect to Created - */ - public static Created fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Created.class); - } - - /** - * Convert an instance of Created to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/DecompilationCommentContext.java b/src/main/java/ai/reveng/model/DecompilationCommentContext.java deleted file mode 100644 index 2f90c81..0000000 --- a/src/main/java/ai/reveng/model/DecompilationCommentContext.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 com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * DecompilationCommentContext - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class DecompilationCommentContext { - public static final String SERIALIZED_NAME_START_LINE = "start_line"; - @SerializedName(SERIALIZED_NAME_START_LINE) - @javax.annotation.Nullable - private Integer startLine; - - public static final String SERIALIZED_NAME_END_LINE = "end_line"; - @SerializedName(SERIALIZED_NAME_END_LINE) - @javax.annotation.Nullable - private Integer endLine; - - public DecompilationCommentContext() { - } - - public DecompilationCommentContext startLine(@javax.annotation.Nullable Integer startLine) { - this.startLine = startLine; - return this; - } - - /** - * Get startLine - * @return startLine - */ - @javax.annotation.Nullable - public Integer getStartLine() { - return startLine; - } - - public void setStartLine(@javax.annotation.Nullable Integer startLine) { - this.startLine = startLine; - } - - - public DecompilationCommentContext endLine(@javax.annotation.Nullable Integer endLine) { - this.endLine = endLine; - return this; - } - - /** - * Get endLine - * @return endLine - */ - @javax.annotation.Nullable - public Integer getEndLine() { - return endLine; - } - - public void setEndLine(@javax.annotation.Nullable Integer endLine) { - this.endLine = endLine; - } - - /** - * 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 DecompilationCommentContext instance itself - */ - public DecompilationCommentContext 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; - } - DecompilationCommentContext decompilationCommentContext = (DecompilationCommentContext) o; - return Objects.equals(this.startLine, decompilationCommentContext.startLine) && - Objects.equals(this.endLine, decompilationCommentContext.endLine)&& - Objects.equals(this.additionalProperties, decompilationCommentContext.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(startLine, endLine, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DecompilationCommentContext {\n"); - sb.append(" startLine: ").append(toIndentedString(startLine)).append("\n"); - sb.append(" endLine: ").append(toIndentedString(endLine)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("start_line", "end_line")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("start_line", "end_line")); - } - - /** - * 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 DecompilationCommentContext - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DecompilationCommentContext.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in DecompilationCommentContext is not found in the empty JSON string", DecompilationCommentContext.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DecompilationCommentContext.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DecompilationCommentContext.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DecompilationCommentContext' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DecompilationCommentContext.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DecompilationCommentContext 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 DecompilationCommentContext read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - DecompilationCommentContext instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DecompilationCommentContext given an JSON string - * - * @param jsonString JSON string - * @return An instance of DecompilationCommentContext - * @throws IOException if the JSON string is invalid with respect to DecompilationCommentContext - */ - public static DecompilationCommentContext fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DecompilationCommentContext.class); - } - - /** - * Convert an instance of DecompilationCommentContext to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/DieMatch.java b/src/main/java/ai/reveng/model/DieMatch.java deleted file mode 100644 index 66777bc..0000000 --- a/src/main/java/ai/reveng/model/DieMatch.java +++ /dev/null @@ -1,376 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * DieMatch - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class DieMatch { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_DISPLAY = "display"; - @SerializedName(SERIALIZED_NAME_DISPLAY) - @javax.annotation.Nonnull - private String display; - - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - @javax.annotation.Nonnull - private String version; - - public DieMatch() { - } - - public DieMatch name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Canonical name of the matched signature/technology (e.g., 'UPX', 'GCC', 'MSVC'). - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public DieMatch type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Category assigned by DIE for the match (e.g., 'compiler', 'packer', 'file'). - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public DieMatch display(@javax.annotation.Nonnull String display) { - this.display = display; - return this; - } - - /** - * Human-readable description from DIE's 'string' field; suitable for UI/logs, not for parsing. - * @return display - */ - @javax.annotation.Nonnull - public String getDisplay() { - return display; - } - - public void setDisplay(@javax.annotation.Nonnull String display) { - this.display = display; - } - - - public DieMatch version(@javax.annotation.Nonnull String version) { - this.version = version; - return this; - } - - /** - * Extracted version string when available; may be empty/None if unknown. - * @return version - */ - @javax.annotation.Nonnull - public String getVersion() { - return version; - } - - public void setVersion(@javax.annotation.Nonnull String version) { - this.version = version; - } - - /** - * 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 DieMatch instance itself - */ - public DieMatch 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; - } - DieMatch dieMatch = (DieMatch) o; - return Objects.equals(this.name, dieMatch.name) && - Objects.equals(this.type, dieMatch.type) && - Objects.equals(this.display, dieMatch.display) && - Objects.equals(this.version, dieMatch.version)&& - Objects.equals(this.additionalProperties, dieMatch.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, type, display, version, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DieMatch {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" display: ").append(toIndentedString(display)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "type", "display", "version")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "type", "display", "version")); - } - - /** - * 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 DieMatch - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DieMatch.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in DieMatch is not found in the empty JSON string", DieMatch.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DieMatch.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("display").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `display` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display").toString())); - } - if (!jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DieMatch.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DieMatch' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DieMatch.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DieMatch 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 DieMatch read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - DieMatch instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DieMatch given an JSON string - * - * @param jsonString JSON string - * @return An instance of DieMatch - * @throws IOException if the JSON string is invalid with respect to DieMatch - */ - public static DieMatch fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DieMatch.class); - } - - /** - * Convert an instance of DieMatch to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/DisassemblyOutputBody.java b/src/main/java/ai/reveng/model/DisassemblyOutputBody.java index e725db4..9c108a1 100644 --- a/src/main/java/ai/reveng/model/DisassemblyOutputBody.java +++ b/src/main/java/ai/reveng/model/DisassemblyOutputBody.java @@ -165,7 +165,7 @@ public DisassemblyOutputBody returnType(@javax.annotation.Nullable String return } /** - * Search is applied to string value + * Get returnType * @return returnType */ @javax.annotation.Nullable diff --git a/src/main/java/ai/reveng/model/DynamicExecutionStatus.java b/src/main/java/ai/reveng/model/DynamicExecutionStatus.java deleted file mode 100644 index 919c59f..0000000 --- a/src/main/java/ai/reveng/model/DynamicExecutionStatus.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Custom enum for the dynamic execution status - */ -@JsonAdapter(DynamicExecutionStatus.Adapter.class) -public enum DynamicExecutionStatus { - - PENDING("PENDING"), - - ERROR("ERROR"), - - SUCCESS("SUCCESS"), - - ALL("ALL"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - DynamicExecutionStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static DynamicExecutionStatus fromValue(String value) { - for (DynamicExecutionStatus b : DynamicExecutionStatus.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final DynamicExecutionStatus enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DynamicExecutionStatus read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return DynamicExecutionStatus.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - DynamicExecutionStatus.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/ELFImportModel.java b/src/main/java/ai/reveng/model/ELFImportModel.java deleted file mode 100644 index ee5bd3e..0000000 --- a/src/main/java/ai/reveng/model/ELFImportModel.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ELFImportModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ELFImportModel { - public static final String SERIALIZED_NAME_NUMBER_OF_IMPORTS = "number_of_imports"; - @SerializedName(SERIALIZED_NAME_NUMBER_OF_IMPORTS) - @javax.annotation.Nonnull - private Integer numberOfImports; - - public static final String SERIALIZED_NAME_IMPORTS = "imports"; - @SerializedName(SERIALIZED_NAME_IMPORTS) - @javax.annotation.Nonnull - private List imports = new ArrayList<>(); - - public ELFImportModel() { - } - - public ELFImportModel numberOfImports(@javax.annotation.Nonnull Integer numberOfImports) { - this.numberOfImports = numberOfImports; - return this; - } - - /** - * Get numberOfImports - * @return numberOfImports - */ - @javax.annotation.Nonnull - public Integer getNumberOfImports() { - return numberOfImports; - } - - public void setNumberOfImports(@javax.annotation.Nonnull Integer numberOfImports) { - this.numberOfImports = numberOfImports; - } - - - public ELFImportModel imports(@javax.annotation.Nonnull List imports) { - this.imports = imports; - return this; - } - - public ELFImportModel addImportsItem(String importsItem) { - if (this.imports == null) { - this.imports = new ArrayList<>(); - } - this.imports.add(importsItem); - return this; - } - - /** - * Get imports - * @return imports - */ - @javax.annotation.Nonnull - public List getImports() { - return imports; - } - - public void setImports(@javax.annotation.Nonnull List imports) { - this.imports = imports; - } - - /** - * 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 ELFImportModel instance itself - */ - public ELFImportModel 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; - } - ELFImportModel elFImportModel = (ELFImportModel) o; - return Objects.equals(this.numberOfImports, elFImportModel.numberOfImports) && - Objects.equals(this.imports, elFImportModel.imports)&& - Objects.equals(this.additionalProperties, elFImportModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(numberOfImports, imports, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ELFImportModel {\n"); - sb.append(" numberOfImports: ").append(toIndentedString(numberOfImports)).append("\n"); - sb.append(" imports: ").append(toIndentedString(imports)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("number_of_imports", "imports")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("number_of_imports", "imports")); - } - - /** - * 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 ELFImportModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ELFImportModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ELFImportModel is not found in the empty JSON string", ELFImportModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ELFImportModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("imports") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("imports").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `imports` to be an array in the JSON string but got `%s`", jsonObj.get("imports").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ELFImportModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ELFImportModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ELFImportModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ELFImportModel 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 ELFImportModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ELFImportModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ELFImportModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ELFImportModel - * @throws IOException if the JSON string is invalid with respect to ELFImportModel - */ - public static ELFImportModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ELFImportModel.class); - } - - /** - * Convert an instance of ELFImportModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ELFModel.java b/src/main/java/ai/reveng/model/ELFModel.java deleted file mode 100644 index 14c1520..0000000 --- a/src/main/java/ai/reveng/model/ELFModel.java +++ /dev/null @@ -1,968 +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 ai.reveng.model.ELFImportModel; -import ai.reveng.model.ELFRelocation; -import ai.reveng.model.ELFSection; -import ai.reveng.model.ELFSecurity; -import ai.reveng.model.ELFSegment; -import ai.reveng.model.ELFSymbol; -import ai.reveng.model.ElfDynamicEntry; -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.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ELFModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ELFModel { - public static final String SERIALIZED_NAME_FILE_TYPE = "file_type"; - @SerializedName(SERIALIZED_NAME_FILE_TYPE) - @javax.annotation.Nonnull - private String fileType; - - public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; - @SerializedName(SERIALIZED_NAME_ARCHITECTURE) - @javax.annotation.Nonnull - private String architecture; - - public static final String SERIALIZED_NAME_ENDIANNESS = "endianness"; - @SerializedName(SERIALIZED_NAME_ENDIANNESS) - @javax.annotation.Nonnull - private String endianness; - - public static final String SERIALIZED_NAME_ENTRY_POINT = "entry_point"; - @SerializedName(SERIALIZED_NAME_ENTRY_POINT) - @javax.annotation.Nonnull - private Integer entryPoint; - - public static final String SERIALIZED_NAME_ENTRY_POINT_BYTES = "entry_point_bytes"; - @SerializedName(SERIALIZED_NAME_ENTRY_POINT_BYTES) - @javax.annotation.Nonnull - private String entryPointBytes; - - public static final String SERIALIZED_NAME_IMPORT_HASH = "import_hash"; - @SerializedName(SERIALIZED_NAME_IMPORT_HASH) - @javax.annotation.Nonnull - private String importHash; - - public static final String SERIALIZED_NAME_EXPORT_HASH = "export_hash"; - @SerializedName(SERIALIZED_NAME_EXPORT_HASH) - @javax.annotation.Nonnull - private String exportHash; - - public static final String SERIALIZED_NAME_BUILD_ID = "build_id"; - @SerializedName(SERIALIZED_NAME_BUILD_ID) - @javax.annotation.Nonnull - private String buildId; - - public static final String SERIALIZED_NAME_SECURITY = "security"; - @SerializedName(SERIALIZED_NAME_SECURITY) - @javax.annotation.Nonnull - private ELFSecurity security; - - public static final String SERIALIZED_NAME_SECTIONS = "sections"; - @SerializedName(SERIALIZED_NAME_SECTIONS) - @javax.annotation.Nonnull - private List sections = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SEGMENTS = "segments"; - @SerializedName(SERIALIZED_NAME_SEGMENTS) - @javax.annotation.Nonnull - private List segments = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SYMBOLS = "symbols"; - @SerializedName(SERIALIZED_NAME_SYMBOLS) - @javax.annotation.Nonnull - private List symbols = new ArrayList<>(); - - public static final String SERIALIZED_NAME_DYNAMIC_SYMBOLS = "dynamic_symbols"; - @SerializedName(SERIALIZED_NAME_DYNAMIC_SYMBOLS) - @javax.annotation.Nonnull - private List dynamicSymbols = new ArrayList<>(); - - public static final String SERIALIZED_NAME_RELOCATIONS = "relocations"; - @SerializedName(SERIALIZED_NAME_RELOCATIONS) - @javax.annotation.Nonnull - private List relocations = new ArrayList<>(); - - public static final String SERIALIZED_NAME_IMPORTS = "imports"; - @SerializedName(SERIALIZED_NAME_IMPORTS) - @javax.annotation.Nonnull - private ELFImportModel imports; - - public static final String SERIALIZED_NAME_EXPORTED_FUNCTIONS = "exported_functions"; - @SerializedName(SERIALIZED_NAME_EXPORTED_FUNCTIONS) - @javax.annotation.Nonnull - private List exportedFunctions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_DYNAMIC_ENTRIES = "dynamic_entries"; - @SerializedName(SERIALIZED_NAME_DYNAMIC_ENTRIES) - @javax.annotation.Nonnull - private List dynamicEntries = new ArrayList<>(); - - public static final String SERIALIZED_NAME_NOTES = "notes"; - @SerializedName(SERIALIZED_NAME_NOTES) - @javax.annotation.Nonnull - private List> notes = new ArrayList<>(); - - public static final String SERIALIZED_NAME_DEBUG_INFO = "debug_info"; - @SerializedName(SERIALIZED_NAME_DEBUG_INFO) - @javax.annotation.Nonnull - private Map debugInfo = new HashMap<>(); - - public static final String SERIALIZED_NAME_VERSION_INFO = "version_info"; - @SerializedName(SERIALIZED_NAME_VERSION_INFO) - @javax.annotation.Nonnull - private Map versionInfo = new HashMap<>(); - - public ELFModel() { - } - - public ELFModel fileType(@javax.annotation.Nonnull String fileType) { - this.fileType = fileType; - return this; - } - - /** - * Get fileType - * @return fileType - */ - @javax.annotation.Nonnull - public String getFileType() { - return fileType; - } - - public void setFileType(@javax.annotation.Nonnull String fileType) { - this.fileType = fileType; - } - - - public ELFModel architecture(@javax.annotation.Nonnull String architecture) { - this.architecture = architecture; - return this; - } - - /** - * Get architecture - * @return architecture - */ - @javax.annotation.Nonnull - public String getArchitecture() { - return architecture; - } - - public void setArchitecture(@javax.annotation.Nonnull String architecture) { - this.architecture = architecture; - } - - - public ELFModel endianness(@javax.annotation.Nonnull String endianness) { - this.endianness = endianness; - return this; - } - - /** - * Get endianness - * @return endianness - */ - @javax.annotation.Nonnull - public String getEndianness() { - return endianness; - } - - public void setEndianness(@javax.annotation.Nonnull String endianness) { - this.endianness = endianness; - } - - - public ELFModel entryPoint(@javax.annotation.Nonnull Integer entryPoint) { - this.entryPoint = entryPoint; - return this; - } - - /** - * Get entryPoint - * @return entryPoint - */ - @javax.annotation.Nonnull - public Integer getEntryPoint() { - return entryPoint; - } - - public void setEntryPoint(@javax.annotation.Nonnull Integer entryPoint) { - this.entryPoint = entryPoint; - } - - - public ELFModel entryPointBytes(@javax.annotation.Nonnull String entryPointBytes) { - this.entryPointBytes = entryPointBytes; - return this; - } - - /** - * Get entryPointBytes - * @return entryPointBytes - */ - @javax.annotation.Nonnull - public String getEntryPointBytes() { - return entryPointBytes; - } - - public void setEntryPointBytes(@javax.annotation.Nonnull String entryPointBytes) { - this.entryPointBytes = entryPointBytes; - } - - - public ELFModel importHash(@javax.annotation.Nonnull String importHash) { - this.importHash = importHash; - return this; - } - - /** - * Get importHash - * @return importHash - */ - @javax.annotation.Nonnull - public String getImportHash() { - return importHash; - } - - public void setImportHash(@javax.annotation.Nonnull String importHash) { - this.importHash = importHash; - } - - - public ELFModel exportHash(@javax.annotation.Nonnull String exportHash) { - this.exportHash = exportHash; - return this; - } - - /** - * Get exportHash - * @return exportHash - */ - @javax.annotation.Nonnull - public String getExportHash() { - return exportHash; - } - - public void setExportHash(@javax.annotation.Nonnull String exportHash) { - this.exportHash = exportHash; - } - - - public ELFModel buildId(@javax.annotation.Nonnull String buildId) { - this.buildId = buildId; - return this; - } - - /** - * Get buildId - * @return buildId - */ - @javax.annotation.Nonnull - public String getBuildId() { - return buildId; - } - - public void setBuildId(@javax.annotation.Nonnull String buildId) { - this.buildId = buildId; - } - - - public ELFModel security(@javax.annotation.Nonnull ELFSecurity security) { - this.security = security; - return this; - } - - /** - * Get security - * @return security - */ - @javax.annotation.Nonnull - public ELFSecurity getSecurity() { - return security; - } - - public void setSecurity(@javax.annotation.Nonnull ELFSecurity security) { - this.security = security; - } - - - public ELFModel sections(@javax.annotation.Nonnull List sections) { - this.sections = sections; - return this; - } - - public ELFModel addSectionsItem(ELFSection sectionsItem) { - if (this.sections == null) { - this.sections = new ArrayList<>(); - } - this.sections.add(sectionsItem); - return this; - } - - /** - * Get sections - * @return sections - */ - @javax.annotation.Nonnull - public List getSections() { - return sections; - } - - public void setSections(@javax.annotation.Nonnull List sections) { - this.sections = sections; - } - - - public ELFModel segments(@javax.annotation.Nonnull List segments) { - this.segments = segments; - return this; - } - - public ELFModel addSegmentsItem(ELFSegment segmentsItem) { - if (this.segments == null) { - this.segments = new ArrayList<>(); - } - this.segments.add(segmentsItem); - return this; - } - - /** - * Get segments - * @return segments - */ - @javax.annotation.Nonnull - public List getSegments() { - return segments; - } - - public void setSegments(@javax.annotation.Nonnull List segments) { - this.segments = segments; - } - - - public ELFModel symbols(@javax.annotation.Nonnull List symbols) { - this.symbols = symbols; - return this; - } - - public ELFModel addSymbolsItem(ELFSymbol symbolsItem) { - if (this.symbols == null) { - this.symbols = new ArrayList<>(); - } - this.symbols.add(symbolsItem); - return this; - } - - /** - * Get symbols - * @return symbols - */ - @javax.annotation.Nonnull - public List getSymbols() { - return symbols; - } - - public void setSymbols(@javax.annotation.Nonnull List symbols) { - this.symbols = symbols; - } - - - public ELFModel dynamicSymbols(@javax.annotation.Nonnull List dynamicSymbols) { - this.dynamicSymbols = dynamicSymbols; - return this; - } - - public ELFModel addDynamicSymbolsItem(ELFSymbol dynamicSymbolsItem) { - if (this.dynamicSymbols == null) { - this.dynamicSymbols = new ArrayList<>(); - } - this.dynamicSymbols.add(dynamicSymbolsItem); - return this; - } - - /** - * Get dynamicSymbols - * @return dynamicSymbols - */ - @javax.annotation.Nonnull - public List getDynamicSymbols() { - return dynamicSymbols; - } - - public void setDynamicSymbols(@javax.annotation.Nonnull List dynamicSymbols) { - this.dynamicSymbols = dynamicSymbols; - } - - - public ELFModel relocations(@javax.annotation.Nonnull List relocations) { - this.relocations = relocations; - return this; - } - - public ELFModel addRelocationsItem(ELFRelocation relocationsItem) { - if (this.relocations == null) { - this.relocations = new ArrayList<>(); - } - this.relocations.add(relocationsItem); - return this; - } - - /** - * Get relocations - * @return relocations - */ - @javax.annotation.Nonnull - public List getRelocations() { - return relocations; - } - - public void setRelocations(@javax.annotation.Nonnull List relocations) { - this.relocations = relocations; - } - - - public ELFModel imports(@javax.annotation.Nonnull ELFImportModel imports) { - this.imports = imports; - return this; - } - - /** - * Get imports - * @return imports - */ - @javax.annotation.Nonnull - public ELFImportModel getImports() { - return imports; - } - - public void setImports(@javax.annotation.Nonnull ELFImportModel imports) { - this.imports = imports; - } - - - public ELFModel exportedFunctions(@javax.annotation.Nonnull List exportedFunctions) { - this.exportedFunctions = exportedFunctions; - return this; - } - - public ELFModel addExportedFunctionsItem(String exportedFunctionsItem) { - if (this.exportedFunctions == null) { - this.exportedFunctions = new ArrayList<>(); - } - this.exportedFunctions.add(exportedFunctionsItem); - return this; - } - - /** - * Get exportedFunctions - * @return exportedFunctions - */ - @javax.annotation.Nonnull - public List getExportedFunctions() { - return exportedFunctions; - } - - public void setExportedFunctions(@javax.annotation.Nonnull List exportedFunctions) { - this.exportedFunctions = exportedFunctions; - } - - - public ELFModel dynamicEntries(@javax.annotation.Nonnull List dynamicEntries) { - this.dynamicEntries = dynamicEntries; - return this; - } - - public ELFModel addDynamicEntriesItem(ElfDynamicEntry dynamicEntriesItem) { - if (this.dynamicEntries == null) { - this.dynamicEntries = new ArrayList<>(); - } - this.dynamicEntries.add(dynamicEntriesItem); - return this; - } - - /** - * Get dynamicEntries - * @return dynamicEntries - */ - @javax.annotation.Nonnull - public List getDynamicEntries() { - return dynamicEntries; - } - - public void setDynamicEntries(@javax.annotation.Nonnull List dynamicEntries) { - this.dynamicEntries = dynamicEntries; - } - - - public ELFModel notes(@javax.annotation.Nonnull List> notes) { - this.notes = notes; - return this; - } - - public ELFModel addNotesItem(Map notesItem) { - if (this.notes == null) { - this.notes = new ArrayList<>(); - } - this.notes.add(notesItem); - return this; - } - - /** - * Get notes - * @return notes - */ - @javax.annotation.Nonnull - public List> getNotes() { - return notes; - } - - public void setNotes(@javax.annotation.Nonnull List> notes) { - this.notes = notes; - } - - - public ELFModel debugInfo(@javax.annotation.Nonnull Map debugInfo) { - this.debugInfo = debugInfo; - return this; - } - - public ELFModel putDebugInfoItem(String key, Object debugInfoItem) { - if (this.debugInfo == null) { - this.debugInfo = new HashMap<>(); - } - this.debugInfo.put(key, debugInfoItem); - return this; - } - - /** - * Get debugInfo - * @return debugInfo - */ - @javax.annotation.Nonnull - public Map getDebugInfo() { - return debugInfo; - } - - public void setDebugInfo(@javax.annotation.Nonnull Map debugInfo) { - this.debugInfo = debugInfo; - } - - - public ELFModel versionInfo(@javax.annotation.Nonnull Map versionInfo) { - this.versionInfo = versionInfo; - return this; - } - - public ELFModel putVersionInfoItem(String key, Object versionInfoItem) { - if (this.versionInfo == null) { - this.versionInfo = new HashMap<>(); - } - this.versionInfo.put(key, versionInfoItem); - return this; - } - - /** - * Get versionInfo - * @return versionInfo - */ - @javax.annotation.Nonnull - public Map getVersionInfo() { - return versionInfo; - } - - public void setVersionInfo(@javax.annotation.Nonnull Map versionInfo) { - this.versionInfo = versionInfo; - } - - /** - * 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 ELFModel instance itself - */ - public ELFModel 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; - } - ELFModel elFModel = (ELFModel) o; - return Objects.equals(this.fileType, elFModel.fileType) && - Objects.equals(this.architecture, elFModel.architecture) && - Objects.equals(this.endianness, elFModel.endianness) && - Objects.equals(this.entryPoint, elFModel.entryPoint) && - Objects.equals(this.entryPointBytes, elFModel.entryPointBytes) && - Objects.equals(this.importHash, elFModel.importHash) && - Objects.equals(this.exportHash, elFModel.exportHash) && - Objects.equals(this.buildId, elFModel.buildId) && - Objects.equals(this.security, elFModel.security) && - Objects.equals(this.sections, elFModel.sections) && - Objects.equals(this.segments, elFModel.segments) && - Objects.equals(this.symbols, elFModel.symbols) && - Objects.equals(this.dynamicSymbols, elFModel.dynamicSymbols) && - Objects.equals(this.relocations, elFModel.relocations) && - Objects.equals(this.imports, elFModel.imports) && - Objects.equals(this.exportedFunctions, elFModel.exportedFunctions) && - Objects.equals(this.dynamicEntries, elFModel.dynamicEntries) && - Objects.equals(this.notes, elFModel.notes) && - Objects.equals(this.debugInfo, elFModel.debugInfo) && - Objects.equals(this.versionInfo, elFModel.versionInfo)&& - Objects.equals(this.additionalProperties, elFModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(fileType, architecture, endianness, entryPoint, entryPointBytes, importHash, exportHash, buildId, security, sections, segments, symbols, dynamicSymbols, relocations, imports, exportedFunctions, dynamicEntries, notes, debugInfo, versionInfo, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ELFModel {\n"); - sb.append(" fileType: ").append(toIndentedString(fileType)).append("\n"); - sb.append(" architecture: ").append(toIndentedString(architecture)).append("\n"); - sb.append(" endianness: ").append(toIndentedString(endianness)).append("\n"); - sb.append(" entryPoint: ").append(toIndentedString(entryPoint)).append("\n"); - sb.append(" entryPointBytes: ").append(toIndentedString(entryPointBytes)).append("\n"); - sb.append(" importHash: ").append(toIndentedString(importHash)).append("\n"); - sb.append(" exportHash: ").append(toIndentedString(exportHash)).append("\n"); - sb.append(" buildId: ").append(toIndentedString(buildId)).append("\n"); - sb.append(" security: ").append(toIndentedString(security)).append("\n"); - sb.append(" sections: ").append(toIndentedString(sections)).append("\n"); - sb.append(" segments: ").append(toIndentedString(segments)).append("\n"); - sb.append(" symbols: ").append(toIndentedString(symbols)).append("\n"); - sb.append(" dynamicSymbols: ").append(toIndentedString(dynamicSymbols)).append("\n"); - sb.append(" relocations: ").append(toIndentedString(relocations)).append("\n"); - sb.append(" imports: ").append(toIndentedString(imports)).append("\n"); - sb.append(" exportedFunctions: ").append(toIndentedString(exportedFunctions)).append("\n"); - sb.append(" dynamicEntries: ").append(toIndentedString(dynamicEntries)).append("\n"); - sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); - sb.append(" debugInfo: ").append(toIndentedString(debugInfo)).append("\n"); - sb.append(" versionInfo: ").append(toIndentedString(versionInfo)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("file_type", "architecture", "endianness", "entry_point", "entry_point_bytes", "import_hash", "export_hash", "build_id", "security", "sections", "segments", "symbols", "dynamic_symbols", "relocations", "imports", "exported_functions", "dynamic_entries", "notes", "debug_info", "version_info")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("file_type", "architecture", "endianness", "entry_point", "entry_point_bytes", "import_hash", "export_hash", "build_id", "security", "sections", "segments", "symbols", "dynamic_symbols", "relocations", "imports", "exported_functions", "dynamic_entries", "notes", "debug_info", "version_info")); - } - - /** - * 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 ELFModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ELFModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ELFModel is not found in the empty JSON string", ELFModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ELFModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("file_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `file_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_type").toString())); - } - if (!jsonObj.get("architecture").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `architecture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("architecture").toString())); - } - if (!jsonObj.get("endianness").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `endianness` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endianness").toString())); - } - if (!jsonObj.get("entry_point_bytes").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `entry_point_bytes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entry_point_bytes").toString())); - } - if (!jsonObj.get("import_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `import_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("import_hash").toString())); - } - if (!jsonObj.get("export_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `export_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("export_hash").toString())); - } - if (!jsonObj.get("build_id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `build_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("build_id").toString())); - } - // validate the required field `security` - ELFSecurity.validateJsonElement(jsonObj.get("security")); - if (jsonObj.get("sections") != null) { - if (!jsonObj.get("sections").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sections` to be an array in the JSON string but got `%s`", jsonObj.get("sections").toString())); - } - JsonArray jsonArraysections = jsonObj.getAsJsonArray("sections"); - // validate the required field `sections` (array) - for (int i = 0; i < jsonArraysections.size(); i++) { - ELFSection.validateJsonElement(jsonArraysections.get(i)); - } - } - if (jsonObj.get("segments") != null) { - if (!jsonObj.get("segments").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `segments` to be an array in the JSON string but got `%s`", jsonObj.get("segments").toString())); - } - JsonArray jsonArraysegments = jsonObj.getAsJsonArray("segments"); - // validate the required field `segments` (array) - for (int i = 0; i < jsonArraysegments.size(); i++) { - ELFSegment.validateJsonElement(jsonArraysegments.get(i)); - } - } - if (jsonObj.get("symbols") != null) { - if (!jsonObj.get("symbols").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `symbols` to be an array in the JSON string but got `%s`", jsonObj.get("symbols").toString())); - } - JsonArray jsonArraysymbols = jsonObj.getAsJsonArray("symbols"); - // validate the required field `symbols` (array) - for (int i = 0; i < jsonArraysymbols.size(); i++) { - ELFSymbol.validateJsonElement(jsonArraysymbols.get(i)); - } - } - if (jsonObj.get("dynamic_symbols") != null) { - if (!jsonObj.get("dynamic_symbols").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `dynamic_symbols` to be an array in the JSON string but got `%s`", jsonObj.get("dynamic_symbols").toString())); - } - JsonArray jsonArraydynamicSymbols = jsonObj.getAsJsonArray("dynamic_symbols"); - // validate the required field `dynamic_symbols` (array) - for (int i = 0; i < jsonArraydynamicSymbols.size(); i++) { - ELFSymbol.validateJsonElement(jsonArraydynamicSymbols.get(i)); - } - } - if (jsonObj.get("relocations") != null) { - if (!jsonObj.get("relocations").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `relocations` to be an array in the JSON string but got `%s`", jsonObj.get("relocations").toString())); - } - JsonArray jsonArrayrelocations = jsonObj.getAsJsonArray("relocations"); - // validate the required field `relocations` (array) - for (int i = 0; i < jsonArrayrelocations.size(); i++) { - ELFRelocation.validateJsonElement(jsonArrayrelocations.get(i)); - } - } - // validate the required field `imports` - ELFImportModel.validateJsonElement(jsonObj.get("imports")); - // ensure the required json array is present - if (jsonObj.get("exported_functions") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("exported_functions").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `exported_functions` to be an array in the JSON string but got `%s`", jsonObj.get("exported_functions").toString())); - } - if (jsonObj.get("dynamic_entries") != null) { - if (!jsonObj.get("dynamic_entries").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `dynamic_entries` to be an array in the JSON string but got `%s`", jsonObj.get("dynamic_entries").toString())); - } - JsonArray jsonArraydynamicEntries = jsonObj.getAsJsonArray("dynamic_entries"); - // validate the required field `dynamic_entries` (array) - for (int i = 0; i < jsonArraydynamicEntries.size(); i++) { - ElfDynamicEntry.validateJsonElement(jsonArraydynamicEntries.get(i)); - } - } - // ensure the required json array is present - if (jsonObj.get("notes") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("notes").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `notes` to be an array in the JSON string but got `%s`", jsonObj.get("notes").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ELFModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ELFModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ELFModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ELFModel 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 ELFModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ELFModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ELFModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ELFModel - * @throws IOException if the JSON string is invalid with respect to ELFModel - */ - public static ELFModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ELFModel.class); - } - - /** - * Convert an instance of ELFModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ELFRelocation.java b/src/main/java/ai/reveng/model/ELFRelocation.java deleted file mode 100644 index 97589a4..0000000 --- a/src/main/java/ai/reveng/model/ELFRelocation.java +++ /dev/null @@ -1,474 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ELFRelocation - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ELFRelocation { - public static final String SERIALIZED_NAME_ADDRESS = "address"; - @SerializedName(SERIALIZED_NAME_ADDRESS) - @javax.annotation.Nonnull - private Integer address; - - 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 static final String SERIALIZED_NAME_ADDEND = "addend"; - @SerializedName(SERIALIZED_NAME_ADDEND) - @javax.annotation.Nonnull - private Integer addend; - - public static final String SERIALIZED_NAME_SYMBOL_NAME = "symbol_name"; - @SerializedName(SERIALIZED_NAME_SYMBOL_NAME) - @javax.annotation.Nonnull - private String symbolName; - - public static final String SERIALIZED_NAME_IS_DYNAMIC = "is_dynamic"; - @SerializedName(SERIALIZED_NAME_IS_DYNAMIC) - @javax.annotation.Nonnull - private Boolean isDynamic; - - public static final String SERIALIZED_NAME_IS_PLTGOT = "is_pltgot"; - @SerializedName(SERIALIZED_NAME_IS_PLTGOT) - @javax.annotation.Nonnull - private Boolean isPltgot; - - public static final String SERIALIZED_NAME_IS_UNICODE_SYMBOL_NAME = "is_unicode_symbol_name"; - @SerializedName(SERIALIZED_NAME_IS_UNICODE_SYMBOL_NAME) - @javax.annotation.Nullable - private Boolean isUnicodeSymbolName = true; - - public ELFRelocation() { - } - - public ELFRelocation address(@javax.annotation.Nonnull Integer address) { - this.address = address; - return this; - } - - /** - * Get address - * @return address - */ - @javax.annotation.Nonnull - public Integer getAddress() { - return address; - } - - public void setAddress(@javax.annotation.Nonnull Integer address) { - this.address = address; - } - - - public ELFRelocation type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public ELFRelocation size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Get size - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - - public ELFRelocation addend(@javax.annotation.Nonnull Integer addend) { - this.addend = addend; - return this; - } - - /** - * Get addend - * @return addend - */ - @javax.annotation.Nonnull - public Integer getAddend() { - return addend; - } - - public void setAddend(@javax.annotation.Nonnull Integer addend) { - this.addend = addend; - } - - - public ELFRelocation symbolName(@javax.annotation.Nonnull String symbolName) { - this.symbolName = symbolName; - return this; - } - - /** - * Get symbolName - * @return symbolName - */ - @javax.annotation.Nonnull - public String getSymbolName() { - return symbolName; - } - - public void setSymbolName(@javax.annotation.Nonnull String symbolName) { - this.symbolName = symbolName; - } - - - public ELFRelocation isDynamic(@javax.annotation.Nonnull Boolean isDynamic) { - this.isDynamic = isDynamic; - return this; - } - - /** - * Get isDynamic - * @return isDynamic - */ - @javax.annotation.Nonnull - public Boolean getIsDynamic() { - return isDynamic; - } - - public void setIsDynamic(@javax.annotation.Nonnull Boolean isDynamic) { - this.isDynamic = isDynamic; - } - - - public ELFRelocation isPltgot(@javax.annotation.Nonnull Boolean isPltgot) { - this.isPltgot = isPltgot; - return this; - } - - /** - * Get isPltgot - * @return isPltgot - */ - @javax.annotation.Nonnull - public Boolean getIsPltgot() { - return isPltgot; - } - - public void setIsPltgot(@javax.annotation.Nonnull Boolean isPltgot) { - this.isPltgot = isPltgot; - } - - - public ELFRelocation isUnicodeSymbolName(@javax.annotation.Nullable Boolean isUnicodeSymbolName) { - this.isUnicodeSymbolName = isUnicodeSymbolName; - return this; - } - - /** - * Get isUnicodeSymbolName - * @return isUnicodeSymbolName - */ - @javax.annotation.Nullable - public Boolean getIsUnicodeSymbolName() { - return isUnicodeSymbolName; - } - - public void setIsUnicodeSymbolName(@javax.annotation.Nullable Boolean isUnicodeSymbolName) { - this.isUnicodeSymbolName = isUnicodeSymbolName; - } - - /** - * 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 ELFRelocation instance itself - */ - public ELFRelocation 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; - } - ELFRelocation elFRelocation = (ELFRelocation) o; - return Objects.equals(this.address, elFRelocation.address) && - Objects.equals(this.type, elFRelocation.type) && - Objects.equals(this.size, elFRelocation.size) && - Objects.equals(this.addend, elFRelocation.addend) && - Objects.equals(this.symbolName, elFRelocation.symbolName) && - Objects.equals(this.isDynamic, elFRelocation.isDynamic) && - Objects.equals(this.isPltgot, elFRelocation.isPltgot) && - Objects.equals(this.isUnicodeSymbolName, elFRelocation.isUnicodeSymbolName)&& - Objects.equals(this.additionalProperties, elFRelocation.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(address, type, size, addend, symbolName, isDynamic, isPltgot, isUnicodeSymbolName, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ELFRelocation {\n"); - sb.append(" address: ").append(toIndentedString(address)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" addend: ").append(toIndentedString(addend)).append("\n"); - sb.append(" symbolName: ").append(toIndentedString(symbolName)).append("\n"); - sb.append(" isDynamic: ").append(toIndentedString(isDynamic)).append("\n"); - sb.append(" isPltgot: ").append(toIndentedString(isPltgot)).append("\n"); - sb.append(" isUnicodeSymbolName: ").append(toIndentedString(isUnicodeSymbolName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("address", "type", "size", "addend", "symbol_name", "is_dynamic", "is_pltgot", "is_unicode_symbol_name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("address", "type", "size", "addend", "symbol_name", "is_dynamic", "is_pltgot")); - } - - /** - * 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 ELFRelocation - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ELFRelocation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ELFRelocation is not found in the empty JSON string", ELFRelocation.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ELFRelocation.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("symbol_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `symbol_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("symbol_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ELFRelocation.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ELFRelocation' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ELFRelocation.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ELFRelocation 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 ELFRelocation read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ELFRelocation instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ELFRelocation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ELFRelocation - * @throws IOException if the JSON string is invalid with respect to ELFRelocation - */ - public static ELFRelocation fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ELFRelocation.class); - } - - /** - * Convert an instance of ELFRelocation to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ELFSection.java b/src/main/java/ai/reveng/model/ELFSection.java deleted file mode 100644 index 270ea67..0000000 --- a/src/main/java/ai/reveng/model/ELFSection.java +++ /dev/null @@ -1,530 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ELFSection - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ELFSection { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_VIRTUAL_ADDRESS = "virtual_address"; - @SerializedName(SERIALIZED_NAME_VIRTUAL_ADDRESS) - @javax.annotation.Nonnull - private Integer virtualAddress; - - public static final String SERIALIZED_NAME_VIRTUAL_SIZE = "virtual_size"; - @SerializedName(SERIALIZED_NAME_VIRTUAL_SIZE) - @javax.annotation.Nonnull - private Integer virtualSize; - - public static final String SERIALIZED_NAME_RAW_SIZE = "raw_size"; - @SerializedName(SERIALIZED_NAME_RAW_SIZE) - @javax.annotation.Nonnull - private Integer rawSize; - - public static final String SERIALIZED_NAME_FILE_OFFSET = "file_offset"; - @SerializedName(SERIALIZED_NAME_FILE_OFFSET) - @javax.annotation.Nonnull - private Integer fileOffset; - - public static final String SERIALIZED_NAME_FLAGS = "flags"; - @SerializedName(SERIALIZED_NAME_FLAGS) - @javax.annotation.Nonnull - private String flags; - - public static final String SERIALIZED_NAME_FLAGS_RAW = "flags_raw"; - @SerializedName(SERIALIZED_NAME_FLAGS_RAW) - @javax.annotation.Nonnull - private Integer flagsRaw; - - public static final String SERIALIZED_NAME_ENTROPY = "entropy"; - @SerializedName(SERIALIZED_NAME_ENTROPY) - @javax.annotation.Nonnull - private BigDecimal entropy; - - public static final String SERIALIZED_NAME_ALIGNMENT = "alignment"; - @SerializedName(SERIALIZED_NAME_ALIGNMENT) - @javax.annotation.Nonnull - private Integer alignment; - - public ELFSection() { - } - - public ELFSection 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 ELFSection type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public ELFSection virtualAddress(@javax.annotation.Nonnull Integer virtualAddress) { - this.virtualAddress = virtualAddress; - return this; - } - - /** - * Get virtualAddress - * @return virtualAddress - */ - @javax.annotation.Nonnull - public Integer getVirtualAddress() { - return virtualAddress; - } - - public void setVirtualAddress(@javax.annotation.Nonnull Integer virtualAddress) { - this.virtualAddress = virtualAddress; - } - - - public ELFSection virtualSize(@javax.annotation.Nonnull Integer virtualSize) { - this.virtualSize = virtualSize; - return this; - } - - /** - * Get virtualSize - * @return virtualSize - */ - @javax.annotation.Nonnull - public Integer getVirtualSize() { - return virtualSize; - } - - public void setVirtualSize(@javax.annotation.Nonnull Integer virtualSize) { - this.virtualSize = virtualSize; - } - - - public ELFSection rawSize(@javax.annotation.Nonnull Integer rawSize) { - this.rawSize = rawSize; - return this; - } - - /** - * Get rawSize - * @return rawSize - */ - @javax.annotation.Nonnull - public Integer getRawSize() { - return rawSize; - } - - public void setRawSize(@javax.annotation.Nonnull Integer rawSize) { - this.rawSize = rawSize; - } - - - public ELFSection fileOffset(@javax.annotation.Nonnull Integer fileOffset) { - this.fileOffset = fileOffset; - return this; - } - - /** - * Get fileOffset - * @return fileOffset - */ - @javax.annotation.Nonnull - public Integer getFileOffset() { - return fileOffset; - } - - public void setFileOffset(@javax.annotation.Nonnull Integer fileOffset) { - this.fileOffset = fileOffset; - } - - - public ELFSection flags(@javax.annotation.Nonnull String flags) { - this.flags = flags; - return this; - } - - /** - * Get flags - * @return flags - */ - @javax.annotation.Nonnull - public String getFlags() { - return flags; - } - - public void setFlags(@javax.annotation.Nonnull String flags) { - this.flags = flags; - } - - - public ELFSection flagsRaw(@javax.annotation.Nonnull Integer flagsRaw) { - this.flagsRaw = flagsRaw; - return this; - } - - /** - * Get flagsRaw - * @return flagsRaw - */ - @javax.annotation.Nonnull - public Integer getFlagsRaw() { - return flagsRaw; - } - - public void setFlagsRaw(@javax.annotation.Nonnull Integer flagsRaw) { - this.flagsRaw = flagsRaw; - } - - - public ELFSection entropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; - return this; - } - - /** - * Get entropy - * @return entropy - */ - @javax.annotation.Nonnull - public BigDecimal getEntropy() { - return entropy; - } - - public void setEntropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; - } - - - public ELFSection alignment(@javax.annotation.Nonnull Integer alignment) { - this.alignment = alignment; - return this; - } - - /** - * Get alignment - * @return alignment - */ - @javax.annotation.Nonnull - public Integer getAlignment() { - return alignment; - } - - public void setAlignment(@javax.annotation.Nonnull Integer alignment) { - this.alignment = alignment; - } - - /** - * 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 ELFSection instance itself - */ - public ELFSection 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; - } - ELFSection elFSection = (ELFSection) o; - return Objects.equals(this.name, elFSection.name) && - Objects.equals(this.type, elFSection.type) && - Objects.equals(this.virtualAddress, elFSection.virtualAddress) && - Objects.equals(this.virtualSize, elFSection.virtualSize) && - Objects.equals(this.rawSize, elFSection.rawSize) && - Objects.equals(this.fileOffset, elFSection.fileOffset) && - Objects.equals(this.flags, elFSection.flags) && - Objects.equals(this.flagsRaw, elFSection.flagsRaw) && - Objects.equals(this.entropy, elFSection.entropy) && - Objects.equals(this.alignment, elFSection.alignment)&& - Objects.equals(this.additionalProperties, elFSection.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, type, virtualAddress, virtualSize, rawSize, fileOffset, flags, flagsRaw, entropy, alignment, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ELFSection {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" virtualAddress: ").append(toIndentedString(virtualAddress)).append("\n"); - sb.append(" virtualSize: ").append(toIndentedString(virtualSize)).append("\n"); - sb.append(" rawSize: ").append(toIndentedString(rawSize)).append("\n"); - sb.append(" fileOffset: ").append(toIndentedString(fileOffset)).append("\n"); - sb.append(" flags: ").append(toIndentedString(flags)).append("\n"); - sb.append(" flagsRaw: ").append(toIndentedString(flagsRaw)).append("\n"); - sb.append(" entropy: ").append(toIndentedString(entropy)).append("\n"); - sb.append(" alignment: ").append(toIndentedString(alignment)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "type", "virtual_address", "virtual_size", "raw_size", "file_offset", "flags", "flags_raw", "entropy", "alignment")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "type", "virtual_address", "virtual_size", "raw_size", "file_offset", "flags", "flags_raw", "entropy", "alignment")); - } - - /** - * 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 ELFSection - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ELFSection.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ELFSection is not found in the empty JSON string", ELFSection.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ELFSection.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("flags").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `flags` to be a primitive type in the JSON string but got `%s`", jsonObj.get("flags").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ELFSection.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ELFSection' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ELFSection.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ELFSection 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 ELFSection read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ELFSection instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ELFSection given an JSON string - * - * @param jsonString JSON string - * @return An instance of ELFSection - * @throws IOException if the JSON string is invalid with respect to ELFSection - */ - public static ELFSection fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ELFSection.class); - } - - /** - * Convert an instance of ELFSection to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ELFSecurity.java b/src/main/java/ai/reveng/model/ELFSecurity.java deleted file mode 100644 index 1654902..0000000 --- a/src/main/java/ai/reveng/model/ELFSecurity.java +++ /dev/null @@ -1,390 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ELFSecurity - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ELFSecurity { - public static final String SERIALIZED_NAME_PIE = "pie"; - @SerializedName(SERIALIZED_NAME_PIE) - @javax.annotation.Nonnull - private Boolean pie; - - public static final String SERIALIZED_NAME_STRIPPED = "stripped"; - @SerializedName(SERIALIZED_NAME_STRIPPED) - @javax.annotation.Nonnull - private Boolean stripped; - - public static final String SERIALIZED_NAME_CANARY = "canary"; - @SerializedName(SERIALIZED_NAME_CANARY) - @javax.annotation.Nonnull - private Boolean canary; - - public static final String SERIALIZED_NAME_NX = "nx"; - @SerializedName(SERIALIZED_NAME_NX) - @javax.annotation.Nonnull - private Boolean nx; - - public static final String SERIALIZED_NAME_RELO = "relo"; - @SerializedName(SERIALIZED_NAME_RELO) - @javax.annotation.Nonnull - private Boolean relo; - - public ELFSecurity() { - } - - public ELFSecurity pie(@javax.annotation.Nonnull Boolean pie) { - this.pie = pie; - return this; - } - - /** - * Get pie - * @return pie - */ - @javax.annotation.Nonnull - public Boolean getPie() { - return pie; - } - - public void setPie(@javax.annotation.Nonnull Boolean pie) { - this.pie = pie; - } - - - public ELFSecurity stripped(@javax.annotation.Nonnull Boolean stripped) { - this.stripped = stripped; - return this; - } - - /** - * Get stripped - * @return stripped - */ - @javax.annotation.Nonnull - public Boolean getStripped() { - return stripped; - } - - public void setStripped(@javax.annotation.Nonnull Boolean stripped) { - this.stripped = stripped; - } - - - public ELFSecurity canary(@javax.annotation.Nonnull Boolean canary) { - this.canary = canary; - return this; - } - - /** - * Get canary - * @return canary - */ - @javax.annotation.Nonnull - public Boolean getCanary() { - return canary; - } - - public void setCanary(@javax.annotation.Nonnull Boolean canary) { - this.canary = canary; - } - - - public ELFSecurity nx(@javax.annotation.Nonnull Boolean nx) { - this.nx = nx; - return this; - } - - /** - * Get nx - * @return nx - */ - @javax.annotation.Nonnull - public Boolean getNx() { - return nx; - } - - public void setNx(@javax.annotation.Nonnull Boolean nx) { - this.nx = nx; - } - - - public ELFSecurity relo(@javax.annotation.Nonnull Boolean relo) { - this.relo = relo; - return this; - } - - /** - * Get relo - * @return relo - */ - @javax.annotation.Nonnull - public Boolean getRelo() { - return relo; - } - - public void setRelo(@javax.annotation.Nonnull Boolean relo) { - this.relo = relo; - } - - /** - * 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 ELFSecurity instance itself - */ - public ELFSecurity 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; - } - ELFSecurity elFSecurity = (ELFSecurity) o; - return Objects.equals(this.pie, elFSecurity.pie) && - Objects.equals(this.stripped, elFSecurity.stripped) && - Objects.equals(this.canary, elFSecurity.canary) && - Objects.equals(this.nx, elFSecurity.nx) && - Objects.equals(this.relo, elFSecurity.relo)&& - Objects.equals(this.additionalProperties, elFSecurity.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(pie, stripped, canary, nx, relo, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ELFSecurity {\n"); - sb.append(" pie: ").append(toIndentedString(pie)).append("\n"); - sb.append(" stripped: ").append(toIndentedString(stripped)).append("\n"); - sb.append(" canary: ").append(toIndentedString(canary)).append("\n"); - sb.append(" nx: ").append(toIndentedString(nx)).append("\n"); - sb.append(" relo: ").append(toIndentedString(relo)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("pie", "stripped", "canary", "nx", "relo")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("pie", "stripped", "canary", "nx", "relo")); - } - - /** - * 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 ELFSecurity - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ELFSecurity.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ELFSecurity is not found in the empty JSON string", ELFSecurity.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ELFSecurity.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ELFSecurity.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ELFSecurity' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ELFSecurity.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ELFSecurity 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 ELFSecurity read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ELFSecurity instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ELFSecurity given an JSON string - * - * @param jsonString JSON string - * @return An instance of ELFSecurity - * @throws IOException if the JSON string is invalid with respect to ELFSecurity - */ - public static ELFSecurity fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ELFSecurity.class); - } - - /** - * Convert an instance of ELFSecurity to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ELFSegment.java b/src/main/java/ai/reveng/model/ELFSegment.java deleted file mode 100644 index 67d3cde..0000000 --- a/src/main/java/ai/reveng/model/ELFSegment.java +++ /dev/null @@ -1,500 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ELFSegment - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ELFSegment { - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_VIRTUAL_ADDRESS = "virtual_address"; - @SerializedName(SERIALIZED_NAME_VIRTUAL_ADDRESS) - @javax.annotation.Nonnull - private Integer virtualAddress; - - public static final String SERIALIZED_NAME_VIRTUAL_SIZE = "virtual_size"; - @SerializedName(SERIALIZED_NAME_VIRTUAL_SIZE) - @javax.annotation.Nonnull - private Integer virtualSize; - - public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS = "physical_address"; - @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS) - @javax.annotation.Nonnull - private Integer physicalAddress; - - public static final String SERIALIZED_NAME_PHYSICAL_SIZE = "physical_size"; - @SerializedName(SERIALIZED_NAME_PHYSICAL_SIZE) - @javax.annotation.Nonnull - private Integer physicalSize; - - public static final String SERIALIZED_NAME_FILE_OFFSET = "file_offset"; - @SerializedName(SERIALIZED_NAME_FILE_OFFSET) - @javax.annotation.Nonnull - private Integer fileOffset; - - public static final String SERIALIZED_NAME_FLAGS = "flags"; - @SerializedName(SERIALIZED_NAME_FLAGS) - @javax.annotation.Nonnull - private String flags; - - public static final String SERIALIZED_NAME_FLAGS_RAW = "flags_raw"; - @SerializedName(SERIALIZED_NAME_FLAGS_RAW) - @javax.annotation.Nonnull - private Integer flagsRaw; - - public static final String SERIALIZED_NAME_ALIGNMENT = "alignment"; - @SerializedName(SERIALIZED_NAME_ALIGNMENT) - @javax.annotation.Nonnull - private Integer alignment; - - public ELFSegment() { - } - - public ELFSegment type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public ELFSegment virtualAddress(@javax.annotation.Nonnull Integer virtualAddress) { - this.virtualAddress = virtualAddress; - return this; - } - - /** - * Get virtualAddress - * @return virtualAddress - */ - @javax.annotation.Nonnull - public Integer getVirtualAddress() { - return virtualAddress; - } - - public void setVirtualAddress(@javax.annotation.Nonnull Integer virtualAddress) { - this.virtualAddress = virtualAddress; - } - - - public ELFSegment virtualSize(@javax.annotation.Nonnull Integer virtualSize) { - this.virtualSize = virtualSize; - return this; - } - - /** - * Get virtualSize - * @return virtualSize - */ - @javax.annotation.Nonnull - public Integer getVirtualSize() { - return virtualSize; - } - - public void setVirtualSize(@javax.annotation.Nonnull Integer virtualSize) { - this.virtualSize = virtualSize; - } - - - public ELFSegment physicalAddress(@javax.annotation.Nonnull Integer physicalAddress) { - this.physicalAddress = physicalAddress; - return this; - } - - /** - * Get physicalAddress - * @return physicalAddress - */ - @javax.annotation.Nonnull - public Integer getPhysicalAddress() { - return physicalAddress; - } - - public void setPhysicalAddress(@javax.annotation.Nonnull Integer physicalAddress) { - this.physicalAddress = physicalAddress; - } - - - public ELFSegment physicalSize(@javax.annotation.Nonnull Integer physicalSize) { - this.physicalSize = physicalSize; - return this; - } - - /** - * Get physicalSize - * @return physicalSize - */ - @javax.annotation.Nonnull - public Integer getPhysicalSize() { - return physicalSize; - } - - public void setPhysicalSize(@javax.annotation.Nonnull Integer physicalSize) { - this.physicalSize = physicalSize; - } - - - public ELFSegment fileOffset(@javax.annotation.Nonnull Integer fileOffset) { - this.fileOffset = fileOffset; - return this; - } - - /** - * Get fileOffset - * @return fileOffset - */ - @javax.annotation.Nonnull - public Integer getFileOffset() { - return fileOffset; - } - - public void setFileOffset(@javax.annotation.Nonnull Integer fileOffset) { - this.fileOffset = fileOffset; - } - - - public ELFSegment flags(@javax.annotation.Nonnull String flags) { - this.flags = flags; - return this; - } - - /** - * Get flags - * @return flags - */ - @javax.annotation.Nonnull - public String getFlags() { - return flags; - } - - public void setFlags(@javax.annotation.Nonnull String flags) { - this.flags = flags; - } - - - public ELFSegment flagsRaw(@javax.annotation.Nonnull Integer flagsRaw) { - this.flagsRaw = flagsRaw; - return this; - } - - /** - * Get flagsRaw - * @return flagsRaw - */ - @javax.annotation.Nonnull - public Integer getFlagsRaw() { - return flagsRaw; - } - - public void setFlagsRaw(@javax.annotation.Nonnull Integer flagsRaw) { - this.flagsRaw = flagsRaw; - } - - - public ELFSegment alignment(@javax.annotation.Nonnull Integer alignment) { - this.alignment = alignment; - return this; - } - - /** - * Get alignment - * @return alignment - */ - @javax.annotation.Nonnull - public Integer getAlignment() { - return alignment; - } - - public void setAlignment(@javax.annotation.Nonnull Integer alignment) { - this.alignment = alignment; - } - - /** - * 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 ELFSegment instance itself - */ - public ELFSegment 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; - } - ELFSegment elFSegment = (ELFSegment) o; - return Objects.equals(this.type, elFSegment.type) && - Objects.equals(this.virtualAddress, elFSegment.virtualAddress) && - Objects.equals(this.virtualSize, elFSegment.virtualSize) && - Objects.equals(this.physicalAddress, elFSegment.physicalAddress) && - Objects.equals(this.physicalSize, elFSegment.physicalSize) && - Objects.equals(this.fileOffset, elFSegment.fileOffset) && - Objects.equals(this.flags, elFSegment.flags) && - Objects.equals(this.flagsRaw, elFSegment.flagsRaw) && - Objects.equals(this.alignment, elFSegment.alignment)&& - Objects.equals(this.additionalProperties, elFSegment.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(type, virtualAddress, virtualSize, physicalAddress, physicalSize, fileOffset, flags, flagsRaw, alignment, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ELFSegment {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" virtualAddress: ").append(toIndentedString(virtualAddress)).append("\n"); - sb.append(" virtualSize: ").append(toIndentedString(virtualSize)).append("\n"); - sb.append(" physicalAddress: ").append(toIndentedString(physicalAddress)).append("\n"); - sb.append(" physicalSize: ").append(toIndentedString(physicalSize)).append("\n"); - sb.append(" fileOffset: ").append(toIndentedString(fileOffset)).append("\n"); - sb.append(" flags: ").append(toIndentedString(flags)).append("\n"); - sb.append(" flagsRaw: ").append(toIndentedString(flagsRaw)).append("\n"); - sb.append(" alignment: ").append(toIndentedString(alignment)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("type", "virtual_address", "virtual_size", "physical_address", "physical_size", "file_offset", "flags", "flags_raw", "alignment")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type", "virtual_address", "virtual_size", "physical_address", "physical_size", "file_offset", "flags", "flags_raw", "alignment")); - } - - /** - * 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 ELFSegment - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ELFSegment.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ELFSegment is not found in the empty JSON string", ELFSegment.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ELFSegment.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("flags").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `flags` to be a primitive type in the JSON string but got `%s`", jsonObj.get("flags").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ELFSegment.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ELFSegment' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ELFSegment.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ELFSegment 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 ELFSegment read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ELFSegment instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ELFSegment given an JSON string - * - * @param jsonString JSON string - * @return An instance of ELFSegment - * @throws IOException if the JSON string is invalid with respect to ELFSegment - */ - public static ELFSegment fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ELFSegment.class); - } - - /** - * Convert an instance of ELFSegment to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ELFSymbol.java b/src/main/java/ai/reveng/model/ELFSymbol.java deleted file mode 100644 index 46ae451..0000000 --- a/src/main/java/ai/reveng/model/ELFSymbol.java +++ /dev/null @@ -1,480 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ELFSymbol - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ELFSymbol { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private Integer value; - - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nonnull - private Integer size; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_BINDING = "binding"; - @SerializedName(SERIALIZED_NAME_BINDING) - @javax.annotation.Nonnull - private String binding; - - public static final String SERIALIZED_NAME_VISIBILITY = "visibility"; - @SerializedName(SERIALIZED_NAME_VISIBILITY) - @javax.annotation.Nonnull - private String visibility; - - public static final String SERIALIZED_NAME_SECTION_INDEX = "section_index"; - @SerializedName(SERIALIZED_NAME_SECTION_INDEX) - @javax.annotation.Nonnull - private Integer sectionIndex; - - public static final String SERIALIZED_NAME_IS_UNICODE_NAME = "is_unicode_name"; - @SerializedName(SERIALIZED_NAME_IS_UNICODE_NAME) - @javax.annotation.Nullable - private Boolean isUnicodeName = true; - - public ELFSymbol() { - } - - public ELFSymbol 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 ELFSymbol value(@javax.annotation.Nonnull Integer value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - */ - @javax.annotation.Nonnull - public Integer getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull Integer value) { - this.value = value; - } - - - public ELFSymbol size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Get size - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - - public ELFSymbol type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public ELFSymbol binding(@javax.annotation.Nonnull String binding) { - this.binding = binding; - return this; - } - - /** - * Get binding - * @return binding - */ - @javax.annotation.Nonnull - public String getBinding() { - return binding; - } - - public void setBinding(@javax.annotation.Nonnull String binding) { - this.binding = binding; - } - - - public ELFSymbol visibility(@javax.annotation.Nonnull String visibility) { - this.visibility = visibility; - return this; - } - - /** - * Get visibility - * @return visibility - */ - @javax.annotation.Nonnull - public String getVisibility() { - return visibility; - } - - public void setVisibility(@javax.annotation.Nonnull String visibility) { - this.visibility = visibility; - } - - - public ELFSymbol sectionIndex(@javax.annotation.Nonnull Integer sectionIndex) { - this.sectionIndex = sectionIndex; - return this; - } - - /** - * Get sectionIndex - * @return sectionIndex - */ - @javax.annotation.Nonnull - public Integer getSectionIndex() { - return sectionIndex; - } - - public void setSectionIndex(@javax.annotation.Nonnull Integer sectionIndex) { - this.sectionIndex = sectionIndex; - } - - - public ELFSymbol isUnicodeName(@javax.annotation.Nullable Boolean isUnicodeName) { - this.isUnicodeName = isUnicodeName; - return this; - } - - /** - * Get isUnicodeName - * @return isUnicodeName - */ - @javax.annotation.Nullable - public Boolean getIsUnicodeName() { - return isUnicodeName; - } - - public void setIsUnicodeName(@javax.annotation.Nullable Boolean isUnicodeName) { - this.isUnicodeName = isUnicodeName; - } - - /** - * 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 ELFSymbol instance itself - */ - public ELFSymbol 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; - } - ELFSymbol elFSymbol = (ELFSymbol) o; - return Objects.equals(this.name, elFSymbol.name) && - Objects.equals(this.value, elFSymbol.value) && - Objects.equals(this.size, elFSymbol.size) && - Objects.equals(this.type, elFSymbol.type) && - Objects.equals(this.binding, elFSymbol.binding) && - Objects.equals(this.visibility, elFSymbol.visibility) && - Objects.equals(this.sectionIndex, elFSymbol.sectionIndex) && - Objects.equals(this.isUnicodeName, elFSymbol.isUnicodeName)&& - Objects.equals(this.additionalProperties, elFSymbol.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, value, size, type, binding, visibility, sectionIndex, isUnicodeName, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ELFSymbol {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" binding: ").append(toIndentedString(binding)).append("\n"); - sb.append(" visibility: ").append(toIndentedString(visibility)).append("\n"); - sb.append(" sectionIndex: ").append(toIndentedString(sectionIndex)).append("\n"); - sb.append(" isUnicodeName: ").append(toIndentedString(isUnicodeName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "value", "size", "type", "binding", "visibility", "section_index", "is_unicode_name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "value", "size", "type", "binding", "visibility", "section_index")); - } - - /** - * 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 ELFSymbol - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ELFSymbol.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ELFSymbol is not found in the empty JSON string", ELFSymbol.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ELFSymbol.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("binding").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binding").toString())); - } - if (!jsonObj.get("visibility").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `visibility` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visibility").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ELFSymbol.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ELFSymbol' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ELFSymbol.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ELFSymbol 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 ELFSymbol read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ELFSymbol instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ELFSymbol given an JSON string - * - * @param jsonString JSON string - * @return An instance of ELFSymbol - * @throws IOException if the JSON string is invalid with respect to ELFSymbol - */ - public static ELFSymbol fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ELFSymbol.class); - } - - /** - * Convert an instance of ELFSymbol to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ElfDynamicEntry.java b/src/main/java/ai/reveng/model/ElfDynamicEntry.java deleted file mode 100644 index 0c1b849..0000000 --- a/src/main/java/ai/reveng/model/ElfDynamicEntry.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ElfDynamicEntry - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ElfDynamicEntry { - public static final String SERIALIZED_NAME_TAG = "tag"; - @SerializedName(SERIALIZED_NAME_TAG) - @javax.annotation.Nonnull - private String tag; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private Integer value; - - public ElfDynamicEntry() { - } - - public ElfDynamicEntry tag(@javax.annotation.Nonnull String tag) { - this.tag = tag; - return this; - } - - /** - * Get tag - * @return tag - */ - @javax.annotation.Nonnull - public String getTag() { - return tag; - } - - public void setTag(@javax.annotation.Nonnull String tag) { - this.tag = tag; - } - - - public ElfDynamicEntry value(@javax.annotation.Nonnull Integer value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - */ - @javax.annotation.Nonnull - public Integer getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull Integer value) { - this.value = value; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ElfDynamicEntry instance itself - */ - public ElfDynamicEntry 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; - } - ElfDynamicEntry elfDynamicEntry = (ElfDynamicEntry) o; - return Objects.equals(this.tag, elfDynamicEntry.tag) && - Objects.equals(this.value, elfDynamicEntry.value)&& - Objects.equals(this.additionalProperties, elfDynamicEntry.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(tag, value, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ElfDynamicEntry {\n"); - sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("tag", "value")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("tag", "value")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ElfDynamicEntry - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ElfDynamicEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ElfDynamicEntry is not found in the empty JSON string", ElfDynamicEntry.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ElfDynamicEntry.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("tag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ElfDynamicEntry.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ElfDynamicEntry' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ElfDynamicEntry.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ElfDynamicEntry 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 ElfDynamicEntry read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ElfDynamicEntry instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ElfDynamicEntry given an JSON string - * - * @param jsonString JSON string - * @return An instance of ElfDynamicEntry - * @throws IOException if the JSON string is invalid with respect to ElfDynamicEntry - */ - public static ElfDynamicEntry fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ElfDynamicEntry.class); - } - - /** - * Convert an instance of ElfDynamicEntry to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/EntrypointModel.java b/src/main/java/ai/reveng/model/EntrypointModel.java deleted file mode 100644 index 443eac9..0000000 --- a/src/main/java/ai/reveng/model/EntrypointModel.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * EntrypointModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class EntrypointModel { - public static final String SERIALIZED_NAME_ADDRESS = "address"; - @SerializedName(SERIALIZED_NAME_ADDRESS) - @javax.annotation.Nonnull - private Integer address; - - public static final String SERIALIZED_NAME_FIRST_BYTES = "first_bytes"; - @SerializedName(SERIALIZED_NAME_FIRST_BYTES) - @javax.annotation.Nonnull - private String firstBytes; - - public EntrypointModel() { - } - - public EntrypointModel address(@javax.annotation.Nonnull Integer address) { - this.address = address; - return this; - } - - /** - * Get address - * @return address - */ - @javax.annotation.Nonnull - public Integer getAddress() { - return address; - } - - public void setAddress(@javax.annotation.Nonnull Integer address) { - this.address = address; - } - - - public EntrypointModel firstBytes(@javax.annotation.Nonnull String firstBytes) { - this.firstBytes = firstBytes; - return this; - } - - /** - * Get firstBytes - * @return firstBytes - */ - @javax.annotation.Nonnull - public String getFirstBytes() { - return firstBytes; - } - - public void setFirstBytes(@javax.annotation.Nonnull String firstBytes) { - this.firstBytes = firstBytes; - } - - /** - * 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 EntrypointModel instance itself - */ - public EntrypointModel 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; - } - EntrypointModel entrypointModel = (EntrypointModel) o; - return Objects.equals(this.address, entrypointModel.address) && - Objects.equals(this.firstBytes, entrypointModel.firstBytes)&& - Objects.equals(this.additionalProperties, entrypointModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(address, firstBytes, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EntrypointModel {\n"); - sb.append(" address: ").append(toIndentedString(address)).append("\n"); - sb.append(" firstBytes: ").append(toIndentedString(firstBytes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("address", "first_bytes")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("address", "first_bytes")); - } - - /** - * 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 EntrypointModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EntrypointModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in EntrypointModel is not found in the empty JSON string", EntrypointModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EntrypointModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("first_bytes").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `first_bytes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("first_bytes").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EntrypointModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EntrypointModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EntrypointModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EntrypointModel 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 EntrypointModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - EntrypointModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EntrypointModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of EntrypointModel - * @throws IOException if the JSON string is invalid with respect to EntrypointModel - */ - public static EntrypointModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EntrypointModel.class); - } - - /** - * Convert an instance of EntrypointModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Enumeration.java b/src/main/java/ai/reveng/model/Enumeration.java deleted file mode 100644 index ee910d7..0000000 --- a/src/main/java/ai/reveng/model/Enumeration.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Enumeration - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Enumeration { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_MEMBERS = "members"; - @SerializedName(SERIALIZED_NAME_MEMBERS) - @javax.annotation.Nonnull - private Map members = new HashMap<>(); - - public static final String SERIALIZED_NAME_ARTIFACT_TYPE = "artifact_type"; - @SerializedName(SERIALIZED_NAME_ARTIFACT_TYPE) - @javax.annotation.Nullable - private String artifactType; - - public Enumeration() { - } - - public Enumeration lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this enumeration - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public Enumeration name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the enumeration - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public Enumeration members(@javax.annotation.Nonnull Map members) { - this.members = members; - return this; - } - - public Enumeration putMembersItem(String key, Integer membersItem) { - if (this.members == null) { - this.members = new HashMap<>(); - } - this.members.put(key, membersItem); - return this; - } - - /** - * Dictionary of enumeration members and their values - * @return members - */ - @javax.annotation.Nonnull - public Map getMembers() { - return members; - } - - public void setMembers(@javax.annotation.Nonnull Map members) { - this.members = members; - } - - - public Enumeration artifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - return this; - } - - /** - * Type of artifact that the enumeration is associated with - * @return artifactType - */ - @javax.annotation.Nullable - public String getArtifactType() { - return artifactType; - } - - public void setArtifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - } - - /** - * 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 Enumeration instance itself - */ - public Enumeration 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; - } - Enumeration enumeration = (Enumeration) o; - return Objects.equals(this.lastChange, enumeration.lastChange) && - Objects.equals(this.name, enumeration.name) && - Objects.equals(this.members, enumeration.members) && - Objects.equals(this.artifactType, enumeration.artifactType)&& - Objects.equals(this.additionalProperties, enumeration.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(lastChange, name, members, artifactType, 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 Enumeration {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" members: ").append(toIndentedString(members)).append("\n"); - sb.append(" artifactType: ").append(toIndentedString(artifactType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "name", "members", "artifact_type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "members")); - } - - /** - * 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 Enumeration - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Enumeration.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Enumeration is not found in the empty JSON string", Enumeration.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Enumeration.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("artifact_type") != null && !jsonObj.get("artifact_type").isJsonNull()) && !jsonObj.get("artifact_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `artifact_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("artifact_type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Enumeration.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Enumeration' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Enumeration.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Enumeration 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 Enumeration read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Enumeration instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Enumeration given an JSON string - * - * @param jsonString JSON string - * @return An instance of Enumeration - * @throws IOException if the JSON string is invalid with respect to Enumeration - */ - public static Enumeration fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Enumeration.class); - } - - /** - * Convert an instance of Enumeration to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ErrorModel.java b/src/main/java/ai/reveng/model/ErrorModel.java deleted file mode 100644 index a4eb9e3..0000000 --- a/src/main/java/ai/reveng/model/ErrorModel.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ErrorModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ErrorModel { - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - @javax.annotation.Nonnull - private String code; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - @javax.annotation.Nonnull - private String message; - - public ErrorModel() { - } - - public ErrorModel code(@javax.annotation.Nonnull String code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - @javax.annotation.Nonnull - public String getCode() { - return code; - } - - public void setCode(@javax.annotation.Nonnull String code) { - this.code = code; - } - - - public ErrorModel message(@javax.annotation.Nonnull String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nonnull String message) { - this.message = message; - } - - /** - * 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 ErrorModel instance itself - */ - public ErrorModel 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; - } - ErrorModel errorModel = (ErrorModel) o; - return Objects.equals(this.code, errorModel.code) && - Objects.equals(this.message, errorModel.message)&& - Objects.equals(this.additionalProperties, errorModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorModel {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("code", "message")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("code", "message")); - } - - /** - * 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 ErrorModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ErrorModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ErrorModel is not found in the empty JSON string", ErrorModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ErrorModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ErrorModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ErrorModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ErrorModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ErrorModel 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 ErrorModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ErrorModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ErrorModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ErrorModel - * @throws IOException if the JSON string is invalid with respect to ErrorModel - */ - public static ErrorModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ErrorModel.class); - } - - /** - * Convert an instance of ErrorModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ExportModel.java b/src/main/java/ai/reveng/model/ExportModel.java deleted file mode 100644 index 4e30481..0000000 --- a/src/main/java/ai/reveng/model/ExportModel.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ExportModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ExportModel { - public static final String SERIALIZED_NAME_NUMBER_OF_EXPORTS = "number_of_exports"; - @SerializedName(SERIALIZED_NAME_NUMBER_OF_EXPORTS) - @javax.annotation.Nonnull - private Integer numberOfExports; - - public static final String SERIALIZED_NAME_EXPORTS = "exports"; - @SerializedName(SERIALIZED_NAME_EXPORTS) - @javax.annotation.Nonnull - private List> exports = new ArrayList<>(); - - public ExportModel() { - } - - public ExportModel numberOfExports(@javax.annotation.Nonnull Integer numberOfExports) { - this.numberOfExports = numberOfExports; - return this; - } - - /** - * Get numberOfExports - * @return numberOfExports - */ - @javax.annotation.Nonnull - public Integer getNumberOfExports() { - return numberOfExports; - } - - public void setNumberOfExports(@javax.annotation.Nonnull Integer numberOfExports) { - this.numberOfExports = numberOfExports; - } - - - public ExportModel exports(@javax.annotation.Nonnull List> exports) { - this.exports = exports; - return this; - } - - public ExportModel addExportsItem(Map exportsItem) { - if (this.exports == null) { - this.exports = new ArrayList<>(); - } - this.exports.add(exportsItem); - return this; - } - - /** - * Get exports - * @return exports - */ - @javax.annotation.Nonnull - public List> getExports() { - return exports; - } - - public void setExports(@javax.annotation.Nonnull List> exports) { - this.exports = exports; - } - - /** - * 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 ExportModel instance itself - */ - public ExportModel 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; - } - ExportModel exportModel = (ExportModel) o; - return Objects.equals(this.numberOfExports, exportModel.numberOfExports) && - Objects.equals(this.exports, exportModel.exports)&& - Objects.equals(this.additionalProperties, exportModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(numberOfExports, exports, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExportModel {\n"); - sb.append(" numberOfExports: ").append(toIndentedString(numberOfExports)).append("\n"); - sb.append(" exports: ").append(toIndentedString(exports)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("number_of_exports", "exports")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("number_of_exports", "exports")); - } - - /** - * 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 ExportModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExportModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ExportModel is not found in the empty JSON string", ExportModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ExportModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("exports") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("exports").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `exports` to be an array in the JSON string but got `%s`", jsonObj.get("exports").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExportModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExportModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ExportModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ExportModel 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 ExportModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ExportModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ExportModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExportModel - * @throws IOException if the JSON string is invalid with respect to ExportModel - */ - public static ExportModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExportModel.class); - } - - /** - * Convert an instance of ExportModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ExternalResponse.java b/src/main/java/ai/reveng/model/ExternalResponse.java deleted file mode 100644 index 2f94c4e..0000000 --- a/src/main/java/ai/reveng/model/ExternalResponse.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 com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ExternalResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ExternalResponse { - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - @javax.annotation.Nonnull - private Map data = new HashMap<>(); - - public static final String SERIALIZED_NAME_LAST_UPDATED = "last_updated"; - @SerializedName(SERIALIZED_NAME_LAST_UPDATED) - @javax.annotation.Nonnull - private OffsetDateTime lastUpdated; - - public ExternalResponse() { - } - - public ExternalResponse sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * Get sha256Hash - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public ExternalResponse data(@javax.annotation.Nonnull Map data) { - this.data = data; - return this; - } - - public ExternalResponse putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); - } - this.data.put(key, dataItem); - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nonnull - public Map getData() { - return data; - } - - public void setData(@javax.annotation.Nonnull Map data) { - this.data = data; - } - - - public ExternalResponse lastUpdated(@javax.annotation.Nonnull OffsetDateTime lastUpdated) { - this.lastUpdated = lastUpdated; - return this; - } - - /** - * Get lastUpdated - * @return lastUpdated - */ - @javax.annotation.Nonnull - public OffsetDateTime getLastUpdated() { - return lastUpdated; - } - - public void setLastUpdated(@javax.annotation.Nonnull OffsetDateTime lastUpdated) { - this.lastUpdated = lastUpdated; - } - - /** - * 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 ExternalResponse instance itself - */ - public ExternalResponse 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; - } - ExternalResponse externalResponse = (ExternalResponse) o; - return Objects.equals(this.sha256Hash, externalResponse.sha256Hash) && - Objects.equals(this.data, externalResponse.data) && - Objects.equals(this.lastUpdated, externalResponse.lastUpdated)&& - Objects.equals(this.additionalProperties, externalResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(sha256Hash, data, lastUpdated, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExternalResponse {\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" lastUpdated: ").append(toIndentedString(lastUpdated)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("sha_256_hash", "data", "last_updated")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("sha_256_hash", "data", "last_updated")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExternalResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExternalResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ExternalResponse is not found in the empty JSON string", ExternalResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ExternalResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExternalResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExternalResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ExternalResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ExternalResponse 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 ExternalResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ExternalResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ExternalResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExternalResponse - * @throws IOException if the JSON string is invalid with respect to ExternalResponse - */ - public static ExternalResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExternalResponse.class); - } - - /** - * Convert an instance of ExternalResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FileFormat.java b/src/main/java/ai/reveng/model/FileFormat.java deleted file mode 100644 index b4f8158..0000000 --- a/src/main/java/ai/reveng/model/FileFormat.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets FileFormat - */ -@JsonAdapter(FileFormat.Adapter.class) -public enum FileFormat { - - PE("pe"), - - ELF("elf"), - - BLOB("blob"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - FileFormat(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FileFormat fromValue(String value) { - for (FileFormat b : FileFormat.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final FileFormat enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FileFormat read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FileFormat.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - FileFormat.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/FileHashes.java b/src/main/java/ai/reveng/model/FileHashes.java deleted file mode 100644 index 64a0b40..0000000 --- a/src/main/java/ai/reveng/model/FileHashes.java +++ /dev/null @@ -1,492 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FileHashes - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FileHashes { - public static final String SERIALIZED_NAME_MD5 = "md5"; - @SerializedName(SERIALIZED_NAME_MD5) - @javax.annotation.Nullable - private String md5; - - public static final String SERIALIZED_NAME_SHA1 = "sha1"; - @SerializedName(SERIALIZED_NAME_SHA1) - @javax.annotation.Nullable - private String sha1; - - public static final String SERIALIZED_NAME_SHA256 = "sha256"; - @SerializedName(SERIALIZED_NAME_SHA256) - @javax.annotation.Nullable - private String sha256; - - public static final String SERIALIZED_NAME_SHA512 = "sha512"; - @SerializedName(SERIALIZED_NAME_SHA512) - @javax.annotation.Nullable - private String sha512; - - public static final String SERIALIZED_NAME_SHA3224 = "sha3_224"; - @SerializedName(SERIALIZED_NAME_SHA3224) - @javax.annotation.Nullable - private String sha3224; - - public static final String SERIALIZED_NAME_SHA3256 = "sha3_256"; - @SerializedName(SERIALIZED_NAME_SHA3256) - @javax.annotation.Nullable - private String sha3256; - - public static final String SERIALIZED_NAME_SHA3384 = "sha3_384"; - @SerializedName(SERIALIZED_NAME_SHA3384) - @javax.annotation.Nullable - private String sha3384; - - public static final String SERIALIZED_NAME_SHA3512 = "sha3_512"; - @SerializedName(SERIALIZED_NAME_SHA3512) - @javax.annotation.Nullable - private String sha3512; - - public FileHashes() { - } - - public FileHashes md5(@javax.annotation.Nullable String md5) { - this.md5 = md5; - return this; - } - - /** - * Get md5 - * @return md5 - */ - @javax.annotation.Nullable - public String getMd5() { - return md5; - } - - public void setMd5(@javax.annotation.Nullable String md5) { - this.md5 = md5; - } - - - public FileHashes sha1(@javax.annotation.Nullable String sha1) { - this.sha1 = sha1; - return this; - } - - /** - * Get sha1 - * @return sha1 - */ - @javax.annotation.Nullable - public String getSha1() { - return sha1; - } - - public void setSha1(@javax.annotation.Nullable String sha1) { - this.sha1 = sha1; - } - - - public FileHashes sha256(@javax.annotation.Nullable String sha256) { - this.sha256 = sha256; - return this; - } - - /** - * Get sha256 - * @return sha256 - */ - @javax.annotation.Nullable - public String getSha256() { - return sha256; - } - - public void setSha256(@javax.annotation.Nullable String sha256) { - this.sha256 = sha256; - } - - - public FileHashes sha512(@javax.annotation.Nullable String sha512) { - this.sha512 = sha512; - return this; - } - - /** - * Get sha512 - * @return sha512 - */ - @javax.annotation.Nullable - public String getSha512() { - return sha512; - } - - public void setSha512(@javax.annotation.Nullable String sha512) { - this.sha512 = sha512; - } - - - public FileHashes sha3224(@javax.annotation.Nullable String sha3224) { - this.sha3224 = sha3224; - return this; - } - - /** - * Get sha3224 - * @return sha3224 - */ - @javax.annotation.Nullable - public String getSha3224() { - return sha3224; - } - - public void setSha3224(@javax.annotation.Nullable String sha3224) { - this.sha3224 = sha3224; - } - - - public FileHashes sha3256(@javax.annotation.Nullable String sha3256) { - this.sha3256 = sha3256; - return this; - } - - /** - * Get sha3256 - * @return sha3256 - */ - @javax.annotation.Nullable - public String getSha3256() { - return sha3256; - } - - public void setSha3256(@javax.annotation.Nullable String sha3256) { - this.sha3256 = sha3256; - } - - - public FileHashes sha3384(@javax.annotation.Nullable String sha3384) { - this.sha3384 = sha3384; - return this; - } - - /** - * Get sha3384 - * @return sha3384 - */ - @javax.annotation.Nullable - public String getSha3384() { - return sha3384; - } - - public void setSha3384(@javax.annotation.Nullable String sha3384) { - this.sha3384 = sha3384; - } - - - public FileHashes sha3512(@javax.annotation.Nullable String sha3512) { - this.sha3512 = sha3512; - return this; - } - - /** - * Get sha3512 - * @return sha3512 - */ - @javax.annotation.Nullable - public String getSha3512() { - return sha3512; - } - - public void setSha3512(@javax.annotation.Nullable String sha3512) { - this.sha3512 = sha3512; - } - - /** - * 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 FileHashes instance itself - */ - public FileHashes 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; - } - FileHashes fileHashes = (FileHashes) o; - return Objects.equals(this.md5, fileHashes.md5) && - Objects.equals(this.sha1, fileHashes.sha1) && - Objects.equals(this.sha256, fileHashes.sha256) && - Objects.equals(this.sha512, fileHashes.sha512) && - Objects.equals(this.sha3224, fileHashes.sha3224) && - Objects.equals(this.sha3256, fileHashes.sha3256) && - Objects.equals(this.sha3384, fileHashes.sha3384) && - Objects.equals(this.sha3512, fileHashes.sha3512)&& - Objects.equals(this.additionalProperties, fileHashes.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(md5, sha1, sha256, sha512, sha3224, sha3256, sha3384, sha3512, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileHashes {\n"); - sb.append(" md5: ").append(toIndentedString(md5)).append("\n"); - sb.append(" sha1: ").append(toIndentedString(sha1)).append("\n"); - sb.append(" sha256: ").append(toIndentedString(sha256)).append("\n"); - sb.append(" sha512: ").append(toIndentedString(sha512)).append("\n"); - sb.append(" sha3224: ").append(toIndentedString(sha3224)).append("\n"); - sb.append(" sha3256: ").append(toIndentedString(sha3256)).append("\n"); - sb.append(" sha3384: ").append(toIndentedString(sha3384)).append("\n"); - sb.append(" sha3512: ").append(toIndentedString(sha3512)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("md5", "sha1", "sha256", "sha512", "sha3_224", "sha3_256", "sha3_384", "sha3_512")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("md5", "sha1", "sha256", "sha512", "sha3_224", "sha3_256", "sha3_384", "sha3_512")); - } - - /** - * 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 FileHashes - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FileHashes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FileHashes is not found in the empty JSON string", FileHashes.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FileHashes.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("md5") != null && !jsonObj.get("md5").isJsonNull()) && !jsonObj.get("md5").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `md5` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md5").toString())); - } - if ((jsonObj.get("sha1") != null && !jsonObj.get("sha1").isJsonNull()) && !jsonObj.get("sha1").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha1").toString())); - } - if ((jsonObj.get("sha256") != null && !jsonObj.get("sha256").isJsonNull()) && !jsonObj.get("sha256").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.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("sha512") != null && !jsonObj.get("sha512").isJsonNull()) && !jsonObj.get("sha512").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha512` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha512").toString())); - } - if ((jsonObj.get("sha3_224") != null && !jsonObj.get("sha3_224").isJsonNull()) && !jsonObj.get("sha3_224").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha3_224` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3_224").toString())); - } - if ((jsonObj.get("sha3_256") != null && !jsonObj.get("sha3_256").isJsonNull()) && !jsonObj.get("sha3_256").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha3_256` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3_256").toString())); - } - if ((jsonObj.get("sha3_384") != null && !jsonObj.get("sha3_384").isJsonNull()) && !jsonObj.get("sha3_384").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha3_384` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3_384").toString())); - } - if ((jsonObj.get("sha3_512") != null && !jsonObj.get("sha3_512").isJsonNull()) && !jsonObj.get("sha3_512").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha3_512` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3_512").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FileHashes.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FileHashes' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FileHashes.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FileHashes 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 FileHashes read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FileHashes instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FileHashes given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileHashes - * @throws IOException if the JSON string is invalid with respect to FileHashes - */ - public static FileHashes fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FileHashes.class); - } - - /** - * Convert an instance of FileHashes to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FileMetadata.java b/src/main/java/ai/reveng/model/FileMetadata.java deleted file mode 100644 index 236f910..0000000 --- a/src/main/java/ai/reveng/model/FileMetadata.java +++ /dev/null @@ -1,371 +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 ai.reveng.model.FileHashes; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FileMetadata - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FileMetadata { - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nonnull - private Integer size; - - public static final String SERIALIZED_NAME_FRIENDLY_SIZE = "friendly_size"; - @SerializedName(SERIALIZED_NAME_FRIENDLY_SIZE) - @javax.annotation.Nonnull - private String friendlySize; - - public static final String SERIALIZED_NAME_ENTROPY = "entropy"; - @SerializedName(SERIALIZED_NAME_ENTROPY) - @javax.annotation.Nonnull - private BigDecimal entropy; - - public static final String SERIALIZED_NAME_HASHES = "hashes"; - @SerializedName(SERIALIZED_NAME_HASHES) - @javax.annotation.Nonnull - private FileHashes hashes; - - public FileMetadata() { - } - - public FileMetadata size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Get size - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - - public FileMetadata friendlySize(@javax.annotation.Nonnull String friendlySize) { - this.friendlySize = friendlySize; - return this; - } - - /** - * Get friendlySize - * @return friendlySize - */ - @javax.annotation.Nonnull - public String getFriendlySize() { - return friendlySize; - } - - public void setFriendlySize(@javax.annotation.Nonnull String friendlySize) { - this.friendlySize = friendlySize; - } - - - public FileMetadata entropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; - return this; - } - - /** - * Get entropy - * @return entropy - */ - @javax.annotation.Nonnull - public BigDecimal getEntropy() { - return entropy; - } - - public void setEntropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; - } - - - public FileMetadata hashes(@javax.annotation.Nonnull FileHashes hashes) { - this.hashes = hashes; - return this; - } - - /** - * Get hashes - * @return hashes - */ - @javax.annotation.Nonnull - public FileHashes getHashes() { - return hashes; - } - - public void setHashes(@javax.annotation.Nonnull FileHashes hashes) { - this.hashes = hashes; - } - - /** - * 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 FileMetadata instance itself - */ - public FileMetadata 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; - } - FileMetadata fileMetadata = (FileMetadata) o; - return Objects.equals(this.size, fileMetadata.size) && - Objects.equals(this.friendlySize, fileMetadata.friendlySize) && - Objects.equals(this.entropy, fileMetadata.entropy) && - Objects.equals(this.hashes, fileMetadata.hashes)&& - Objects.equals(this.additionalProperties, fileMetadata.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(size, friendlySize, entropy, hashes, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileMetadata {\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" friendlySize: ").append(toIndentedString(friendlySize)).append("\n"); - sb.append(" entropy: ").append(toIndentedString(entropy)).append("\n"); - sb.append(" hashes: ").append(toIndentedString(hashes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("size", "friendly_size", "entropy", "hashes")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("size", "friendly_size", "entropy", "hashes")); - } - - /** - * 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 FileMetadata - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FileMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FileMetadata is not found in the empty JSON string", FileMetadata.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FileMetadata.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("friendly_size").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `friendly_size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("friendly_size").toString())); - } - // validate the required field `hashes` - FileHashes.validateJsonElement(jsonObj.get("hashes")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FileMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FileMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FileMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FileMetadata 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 FileMetadata read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FileMetadata instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FileMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileMetadata - * @throws IOException if the JSON string is invalid with respect to FileMetadata - */ - public static FileMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FileMetadata.class); - } - - /** - * Convert an instance of FileMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Filters.java b/src/main/java/ai/reveng/model/Filters.java deleted file mode 100644 index 7263693..0000000 --- a/src/main/java/ai/reveng/model/Filters.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets Filters - */ -@JsonAdapter(Filters.Adapter.class) -public enum Filters { - - OFFICIAL_ONLY("official_only"), - - USER_ONLY("user_only"), - - TEAM_ONLY("team_only"), - - PUBLIC_ONLY("public_only"), - - HIDE_EMPTY("hide_empty"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - Filters(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Filters fromValue(String value) { - for (Filters b : Filters.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final Filters enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Filters read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Filters.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - Filters.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/FormFile.java b/src/main/java/ai/reveng/model/FormFile.java index 3fdf105..e58a762 100644 --- a/src/main/java/ai/reveng/model/FormFile.java +++ b/src/main/java/ai/reveng/model/FormFile.java @@ -51,12 +51,12 @@ public class FormFile { public static final String SERIALIZED_NAME_CONTENT_TYPE = "ContentType"; @SerializedName(SERIALIZED_NAME_CONTENT_TYPE) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String contentType; public static final String SERIALIZED_NAME_FILENAME = "Filename"; @SerializedName(SERIALIZED_NAME_FILENAME) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String filename; public static final String SERIALIZED_NAME_IS_SET = "IsSet"; @@ -72,40 +72,40 @@ public class FormFile { public FormFile() { } - public FormFile contentType(@javax.annotation.Nullable String contentType) { + public FormFile contentType(@javax.annotation.Nonnull String contentType) { this.contentType = contentType; return this; } /** - * Search is applied to string value + * Get contentType * @return contentType */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getContentType() { return contentType; } - public void setContentType(@javax.annotation.Nullable String contentType) { + public void setContentType(@javax.annotation.Nonnull String contentType) { this.contentType = contentType; } - public FormFile filename(@javax.annotation.Nullable String filename) { + public FormFile filename(@javax.annotation.Nonnull String filename) { this.filename = filename; return this; } /** - * Search is applied to string value + * Get filename * @return filename */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getFilename() { return filename; } - public void setFilename(@javax.annotation.Nullable String filename) { + public void setFilename(@javax.annotation.Nonnull String filename) { this.filename = filename; } @@ -267,10 +267,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("ContentType") != null && !jsonObj.get("ContentType").isJsonNull()) && !jsonObj.get("ContentType").isJsonPrimitive()) { + if (!jsonObj.get("ContentType").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ContentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ContentType").toString())); } - if ((jsonObj.get("Filename") != null && !jsonObj.get("Filename").isJsonNull()) && !jsonObj.get("Filename").isJsonPrimitive()) { + if (!jsonObj.get("Filename").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `Filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Filename").toString())); } } diff --git a/src/main/java/ai/reveng/model/FuncDepsInner.java b/src/main/java/ai/reveng/model/FuncDepsInner.java deleted file mode 100644 index 3bd6773..0000000 --- a/src/main/java/ai/reveng/model/FuncDepsInner.java +++ /dev/null @@ -1,360 +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 ai.reveng.model.Enumeration; -import ai.reveng.model.GlobalVariable; -import ai.reveng.model.Structure; -import ai.reveng.model.TypeDefinition; -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.util.HashMap; -import java.util.Map; - - - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonArray; -import com.google.gson.JsonParseException; - -import ai.reveng.invoker.JSON; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FuncDepsInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(FuncDepsInner.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FuncDepsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FuncDepsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterStructure = gson.getDelegateAdapter(this, TypeToken.get(Structure.class)); - final TypeAdapter adapterEnumeration = gson.getDelegateAdapter(this, TypeToken.get(Enumeration.class)); - final TypeAdapter adapterTypeDefinition = gson.getDelegateAdapter(this, TypeToken.get(TypeDefinition.class)); - final TypeAdapter adapterGlobalVariable = gson.getDelegateAdapter(this, TypeToken.get(GlobalVariable.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FuncDepsInner value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `Structure` - if (value.getActualInstance() instanceof Structure) { - JsonElement element = adapterStructure.toJsonTree((Structure)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `Enumeration` - if (value.getActualInstance() instanceof Enumeration) { - JsonElement element = adapterEnumeration.toJsonTree((Enumeration)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `TypeDefinition` - if (value.getActualInstance() instanceof TypeDefinition) { - JsonElement element = adapterTypeDefinition.toJsonTree((TypeDefinition)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `GlobalVariable` - if (value.getActualInstance() instanceof GlobalVariable) { - JsonElement element = adapterGlobalVariable.toJsonTree((GlobalVariable)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: Enumeration, GlobalVariable, Structure, TypeDefinition"); - } - - @Override - public FuncDepsInner read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize Structure - try { - // validate the JSON object to see if any exception is thrown - Structure.validateJsonElement(jsonElement); - actualAdapter = adapterStructure; - FuncDepsInner ret = new FuncDepsInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for Structure failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Structure'", e); - } - // deserialize Enumeration - try { - // validate the JSON object to see if any exception is thrown - Enumeration.validateJsonElement(jsonElement); - actualAdapter = adapterEnumeration; - FuncDepsInner ret = new FuncDepsInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for Enumeration failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Enumeration'", e); - } - // deserialize TypeDefinition - try { - // validate the JSON object to see if any exception is thrown - TypeDefinition.validateJsonElement(jsonElement); - actualAdapter = adapterTypeDefinition; - FuncDepsInner ret = new FuncDepsInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TypeDefinition failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'TypeDefinition'", e); - } - // deserialize GlobalVariable - try { - // validate the JSON object to see if any exception is thrown - GlobalVariable.validateJsonElement(jsonElement); - actualAdapter = adapterGlobalVariable; - FuncDepsInner ret = new FuncDepsInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for GlobalVariable failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'GlobalVariable'", e); - } - - throw new IOException(String.format(java.util.Locale.ROOT, "Failed deserialization for FuncDepsInner: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public FuncDepsInner() { - super("anyOf", Boolean.FALSE); - } - - public FuncDepsInner(Object o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("Structure", Structure.class); - schemas.put("Enumeration", Enumeration.class); - schemas.put("TypeDefinition", TypeDefinition.class); - schemas.put("GlobalVariable", GlobalVariable.class); - } - - @Override - public Map> getSchemas() { - return FuncDepsInner.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * Enumeration, GlobalVariable, Structure, TypeDefinition - * - * It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof Structure) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof Enumeration) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof TypeDefinition) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof GlobalVariable) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be Enumeration, GlobalVariable, Structure, TypeDefinition"); - } - - /** - * Get the actual instance, which can be the following: - * Enumeration, GlobalVariable, Structure, TypeDefinition - * - * @return The actual instance (Enumeration, GlobalVariable, Structure, TypeDefinition) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `Structure`. If the actual instance is not `Structure`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Structure` - * @throws ClassCastException if the instance is not `Structure` - */ - public Structure getStructure() throws ClassCastException { - return (Structure)super.getActualInstance(); - } - - /** - * Get the actual instance of `Enumeration`. If the actual instance is not `Enumeration`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Enumeration` - * @throws ClassCastException if the instance is not `Enumeration` - */ - public Enumeration getEnumeration() throws ClassCastException { - return (Enumeration)super.getActualInstance(); - } - - /** - * Get the actual instance of `TypeDefinition`. If the actual instance is not `TypeDefinition`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `TypeDefinition` - * @throws ClassCastException if the instance is not `TypeDefinition` - */ - public TypeDefinition getTypeDefinition() throws ClassCastException { - return (TypeDefinition)super.getActualInstance(); - } - - /** - * Get the actual instance of `GlobalVariable`. If the actual instance is not `GlobalVariable`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `GlobalVariable` - * @throws ClassCastException if the instance is not `GlobalVariable` - */ - public GlobalVariable getGlobalVariable() throws ClassCastException { - return (GlobalVariable)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 FuncDepsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with Structure - try { - Structure.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for Structure failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with Enumeration - try { - Enumeration.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for Enumeration failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with TypeDefinition - try { - TypeDefinition.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for TypeDefinition failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with GlobalVariable - try { - GlobalVariable.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for GlobalVariable failed with `%s`.", e.getMessage())); - // continue to the next one - } - throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for FuncDepsInner with anyOf schemas: Enumeration, GlobalVariable, Structure, TypeDefinition. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of FuncDepsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of FuncDepsInner - * @throws IOException if the JSON string is invalid with respect to FuncDepsInner - */ - public static FuncDepsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FuncDepsInner.class); - } - - /** - * Convert an instance of FuncDepsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionBlockDestinationResponse.java b/src/main/java/ai/reveng/model/FunctionBlockDestinationResponse.java deleted file mode 100644 index 6d5f1cf..0000000 --- a/src/main/java/ai/reveng/model/FunctionBlockDestinationResponse.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionBlockDestinationResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionBlockDestinationResponse { - public static final String SERIALIZED_NAME_DESTINATION_BLOCK_ID = "destination_block_id"; - @SerializedName(SERIALIZED_NAME_DESTINATION_BLOCK_ID) - @javax.annotation.Nullable - private Integer destinationBlockId; - - public static final String SERIALIZED_NAME_FLOWTYPE = "flowtype"; - @SerializedName(SERIALIZED_NAME_FLOWTYPE) - @javax.annotation.Nonnull - private String flowtype; - - public static final String SERIALIZED_NAME_VADDR = "vaddr"; - @SerializedName(SERIALIZED_NAME_VADDR) - @javax.annotation.Nonnull - private String vaddr; - - public FunctionBlockDestinationResponse() { - } - - public FunctionBlockDestinationResponse destinationBlockId(@javax.annotation.Nullable Integer destinationBlockId) { - this.destinationBlockId = destinationBlockId; - return this; - } - - /** - * The block where execution can flow to from the current block - * @return destinationBlockId - */ - @javax.annotation.Nullable - public Integer getDestinationBlockId() { - return destinationBlockId; - } - - public void setDestinationBlockId(@javax.annotation.Nullable Integer destinationBlockId) { - this.destinationBlockId = destinationBlockId; - } - - - public FunctionBlockDestinationResponse flowtype(@javax.annotation.Nonnull String flowtype) { - this.flowtype = flowtype; - return this; - } - - /** - * The type of execution flow between chunks - * @return flowtype - */ - @javax.annotation.Nonnull - public String getFlowtype() { - return flowtype; - } - - public void setFlowtype(@javax.annotation.Nonnull String flowtype) { - this.flowtype = flowtype; - } - - - public FunctionBlockDestinationResponse vaddr(@javax.annotation.Nonnull String vaddr) { - this.vaddr = vaddr; - return this; - } - - /** - * The vaddr of the destination where the execution flow continues from - * @return vaddr - */ - @javax.annotation.Nonnull - public String getVaddr() { - return vaddr; - } - - public void setVaddr(@javax.annotation.Nonnull String vaddr) { - this.vaddr = vaddr; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FunctionBlockDestinationResponse instance itself - */ - public FunctionBlockDestinationResponse 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; - } - FunctionBlockDestinationResponse functionBlockDestinationResponse = (FunctionBlockDestinationResponse) o; - return Objects.equals(this.destinationBlockId, functionBlockDestinationResponse.destinationBlockId) && - Objects.equals(this.flowtype, functionBlockDestinationResponse.flowtype) && - Objects.equals(this.vaddr, functionBlockDestinationResponse.vaddr)&& - Objects.equals(this.additionalProperties, functionBlockDestinationResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(destinationBlockId, flowtype, vaddr, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionBlockDestinationResponse {\n"); - sb.append(" destinationBlockId: ").append(toIndentedString(destinationBlockId)).append("\n"); - sb.append(" flowtype: ").append(toIndentedString(flowtype)).append("\n"); - sb.append(" vaddr: ").append(toIndentedString(vaddr)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("destination_block_id", "flowtype", "vaddr")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("destination_block_id", "flowtype", "vaddr")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionBlockDestinationResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionBlockDestinationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionBlockDestinationResponse is not found in the empty JSON string", FunctionBlockDestinationResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionBlockDestinationResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("flowtype").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `flowtype` to be a primitive type in the JSON string but got `%s`", jsonObj.get("flowtype").toString())); - } - if (!jsonObj.get("vaddr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `vaddr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vaddr").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionBlockDestinationResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionBlockDestinationResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionBlockDestinationResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionBlockDestinationResponse 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 FunctionBlockDestinationResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionBlockDestinationResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionBlockDestinationResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionBlockDestinationResponse - * @throws IOException if the JSON string is invalid with respect to FunctionBlockDestinationResponse - */ - public static FunctionBlockDestinationResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionBlockDestinationResponse.class); - } - - /** - * Convert an instance of FunctionBlockDestinationResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionBlockResponse.java b/src/main/java/ai/reveng/model/FunctionBlockResponse.java deleted file mode 100644 index 90ad78d..0000000 --- a/src/main/java/ai/reveng/model/FunctionBlockResponse.java +++ /dev/null @@ -1,466 +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 ai.reveng.model.FunctionBlockDestinationResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionBlockResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionBlockResponse { - public static final String SERIALIZED_NAME_ASM = "asm"; - @SerializedName(SERIALIZED_NAME_ASM) - @javax.annotation.Nonnull - private List asm = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private Integer id; - - public static final String SERIALIZED_NAME_MIN_ADDR = "min_addr"; - @SerializedName(SERIALIZED_NAME_MIN_ADDR) - @javax.annotation.Nonnull - private Integer minAddr; - - public static final String SERIALIZED_NAME_MAX_ADDR = "max_addr"; - @SerializedName(SERIALIZED_NAME_MAX_ADDR) - @javax.annotation.Nonnull - private Integer maxAddr; - - public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; - @SerializedName(SERIALIZED_NAME_DESTINATIONS) - @javax.annotation.Nonnull - private List destinations = new ArrayList<>(); - - public static final String SERIALIZED_NAME_COMMENT = "comment"; - @SerializedName(SERIALIZED_NAME_COMMENT) - @javax.annotation.Nullable - private String comment; - - public FunctionBlockResponse() { - } - - public FunctionBlockResponse asm(@javax.annotation.Nonnull List asm) { - this.asm = asm; - return this; - } - - public FunctionBlockResponse addAsmItem(String asmItem) { - if (this.asm == null) { - this.asm = new ArrayList<>(); - } - this.asm.add(asmItem); - return this; - } - - /** - * The ordered assembly strings for this chunk - * @return asm - */ - @javax.annotation.Nonnull - public List getAsm() { - return asm; - } - - public void setAsm(@javax.annotation.Nonnull List asm) { - this.asm = asm; - } - - - public FunctionBlockResponse id(@javax.annotation.Nonnull Integer id) { - this.id = id; - return this; - } - - /** - * ID of the block - * @return id - */ - @javax.annotation.Nonnull - public Integer getId() { - return id; - } - - public void setId(@javax.annotation.Nonnull Integer id) { - this.id = id; - } - - - public FunctionBlockResponse minAddr(@javax.annotation.Nonnull Integer minAddr) { - this.minAddr = minAddr; - return this; - } - - /** - * The minimum vaddr of the block - * @return minAddr - */ - @javax.annotation.Nonnull - public Integer getMinAddr() { - return minAddr; - } - - public void setMinAddr(@javax.annotation.Nonnull Integer minAddr) { - this.minAddr = minAddr; - } - - - public FunctionBlockResponse maxAddr(@javax.annotation.Nonnull Integer maxAddr) { - this.maxAddr = maxAddr; - return this; - } - - /** - * The maximum vaddr of the block - * @return maxAddr - */ - @javax.annotation.Nonnull - public Integer getMaxAddr() { - return maxAddr; - } - - public void setMaxAddr(@javax.annotation.Nonnull Integer maxAddr) { - this.maxAddr = maxAddr; - } - - - public FunctionBlockResponse destinations(@javax.annotation.Nonnull List destinations) { - this.destinations = destinations; - return this; - } - - public FunctionBlockResponse addDestinationsItem(FunctionBlockDestinationResponse destinationsItem) { - if (this.destinations == null) { - this.destinations = new ArrayList<>(); - } - this.destinations.add(destinationsItem); - return this; - } - - /** - * The potential execution flow destinations from this block - * @return destinations - */ - @javax.annotation.Nonnull - public List getDestinations() { - return destinations; - } - - public void setDestinations(@javax.annotation.Nonnull List destinations) { - this.destinations = destinations; - } - - - public FunctionBlockResponse comment(@javax.annotation.Nullable String comment) { - this.comment = comment; - return this; - } - - /** - * An optional comment associated with this block, if any - * @return comment - */ - @javax.annotation.Nullable - public String getComment() { - return comment; - } - - public void setComment(@javax.annotation.Nullable String comment) { - this.comment = comment; - } - - /** - * 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 FunctionBlockResponse instance itself - */ - public FunctionBlockResponse 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; - } - FunctionBlockResponse functionBlockResponse = (FunctionBlockResponse) o; - return Objects.equals(this.asm, functionBlockResponse.asm) && - Objects.equals(this.id, functionBlockResponse.id) && - Objects.equals(this.minAddr, functionBlockResponse.minAddr) && - Objects.equals(this.maxAddr, functionBlockResponse.maxAddr) && - Objects.equals(this.destinations, functionBlockResponse.destinations) && - Objects.equals(this.comment, functionBlockResponse.comment)&& - Objects.equals(this.additionalProperties, functionBlockResponse.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(asm, id, minAddr, maxAddr, destinations, comment, 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 FunctionBlockResponse {\n"); - sb.append(" asm: ").append(toIndentedString(asm)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" minAddr: ").append(toIndentedString(minAddr)).append("\n"); - sb.append(" maxAddr: ").append(toIndentedString(maxAddr)).append("\n"); - sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); - sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("asm", "id", "min_addr", "max_addr", "destinations", "comment")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("asm", "id", "min_addr", "max_addr", "destinations")); - } - - /** - * 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 FunctionBlockResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionBlockResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionBlockResponse is not found in the empty JSON string", FunctionBlockResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionBlockResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("asm") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("asm").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `asm` to be an array in the JSON string but got `%s`", jsonObj.get("asm").toString())); - } - if (jsonObj.get("destinations") != null) { - if (!jsonObj.get("destinations").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `destinations` to be an array in the JSON string but got `%s`", jsonObj.get("destinations").toString())); - } - JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); - // validate the required field `destinations` (array) - for (int i = 0; i < jsonArraydestinations.size(); i++) { - FunctionBlockDestinationResponse.validateJsonElement(jsonArraydestinations.get(i)); - } - } - if ((jsonObj.get("comment") != null && !jsonObj.get("comment").isJsonNull()) && !jsonObj.get("comment").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("comment").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionBlockResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionBlockResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionBlockResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionBlockResponse 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 FunctionBlockResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionBlockResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionBlockResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionBlockResponse - * @throws IOException if the JSON string is invalid with respect to FunctionBlockResponse - */ - public static FunctionBlockResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionBlockResponse.class); - } - - /** - * Convert an instance of FunctionBlockResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionBlocksResponse.java b/src/main/java/ai/reveng/model/FunctionBlocksResponse.java deleted file mode 100644 index 630a123..0000000 --- a/src/main/java/ai/reveng/model/FunctionBlocksResponse.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 ai.reveng.model.FunctionBlockResponse; -import ai.reveng.model.FunctionLocalVariableResponse; -import ai.reveng.model.FunctionParamResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Response for returning disassembly of a function. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionBlocksResponse { - public static final String SERIALIZED_NAME_BLOCKS = "blocks"; - @SerializedName(SERIALIZED_NAME_BLOCKS) - @javax.annotation.Nonnull - private List blocks = new ArrayList<>(); - - public static final String SERIALIZED_NAME_LOCAL_VARIABLES = "local_variables"; - @SerializedName(SERIALIZED_NAME_LOCAL_VARIABLES) - @javax.annotation.Nonnull - private List localVariables = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PARAMS = "params"; - @SerializedName(SERIALIZED_NAME_PARAMS) - @javax.annotation.Nonnull - private List params = new ArrayList<>(); - - public static final String SERIALIZED_NAME_OVERVIEW_COMMENT = "overview_comment"; - @SerializedName(SERIALIZED_NAME_OVERVIEW_COMMENT) - @javax.annotation.Nullable - private String overviewComment; - - public FunctionBlocksResponse() { - } - - public FunctionBlocksResponse blocks(@javax.annotation.Nonnull List blocks) { - this.blocks = blocks; - return this; - } - - public FunctionBlocksResponse addBlocksItem(FunctionBlockResponse blocksItem) { - if (this.blocks == null) { - this.blocks = new ArrayList<>(); - } - this.blocks.add(blocksItem); - return this; - } - - /** - * Disassembly is broken into control flow blocks - * @return blocks - */ - @javax.annotation.Nonnull - public List getBlocks() { - return blocks; - } - - public void setBlocks(@javax.annotation.Nonnull List blocks) { - this.blocks = blocks; - } - - - public FunctionBlocksResponse localVariables(@javax.annotation.Nonnull List localVariables) { - this.localVariables = localVariables; - return this; - } - - public FunctionBlocksResponse addLocalVariablesItem(FunctionLocalVariableResponse localVariablesItem) { - if (this.localVariables == null) { - this.localVariables = new ArrayList<>(); - } - this.localVariables.add(localVariablesItem); - return this; - } - - /** - * Local variables associated with this function - * @return localVariables - */ - @javax.annotation.Nonnull - public List getLocalVariables() { - return localVariables; - } - - public void setLocalVariables(@javax.annotation.Nonnull List localVariables) { - this.localVariables = localVariables; - } - - - public FunctionBlocksResponse params(@javax.annotation.Nonnull List params) { - this.params = params; - return this; - } - - public FunctionBlocksResponse addParamsItem(FunctionParamResponse paramsItem) { - if (this.params == null) { - this.params = new ArrayList<>(); - } - this.params.add(paramsItem); - return this; - } - - /** - * Params associated with this function - * @return params - */ - @javax.annotation.Nonnull - public List getParams() { - return params; - } - - public void setParams(@javax.annotation.Nonnull List params) { - this.params = params; - } - - - public FunctionBlocksResponse overviewComment(@javax.annotation.Nullable String overviewComment) { - this.overviewComment = overviewComment; - return this; - } - - /** - * An overview comment for the whole function - * @return overviewComment - */ - @javax.annotation.Nullable - public String getOverviewComment() { - return overviewComment; - } - - public void setOverviewComment(@javax.annotation.Nullable String overviewComment) { - this.overviewComment = overviewComment; - } - - /** - * 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 FunctionBlocksResponse instance itself - */ - public FunctionBlocksResponse 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; - } - FunctionBlocksResponse functionBlocksResponse = (FunctionBlocksResponse) o; - return Objects.equals(this.blocks, functionBlocksResponse.blocks) && - Objects.equals(this.localVariables, functionBlocksResponse.localVariables) && - Objects.equals(this.params, functionBlocksResponse.params) && - Objects.equals(this.overviewComment, functionBlocksResponse.overviewComment)&& - Objects.equals(this.additionalProperties, functionBlocksResponse.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(blocks, localVariables, params, overviewComment, 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 FunctionBlocksResponse {\n"); - sb.append(" blocks: ").append(toIndentedString(blocks)).append("\n"); - sb.append(" localVariables: ").append(toIndentedString(localVariables)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" overviewComment: ").append(toIndentedString(overviewComment)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("blocks", "local_variables", "params", "overview_comment")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("blocks", "local_variables", "params")); - } - - /** - * 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 FunctionBlocksResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionBlocksResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionBlocksResponse is not found in the empty JSON string", FunctionBlocksResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionBlocksResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("blocks") != null) { - if (!jsonObj.get("blocks").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `blocks` to be an array in the JSON string but got `%s`", jsonObj.get("blocks").toString())); - } - JsonArray jsonArrayblocks = jsonObj.getAsJsonArray("blocks"); - // validate the required field `blocks` (array) - for (int i = 0; i < jsonArrayblocks.size(); i++) { - FunctionBlockResponse.validateJsonElement(jsonArrayblocks.get(i)); - } - } - if (jsonObj.get("local_variables") != null) { - if (!jsonObj.get("local_variables").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `local_variables` to be an array in the JSON string but got `%s`", jsonObj.get("local_variables").toString())); - } - JsonArray jsonArraylocalVariables = jsonObj.getAsJsonArray("local_variables"); - // validate the required field `local_variables` (array) - for (int i = 0; i < jsonArraylocalVariables.size(); i++) { - FunctionLocalVariableResponse.validateJsonElement(jsonArraylocalVariables.get(i)); - } - } - if (jsonObj.get("params") != null) { - if (!jsonObj.get("params").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); - } - JsonArray jsonArrayparams = jsonObj.getAsJsonArray("params"); - // validate the required field `params` (array) - for (int i = 0; i < jsonArrayparams.size(); i++) { - FunctionParamResponse.validateJsonElement(jsonArrayparams.get(i)); - } - } - if ((jsonObj.get("overview_comment") != null && !jsonObj.get("overview_comment").isJsonNull()) && !jsonObj.get("overview_comment").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `overview_comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("overview_comment").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionBlocksResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionBlocksResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionBlocksResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionBlocksResponse 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 FunctionBlocksResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionBlocksResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionBlocksResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionBlocksResponse - * @throws IOException if the JSON string is invalid with respect to FunctionBlocksResponse - */ - public static FunctionBlocksResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionBlocksResponse.class); - } - - /** - * Convert an instance of FunctionBlocksResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionBoundary.java b/src/main/java/ai/reveng/model/FunctionBoundary.java deleted file mode 100644 index 5e3d2f9..0000000 --- a/src/main/java/ai/reveng/model/FunctionBoundary.java +++ /dev/null @@ -1,379 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionBoundary - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionBoundary { - public static final String SERIALIZED_NAME_MANGLED_NAME = "mangled_name"; - @SerializedName(SERIALIZED_NAME_MANGLED_NAME) - @javax.annotation.Nonnull - private String mangledName; - - public static final String SERIALIZED_NAME_START_ADDRESS = "start_address"; - @SerializedName(SERIALIZED_NAME_START_ADDRESS) - @javax.annotation.Nonnull - private Long startAddress; - - public static final String SERIALIZED_NAME_END_ADDRESS = "end_address"; - @SerializedName(SERIALIZED_NAME_END_ADDRESS) - @javax.annotation.Nonnull - private Long endAddress; - - public static final String SERIALIZED_NAME_INCLUDE_IN_ANALYSIS = "include_in_analysis"; - @SerializedName(SERIALIZED_NAME_INCLUDE_IN_ANALYSIS) - @javax.annotation.Nullable - private Boolean includeInAnalysis; - - public FunctionBoundary() { - } - - public FunctionBoundary mangledName(@javax.annotation.Nonnull String mangledName) { - this.mangledName = mangledName; - return this; - } - - /** - * Get mangledName - * @return mangledName - */ - @javax.annotation.Nonnull - public String getMangledName() { - return mangledName; - } - - public void setMangledName(@javax.annotation.Nonnull String mangledName) { - this.mangledName = mangledName; - } - - - public FunctionBoundary startAddress(@javax.annotation.Nonnull Long startAddress) { - this.startAddress = startAddress; - return this; - } - - /** - * Get startAddress - * @return startAddress - */ - @javax.annotation.Nonnull - public Long getStartAddress() { - return startAddress; - } - - public void setStartAddress(@javax.annotation.Nonnull Long startAddress) { - this.startAddress = startAddress; - } - - - public FunctionBoundary endAddress(@javax.annotation.Nonnull Long endAddress) { - this.endAddress = endAddress; - return this; - } - - /** - * Get endAddress - * @return endAddress - */ - @javax.annotation.Nonnull - public Long getEndAddress() { - return endAddress; - } - - public void setEndAddress(@javax.annotation.Nonnull Long endAddress) { - this.endAddress = endAddress; - } - - - public FunctionBoundary includeInAnalysis(@javax.annotation.Nullable Boolean includeInAnalysis) { - this.includeInAnalysis = includeInAnalysis; - return this; - } - - /** - * Indicates whether the function should be included in the analysis - * @return includeInAnalysis - */ - @javax.annotation.Nullable - public Boolean getIncludeInAnalysis() { - return includeInAnalysis; - } - - public void setIncludeInAnalysis(@javax.annotation.Nullable Boolean includeInAnalysis) { - this.includeInAnalysis = includeInAnalysis; - } - - /** - * 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 FunctionBoundary instance itself - */ - public FunctionBoundary 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; - } - FunctionBoundary functionBoundary = (FunctionBoundary) o; - return Objects.equals(this.mangledName, functionBoundary.mangledName) && - Objects.equals(this.startAddress, functionBoundary.startAddress) && - Objects.equals(this.endAddress, functionBoundary.endAddress) && - Objects.equals(this.includeInAnalysis, functionBoundary.includeInAnalysis)&& - Objects.equals(this.additionalProperties, functionBoundary.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(mangledName, startAddress, endAddress, includeInAnalysis, 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 FunctionBoundary {\n"); - sb.append(" mangledName: ").append(toIndentedString(mangledName)).append("\n"); - sb.append(" startAddress: ").append(toIndentedString(startAddress)).append("\n"); - sb.append(" endAddress: ").append(toIndentedString(endAddress)).append("\n"); - sb.append(" includeInAnalysis: ").append(toIndentedString(includeInAnalysis)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("mangled_name", "start_address", "end_address", "include_in_analysis")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("mangled_name", "start_address", "end_address")); - } - - /** - * 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 FunctionBoundary - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionBoundary.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionBoundary is not found in the empty JSON string", FunctionBoundary.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionBoundary.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("mangled_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `mangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mangled_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionBoundary.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionBoundary' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionBoundary.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionBoundary 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 FunctionBoundary read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionBoundary instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionBoundary given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionBoundary - * @throws IOException if the JSON string is invalid with respect to FunctionBoundary - */ - public static FunctionBoundary fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionBoundary.class); - } - - /** - * Convert an instance of FunctionBoundary to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionCapabilityResponse.java b/src/main/java/ai/reveng/model/FunctionCapabilityResponse.java deleted file mode 100644 index 73a77ca..0000000 --- a/src/main/java/ai/reveng/model/FunctionCapabilityResponse.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionCapabilityResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionCapabilityResponse { - public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; - @SerializedName(SERIALIZED_NAME_CAPABILITIES) - @javax.annotation.Nonnull - private List capabilities = new ArrayList<>(); - - public FunctionCapabilityResponse() { - } - - public FunctionCapabilityResponse capabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - return this; - } - - public FunctionCapabilityResponse addCapabilitiesItem(String capabilitiesItem) { - if (this.capabilities == null) { - this.capabilities = new ArrayList<>(); - } - this.capabilities.add(capabilitiesItem); - return this; - } - - /** - * The capabilities of the function - * @return capabilities - */ - @javax.annotation.Nonnull - public List getCapabilities() { - return capabilities; - } - - public void setCapabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FunctionCapabilityResponse instance itself - */ - public FunctionCapabilityResponse 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; - } - FunctionCapabilityResponse functionCapabilityResponse = (FunctionCapabilityResponse) o; - return Objects.equals(this.capabilities, functionCapabilityResponse.capabilities)&& - Objects.equals(this.additionalProperties, functionCapabilityResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(capabilities, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionCapabilityResponse {\n"); - sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("capabilities")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("capabilities")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionCapabilityResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionCapabilityResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionCapabilityResponse is not found in the empty JSON string", FunctionCapabilityResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionCapabilityResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("capabilities") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("capabilities").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionCapabilityResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionCapabilityResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionCapabilityResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionCapabilityResponse 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 FunctionCapabilityResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionCapabilityResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionCapabilityResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionCapabilityResponse - * @throws IOException if the JSON string is invalid with respect to FunctionCapabilityResponse - */ - public static FunctionCapabilityResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionCapabilityResponse.class); - } - - /** - * Convert an instance of FunctionCapabilityResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionDataTypes.java b/src/main/java/ai/reveng/model/FunctionDataTypes.java deleted file mode 100644 index 82a545f..0000000 --- a/src/main/java/ai/reveng/model/FunctionDataTypes.java +++ /dev/null @@ -1,384 +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 ai.reveng.model.V2FunctionInfo; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionDataTypes - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionDataTypes { - public static final String SERIALIZED_NAME_COMPLETED = "completed"; - @SerializedName(SERIALIZED_NAME_COMPLETED) - @javax.annotation.Nonnull - private Boolean completed; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private String status; - - public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; - @SerializedName(SERIALIZED_NAME_DATA_TYPES) - @javax.annotation.Nullable - private V2FunctionInfo dataTypes; - - public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; - @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) - @javax.annotation.Nullable - private Integer dataTypesVersion; - - public FunctionDataTypes() { - } - - public FunctionDataTypes completed(@javax.annotation.Nonnull Boolean completed) { - this.completed = completed; - return this; - } - - /** - * Whether the service has completed data types generation - * @return completed - */ - @javax.annotation.Nonnull - public Boolean getCompleted() { - return completed; - } - - public void setCompleted(@javax.annotation.Nonnull Boolean completed) { - this.completed = completed; - } - - - public FunctionDataTypes status(@javax.annotation.Nonnull String status) { - this.status = status; - return this; - } - - /** - * The current status of the data types service - * @return status - */ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull String status) { - this.status = status; - } - - - public FunctionDataTypes dataTypes(@javax.annotation.Nullable V2FunctionInfo dataTypes) { - this.dataTypes = dataTypes; - return this; - } - - /** - * Function data types information if available - * @return dataTypes - */ - @javax.annotation.Nullable - public V2FunctionInfo getDataTypes() { - return dataTypes; - } - - public void setDataTypes(@javax.annotation.Nullable V2FunctionInfo dataTypes) { - this.dataTypes = dataTypes; - } - - - public FunctionDataTypes dataTypesVersion(@javax.annotation.Nullable Integer dataTypesVersion) { - this.dataTypesVersion = dataTypesVersion; - return this; - } - - /** - * If the data types information has been updated by the user, this field will be populated - * @return dataTypesVersion - */ - @javax.annotation.Nullable - public Integer getDataTypesVersion() { - return dataTypesVersion; - } - - public void setDataTypesVersion(@javax.annotation.Nullable Integer dataTypesVersion) { - this.dataTypesVersion = dataTypesVersion; - } - - /** - * 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 FunctionDataTypes instance itself - */ - public FunctionDataTypes 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; - } - FunctionDataTypes functionDataTypes = (FunctionDataTypes) o; - return Objects.equals(this.completed, functionDataTypes.completed) && - Objects.equals(this.status, functionDataTypes.status) && - Objects.equals(this.dataTypes, functionDataTypes.dataTypes) && - Objects.equals(this.dataTypesVersion, functionDataTypes.dataTypesVersion)&& - Objects.equals(this.additionalProperties, functionDataTypes.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(completed, status, dataTypes, dataTypesVersion, 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 FunctionDataTypes {\n"); - sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); - sb.append(" dataTypesVersion: ").append(toIndentedString(dataTypesVersion)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("completed", "status", "data_types", "data_types_version")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("completed", "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 FunctionDataTypes - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionDataTypes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionDataTypes is not found in the empty JSON string", FunctionDataTypes.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionDataTypes.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the optional field `data_types` - if (jsonObj.get("data_types") != null && !jsonObj.get("data_types").isJsonNull()) { - V2FunctionInfo.validateJsonElement(jsonObj.get("data_types")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionDataTypes.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionDataTypes' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionDataTypes.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionDataTypes 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 FunctionDataTypes read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionDataTypes instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionDataTypes given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionDataTypes - * @throws IOException if the JSON string is invalid with respect to FunctionDataTypes - */ - public static FunctionDataTypes fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionDataTypes.class); - } - - /** - * Convert an instance of FunctionDataTypes to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionDataTypesList.java b/src/main/java/ai/reveng/model/FunctionDataTypesList.java deleted file mode 100644 index db96206..0000000 --- a/src/main/java/ai/reveng/model/FunctionDataTypesList.java +++ /dev/null @@ -1,359 +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 ai.reveng.model.FunctionDataTypesListItem; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionDataTypesList - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionDataTypesList { - public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; - @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) - @javax.annotation.Nullable - private Integer totalCount = 0; - - public static final String SERIALIZED_NAME_TOTAL_DATA_TYPES_COUNT = "total_data_types_count"; - @SerializedName(SERIALIZED_NAME_TOTAL_DATA_TYPES_COUNT) - @javax.annotation.Nullable - private Integer totalDataTypesCount = 0; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public FunctionDataTypesList() { - } - - public FunctionDataTypesList totalCount(@javax.annotation.Nullable Integer totalCount) { - this.totalCount = totalCount; - return this; - } - - /** - * Total number of functions in analysis - * @return totalCount - */ - @javax.annotation.Nullable - public Integer getTotalCount() { - return totalCount; - } - - public void setTotalCount(@javax.annotation.Nullable Integer totalCount) { - this.totalCount = totalCount; - } - - - public FunctionDataTypesList totalDataTypesCount(@javax.annotation.Nullable Integer totalDataTypesCount) { - this.totalDataTypesCount = totalDataTypesCount; - return this; - } - - /** - * Total number of functions with data types - * @return totalDataTypesCount - */ - @javax.annotation.Nullable - public Integer getTotalDataTypesCount() { - return totalDataTypesCount; - } - - public void setTotalDataTypesCount(@javax.annotation.Nullable Integer totalDataTypesCount) { - this.totalDataTypesCount = totalDataTypesCount; - } - - - public FunctionDataTypesList items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public FunctionDataTypesList addItemsItem(FunctionDataTypesListItem itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * List of function data types information - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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 FunctionDataTypesList instance itself - */ - public FunctionDataTypesList 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; - } - FunctionDataTypesList functionDataTypesList = (FunctionDataTypesList) o; - return Objects.equals(this.totalCount, functionDataTypesList.totalCount) && - Objects.equals(this.totalDataTypesCount, functionDataTypesList.totalDataTypesCount) && - Objects.equals(this.items, functionDataTypesList.items)&& - Objects.equals(this.additionalProperties, functionDataTypesList.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(totalCount, totalDataTypesCount, items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionDataTypesList {\n"); - sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); - sb.append(" totalDataTypesCount: ").append(toIndentedString(totalDataTypesCount)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("total_count", "total_data_types_count", "items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * 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 FunctionDataTypesList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionDataTypesList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionDataTypesList is not found in the empty JSON string", FunctionDataTypesList.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionDataTypesList.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("items") != null) { - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - FunctionDataTypesListItem.validateJsonElement(jsonArrayitems.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionDataTypesList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionDataTypesList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionDataTypesList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionDataTypesList 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 FunctionDataTypesList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionDataTypesList instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionDataTypesList given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionDataTypesList - * @throws IOException if the JSON string is invalid with respect to FunctionDataTypesList - */ - public static FunctionDataTypesList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionDataTypesList.class); - } - - /** - * Convert an instance of FunctionDataTypesList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionDataTypesListItem.java b/src/main/java/ai/reveng/model/FunctionDataTypesListItem.java deleted file mode 100644 index 23b8977..0000000 --- a/src/main/java/ai/reveng/model/FunctionDataTypesListItem.java +++ /dev/null @@ -1,410 +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 ai.reveng.model.V2FunctionInfo; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionDataTypesListItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionDataTypesListItem { - public static final String SERIALIZED_NAME_COMPLETED = "completed"; - @SerializedName(SERIALIZED_NAME_COMPLETED) - @javax.annotation.Nonnull - private Boolean completed; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private String status; - - public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; - @SerializedName(SERIALIZED_NAME_DATA_TYPES) - @javax.annotation.Nullable - private V2FunctionInfo dataTypes; - - public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; - @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) - @javax.annotation.Nullable - private Integer dataTypesVersion; - - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public FunctionDataTypesListItem() { - } - - public FunctionDataTypesListItem completed(@javax.annotation.Nonnull Boolean completed) { - this.completed = completed; - return this; - } - - /** - * Whether the service has completed data types generation - * @return completed - */ - @javax.annotation.Nonnull - public Boolean getCompleted() { - return completed; - } - - public void setCompleted(@javax.annotation.Nonnull Boolean completed) { - this.completed = completed; - } - - - public FunctionDataTypesListItem status(@javax.annotation.Nonnull String status) { - this.status = status; - return this; - } - - /** - * The current status of the data types service - * @return status - */ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull String status) { - this.status = status; - } - - - public FunctionDataTypesListItem dataTypes(@javax.annotation.Nullable V2FunctionInfo dataTypes) { - this.dataTypes = dataTypes; - return this; - } - - /** - * Function data types information if available - * @return dataTypes - */ - @javax.annotation.Nullable - public V2FunctionInfo getDataTypes() { - return dataTypes; - } - - public void setDataTypes(@javax.annotation.Nullable V2FunctionInfo dataTypes) { - this.dataTypes = dataTypes; - } - - - public FunctionDataTypesListItem dataTypesVersion(@javax.annotation.Nullable Integer dataTypesVersion) { - this.dataTypesVersion = dataTypesVersion; - return this; - } - - /** - * If the data types information has been updated by the user, this field will be populated - * @return dataTypesVersion - */ - @javax.annotation.Nullable - public Integer getDataTypesVersion() { - return dataTypesVersion; - } - - public void setDataTypesVersion(@javax.annotation.Nullable Integer dataTypesVersion) { - this.dataTypesVersion = dataTypesVersion; - } - - - public FunctionDataTypesListItem functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Function id - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - /** - * 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 FunctionDataTypesListItem instance itself - */ - public FunctionDataTypesListItem 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; - } - FunctionDataTypesListItem functionDataTypesListItem = (FunctionDataTypesListItem) o; - return Objects.equals(this.completed, functionDataTypesListItem.completed) && - Objects.equals(this.status, functionDataTypesListItem.status) && - Objects.equals(this.dataTypes, functionDataTypesListItem.dataTypes) && - Objects.equals(this.dataTypesVersion, functionDataTypesListItem.dataTypesVersion) && - Objects.equals(this.functionId, functionDataTypesListItem.functionId)&& - Objects.equals(this.additionalProperties, functionDataTypesListItem.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(completed, status, dataTypes, dataTypesVersion, functionId, 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 FunctionDataTypesListItem {\n"); - sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); - sb.append(" dataTypesVersion: ").append(toIndentedString(dataTypesVersion)).append("\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("completed", "status", "data_types", "data_types_version", "function_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("completed", "status", "function_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 FunctionDataTypesListItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionDataTypesListItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionDataTypesListItem is not found in the empty JSON string", FunctionDataTypesListItem.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionDataTypesListItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the optional field `data_types` - if (jsonObj.get("data_types") != null && !jsonObj.get("data_types").isJsonNull()) { - V2FunctionInfo.validateJsonElement(jsonObj.get("data_types")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionDataTypesListItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionDataTypesListItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionDataTypesListItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionDataTypesListItem 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 FunctionDataTypesListItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionDataTypesListItem instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionDataTypesListItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionDataTypesListItem - * @throws IOException if the JSON string is invalid with respect to FunctionDataTypesListItem - */ - public static FunctionDataTypesListItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionDataTypesListItem.class); - } - - /** - * Convert an instance of FunctionDataTypesListItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionDataTypesParams.java b/src/main/java/ai/reveng/model/FunctionDataTypesParams.java deleted file mode 100644 index af99b78..0000000 --- a/src/main/java/ai/reveng/model/FunctionDataTypesParams.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionDataTypesParams - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionDataTypesParams { - public static final String SERIALIZED_NAME_FUNCTION_IDS = "function_ids"; - @SerializedName(SERIALIZED_NAME_FUNCTION_IDS) - @javax.annotation.Nonnull - private List functionIds = new ArrayList<>(); - - public FunctionDataTypesParams() { - } - - public FunctionDataTypesParams functionIds(@javax.annotation.Nonnull List functionIds) { - this.functionIds = functionIds; - return this; - } - - public FunctionDataTypesParams addFunctionIdsItem(Long functionIdsItem) { - if (this.functionIds == null) { - this.functionIds = new ArrayList<>(); - } - this.functionIds.add(functionIdsItem); - return this; - } - - /** - * The function ID's to generate/get data types for - * @return functionIds - */ - @javax.annotation.Nonnull - public List getFunctionIds() { - return functionIds; - } - - public void setFunctionIds(@javax.annotation.Nonnull List functionIds) { - this.functionIds = functionIds; - } - - /** - * 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 FunctionDataTypesParams instance itself - */ - public FunctionDataTypesParams 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; - } - FunctionDataTypesParams functionDataTypesParams = (FunctionDataTypesParams) o; - return Objects.equals(this.functionIds, functionDataTypesParams.functionIds)&& - Objects.equals(this.additionalProperties, functionDataTypesParams.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionIds, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionDataTypesParams {\n"); - sb.append(" functionIds: ").append(toIndentedString(functionIds)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_ids")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_ids")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionDataTypesParams - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionDataTypesParams.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionDataTypesParams is not found in the empty JSON string", FunctionDataTypesParams.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionDataTypesParams.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("function_ids") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("function_ids").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_ids` to be an array in the JSON string but got `%s`", jsonObj.get("function_ids").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionDataTypesParams.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionDataTypesParams' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionDataTypesParams.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionDataTypesParams 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 FunctionDataTypesParams read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionDataTypesParams instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionDataTypesParams given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionDataTypesParams - * @throws IOException if the JSON string is invalid with respect to FunctionDataTypesParams - */ - public static FunctionDataTypesParams fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionDataTypesParams.class); - } - - /** - * Convert an instance of FunctionDataTypesParams to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionDataTypesStatus.java b/src/main/java/ai/reveng/model/FunctionDataTypesStatus.java deleted file mode 100644 index 12e8d9c..0000000 --- a/src/main/java/ai/reveng/model/FunctionDataTypesStatus.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionDataTypesStatus - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionDataTypesStatus { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public static final String SERIALIZED_NAME_COMPLETED = "completed"; - @SerializedName(SERIALIZED_NAME_COMPLETED) - @javax.annotation.Nonnull - private Boolean completed; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private String status; - - public FunctionDataTypesStatus() { - } - - public FunctionDataTypesStatus functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Function id - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public FunctionDataTypesStatus completed(@javax.annotation.Nonnull Boolean completed) { - this.completed = completed; - return this; - } - - /** - * Whether the service has completed data types generation - * @return completed - */ - @javax.annotation.Nonnull - public Boolean getCompleted() { - return completed; - } - - public void setCompleted(@javax.annotation.Nonnull Boolean completed) { - this.completed = completed; - } - - - public FunctionDataTypesStatus status(@javax.annotation.Nonnull String status) { - this.status = status; - return this; - } - - /** - * The current status of the data types service - * @return status - */ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull String status) { - this.status = status; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FunctionDataTypesStatus instance itself - */ - public FunctionDataTypesStatus 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; - } - FunctionDataTypesStatus functionDataTypesStatus = (FunctionDataTypesStatus) o; - return Objects.equals(this.functionId, functionDataTypesStatus.functionId) && - Objects.equals(this.completed, functionDataTypesStatus.completed) && - Objects.equals(this.status, functionDataTypesStatus.status)&& - Objects.equals(this.additionalProperties, functionDataTypesStatus.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, completed, status, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionDataTypesStatus {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "completed", "status")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "completed", "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 FunctionDataTypesStatus - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionDataTypesStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionDataTypesStatus is not found in the empty JSON string", FunctionDataTypesStatus.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionDataTypesStatus.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionDataTypesStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionDataTypesStatus' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionDataTypesStatus.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionDataTypesStatus 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 FunctionDataTypesStatus read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionDataTypesStatus instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionDataTypesStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionDataTypesStatus - * @throws IOException if the JSON string is invalid with respect to FunctionDataTypesStatus - */ - public static FunctionDataTypesStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionDataTypesStatus.class); - } - - /** - * Convert an instance of FunctionDataTypesStatus to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionListItem.java b/src/main/java/ai/reveng/model/FunctionListItem.java deleted file mode 100644 index 95c2df6..0000000 --- a/src/main/java/ai/reveng/model/FunctionListItem.java +++ /dev/null @@ -1,544 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import ai.reveng.model.NameSourceType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionListItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionListItem { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private Long id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - /** - * The source (process) the function name came from - */ - @JsonAdapter(NameSourceTypeEnum.Adapter.class) - public enum NameSourceTypeEnum { - SYSTEM("SYSTEM"), - - USER("USER"), - - AUTO_UNSTRIP("AUTO_UNSTRIP"), - - EXTERNAL("EXTERNAL"), - - AI_UNSTRIP("AI_UNSTRIP"), - - AI_AGENT("AI_AGENT"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - NameSourceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static NameSourceTypeEnum fromValue(String value) { - for (NameSourceTypeEnum b : NameSourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final NameSourceTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public NameSourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return NameSourceTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - NameSourceTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_NAME_SOURCE_TYPE = "name_source_type"; - @SerializedName(SERIALIZED_NAME_NAME_SOURCE_TYPE) - @javax.annotation.Nonnull - private NameSourceTypeEnum nameSourceType; - - public static final String SERIALIZED_NAME_NAME_SOURCE = "name_source"; - @SerializedName(SERIALIZED_NAME_NAME_SOURCE) - @javax.annotation.Nonnull - private NameSourceType nameSource; - - public static final String SERIALIZED_NAME_MANGLED_NAME = "mangled_name"; - @SerializedName(SERIALIZED_NAME_MANGLED_NAME) - @javax.annotation.Nonnull - private String mangledName; - - public static final String SERIALIZED_NAME_VADDR = "vaddr"; - @SerializedName(SERIALIZED_NAME_VADDR) - @javax.annotation.Nonnull - private Long vaddr; - - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nonnull - private Integer size; - - public static final String SERIALIZED_NAME_DEBUG = "debug"; - @SerializedName(SERIALIZED_NAME_DEBUG) - @javax.annotation.Nonnull - private Boolean debug; - - public FunctionListItem() { - } - - public FunctionListItem id(@javax.annotation.Nonnull Long id) { - this.id = id; - return this; - } - - /** - * Function id - * @return id - */ - @javax.annotation.Nonnull - public Long getId() { - return id; - } - - public void setId(@javax.annotation.Nonnull Long id) { - this.id = id; - } - - - public FunctionListItem name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the function - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public FunctionListItem nameSourceType(@javax.annotation.Nonnull NameSourceTypeEnum nameSourceType) { - this.nameSourceType = nameSourceType; - return this; - } - - /** - * The source (process) the function name came from - * @return nameSourceType - */ - @javax.annotation.Nonnull - public NameSourceTypeEnum getNameSourceType() { - return nameSourceType; - } - - public void setNameSourceType(@javax.annotation.Nonnull NameSourceTypeEnum nameSourceType) { - this.nameSourceType = nameSourceType; - } - - - public FunctionListItem nameSource(@javax.annotation.Nonnull NameSourceType nameSource) { - this.nameSource = nameSource; - return this; - } - - /** - * The source of the current function name. - * @return nameSource - */ - @javax.annotation.Nonnull - public NameSourceType getNameSource() { - return nameSource; - } - - public void setNameSource(@javax.annotation.Nonnull NameSourceType nameSource) { - this.nameSource = nameSource; - } - - - public FunctionListItem mangledName(@javax.annotation.Nonnull String mangledName) { - this.mangledName = mangledName; - return this; - } - - /** - * Mangled name of the function - * @return mangledName - */ - @javax.annotation.Nonnull - public String getMangledName() { - return mangledName; - } - - public void setMangledName(@javax.annotation.Nonnull String mangledName) { - this.mangledName = mangledName; - } - - - public FunctionListItem vaddr(@javax.annotation.Nonnull Long vaddr) { - this.vaddr = vaddr; - return this; - } - - /** - * Function virtual address - * @return vaddr - */ - @javax.annotation.Nonnull - public Long getVaddr() { - return vaddr; - } - - public void setVaddr(@javax.annotation.Nonnull Long vaddr) { - this.vaddr = vaddr; - } - - - public FunctionListItem size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Function size in bytes - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - - public FunctionListItem debug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - return this; - } - - /** - * Whether the function has debug information - * @return debug - */ - @javax.annotation.Nonnull - public Boolean getDebug() { - return debug; - } - - public void setDebug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - } - - /** - * 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 FunctionListItem instance itself - */ - public FunctionListItem 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; - } - FunctionListItem functionListItem = (FunctionListItem) o; - return Objects.equals(this.id, functionListItem.id) && - Objects.equals(this.name, functionListItem.name) && - Objects.equals(this.nameSourceType, functionListItem.nameSourceType) && - Objects.equals(this.nameSource, functionListItem.nameSource) && - Objects.equals(this.mangledName, functionListItem.mangledName) && - Objects.equals(this.vaddr, functionListItem.vaddr) && - Objects.equals(this.size, functionListItem.size) && - Objects.equals(this.debug, functionListItem.debug)&& - Objects.equals(this.additionalProperties, functionListItem.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, nameSourceType, nameSource, mangledName, vaddr, size, debug, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionListItem {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" nameSourceType: ").append(toIndentedString(nameSourceType)).append("\n"); - sb.append(" nameSource: ").append(toIndentedString(nameSource)).append("\n"); - sb.append(" mangledName: ").append(toIndentedString(mangledName)).append("\n"); - sb.append(" vaddr: ").append(toIndentedString(vaddr)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "name", "name_source_type", "name_source", "mangled_name", "vaddr", "size", "debug")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "name", "name_source_type", "name_source", "mangled_name", "vaddr", "size", "debug")); - } - - /** - * 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 FunctionListItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionListItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionListItem is not found in the empty JSON string", FunctionListItem.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionListItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("name_source_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name_source_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_source_type").toString())); - } - // validate the required field `name_source_type` - NameSourceTypeEnum.validateJsonElement(jsonObj.get("name_source_type")); - // validate the required field `name_source` - NameSourceType.validateJsonElement(jsonObj.get("name_source")); - if (!jsonObj.get("mangled_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `mangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mangled_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionListItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionListItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionListItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionListItem 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 FunctionListItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionListItem instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionListItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionListItem - * @throws IOException if the JSON string is invalid with respect to FunctionListItem - */ - public static FunctionListItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionListItem.class); - } - - /** - * Convert an instance of FunctionListItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionLocalVariableResponse.java b/src/main/java/ai/reveng/model/FunctionLocalVariableResponse.java deleted file mode 100644 index db6c2f6..0000000 --- a/src/main/java/ai/reveng/model/FunctionLocalVariableResponse.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionLocalVariableResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionLocalVariableResponse { - public static final String SERIALIZED_NAME_ADDRESS = "address"; - @SerializedName(SERIALIZED_NAME_ADDRESS) - @javax.annotation.Nonnull - private String address; - - public static final String SERIALIZED_NAME_D_TYPE = "d_type"; - @SerializedName(SERIALIZED_NAME_D_TYPE) - @javax.annotation.Nonnull - private String dType; - - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nonnull - private Integer size; - - public static final String SERIALIZED_NAME_LOC = "loc"; - @SerializedName(SERIALIZED_NAME_LOC) - @javax.annotation.Nonnull - private String loc; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public FunctionLocalVariableResponse() { - } - - public FunctionLocalVariableResponse address(@javax.annotation.Nonnull String address) { - this.address = address; - return this; - } - - /** - * Get address - * @return address - */ - @javax.annotation.Nonnull - public String getAddress() { - return address; - } - - public void setAddress(@javax.annotation.Nonnull String address) { - this.address = address; - } - - - public FunctionLocalVariableResponse dType(@javax.annotation.Nonnull String dType) { - this.dType = dType; - return this; - } - - /** - * Get dType - * @return dType - */ - @javax.annotation.Nonnull - public String getdType() { - return dType; - } - - public void setdType(@javax.annotation.Nonnull String dType) { - this.dType = dType; - } - - - public FunctionLocalVariableResponse size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Get size - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - - public FunctionLocalVariableResponse loc(@javax.annotation.Nonnull String loc) { - this.loc = loc; - return this; - } - - /** - * Get loc - * @return loc - */ - @javax.annotation.Nonnull - public String getLoc() { - return loc; - } - - public void setLoc(@javax.annotation.Nonnull String loc) { - this.loc = loc; - } - - - public FunctionLocalVariableResponse 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; - } - - /** - * 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 FunctionLocalVariableResponse instance itself - */ - public FunctionLocalVariableResponse 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; - } - FunctionLocalVariableResponse functionLocalVariableResponse = (FunctionLocalVariableResponse) o; - return Objects.equals(this.address, functionLocalVariableResponse.address) && - Objects.equals(this.dType, functionLocalVariableResponse.dType) && - Objects.equals(this.size, functionLocalVariableResponse.size) && - Objects.equals(this.loc, functionLocalVariableResponse.loc) && - Objects.equals(this.name, functionLocalVariableResponse.name)&& - Objects.equals(this.additionalProperties, functionLocalVariableResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(address, dType, size, loc, name, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionLocalVariableResponse {\n"); - sb.append(" address: ").append(toIndentedString(address)).append("\n"); - sb.append(" dType: ").append(toIndentedString(dType)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" loc: ").append(toIndentedString(loc)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("address", "d_type", "size", "loc", "name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("address", "d_type", "size", "loc", "name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionLocalVariableResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionLocalVariableResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionLocalVariableResponse is not found in the empty JSON string", FunctionLocalVariableResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionLocalVariableResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("address").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); - } - if (!jsonObj.get("d_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `d_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("d_type").toString())); - } - if (!jsonObj.get("loc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `loc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loc").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionLocalVariableResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionLocalVariableResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionLocalVariableResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionLocalVariableResponse 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 FunctionLocalVariableResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionLocalVariableResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionLocalVariableResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionLocalVariableResponse - * @throws IOException if the JSON string is invalid with respect to FunctionLocalVariableResponse - */ - public static FunctionLocalVariableResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionLocalVariableResponse.class); - } - - /** - * Convert an instance of FunctionLocalVariableResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionMapping.java b/src/main/java/ai/reveng/model/FunctionMapping.java deleted file mode 100644 index 512afc3..0000000 --- a/src/main/java/ai/reveng/model/FunctionMapping.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionMapping - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionMapping { - public static final String SERIALIZED_NAME_FUNCTION_MAP = "function_map"; - @SerializedName(SERIALIZED_NAME_FUNCTION_MAP) - @javax.annotation.Nonnull - private Map functionMap = new HashMap<>(); - - public static final String SERIALIZED_NAME_INVERSE_FUNCTION_MAP = "inverse_function_map"; - @SerializedName(SERIALIZED_NAME_INVERSE_FUNCTION_MAP) - @javax.annotation.Nonnull - private Map inverseFunctionMap = new HashMap<>(); - - public static final String SERIALIZED_NAME_NAME_MAP = "name_map"; - @SerializedName(SERIALIZED_NAME_NAME_MAP) - @javax.annotation.Nonnull - private Map nameMap = new HashMap<>(); - - public FunctionMapping() { - } - - public FunctionMapping functionMap(@javax.annotation.Nonnull Map functionMap) { - this.functionMap = functionMap; - return this; - } - - public FunctionMapping putFunctionMapItem(String key, Integer functionMapItem) { - if (this.functionMap == null) { - this.functionMap = new HashMap<>(); - } - this.functionMap.put(key, functionMapItem); - return this; - } - - /** - * Mapping of remote function ids to local function addresses - * @return functionMap - */ - @javax.annotation.Nonnull - public Map getFunctionMap() { - return functionMap; - } - - public void setFunctionMap(@javax.annotation.Nonnull Map functionMap) { - this.functionMap = functionMap; - } - - - public FunctionMapping inverseFunctionMap(@javax.annotation.Nonnull Map inverseFunctionMap) { - this.inverseFunctionMap = inverseFunctionMap; - return this; - } - - public FunctionMapping putInverseFunctionMapItem(String key, Integer inverseFunctionMapItem) { - if (this.inverseFunctionMap == null) { - this.inverseFunctionMap = new HashMap<>(); - } - this.inverseFunctionMap.put(key, inverseFunctionMapItem); - return this; - } - - /** - * Mapping of local function addresses to remote function ids - * @return inverseFunctionMap - */ - @javax.annotation.Nonnull - public Map getInverseFunctionMap() { - return inverseFunctionMap; - } - - public void setInverseFunctionMap(@javax.annotation.Nonnull Map inverseFunctionMap) { - this.inverseFunctionMap = inverseFunctionMap; - } - - - public FunctionMapping nameMap(@javax.annotation.Nonnull Map nameMap) { - this.nameMap = nameMap; - return this; - } - - public FunctionMapping putNameMapItem(String key, String nameMapItem) { - if (this.nameMap == null) { - this.nameMap = new HashMap<>(); - } - this.nameMap.put(key, nameMapItem); - return this; - } - - /** - * Mapping of local function addresses to mangled names - * @return nameMap - */ - @javax.annotation.Nonnull - public Map getNameMap() { - return nameMap; - } - - public void setNameMap(@javax.annotation.Nonnull Map nameMap) { - this.nameMap = nameMap; - } - - /** - * 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 FunctionMapping instance itself - */ - public FunctionMapping 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; - } - FunctionMapping functionMapping = (FunctionMapping) o; - return Objects.equals(this.functionMap, functionMapping.functionMap) && - Objects.equals(this.inverseFunctionMap, functionMapping.inverseFunctionMap) && - Objects.equals(this.nameMap, functionMapping.nameMap)&& - Objects.equals(this.additionalProperties, functionMapping.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionMap, inverseFunctionMap, nameMap, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionMapping {\n"); - sb.append(" functionMap: ").append(toIndentedString(functionMap)).append("\n"); - sb.append(" inverseFunctionMap: ").append(toIndentedString(inverseFunctionMap)).append("\n"); - sb.append(" nameMap: ").append(toIndentedString(nameMap)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_map", "inverse_function_map", "name_map")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_map", "inverse_function_map", "name_map")); - } - - /** - * 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 FunctionMapping - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionMapping.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionMapping is not found in the empty JSON string", FunctionMapping.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionMapping.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionMapping.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionMapping' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionMapping.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionMapping 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 FunctionMapping read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionMapping instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionMapping given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionMapping - * @throws IOException if the JSON string is invalid with respect to FunctionMapping - */ - public static FunctionMapping fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionMapping.class); - } - - /** - * Convert an instance of FunctionMapping to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionNameHistory.java b/src/main/java/ai/reveng/model/FunctionNameHistory.java deleted file mode 100644 index a75c22c..0000000 --- a/src/main/java/ai/reveng/model/FunctionNameHistory.java +++ /dev/null @@ -1,457 +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 ai.reveng.model.FunctionSourceType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionNameHistory - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionNameHistory { - public static final String SERIALIZED_NAME_HISTORY_ID = "history_id"; - @SerializedName(SERIALIZED_NAME_HISTORY_ID) - @javax.annotation.Nonnull - private Integer historyId; - - public static final String SERIALIZED_NAME_CHANGE_MADE_BY = "change_made_by"; - @SerializedName(SERIALIZED_NAME_CHANGE_MADE_BY) - @javax.annotation.Nonnull - private String changeMadeBy; - - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nonnull - private String functionName; - - public static final String SERIALIZED_NAME_MANGLED_NAME = "mangled_name"; - @SerializedName(SERIALIZED_NAME_MANGLED_NAME) - @javax.annotation.Nonnull - private String mangledName; - - public static final String SERIALIZED_NAME_IS_DEBUG = "is_debug"; - @SerializedName(SERIALIZED_NAME_IS_DEBUG) - @javax.annotation.Nonnull - private Boolean isDebug; - - public static final String SERIALIZED_NAME_SOURCE_TYPE = "source_type"; - @SerializedName(SERIALIZED_NAME_SOURCE_TYPE) - @javax.annotation.Nonnull - private FunctionSourceType sourceType; - - public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - @javax.annotation.Nonnull - private String createdAt; - - public FunctionNameHistory() { - } - - public FunctionNameHistory historyId(@javax.annotation.Nonnull Integer historyId) { - this.historyId = historyId; - return this; - } - - /** - * The ID of the history record - * @return historyId - */ - @javax.annotation.Nonnull - public Integer getHistoryId() { - return historyId; - } - - public void setHistoryId(@javax.annotation.Nonnull Integer historyId) { - this.historyId = historyId; - } - - - public FunctionNameHistory changeMadeBy(@javax.annotation.Nonnull String changeMadeBy) { - this.changeMadeBy = changeMadeBy; - return this; - } - - /** - * The user who made the change - * @return changeMadeBy - */ - @javax.annotation.Nonnull - public String getChangeMadeBy() { - return changeMadeBy; - } - - public void setChangeMadeBy(@javax.annotation.Nonnull String changeMadeBy) { - this.changeMadeBy = changeMadeBy; - } - - - public FunctionNameHistory functionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - return this; - } - - /** - * The name of the function - * @return functionName - */ - @javax.annotation.Nonnull - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - } - - - public FunctionNameHistory mangledName(@javax.annotation.Nonnull String mangledName) { - this.mangledName = mangledName; - return this; - } - - /** - * The mangled name of the function - * @return mangledName - */ - @javax.annotation.Nonnull - public String getMangledName() { - return mangledName; - } - - public void setMangledName(@javax.annotation.Nonnull String mangledName) { - this.mangledName = mangledName; - } - - - public FunctionNameHistory isDebug(@javax.annotation.Nonnull Boolean isDebug) { - this.isDebug = isDebug; - return this; - } - - /** - * Whether the function is debugged - * @return isDebug - */ - @javax.annotation.Nonnull - public Boolean getIsDebug() { - return isDebug; - } - - public void setIsDebug(@javax.annotation.Nonnull Boolean isDebug) { - this.isDebug = isDebug; - } - - - public FunctionNameHistory sourceType(@javax.annotation.Nonnull FunctionSourceType sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * The source type of the function - * @return sourceType - */ - @javax.annotation.Nonnull - public FunctionSourceType getSourceType() { - return sourceType; - } - - public void setSourceType(@javax.annotation.Nonnull FunctionSourceType sourceType) { - this.sourceType = sourceType; - } - - - public FunctionNameHistory createdAt(@javax.annotation.Nonnull String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp when the function name was created - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@javax.annotation.Nonnull String createdAt) { - this.createdAt = createdAt; - } - - /** - * 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 FunctionNameHistory instance itself - */ - public FunctionNameHistory 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; - } - FunctionNameHistory functionNameHistory = (FunctionNameHistory) o; - return Objects.equals(this.historyId, functionNameHistory.historyId) && - Objects.equals(this.changeMadeBy, functionNameHistory.changeMadeBy) && - Objects.equals(this.functionName, functionNameHistory.functionName) && - Objects.equals(this.mangledName, functionNameHistory.mangledName) && - Objects.equals(this.isDebug, functionNameHistory.isDebug) && - Objects.equals(this.sourceType, functionNameHistory.sourceType) && - Objects.equals(this.createdAt, functionNameHistory.createdAt)&& - Objects.equals(this.additionalProperties, functionNameHistory.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(historyId, changeMadeBy, functionName, mangledName, isDebug, sourceType, createdAt, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionNameHistory {\n"); - sb.append(" historyId: ").append(toIndentedString(historyId)).append("\n"); - sb.append(" changeMadeBy: ").append(toIndentedString(changeMadeBy)).append("\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" mangledName: ").append(toIndentedString(mangledName)).append("\n"); - sb.append(" isDebug: ").append(toIndentedString(isDebug)).append("\n"); - sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("history_id", "change_made_by", "function_name", "mangled_name", "is_debug", "source_type", "created_at")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("history_id", "change_made_by", "function_name", "mangled_name", "is_debug", "source_type", "created_at")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionNameHistory - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionNameHistory.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionNameHistory is not found in the empty JSON string", FunctionNameHistory.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionNameHistory.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("change_made_by").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `change_made_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("change_made_by").toString())); - } - if (!jsonObj.get("function_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); - } - if (!jsonObj.get("mangled_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `mangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mangled_name").toString())); - } - // validate the required field `source_type` - FunctionSourceType.validateJsonElement(jsonObj.get("source_type")); - if (!jsonObj.get("created_at").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionNameHistory.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionNameHistory' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionNameHistory.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionNameHistory 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 FunctionNameHistory read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionNameHistory instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionNameHistory given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionNameHistory - * @throws IOException if the JSON string is invalid with respect to FunctionNameHistory - */ - public static FunctionNameHistory fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionNameHistory.class); - } - - /** - * Convert an instance of FunctionNameHistory to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionParamResponse.java b/src/main/java/ai/reveng/model/FunctionParamResponse.java deleted file mode 100644 index aa59861..0000000 --- a/src/main/java/ai/reveng/model/FunctionParamResponse.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionParamResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionParamResponse { - public static final String SERIALIZED_NAME_D_TYPE = "d_type"; - @SerializedName(SERIALIZED_NAME_D_TYPE) - @javax.annotation.Nonnull - private String dType; - - public static final String SERIALIZED_NAME_LOC = "loc"; - @SerializedName(SERIALIZED_NAME_LOC) - @javax.annotation.Nonnull - private String loc; - - public static final String SERIALIZED_NAME_ADDR = "addr"; - @SerializedName(SERIALIZED_NAME_ADDR) - @javax.annotation.Nonnull - private String addr; - - public static final String SERIALIZED_NAME_LENGTH = "length"; - @SerializedName(SERIALIZED_NAME_LENGTH) - @javax.annotation.Nonnull - private Integer length; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public FunctionParamResponse() { - } - - public FunctionParamResponse dType(@javax.annotation.Nonnull String dType) { - this.dType = dType; - return this; - } - - /** - * Get dType - * @return dType - */ - @javax.annotation.Nonnull - public String getdType() { - return dType; - } - - public void setdType(@javax.annotation.Nonnull String dType) { - this.dType = dType; - } - - - public FunctionParamResponse loc(@javax.annotation.Nonnull String loc) { - this.loc = loc; - return this; - } - - /** - * Get loc - * @return loc - */ - @javax.annotation.Nonnull - public String getLoc() { - return loc; - } - - public void setLoc(@javax.annotation.Nonnull String loc) { - this.loc = loc; - } - - - public FunctionParamResponse addr(@javax.annotation.Nonnull String addr) { - this.addr = addr; - return this; - } - - /** - * Get addr - * @return addr - */ - @javax.annotation.Nonnull - public String getAddr() { - return addr; - } - - public void setAddr(@javax.annotation.Nonnull String addr) { - this.addr = addr; - } - - - public FunctionParamResponse length(@javax.annotation.Nonnull Integer length) { - this.length = length; - return this; - } - - /** - * Get length - * @return length - */ - @javax.annotation.Nonnull - public Integer getLength() { - return length; - } - - public void setLength(@javax.annotation.Nonnull Integer length) { - this.length = length; - } - - - public FunctionParamResponse 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; - } - - /** - * 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 FunctionParamResponse instance itself - */ - public FunctionParamResponse 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; - } - FunctionParamResponse functionParamResponse = (FunctionParamResponse) o; - return Objects.equals(this.dType, functionParamResponse.dType) && - Objects.equals(this.loc, functionParamResponse.loc) && - Objects.equals(this.addr, functionParamResponse.addr) && - Objects.equals(this.length, functionParamResponse.length) && - Objects.equals(this.name, functionParamResponse.name)&& - Objects.equals(this.additionalProperties, functionParamResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(dType, loc, addr, length, name, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionParamResponse {\n"); - sb.append(" dType: ").append(toIndentedString(dType)).append("\n"); - sb.append(" loc: ").append(toIndentedString(loc)).append("\n"); - sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); - sb.append(" length: ").append(toIndentedString(length)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("d_type", "loc", "addr", "length", "name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("d_type", "loc", "addr", "length", "name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionParamResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionParamResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionParamResponse is not found in the empty JSON string", FunctionParamResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionParamResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("d_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `d_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("d_type").toString())); - } - if (!jsonObj.get("loc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `loc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loc").toString())); - } - if (!jsonObj.get("addr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `addr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("addr").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionParamResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionParamResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionParamResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionParamResponse 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 FunctionParamResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionParamResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionParamResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionParamResponse - * @throws IOException if the JSON string is invalid with respect to FunctionParamResponse - */ - public static FunctionParamResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionParamResponse.class); - } - - /** - * Convert an instance of FunctionParamResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionRename.java b/src/main/java/ai/reveng/model/FunctionRename.java deleted file mode 100644 index 9147000..0000000 --- a/src/main/java/ai/reveng/model/FunctionRename.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionRename - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionRename { - public static final String SERIALIZED_NAME_NEW_NAME = "new_name"; - @SerializedName(SERIALIZED_NAME_NEW_NAME) - @javax.annotation.Nonnull - private String newName; - - public static final String SERIALIZED_NAME_NEW_MANGLED_NAME = "new_mangled_name"; - @SerializedName(SERIALIZED_NAME_NEW_MANGLED_NAME) - @javax.annotation.Nonnull - private String newMangledName; - - public FunctionRename() { - } - - public FunctionRename newName(@javax.annotation.Nonnull String newName) { - this.newName = newName; - return this; - } - - /** - * The new name for the function - * @return newName - */ - @javax.annotation.Nonnull - public String getNewName() { - return newName; - } - - public void setNewName(@javax.annotation.Nonnull String newName) { - this.newName = newName; - } - - - public FunctionRename newMangledName(@javax.annotation.Nonnull String newMangledName) { - this.newMangledName = newMangledName; - return this; - } - - /** - * The new mangled name for the function - * @return newMangledName - */ - @javax.annotation.Nonnull - public String getNewMangledName() { - return newMangledName; - } - - public void setNewMangledName(@javax.annotation.Nonnull String newMangledName) { - this.newMangledName = newMangledName; - } - - /** - * 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 FunctionRename instance itself - */ - public FunctionRename 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; - } - FunctionRename functionRename = (FunctionRename) o; - return Objects.equals(this.newName, functionRename.newName) && - Objects.equals(this.newMangledName, functionRename.newMangledName)&& - Objects.equals(this.additionalProperties, functionRename.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(newName, newMangledName, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionRename {\n"); - sb.append(" newName: ").append(toIndentedString(newName)).append("\n"); - sb.append(" newMangledName: ").append(toIndentedString(newMangledName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("new_name", "new_mangled_name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("new_name", "new_mangled_name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionRename - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionRename.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionRename is not found in the empty JSON string", FunctionRename.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionRename.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("new_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `new_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_name").toString())); - } - if (!jsonObj.get("new_mangled_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `new_mangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_mangled_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionRename.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionRename' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionRename.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionRename 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 FunctionRename read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionRename instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionRename given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionRename - * @throws IOException if the JSON string is invalid with respect to FunctionRename - */ - public static FunctionRename fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionRename.class); - } - - /** - * Convert an instance of FunctionRename to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionRenameMap.java b/src/main/java/ai/reveng/model/FunctionRenameMap.java deleted file mode 100644 index 3d9fed1..0000000 --- a/src/main/java/ai/reveng/model/FunctionRenameMap.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionRenameMap - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionRenameMap { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public static final String SERIALIZED_NAME_NEW_NAME = "new_name"; - @SerializedName(SERIALIZED_NAME_NEW_NAME) - @javax.annotation.Nonnull - private String newName; - - public static final String SERIALIZED_NAME_NEW_MANGLED_NAME = "new_mangled_name"; - @SerializedName(SERIALIZED_NAME_NEW_MANGLED_NAME) - @javax.annotation.Nonnull - private String newMangledName; - - public FunctionRenameMap() { - } - - public FunctionRenameMap functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * The ID of the function to rename - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public FunctionRenameMap newName(@javax.annotation.Nonnull String newName) { - this.newName = newName; - return this; - } - - /** - * The new name for the function - * @return newName - */ - @javax.annotation.Nonnull - public String getNewName() { - return newName; - } - - public void setNewName(@javax.annotation.Nonnull String newName) { - this.newName = newName; - } - - - public FunctionRenameMap newMangledName(@javax.annotation.Nonnull String newMangledName) { - this.newMangledName = newMangledName; - return this; - } - - /** - * The new mangled name for the function - * @return newMangledName - */ - @javax.annotation.Nonnull - public String getNewMangledName() { - return newMangledName; - } - - public void setNewMangledName(@javax.annotation.Nonnull String newMangledName) { - this.newMangledName = newMangledName; - } - - /** - * 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 FunctionRenameMap instance itself - */ - public FunctionRenameMap 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; - } - FunctionRenameMap functionRenameMap = (FunctionRenameMap) o; - return Objects.equals(this.functionId, functionRenameMap.functionId) && - Objects.equals(this.newName, functionRenameMap.newName) && - Objects.equals(this.newMangledName, functionRenameMap.newMangledName)&& - Objects.equals(this.additionalProperties, functionRenameMap.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, newName, newMangledName, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionRenameMap {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" newName: ").append(toIndentedString(newName)).append("\n"); - sb.append(" newMangledName: ").append(toIndentedString(newMangledName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "new_name", "new_mangled_name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "new_name", "new_mangled_name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionRenameMap - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionRenameMap.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionRenameMap is not found in the empty JSON string", FunctionRenameMap.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionRenameMap.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("new_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `new_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_name").toString())); - } - if (!jsonObj.get("new_mangled_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `new_mangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_mangled_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionRenameMap.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionRenameMap' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionRenameMap.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionRenameMap 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 FunctionRenameMap read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionRenameMap instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionRenameMap given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionRenameMap - * @throws IOException if the JSON string is invalid with respect to FunctionRenameMap - */ - public static FunctionRenameMap fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionRenameMap.class); - } - - /** - * Convert an instance of FunctionRenameMap to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionSearchResponse.java b/src/main/java/ai/reveng/model/FunctionSearchResponse.java deleted file mode 100644 index ad4dccd..0000000 --- a/src/main/java/ai/reveng/model/FunctionSearchResponse.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.FunctionSearchResult; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionSearchResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionSearchResponse { - public static final String SERIALIZED_NAME_RESULTS = "results"; - @SerializedName(SERIALIZED_NAME_RESULTS) - @javax.annotation.Nonnull - private List results = new ArrayList<>(); - - public FunctionSearchResponse() { - } - - public FunctionSearchResponse results(@javax.annotation.Nonnull List results) { - this.results = results; - return this; - } - - public FunctionSearchResponse addResultsItem(FunctionSearchResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * The results of the search - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(@javax.annotation.Nonnull List results) { - this.results = results; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FunctionSearchResponse instance itself - */ - public FunctionSearchResponse 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; - } - FunctionSearchResponse functionSearchResponse = (FunctionSearchResponse) o; - return Objects.equals(this.results, functionSearchResponse.results)&& - Objects.equals(this.additionalProperties, functionSearchResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(results, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionSearchResponse {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("results")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("results")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionSearchResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionSearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionSearchResponse is not found in the empty JSON string", FunctionSearchResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionSearchResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("results") != null) { - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); - } - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - FunctionSearchResult.validateJsonElement(jsonArrayresults.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionSearchResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionSearchResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionSearchResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionSearchResponse 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 FunctionSearchResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionSearchResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionSearchResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionSearchResponse - * @throws IOException if the JSON string is invalid with respect to FunctionSearchResponse - */ - public static FunctionSearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionSearchResponse.class); - } - - /** - * Convert an instance of FunctionSearchResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionSearchResult.java b/src/main/java/ai/reveng/model/FunctionSearchResult.java deleted file mode 100644 index fb31baf..0000000 --- a/src/main/java/ai/reveng/model/FunctionSearchResult.java +++ /dev/null @@ -1,455 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionSearchResult - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionSearchResult { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nonnull - private String functionName; - - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - 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_MODEL_ID = "model_id"; - @SerializedName(SERIALIZED_NAME_MODEL_ID) - @javax.annotation.Nonnull - private Integer modelId; - - public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; - @SerializedName(SERIALIZED_NAME_MODEL_NAME) - @javax.annotation.Nonnull - private String modelName; - - public static final String SERIALIZED_NAME_OWNED_BY = "owned_by"; - @SerializedName(SERIALIZED_NAME_OWNED_BY) - @javax.annotation.Nonnull - private String ownedBy; - - public FunctionSearchResult() { - } - - public FunctionSearchResult functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * The function ID - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public FunctionSearchResult functionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - return this; - } - - /** - * The name of the function - * @return functionName - */ - @javax.annotation.Nonnull - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - } - - - public FunctionSearchResult binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * The name of the binary the function belongs to - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public FunctionSearchResult createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The creation date of the function - * @return createdAt - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public FunctionSearchResult modelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - return this; - } - - /** - * The model ID used to analyze the binary the function belongs to - * @return modelId - */ - @javax.annotation.Nonnull - public Integer getModelId() { - return modelId; - } - - public void setModelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - } - - - public FunctionSearchResult modelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - return this; - } - - /** - * The name of the model used to analyze the binary the function belongs to - * @return modelName - */ - @javax.annotation.Nonnull - public String getModelName() { - return modelName; - } - - public void setModelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - } - - - public FunctionSearchResult ownedBy(@javax.annotation.Nonnull String ownedBy) { - this.ownedBy = ownedBy; - return this; - } - - /** - * The owner of the binary the function belongs to - * @return ownedBy - */ - @javax.annotation.Nonnull - public String getOwnedBy() { - return ownedBy; - } - - public void setOwnedBy(@javax.annotation.Nonnull String ownedBy) { - this.ownedBy = ownedBy; - } - - /** - * 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 FunctionSearchResult instance itself - */ - public FunctionSearchResult 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; - } - FunctionSearchResult functionSearchResult = (FunctionSearchResult) o; - return Objects.equals(this.functionId, functionSearchResult.functionId) && - Objects.equals(this.functionName, functionSearchResult.functionName) && - Objects.equals(this.binaryName, functionSearchResult.binaryName) && - Objects.equals(this.createdAt, functionSearchResult.createdAt) && - Objects.equals(this.modelId, functionSearchResult.modelId) && - Objects.equals(this.modelName, functionSearchResult.modelName) && - Objects.equals(this.ownedBy, functionSearchResult.ownedBy)&& - Objects.equals(this.additionalProperties, functionSearchResult.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, functionName, binaryName, createdAt, modelId, modelName, ownedBy, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionSearchResult {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); - sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); - sb.append(" ownedBy: ").append(toIndentedString(ownedBy)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "function_name", "binary_name", "created_at", "model_id", "model_name", "owned_by")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_name", "binary_name", "created_at", "model_id", "model_name", "owned_by")); - } - - /** - * 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 FunctionSearchResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionSearchResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionSearchResult is not found in the empty JSON string", FunctionSearchResult.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionSearchResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("function_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); - } - if (!jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - if (!jsonObj.get("model_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); - } - if (!jsonObj.get("owned_by").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `owned_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owned_by").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionSearchResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionSearchResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionSearchResult.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionSearchResult 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 FunctionSearchResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionSearchResult instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionSearchResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionSearchResult - * @throws IOException if the JSON string is invalid with respect to FunctionSearchResult - */ - public static FunctionSearchResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionSearchResult.class); - } - - /** - * Convert an instance of FunctionSearchResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionSourceType.java b/src/main/java/ai/reveng/model/FunctionSourceType.java deleted file mode 100644 index 2c3f34b..0000000 --- a/src/main/java/ai/reveng/model/FunctionSourceType.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets FunctionSourceType - */ -@JsonAdapter(FunctionSourceType.Adapter.class) -public enum FunctionSourceType { - - SYSTEM("SYSTEM"), - - USER("USER"), - - EXTERNAL("EXTERNAL"), - - AUTO_UNSTRIP("AUTO_UNSTRIP"), - - AI_UNSTRIP("AI_UNSTRIP"), - - AI_AGENT("AI_AGENT"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - FunctionSourceType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FunctionSourceType fromValue(String value) { - for (FunctionSourceType b : FunctionSourceType.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final FunctionSourceType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FunctionSourceType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FunctionSourceType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - FunctionSourceType.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionString.java b/src/main/java/ai/reveng/model/FunctionString.java deleted file mode 100644 index fadcd76..0000000 --- a/src/main/java/ai/reveng/model/FunctionString.java +++ /dev/null @@ -1,346 +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 ai.reveng.model.StringSource; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionString - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionString { - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private String value; - - public static final String SERIALIZED_NAME_VADDR = "vaddr"; - @SerializedName(SERIALIZED_NAME_VADDR) - @javax.annotation.Nonnull - private Integer vaddr; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - @javax.annotation.Nullable - private StringSource source = StringSource.SYSTEM; - - public FunctionString() { - } - - public FunctionString value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * The value of the string literal - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; - } - - - public FunctionString vaddr(@javax.annotation.Nonnull Integer vaddr) { - this.vaddr = vaddr; - return this; - } - - /** - * The vaddr of the string value - * @return vaddr - */ - @javax.annotation.Nonnull - public Integer getVaddr() { - return vaddr; - } - - public void setVaddr(@javax.annotation.Nonnull Integer vaddr) { - this.vaddr = vaddr; - } - - - public FunctionString source(@javax.annotation.Nullable StringSource source) { - this.source = source; - return this; - } - - /** - * The source of the string - * @return source - */ - @javax.annotation.Nullable - public StringSource getSource() { - return source; - } - - public void setSource(@javax.annotation.Nullable StringSource source) { - this.source = source; - } - - /** - * 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 FunctionString instance itself - */ - public FunctionString 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; - } - FunctionString functionString = (FunctionString) o; - return Objects.equals(this.value, functionString.value) && - Objects.equals(this.vaddr, functionString.vaddr) && - Objects.equals(this.source, functionString.source)&& - Objects.equals(this.additionalProperties, functionString.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(value, vaddr, source, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionString {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" vaddr: ").append(toIndentedString(vaddr)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("value", "vaddr", "source")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("value", "vaddr")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionString - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionString.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionString is not found in the empty JSON string", FunctionString.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionString.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - // validate the optional field `source` - if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { - StringSource.validateJsonElement(jsonObj.get("source")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionString.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionString' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionString.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionString 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 FunctionString read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionString instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionString given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionString - * @throws IOException if the JSON string is invalid with respect to FunctionString - */ - public static FunctionString fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionString.class); - } - - /** - * Convert an instance of FunctionString to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionStringsResponse.java b/src/main/java/ai/reveng/model/FunctionStringsResponse.java deleted file mode 100644 index 05f678f..0000000 --- a/src/main/java/ai/reveng/model/FunctionStringsResponse.java +++ /dev/null @@ -1,333 +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 ai.reveng.model.FunctionString; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Response for listing all the strings of a function. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionStringsResponse { - public static final String SERIALIZED_NAME_STRINGS = "strings"; - @SerializedName(SERIALIZED_NAME_STRINGS) - @javax.annotation.Nonnull - private List strings = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TOTAL_STRINGS = "total_strings"; - @SerializedName(SERIALIZED_NAME_TOTAL_STRINGS) - @javax.annotation.Nonnull - private Integer totalStrings; - - public FunctionStringsResponse() { - } - - public FunctionStringsResponse strings(@javax.annotation.Nonnull List strings) { - this.strings = strings; - return this; - } - - public FunctionStringsResponse addStringsItem(FunctionString stringsItem) { - if (this.strings == null) { - this.strings = new ArrayList<>(); - } - this.strings.add(stringsItem); - return this; - } - - /** - * The strings associated with this function - * @return strings - */ - @javax.annotation.Nonnull - public List getStrings() { - return strings; - } - - public void setStrings(@javax.annotation.Nonnull List strings) { - this.strings = strings; - } - - - public FunctionStringsResponse totalStrings(@javax.annotation.Nonnull Integer totalStrings) { - this.totalStrings = totalStrings; - return this; - } - - /** - * The total number of strings associated with this function - * @return totalStrings - */ - @javax.annotation.Nonnull - public Integer getTotalStrings() { - return totalStrings; - } - - public void setTotalStrings(@javax.annotation.Nonnull Integer totalStrings) { - this.totalStrings = totalStrings; - } - - /** - * 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 FunctionStringsResponse instance itself - */ - public FunctionStringsResponse 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; - } - FunctionStringsResponse functionStringsResponse = (FunctionStringsResponse) o; - return Objects.equals(this.strings, functionStringsResponse.strings) && - Objects.equals(this.totalStrings, functionStringsResponse.totalStrings)&& - Objects.equals(this.additionalProperties, functionStringsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(strings, totalStrings, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionStringsResponse {\n"); - sb.append(" strings: ").append(toIndentedString(strings)).append("\n"); - sb.append(" totalStrings: ").append(toIndentedString(totalStrings)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("strings", "total_strings")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("strings", "total_strings")); - } - - /** - * 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 FunctionStringsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionStringsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionStringsResponse is not found in the empty JSON string", FunctionStringsResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionStringsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("strings") != null) { - if (!jsonObj.get("strings").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strings` to be an array in the JSON string but got `%s`", jsonObj.get("strings").toString())); - } - JsonArray jsonArraystrings = jsonObj.getAsJsonArray("strings"); - // validate the required field `strings` (array) - for (int i = 0; i < jsonArraystrings.size(); i++) { - FunctionString.validateJsonElement(jsonArraystrings.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionStringsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionStringsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionStringsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionStringsResponse 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 FunctionStringsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionStringsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionStringsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionStringsResponse - * @throws IOException if the JSON string is invalid with respect to FunctionStringsResponse - */ - public static FunctionStringsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionStringsResponse.class); - } - - /** - * Convert an instance of FunctionStringsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionsDetailResponse.java b/src/main/java/ai/reveng/model/FunctionsDetailResponse.java deleted file mode 100644 index 2f6a3ab..0000000 --- a/src/main/java/ai/reveng/model/FunctionsDetailResponse.java +++ /dev/null @@ -1,561 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionsDetailResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionsDetailResponse { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nonnull - private String functionName; - - public static final String SERIALIZED_NAME_FUNCTION_NAME_MANGLED = "function_name_mangled"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME_MANGLED) - @javax.annotation.Nonnull - private String functionNameMangled; - - public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr"; - @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) - @javax.annotation.Nonnull - private Long functionVaddr; - - public static final String SERIALIZED_NAME_FUNCTION_SIZE = "function_size"; - @SerializedName(SERIALIZED_NAME_FUNCTION_SIZE) - @javax.annotation.Nonnull - private Integer functionSize; - - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_DEBUG_HASH = "debug_hash"; - @SerializedName(SERIALIZED_NAME_DEBUG_HASH) - @javax.annotation.Nullable - private String debugHash; - - public static final String SERIALIZED_NAME_DEBUG = "debug"; - @SerializedName(SERIALIZED_NAME_DEBUG) - @javax.annotation.Nonnull - private Boolean debug; - - public FunctionsDetailResponse() { - } - - public FunctionsDetailResponse functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Function id - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public FunctionsDetailResponse functionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - return this; - } - - /** - * Get functionName - * @return functionName - */ - @javax.annotation.Nonnull - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - } - - - public FunctionsDetailResponse functionNameMangled(@javax.annotation.Nonnull String functionNameMangled) { - this.functionNameMangled = functionNameMangled; - return this; - } - - /** - * Get functionNameMangled - * @return functionNameMangled - */ - @javax.annotation.Nonnull - public String getFunctionNameMangled() { - return functionNameMangled; - } - - public void setFunctionNameMangled(@javax.annotation.Nonnull String functionNameMangled) { - this.functionNameMangled = functionNameMangled; - } - - - public FunctionsDetailResponse functionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - return this; - } - - /** - * Get functionVaddr - * @return functionVaddr - */ - @javax.annotation.Nonnull - public Long getFunctionVaddr() { - return functionVaddr; - } - - public void setFunctionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - } - - - public FunctionsDetailResponse functionSize(@javax.annotation.Nonnull Integer functionSize) { - this.functionSize = functionSize; - return this; - } - - /** - * Get functionSize - * @return functionSize - */ - @javax.annotation.Nonnull - public Integer getFunctionSize() { - return functionSize; - } - - public void setFunctionSize(@javax.annotation.Nonnull Integer functionSize) { - this.functionSize = functionSize; - } - - - public FunctionsDetailResponse analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * Get analysisId - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public FunctionsDetailResponse binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * Get binaryId - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public FunctionsDetailResponse binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * Get binaryName - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public FunctionsDetailResponse sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * Get sha256Hash - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public FunctionsDetailResponse debugHash(@javax.annotation.Nullable String debugHash) { - this.debugHash = debugHash; - return this; - } - - /** - * Get debugHash - * @return debugHash - */ - @javax.annotation.Nullable - public String getDebugHash() { - return debugHash; - } - - public void setDebugHash(@javax.annotation.Nullable String debugHash) { - this.debugHash = debugHash; - } - - - public FunctionsDetailResponse debug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - return this; - } - - /** - * Get debug - * @return debug - */ - @javax.annotation.Nonnull - public Boolean getDebug() { - return debug; - } - - public void setDebug(@javax.annotation.Nonnull Boolean debug) { - this.debug = debug; - } - - /** - * 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 FunctionsDetailResponse instance itself - */ - public FunctionsDetailResponse 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; - } - FunctionsDetailResponse functionsDetailResponse = (FunctionsDetailResponse) o; - return Objects.equals(this.functionId, functionsDetailResponse.functionId) && - Objects.equals(this.functionName, functionsDetailResponse.functionName) && - Objects.equals(this.functionNameMangled, functionsDetailResponse.functionNameMangled) && - Objects.equals(this.functionVaddr, functionsDetailResponse.functionVaddr) && - Objects.equals(this.functionSize, functionsDetailResponse.functionSize) && - Objects.equals(this.analysisId, functionsDetailResponse.analysisId) && - Objects.equals(this.binaryId, functionsDetailResponse.binaryId) && - Objects.equals(this.binaryName, functionsDetailResponse.binaryName) && - Objects.equals(this.sha256Hash, functionsDetailResponse.sha256Hash) && - Objects.equals(this.debugHash, functionsDetailResponse.debugHash) && - Objects.equals(this.debug, functionsDetailResponse.debug)&& - Objects.equals(this.additionalProperties, functionsDetailResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, functionName, functionNameMangled, functionVaddr, functionSize, analysisId, binaryId, binaryName, sha256Hash, debugHash, debug, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionsDetailResponse {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" functionNameMangled: ").append(toIndentedString(functionNameMangled)).append("\n"); - sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); - sb.append(" functionSize: ").append(toIndentedString(functionSize)).append("\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" debugHash: ").append(toIndentedString(debugHash)).append("\n"); - sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "function_name", "function_name_mangled", "function_vaddr", "function_size", "analysis_id", "binary_id", "binary_name", "sha_256_hash", "debug_hash", "debug")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_name", "function_name_mangled", "function_vaddr", "function_size", "analysis_id", "binary_id", "binary_name", "sha_256_hash", "debug_hash", "debug")); - } - - /** - * 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 FunctionsDetailResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionsDetailResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionsDetailResponse is not found in the empty JSON string", FunctionsDetailResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionsDetailResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("function_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); - } - if (!jsonObj.get("function_name_mangled").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name_mangled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name_mangled").toString())); - } - if (!jsonObj.get("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - if ((jsonObj.get("debug_hash") != null && !jsonObj.get("debug_hash").isJsonNull()) && !jsonObj.get("debug_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `debug_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("debug_hash").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionsDetailResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionsDetailResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionsDetailResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionsDetailResponse 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 FunctionsDetailResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionsDetailResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionsDetailResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionsDetailResponse - * @throws IOException if the JSON string is invalid with respect to FunctionsDetailResponse - */ - public static FunctionsDetailResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionsDetailResponse.class); - } - - /** - * Convert an instance of FunctionsDetailResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionsListRename.java b/src/main/java/ai/reveng/model/FunctionsListRename.java deleted file mode 100644 index 1e402a2..0000000 --- a/src/main/java/ai/reveng/model/FunctionsListRename.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.FunctionRenameMap; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * FunctionsListRename - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionsListRename { - public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; - @SerializedName(SERIALIZED_NAME_FUNCTIONS) - @javax.annotation.Nonnull - private List functions = new ArrayList<>(); - - public FunctionsListRename() { - } - - public FunctionsListRename functions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - return this; - } - - public FunctionsListRename addFunctionsItem(FunctionRenameMap functionsItem) { - if (this.functions == null) { - this.functions = new ArrayList<>(); - } - this.functions.add(functionsItem); - return this; - } - - /** - * A list of functions to rename - * @return functions - */ - @javax.annotation.Nonnull - public List getFunctions() { - return functions; - } - - public void setFunctions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FunctionsListRename instance itself - */ - public FunctionsListRename 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; - } - FunctionsListRename functionsListRename = (FunctionsListRename) o; - return Objects.equals(this.functions, functionsListRename.functions)&& - Objects.equals(this.additionalProperties, functionsListRename.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(functions, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionsListRename {\n"); - sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("functions")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("functions")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionsListRename - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionsListRename.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionsListRename is not found in the empty JSON string", FunctionsListRename.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionsListRename.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("functions") != null) { - if (!jsonObj.get("functions").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `functions` to be an array in the JSON string but got `%s`", jsonObj.get("functions").toString())); - } - JsonArray jsonArrayfunctions = jsonObj.getAsJsonArray("functions"); - // validate the required field `functions` (array) - for (int i = 0; i < jsonArrayfunctions.size(); i++) { - FunctionRenameMap.validateJsonElement(jsonArrayfunctions.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionsListRename.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionsListRename' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionsListRename.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionsListRename 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 FunctionsListRename read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionsListRename instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionsListRename given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionsListRename - * @throws IOException if the JSON string is invalid with respect to FunctionsListRename - */ - public static FunctionsListRename fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionsListRename.class); - } - - /** - * Convert an instance of FunctionsListRename to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/GenerateFunctionDataTypes.java b/src/main/java/ai/reveng/model/GenerateFunctionDataTypes.java deleted file mode 100644 index 6958b7c..0000000 --- a/src/main/java/ai/reveng/model/GenerateFunctionDataTypes.java +++ /dev/null @@ -1,354 +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 ai.reveng.model.GenerationStatusList; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * GenerateFunctionDataTypes - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class GenerateFunctionDataTypes { - public static final String SERIALIZED_NAME_QUEUED = "queued"; - @Deprecated - @SerializedName(SERIALIZED_NAME_QUEUED) - @javax.annotation.Nonnull - private Boolean queued; - - public static final String SERIALIZED_NAME_REFERENCE = "reference"; - @Deprecated - @SerializedName(SERIALIZED_NAME_REFERENCE) - @javax.annotation.Nonnull - private String reference; - - public static final String SERIALIZED_NAME_DATA_TYPES_LIST = "data_types_list"; - @SerializedName(SERIALIZED_NAME_DATA_TYPES_LIST) - @javax.annotation.Nonnull - private GenerationStatusList dataTypesList; - - public GenerateFunctionDataTypes() { - } - - @Deprecated - public GenerateFunctionDataTypes queued(@javax.annotation.Nonnull Boolean queued) { - this.queued = queued; - return this; - } - - /** - * [DEPRECATED] This value has been replaced with the `data_types_list` field - * @return queued - * @deprecated - */ - @Deprecated - @javax.annotation.Nonnull - public Boolean getQueued() { - return queued; - } - - @Deprecated - public void setQueued(@javax.annotation.Nonnull Boolean queued) { - this.queued = queued; - } - - - @Deprecated - public GenerateFunctionDataTypes reference(@javax.annotation.Nonnull String reference) { - this.reference = reference; - return this; - } - - /** - * [DEPRECATED] This value has been replaced with the `data_types_list` field - * @return reference - * @deprecated - */ - @Deprecated - @javax.annotation.Nonnull - public String getReference() { - return reference; - } - - @Deprecated - public void setReference(@javax.annotation.Nonnull String reference) { - this.reference = reference; - } - - - public GenerateFunctionDataTypes dataTypesList(@javax.annotation.Nonnull GenerationStatusList dataTypesList) { - this.dataTypesList = dataTypesList; - return this; - } - - /** - * List of function data types information that are either already generated, or now queued for generation - * @return dataTypesList - */ - @javax.annotation.Nonnull - public GenerationStatusList getDataTypesList() { - return dataTypesList; - } - - public void setDataTypesList(@javax.annotation.Nonnull GenerationStatusList dataTypesList) { - this.dataTypesList = dataTypesList; - } - - /** - * 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 GenerateFunctionDataTypes instance itself - */ - public GenerateFunctionDataTypes 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; - } - GenerateFunctionDataTypes generateFunctionDataTypes = (GenerateFunctionDataTypes) o; - return Objects.equals(this.queued, generateFunctionDataTypes.queued) && - Objects.equals(this.reference, generateFunctionDataTypes.reference) && - Objects.equals(this.dataTypesList, generateFunctionDataTypes.dataTypesList)&& - Objects.equals(this.additionalProperties, generateFunctionDataTypes.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(queued, reference, dataTypesList, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GenerateFunctionDataTypes {\n"); - sb.append(" queued: ").append(toIndentedString(queued)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" dataTypesList: ").append(toIndentedString(dataTypesList)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("queued", "reference", "data_types_list")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("queued", "reference", "data_types_list")); - } - - /** - * 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 GenerateFunctionDataTypes - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GenerateFunctionDataTypes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in GenerateFunctionDataTypes is not found in the empty JSON string", GenerateFunctionDataTypes.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GenerateFunctionDataTypes.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("reference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); - } - // validate the required field `data_types_list` - GenerationStatusList.validateJsonElement(jsonObj.get("data_types_list")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GenerateFunctionDataTypes.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GenerateFunctionDataTypes' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GenerateFunctionDataTypes.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GenerateFunctionDataTypes 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 GenerateFunctionDataTypes read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - GenerateFunctionDataTypes instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of GenerateFunctionDataTypes given an JSON string - * - * @param jsonString JSON string - * @return An instance of GenerateFunctionDataTypes - * @throws IOException if the JSON string is invalid with respect to GenerateFunctionDataTypes - */ - public static GenerateFunctionDataTypes fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GenerateFunctionDataTypes.class); - } - - /** - * Convert an instance of GenerateFunctionDataTypes to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/GenerationStatusList.java b/src/main/java/ai/reveng/model/GenerationStatusList.java deleted file mode 100644 index ced7c04..0000000 --- a/src/main/java/ai/reveng/model/GenerationStatusList.java +++ /dev/null @@ -1,359 +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 ai.reveng.model.FunctionDataTypesStatus; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * GenerationStatusList - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class GenerationStatusList { - public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; - @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) - @javax.annotation.Nullable - private Integer totalCount = 0; - - public static final String SERIALIZED_NAME_TOTAL_DATA_TYPES_COUNT = "total_data_types_count"; - @SerializedName(SERIALIZED_NAME_TOTAL_DATA_TYPES_COUNT) - @javax.annotation.Nullable - private Integer totalDataTypesCount = 0; - - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - @javax.annotation.Nonnull - private List items = new ArrayList<>(); - - public GenerationStatusList() { - } - - public GenerationStatusList totalCount(@javax.annotation.Nullable Integer totalCount) { - this.totalCount = totalCount; - return this; - } - - /** - * Total number of functions in analysis - * @return totalCount - */ - @javax.annotation.Nullable - public Integer getTotalCount() { - return totalCount; - } - - public void setTotalCount(@javax.annotation.Nullable Integer totalCount) { - this.totalCount = totalCount; - } - - - public GenerationStatusList totalDataTypesCount(@javax.annotation.Nullable Integer totalDataTypesCount) { - this.totalDataTypesCount = totalDataTypesCount; - return this; - } - - /** - * Total number of functions with data types - * @return totalDataTypesCount - */ - @javax.annotation.Nullable - public Integer getTotalDataTypesCount() { - return totalDataTypesCount; - } - - public void setTotalDataTypesCount(@javax.annotation.Nullable Integer totalDataTypesCount) { - this.totalDataTypesCount = totalDataTypesCount; - } - - - public GenerationStatusList items(@javax.annotation.Nonnull List items) { - this.items = items; - return this; - } - - public GenerationStatusList addItemsItem(FunctionDataTypesStatus itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * List of function data types information - * @return items - */ - @javax.annotation.Nonnull - public List getItems() { - return items; - } - - public void setItems(@javax.annotation.Nonnull List items) { - this.items = items; - } - - /** - * 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 GenerationStatusList instance itself - */ - public GenerationStatusList 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; - } - GenerationStatusList generationStatusList = (GenerationStatusList) o; - return Objects.equals(this.totalCount, generationStatusList.totalCount) && - Objects.equals(this.totalDataTypesCount, generationStatusList.totalDataTypesCount) && - Objects.equals(this.items, generationStatusList.items)&& - Objects.equals(this.additionalProperties, generationStatusList.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(totalCount, totalDataTypesCount, items, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GenerationStatusList {\n"); - sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); - sb.append(" totalDataTypesCount: ").append(toIndentedString(totalDataTypesCount)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("total_count", "total_data_types_count", "items")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("items")); - } - - /** - * 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 GenerationStatusList - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GenerationStatusList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in GenerationStatusList is not found in the empty JSON string", GenerationStatusList.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GenerationStatusList.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("items") != null) { - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); - } - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - FunctionDataTypesStatus.validateJsonElement(jsonArrayitems.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GenerationStatusList.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GenerationStatusList' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GenerationStatusList.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GenerationStatusList 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 GenerationStatusList read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - GenerationStatusList instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of GenerationStatusList given an JSON string - * - * @param jsonString JSON string - * @return An instance of GenerationStatusList - * @throws IOException if the JSON string is invalid with respect to GenerationStatusList - */ - public static GenerationStatusList fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GenerationStatusList.class); - } - - /** - * Convert an instance of GenerationStatusList to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/GetAiDecompilationRatingResponse.java b/src/main/java/ai/reveng/model/GetAiDecompilationRatingResponse.java deleted file mode 100644 index 5b802ae..0000000 --- a/src/main/java/ai/reveng/model/GetAiDecompilationRatingResponse.java +++ /dev/null @@ -1,318 +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 ai.reveng.model.AiDecompilationRating; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * GetAiDecompilationRatingResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class GetAiDecompilationRatingResponse { - public static final String SERIALIZED_NAME_RATING = "rating"; - @SerializedName(SERIALIZED_NAME_RATING) - @javax.annotation.Nonnull - private AiDecompilationRating rating; - - public static final String SERIALIZED_NAME_REASON = "reason"; - @SerializedName(SERIALIZED_NAME_REASON) - @javax.annotation.Nullable - private String reason; - - public GetAiDecompilationRatingResponse() { - } - - public GetAiDecompilationRatingResponse rating(@javax.annotation.Nonnull AiDecompilationRating rating) { - this.rating = rating; - return this; - } - - /** - * The rating the user has given to the AI decompilation response - * @return rating - */ - @javax.annotation.Nonnull - public AiDecompilationRating getRating() { - return rating; - } - - public void setRating(@javax.annotation.Nonnull AiDecompilationRating rating) { - this.rating = rating; - } - - - public GetAiDecompilationRatingResponse reason(@javax.annotation.Nullable String reason) { - this.reason = reason; - return this; - } - - /** - * The optional reason the user has given for the rating - * @return reason - */ - @javax.annotation.Nullable - public String getReason() { - return reason; - } - - public void setReason(@javax.annotation.Nullable String reason) { - this.reason = reason; - } - - /** - * 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 GetAiDecompilationRatingResponse instance itself - */ - public GetAiDecompilationRatingResponse 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; - } - GetAiDecompilationRatingResponse getAiDecompilationRatingResponse = (GetAiDecompilationRatingResponse) o; - return Objects.equals(this.rating, getAiDecompilationRatingResponse.rating) && - Objects.equals(this.reason, getAiDecompilationRatingResponse.reason)&& - Objects.equals(this.additionalProperties, getAiDecompilationRatingResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(rating, reason, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAiDecompilationRatingResponse {\n"); - sb.append(" rating: ").append(toIndentedString(rating)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("rating", "reason")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("rating", "reason")); - } - - /** - * 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 GetAiDecompilationRatingResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetAiDecompilationRatingResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in GetAiDecompilationRatingResponse is not found in the empty JSON string", GetAiDecompilationRatingResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetAiDecompilationRatingResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `rating` - AiDecompilationRating.validateJsonElement(jsonObj.get("rating")); - if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) && !jsonObj.get("reason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAiDecompilationRatingResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAiDecompilationRatingResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetAiDecompilationRatingResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetAiDecompilationRatingResponse 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 GetAiDecompilationRatingResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - GetAiDecompilationRatingResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of GetAiDecompilationRatingResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAiDecompilationRatingResponse - * @throws IOException if the JSON string is invalid with respect to GetAiDecompilationRatingResponse - */ - public static GetAiDecompilationRatingResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAiDecompilationRatingResponse.class); - } - - /** - * Convert an instance of GetAiDecompilationRatingResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/GetPublicUserResponse.java b/src/main/java/ai/reveng/model/GetPublicUserResponse.java deleted file mode 100644 index cd94744..0000000 --- a/src/main/java/ai/reveng/model/GetPublicUserResponse.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * GetPublicUserResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class GetPublicUserResponse { - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - @javax.annotation.Nonnull - private String username; - - public static final String SERIALIZED_NAME_USER_ID = "user_id"; - @SerializedName(SERIALIZED_NAME_USER_ID) - @javax.annotation.Nonnull - private Integer userId; - - public GetPublicUserResponse() { - } - - public GetPublicUserResponse username(@javax.annotation.Nonnull String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(@javax.annotation.Nonnull String username) { - this.username = username; - } - - - public GetPublicUserResponse userId(@javax.annotation.Nonnull Integer userId) { - this.userId = userId; - return this; - } - - /** - * Get userId - * @return userId - */ - @javax.annotation.Nonnull - public Integer getUserId() { - return userId; - } - - public void setUserId(@javax.annotation.Nonnull Integer userId) { - this.userId = userId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the GetPublicUserResponse instance itself - */ - public GetPublicUserResponse 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; - } - GetPublicUserResponse getPublicUserResponse = (GetPublicUserResponse) o; - return Objects.equals(this.username, getPublicUserResponse.username) && - Objects.equals(this.userId, getPublicUserResponse.userId)&& - Objects.equals(this.additionalProperties, getPublicUserResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(username, userId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetPublicUserResponse {\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("username", "user_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("username", "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 GetPublicUserResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetPublicUserResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in GetPublicUserResponse is not found in the empty JSON string", GetPublicUserResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetPublicUserResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetPublicUserResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetPublicUserResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetPublicUserResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetPublicUserResponse 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 GetPublicUserResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - GetPublicUserResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of GetPublicUserResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetPublicUserResponse - * @throws IOException if the JSON string is invalid with respect to GetPublicUserResponse - */ - public static GetPublicUserResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetPublicUserResponse.class); - } - - /** - * Convert an instance of GetPublicUserResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/GlobalVariable.java b/src/main/java/ai/reveng/model/GlobalVariable.java deleted file mode 100644 index 6b4624c..0000000 --- a/src/main/java/ai/reveng/model/GlobalVariable.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * GlobalVariable - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class GlobalVariable { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_ADDR = "addr"; - @SerializedName(SERIALIZED_NAME_ADDR) - @javax.annotation.Nonnull - private Integer addr; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - 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 static final String SERIALIZED_NAME_ARTIFACT_TYPE = "artifact_type"; - @SerializedName(SERIALIZED_NAME_ARTIFACT_TYPE) - @javax.annotation.Nullable - private String artifactType; - - public GlobalVariable() { - } - - public GlobalVariable lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this global variable - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public GlobalVariable addr(@javax.annotation.Nonnull Integer addr) { - this.addr = addr; - return this; - } - - /** - * Memory address of the global variable - * @return addr - */ - @javax.annotation.Nonnull - public Integer getAddr() { - return addr; - } - - public void setAddr(@javax.annotation.Nonnull Integer addr) { - this.addr = addr; - } - - - public GlobalVariable name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the global variable - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public GlobalVariable type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Data type of the global variable - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public GlobalVariable size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Size of the global variable in bytes - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - - public GlobalVariable artifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - return this; - } - - /** - * Type of artifact that the global variable is associated with - * @return artifactType - */ - @javax.annotation.Nullable - public String getArtifactType() { - return artifactType; - } - - public void setArtifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the GlobalVariable instance itself - */ - public GlobalVariable putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GlobalVariable globalVariable = (GlobalVariable) o; - return Objects.equals(this.lastChange, globalVariable.lastChange) && - Objects.equals(this.addr, globalVariable.addr) && - Objects.equals(this.name, globalVariable.name) && - Objects.equals(this.type, globalVariable.type) && - Objects.equals(this.size, globalVariable.size) && - Objects.equals(this.artifactType, globalVariable.artifactType)&& - Objects.equals(this.additionalProperties, globalVariable.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(lastChange, addr, name, type, size, artifactType, 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 GlobalVariable {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" artifactType: ").append(toIndentedString(artifactType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "addr", "name", "type", "size", "artifact_type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("addr", "name", "type", "size")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GlobalVariable - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GlobalVariable.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in GlobalVariable is not found in the empty JSON string", GlobalVariable.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GlobalVariable.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if ((jsonObj.get("artifact_type") != null && !jsonObj.get("artifact_type").isJsonNull()) && !jsonObj.get("artifact_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `artifact_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("artifact_type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GlobalVariable.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GlobalVariable' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GlobalVariable.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GlobalVariable value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public GlobalVariable read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - GlobalVariable instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of GlobalVariable given an JSON string - * - * @param jsonString JSON string - * @return An instance of GlobalVariable - * @throws IOException if the JSON string is invalid with respect to GlobalVariable - */ - public static GlobalVariable fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GlobalVariable.class); - } - - /** - * Convert an instance of GlobalVariable to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/IOC.java b/src/main/java/ai/reveng/model/IOC.java deleted file mode 100644 index 57da4b1..0000000 --- a/src/main/java/ai/reveng/model/IOC.java +++ /dev/null @@ -1,541 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * IOC - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class IOC { - /** - * Type of the IOC - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - IP("ip"), - - DOMAIN("domain"), - - URL("url"), - - USERNAMES("usernames"), - - PASSWORDS("passwords"), - - FILE_HASH("file_hash"), - - MUTEX("mutex"), - - REGISTRY_KEY("registry_key"), - - FILENAME("filename"), - - EMAIL("email"), - - C2_ENDPOINT("c2_endpoint"), - - USER_AGENT("user_agent"), - - PEM_KEY("pem_key"), - - SSH_KEY("ssh_key"), - - NETWORK_PORT("network_port"), - - JA3("ja3"), - - SSL_CERT_FINGERPRINT("ssl_cert_fingerprint"), - - HTTP_HEADER("http_header"), - - SERVICE("service"), - - SCHEDULED_TASK("scheduled_task"), - - PE_HEADER("pe_header"), - - ENTROPY("entropy"), - - OTHER("other"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private String value; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - @javax.annotation.Nullable - private String source; - - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nullable - private Integer functionId; - - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nullable - private String functionName; - - public IOC() { - } - - public IOC type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Type of the IOC - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - - public IOC value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * Value of the IOC - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; - } - - - public IOC description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * Description of the IOC - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - - public IOC source(@javax.annotation.Nullable String source) { - this.source = source; - return this; - } - - /** - * The source address where the IOC can be found in the binary if possible. - * @return source - */ - @javax.annotation.Nullable - public String getSource() { - return source; - } - - public void setSource(@javax.annotation.Nullable String source) { - this.source = source; - } - - - public IOC functionId(@javax.annotation.Nullable Integer functionId) { - this.functionId = functionId; - return this; - } - - /** - * Unique identifier of the function containing the IOC - * @return functionId - */ - @javax.annotation.Nullable - public Integer getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nullable Integer functionId) { - this.functionId = functionId; - } - - - public IOC functionName(@javax.annotation.Nullable String functionName) { - this.functionName = functionName; - return this; - } - - /** - * Name of the function containing the IOC - * @return functionName - */ - @javax.annotation.Nullable - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(@javax.annotation.Nullable String functionName) { - this.functionName = functionName; - } - - /** - * 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 IOC instance itself - */ - public IOC 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; - } - IOC IOC = (IOC) o; - return Objects.equals(this.type, IOC.type) && - Objects.equals(this.value, IOC.value) && - Objects.equals(this.description, IOC.description) && - Objects.equals(this.source, IOC.source) && - Objects.equals(this.functionId, IOC.functionId) && - Objects.equals(this.functionName, IOC.functionName)&& - Objects.equals(this.additionalProperties, IOC.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(type, value, description, source, functionId, functionName, 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 IOC {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("type", "value", "description", "source", "function_id", "function_name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type", "value", "description")); - } - - /** - * 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 IOC - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IOC.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in IOC is not found in the empty JSON string", IOC.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IOC.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) && !jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); - } - if ((jsonObj.get("function_name") != null && !jsonObj.get("function_name").isJsonNull()) && !jsonObj.get("function_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IOC.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IOC' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IOC.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IOC 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 IOC read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - IOC instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IOC given an JSON string - * - * @param jsonString JSON string - * @return An instance of IOC - * @throws IOException if the JSON string is invalid with respect to IOC - */ - public static IOC fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IOC.class); - } - - /** - * Convert an instance of IOC to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ISA.java b/src/main/java/ai/reveng/model/ISA.java deleted file mode 100644 index 50f95e9..0000000 --- a/src/main/java/ai/reveng/model/ISA.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets ISA - */ -@JsonAdapter(ISA.Adapter.class) -public enum ISA { - - X86("x86"), - - X86_64("x86_64"), - - ARM("arm"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ISA(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ISA fromValue(String value) { - for (ISA b : ISA.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ISA enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ISA read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ISA.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ISA.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/IconModel.java b/src/main/java/ai/reveng/model/IconModel.java deleted file mode 100644 index b47698b..0000000 --- a/src/main/java/ai/reveng/model/IconModel.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * IconModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class IconModel { - public static final String SERIALIZED_NAME_CONTENT = "content"; - @SerializedName(SERIALIZED_NAME_CONTENT) - @javax.annotation.Nullable - private String content; - - public IconModel() { - } - - public IconModel content(@javax.annotation.Nullable String content) { - this.content = content; - return this; - } - - /** - * Get content - * @return content - */ - @javax.annotation.Nullable - public String getContent() { - return content; - } - - public void setContent(@javax.annotation.Nullable String content) { - this.content = content; - } - - /** - * 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 IconModel instance itself - */ - public IconModel 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; - } - IconModel iconModel = (IconModel) o; - return Objects.equals(this.content, iconModel.content)&& - Objects.equals(this.additionalProperties, iconModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(content, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IconModel {\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("content")); - - // a set of required properties/fields (JSON key names) - 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 IconModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IconModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in IconModel is not found in the empty JSON string", IconModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IconModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) && !jsonObj.get("content").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IconModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IconModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IconModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IconModel 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 IconModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - IconModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IconModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of IconModel - * @throws IOException if the JSON string is invalid with respect to IconModel - */ - public static IconModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IconModel.class); - } - - /** - * Convert an instance of IconModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ImportModel.java b/src/main/java/ai/reveng/model/ImportModel.java deleted file mode 100644 index c5dd847..0000000 --- a/src/main/java/ai/reveng/model/ImportModel.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ImportModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ImportModel { - public static final String SERIALIZED_NAME_NUMBER_OF_IMPORTS = "number_of_imports"; - @SerializedName(SERIALIZED_NAME_NUMBER_OF_IMPORTS) - @javax.annotation.Nonnull - private Integer numberOfImports; - - public static final String SERIALIZED_NAME_IMPORTS = "imports"; - @SerializedName(SERIALIZED_NAME_IMPORTS) - @javax.annotation.Nonnull - private List>> imports = new ArrayList<>(); - - public ImportModel() { - } - - public ImportModel numberOfImports(@javax.annotation.Nonnull Integer numberOfImports) { - this.numberOfImports = numberOfImports; - return this; - } - - /** - * Get numberOfImports - * @return numberOfImports - */ - @javax.annotation.Nonnull - public Integer getNumberOfImports() { - return numberOfImports; - } - - public void setNumberOfImports(@javax.annotation.Nonnull Integer numberOfImports) { - this.numberOfImports = numberOfImports; - } - - - public ImportModel imports(@javax.annotation.Nonnull List>> imports) { - this.imports = imports; - return this; - } - - public ImportModel addImportsItem(Map> importsItem) { - if (this.imports == null) { - this.imports = new ArrayList<>(); - } - this.imports.add(importsItem); - return this; - } - - /** - * Get imports - * @return imports - */ - @javax.annotation.Nonnull - public List>> getImports() { - return imports; - } - - public void setImports(@javax.annotation.Nonnull List>> imports) { - this.imports = imports; - } - - /** - * 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 ImportModel instance itself - */ - public ImportModel 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; - } - ImportModel importModel = (ImportModel) o; - return Objects.equals(this.numberOfImports, importModel.numberOfImports) && - Objects.equals(this.imports, importModel.imports)&& - Objects.equals(this.additionalProperties, importModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(numberOfImports, imports, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ImportModel {\n"); - sb.append(" numberOfImports: ").append(toIndentedString(numberOfImports)).append("\n"); - sb.append(" imports: ").append(toIndentedString(imports)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("number_of_imports", "imports")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("number_of_imports", "imports")); - } - - /** - * 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 ImportModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ImportModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ImportModel is not found in the empty JSON string", ImportModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ImportModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("imports") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("imports").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `imports` to be an array in the JSON string but got `%s`", jsonObj.get("imports").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ImportModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ImportModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ImportModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ImportModel 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 ImportModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ImportModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ImportModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ImportModel - * @throws IOException if the JSON string is invalid with respect to ImportModel - */ - public static ImportModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ImportModel.class); - } - - /** - * Convert an instance of ImportModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/InsertAnalysisLogRequest.java b/src/main/java/ai/reveng/model/InsertAnalysisLogRequest.java deleted file mode 100644 index dfbb35e..0000000 --- a/src/main/java/ai/reveng/model/InsertAnalysisLogRequest.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * InsertAnalysisLogRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class InsertAnalysisLogRequest { - public static final String SERIALIZED_NAME_LOG = "log"; - @SerializedName(SERIALIZED_NAME_LOG) - @javax.annotation.Nonnull - private String log; - - public InsertAnalysisLogRequest() { - } - - public InsertAnalysisLogRequest log(@javax.annotation.Nonnull String log) { - this.log = log; - return this; - } - - /** - * The log message to insert for the analysis - * @return log - */ - @javax.annotation.Nonnull - public String getLog() { - return log; - } - - public void setLog(@javax.annotation.Nonnull String log) { - this.log = log; - } - - /** - * 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 InsertAnalysisLogRequest instance itself - */ - public InsertAnalysisLogRequest 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; - } - InsertAnalysisLogRequest insertAnalysisLogRequest = (InsertAnalysisLogRequest) o; - return Objects.equals(this.log, insertAnalysisLogRequest.log)&& - Objects.equals(this.additionalProperties, insertAnalysisLogRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(log, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InsertAnalysisLogRequest {\n"); - sb.append(" log: ").append(toIndentedString(log)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("log")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("log")); - } - - /** - * 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 InsertAnalysisLogRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!InsertAnalysisLogRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in InsertAnalysisLogRequest is not found in the empty JSON string", InsertAnalysisLogRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InsertAnalysisLogRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("log").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `log` to be a primitive type in the JSON string but got `%s`", jsonObj.get("log").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InsertAnalysisLogRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InsertAnalysisLogRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(InsertAnalysisLogRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, InsertAnalysisLogRequest 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 InsertAnalysisLogRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - InsertAnalysisLogRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of InsertAnalysisLogRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of InsertAnalysisLogRequest - * @throws IOException if the JSON string is invalid with respect to InsertAnalysisLogRequest - */ - public static InsertAnalysisLogRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InsertAnalysisLogRequest.class); - } - - /** - * Convert an instance of InsertAnalysisLogRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ListCollectionResults.java b/src/main/java/ai/reveng/model/ListCollectionResults.java deleted file mode 100644 index a3d76e3..0000000 --- a/src/main/java/ai/reveng/model/ListCollectionResults.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.CollectionListItem; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ListCollectionResults - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ListCollectionResults { - public static final String SERIALIZED_NAME_RESULTS = "results"; - @SerializedName(SERIALIZED_NAME_RESULTS) - @javax.annotation.Nonnull - private List results = new ArrayList<>(); - - public ListCollectionResults() { - } - - public ListCollectionResults results(@javax.annotation.Nonnull List results) { - this.results = results; - return this; - } - - public ListCollectionResults addResultsItem(CollectionListItem resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Page containing the results of the collections search - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(@javax.annotation.Nonnull List results) { - this.results = results; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the ListCollectionResults instance itself - */ - public ListCollectionResults 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; - } - ListCollectionResults listCollectionResults = (ListCollectionResults) o; - return Objects.equals(this.results, listCollectionResults.results)&& - Objects.equals(this.additionalProperties, listCollectionResults.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(results, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListCollectionResults {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("results")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("results")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ListCollectionResults - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListCollectionResults.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ListCollectionResults is not found in the empty JSON string", ListCollectionResults.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListCollectionResults.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("results") != null) { - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); - } - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - CollectionListItem.validateJsonElement(jsonArrayresults.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListCollectionResults.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListCollectionResults' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ListCollectionResults.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ListCollectionResults 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 ListCollectionResults read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ListCollectionResults instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ListCollectionResults given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListCollectionResults - * @throws IOException if the JSON string is invalid with respect to ListCollectionResults - */ - public static ListCollectionResults fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListCollectionResults.class); - } - - /** - * Convert an instance of ListCollectionResults to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Logs.java b/src/main/java/ai/reveng/model/Logs.java deleted file mode 100644 index 7bd56f4..0000000 --- a/src/main/java/ai/reveng/model/Logs.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Logs - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Logs { - public static final String SERIALIZED_NAME_LOGS = "logs"; - @SerializedName(SERIALIZED_NAME_LOGS) - @javax.annotation.Nonnull - private String logs; - - public Logs() { - } - - public Logs logs(@javax.annotation.Nonnull String logs) { - this.logs = logs; - return this; - } - - /** - * Full logs of an analysis of an analysis_id - * @return logs - */ - @javax.annotation.Nonnull - public String getLogs() { - return logs; - } - - public void setLogs(@javax.annotation.Nonnull String logs) { - this.logs = logs; - } - - /** - * 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 Logs instance itself - */ - public Logs 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; - } - Logs logs = (Logs) o; - return Objects.equals(this.logs, logs.logs)&& - Objects.equals(this.additionalProperties, logs.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(logs, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Logs {\n"); - sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("logs")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("logs")); - } - - /** - * 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 Logs - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Logs.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Logs is not found in the empty JSON string", Logs.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Logs.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("logs").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `logs` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logs").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Logs.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Logs' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Logs.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Logs 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 Logs read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Logs instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Logs given an JSON string - * - * @param jsonString JSON string - * @return An instance of Logs - * @throws IOException if the JSON string is invalid with respect to Logs - */ - public static Logs fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Logs.class); - } - - /** - * Convert an instance of Logs to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/MITRETechnique.java b/src/main/java/ai/reveng/model/MITRETechnique.java deleted file mode 100644 index 0fe3911..0000000 --- a/src/main/java/ai/reveng/model/MITRETechnique.java +++ /dev/null @@ -1,547 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * MITRETechnique - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MITRETechnique { - public static final String SERIALIZED_NAME_START_ADDR = "start_addr"; - @SerializedName(SERIALIZED_NAME_START_ADDR) - @javax.annotation.Nonnull - private String startAddr; - - public static final String SERIALIZED_NAME_END_ADDR = "end_addr"; - @SerializedName(SERIALIZED_NAME_END_ADDR) - @javax.annotation.Nonnull - private String endAddr; - - public static final String SERIALIZED_NAME_FUNCTION_ADDR = "function_addr"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ADDR) - @javax.annotation.Nonnull - private String functionAddr; - - public static final String SERIALIZED_NAME_TECHNIQUE_ID = "technique_id"; - @SerializedName(SERIALIZED_NAME_TECHNIQUE_ID) - @javax.annotation.Nonnull - private String techniqueId; - - public static final String SERIALIZED_NAME_TECHNIQUE_NAME = "technique_name"; - @SerializedName(SERIALIZED_NAME_TECHNIQUE_NAME) - @javax.annotation.Nonnull - private String techniqueName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Integer functionId; - - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nonnull - private String functionName; - - public static final String SERIALIZED_NAME_TECHNIQUE_URL = "technique_url"; - @SerializedName(SERIALIZED_NAME_TECHNIQUE_URL) - @javax.annotation.Nonnull - private String techniqueUrl; - - public static final String SERIALIZED_NAME_TECHNIQUE_DESCRIPTION = "technique_description"; - @SerializedName(SERIALIZED_NAME_TECHNIQUE_DESCRIPTION) - @javax.annotation.Nonnull - private String techniqueDescription; - - public MITRETechnique() { - } - - public MITRETechnique startAddr(@javax.annotation.Nonnull String startAddr) { - this.startAddr = startAddr; - return this; - } - - /** - * Starting address of the technique - * @return startAddr - */ - @javax.annotation.Nonnull - public String getStartAddr() { - return startAddr; - } - - public void setStartAddr(@javax.annotation.Nonnull String startAddr) { - this.startAddr = startAddr; - } - - - public MITRETechnique endAddr(@javax.annotation.Nonnull String endAddr) { - this.endAddr = endAddr; - return this; - } - - /** - * Ending address of the technique - * @return endAddr - */ - @javax.annotation.Nonnull - public String getEndAddr() { - return endAddr; - } - - public void setEndAddr(@javax.annotation.Nonnull String endAddr) { - this.endAddr = endAddr; - } - - - public MITRETechnique functionAddr(@javax.annotation.Nonnull String functionAddr) { - this.functionAddr = functionAddr; - return this; - } - - /** - * Function address where the technique is found - * @return functionAddr - */ - @javax.annotation.Nonnull - public String getFunctionAddr() { - return functionAddr; - } - - public void setFunctionAddr(@javax.annotation.Nonnull String functionAddr) { - this.functionAddr = functionAddr; - } - - - public MITRETechnique techniqueId(@javax.annotation.Nonnull String techniqueId) { - this.techniqueId = techniqueId; - return this; - } - - /** - * MITRE technique identifier - * @return techniqueId - */ - @javax.annotation.Nonnull - public String getTechniqueId() { - return techniqueId; - } - - public void setTechniqueId(@javax.annotation.Nonnull String techniqueId) { - this.techniqueId = techniqueId; - } - - - public MITRETechnique techniqueName(@javax.annotation.Nonnull String techniqueName) { - this.techniqueName = techniqueName; - return this; - } - - /** - * Name of the MITRE technique - * @return techniqueName - */ - @javax.annotation.Nonnull - public String getTechniqueName() { - return techniqueName; - } - - public void setTechniqueName(@javax.annotation.Nonnull String techniqueName) { - this.techniqueName = techniqueName; - } - - - public MITRETechnique description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * Description of the technique - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - - public MITRETechnique functionId(@javax.annotation.Nonnull Integer functionId) { - this.functionId = functionId; - return this; - } - - /** - * Unique identifier of the function containing the technique - * @return functionId - */ - @javax.annotation.Nonnull - public Integer getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Integer functionId) { - this.functionId = functionId; - } - - - public MITRETechnique functionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - return this; - } - - /** - * Name of the function containing the technique - * @return functionName - */ - @javax.annotation.Nonnull - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(@javax.annotation.Nonnull String functionName) { - this.functionName = functionName; - } - - - public MITRETechnique techniqueUrl(@javax.annotation.Nonnull String techniqueUrl) { - this.techniqueUrl = techniqueUrl; - return this; - } - - /** - * URL to the MITRE ATT&CK technique page - * @return techniqueUrl - */ - @javax.annotation.Nonnull - public String getTechniqueUrl() { - return techniqueUrl; - } - - public void setTechniqueUrl(@javax.annotation.Nonnull String techniqueUrl) { - this.techniqueUrl = techniqueUrl; - } - - - public MITRETechnique techniqueDescription(@javax.annotation.Nonnull String techniqueDescription) { - this.techniqueDescription = techniqueDescription; - return this; - } - - /** - * Full description of the MITRE technique from ATT&CK - * @return techniqueDescription - */ - @javax.annotation.Nonnull - public String getTechniqueDescription() { - return techniqueDescription; - } - - public void setTechniqueDescription(@javax.annotation.Nonnull String techniqueDescription) { - this.techniqueDescription = techniqueDescription; - } - - /** - * 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 MITRETechnique instance itself - */ - public MITRETechnique 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; - } - MITRETechnique miTRETechnique = (MITRETechnique) o; - return Objects.equals(this.startAddr, miTRETechnique.startAddr) && - Objects.equals(this.endAddr, miTRETechnique.endAddr) && - Objects.equals(this.functionAddr, miTRETechnique.functionAddr) && - Objects.equals(this.techniqueId, miTRETechnique.techniqueId) && - Objects.equals(this.techniqueName, miTRETechnique.techniqueName) && - Objects.equals(this.description, miTRETechnique.description) && - Objects.equals(this.functionId, miTRETechnique.functionId) && - Objects.equals(this.functionName, miTRETechnique.functionName) && - Objects.equals(this.techniqueUrl, miTRETechnique.techniqueUrl) && - Objects.equals(this.techniqueDescription, miTRETechnique.techniqueDescription)&& - Objects.equals(this.additionalProperties, miTRETechnique.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(startAddr, endAddr, functionAddr, techniqueId, techniqueName, description, functionId, functionName, techniqueUrl, techniqueDescription, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MITRETechnique {\n"); - sb.append(" startAddr: ").append(toIndentedString(startAddr)).append("\n"); - sb.append(" endAddr: ").append(toIndentedString(endAddr)).append("\n"); - sb.append(" functionAddr: ").append(toIndentedString(functionAddr)).append("\n"); - sb.append(" techniqueId: ").append(toIndentedString(techniqueId)).append("\n"); - sb.append(" techniqueName: ").append(toIndentedString(techniqueName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" techniqueUrl: ").append(toIndentedString(techniqueUrl)).append("\n"); - sb.append(" techniqueDescription: ").append(toIndentedString(techniqueDescription)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("start_addr", "end_addr", "function_addr", "technique_id", "technique_name", "description", "function_id", "function_name", "technique_url", "technique_description")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("start_addr", "end_addr", "function_addr", "technique_id", "technique_name", "description", "function_id", "function_name", "technique_url", "technique_description")); - } - - /** - * 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 MITRETechnique - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!MITRETechnique.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in MITRETechnique is not found in the empty JSON string", MITRETechnique.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : MITRETechnique.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("start_addr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `start_addr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("start_addr").toString())); - } - if (!jsonObj.get("end_addr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `end_addr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("end_addr").toString())); - } - if (!jsonObj.get("function_addr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_addr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_addr").toString())); - } - if (!jsonObj.get("technique_id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `technique_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("technique_id").toString())); - } - if (!jsonObj.get("technique_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `technique_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("technique_name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("function_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("function_name").toString())); - } - if (!jsonObj.get("technique_url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `technique_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("technique_url").toString())); - } - if (!jsonObj.get("technique_description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `technique_description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("technique_description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MITRETechnique.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MITRETechnique' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MITRETechnique.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MITRETechnique 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 MITRETechnique read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - MITRETechnique instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of MITRETechnique given an JSON string - * - * @param jsonString JSON string - * @return An instance of MITRETechnique - * @throws IOException if the JSON string is invalid with respect to MITRETechnique - */ - public static MITRETechnique fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MITRETechnique.class); - } - - /** - * Convert an instance of MITRETechnique to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/MetaModel.java b/src/main/java/ai/reveng/model/MetaModel.java deleted file mode 100644 index 926e863..0000000 --- a/src/main/java/ai/reveng/model/MetaModel.java +++ /dev/null @@ -1,296 +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 ai.reveng.model.PaginationModel; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * MetaModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MetaModel { - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - @javax.annotation.Nullable - private PaginationModel pagination; - - public MetaModel() { - } - - public MetaModel pagination(@javax.annotation.Nullable PaginationModel pagination) { - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * @return pagination - */ - @javax.annotation.Nullable - public PaginationModel getPagination() { - return pagination; - } - - public void setPagination(@javax.annotation.Nullable PaginationModel pagination) { - this.pagination = pagination; - } - - /** - * 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 MetaModel instance itself - */ - public MetaModel 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; - } - MetaModel metaModel = (MetaModel) o; - return Objects.equals(this.pagination, metaModel.pagination)&& - Objects.equals(this.additionalProperties, metaModel.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(pagination, 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 MetaModel {\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("pagination")); - - // 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 MetaModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!MetaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in MetaModel is not found in the empty JSON string", MetaModel.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `pagination` - if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { - PaginationModel.validateJsonElement(jsonObj.get("pagination")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MetaModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MetaModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MetaModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MetaModel 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 MetaModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - MetaModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of MetaModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of MetaModel - * @throws IOException if the JSON string is invalid with respect to MetaModel - */ - public static MetaModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MetaModel.class); - } - - /** - * Convert an instance of MetaModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ModelName.java b/src/main/java/ai/reveng/model/ModelName.java deleted file mode 100644 index d6015e4..0000000 --- a/src/main/java/ai/reveng/model/ModelName.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Custom enum for the model name - */ -@JsonAdapter(ModelName.Adapter.class) -public enum ModelName { - - BINNET_0_7_X86_64_WINDOWS("binnet-0.7-x86-64-windows"), - - BINNET_0_7_X86_64_LINUX("binnet-0.7-x86-64-linux"), - - BINNET_0_7_X86_32_WINDOWS("binnet-0.7-x86-32-windows"), - - BINNET_0_7_X86_32_LINUX("binnet-0.7-x86-32-linux"), - - BINNET_0_7_ARM_64_WINDOWS("binnet-0.7-arm-64-windows"), - - BINNET_0_7_ARM_64_LINUX("binnet-0.7-arm-64-linux"), - - BINNET_0_7_X86_64_ANDROID("binnet-0.7-x86-64-android"), - - BINNET_0_7_X86_32_ANDROID("binnet-0.7-x86-32-android"), - - BINNET_0_7_ARM_64_ANDROID("binnet-0.7-arm-64-android"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ModelName(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ModelName fromValue(String value) { - for (ModelName b : ModelName.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ModelName enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ModelName read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ModelName.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ModelName.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/ModelsResponse.java b/src/main/java/ai/reveng/model/ModelsResponse.java deleted file mode 100644 index cd8e97c..0000000 --- a/src/main/java/ai/reveng/model/ModelsResponse.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ModelsResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ModelsResponse { - public static final String SERIALIZED_NAME_MODELS = "models"; - @SerializedName(SERIALIZED_NAME_MODELS) - @javax.annotation.Nonnull - private List models = new ArrayList<>(); - - public ModelsResponse() { - } - - public ModelsResponse models(@javax.annotation.Nonnull List models) { - this.models = models; - return this; - } - - public ModelsResponse addModelsItem(String modelsItem) { - if (this.models == null) { - this.models = new ArrayList<>(); - } - this.models.add(modelsItem); - return this; - } - - /** - * List of active models available analysis. - * @return models - */ - @javax.annotation.Nonnull - public List getModels() { - return models; - } - - public void setModels(@javax.annotation.Nonnull List models) { - this.models = models; - } - - /** - * 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 ModelsResponse instance itself - */ - public ModelsResponse 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; - } - ModelsResponse modelsResponse = (ModelsResponse) o; - return Objects.equals(this.models, modelsResponse.models)&& - Objects.equals(this.additionalProperties, modelsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(models, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelsResponse {\n"); - sb.append(" models: ").append(toIndentedString(models)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("models")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("models")); - } - - /** - * 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 ModelsResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ModelsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ModelsResponse is not found in the empty JSON string", ModelsResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ModelsResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("models") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("models").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `models` to be an array in the JSON string but got `%s`", jsonObj.get("models").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ModelsResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ModelsResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ModelsResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ModelsResponse 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 ModelsResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ModelsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ModelsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelsResponse - * @throws IOException if the JSON string is invalid with respect to ModelsResponse - */ - public static ModelsResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ModelsResponse.class); - } - - /** - * Convert an instance of ModelsResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/NameSourceType.java b/src/main/java/ai/reveng/model/NameSourceType.java deleted file mode 100644 index dd2cee7..0000000 --- a/src/main/java/ai/reveng/model/NameSourceType.java +++ /dev/null @@ -1,443 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * NameSourceType - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class NameSourceType { - /** - * The source (process) the function name came from - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - SYSTEM("SYSTEM"), - - USER("USER"), - - AUTO_UNSTRIP("AUTO_UNSTRIP"), - - EXTERNAL("EXTERNAL"), - - AI_UNSTRIP("AI_UNSTRIP"), - - AI_AGENT("AI_AGENT"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private TypeEnum type; - - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nullable - private Integer functionId; - - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nullable - private Integer binaryId; - - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nullable - private Integer analysisId; - - public NameSourceType() { - } - - public NameSourceType type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * The source (process) the function name came from - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - - public NameSourceType functionId(@javax.annotation.Nullable Integer functionId) { - this.functionId = functionId; - return this; - } - - /** - * The function id of the function the function name was copied from. - * @return functionId - */ - @javax.annotation.Nullable - public Integer getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nullable Integer functionId) { - this.functionId = functionId; - } - - - public NameSourceType binaryId(@javax.annotation.Nullable Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * The binary id of the function that the function name was copied from. - * @return binaryId - */ - @javax.annotation.Nullable - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nullable Integer binaryId) { - this.binaryId = binaryId; - } - - - public NameSourceType analysisId(@javax.annotation.Nullable Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * The analysis id of the function that the function name was copied from. - * @return analysisId - */ - @javax.annotation.Nullable - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nullable Integer analysisId) { - this.analysisId = analysisId; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the NameSourceType instance itself - */ - public NameSourceType 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; - } - NameSourceType nameSourceType = (NameSourceType) o; - return Objects.equals(this.type, nameSourceType.type) && - Objects.equals(this.functionId, nameSourceType.functionId) && - Objects.equals(this.binaryId, nameSourceType.binaryId) && - Objects.equals(this.analysisId, nameSourceType.analysisId)&& - Objects.equals(this.additionalProperties, nameSourceType.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(type, functionId, binaryId, analysisId, 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 NameSourceType {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("type", "function_id", "binary_id", "analysis_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("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 NameSourceType - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NameSourceType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in NameSourceType is not found in the empty JSON string", NameSourceType.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : NameSourceType.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NameSourceType.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NameSourceType' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(NameSourceType.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, NameSourceType 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 NameSourceType read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - NameSourceType instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of NameSourceType given an JSON string - * - * @param jsonString JSON string - * @return An instance of NameSourceType - * @throws IOException if the JSON string is invalid with respect to NameSourceType - */ - public static NameSourceType fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NameSourceType.class); - } - - /** - * Convert an instance of NameSourceType to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Order.java b/src/main/java/ai/reveng/model/Order.java deleted file mode 100644 index 1a7a085..0000000 --- a/src/main/java/ai/reveng/model/Order.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets Order - */ -@JsonAdapter(Order.Adapter.class) -public enum Order { - - ASC("ASC"), - - DESC("DESC"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - Order(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Order fromValue(String value) { - for (Order b : Order.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final Order enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Order read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Order.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - Order.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/Organisation.java b/src/main/java/ai/reveng/model/Organisation.java index 0324b3b..84cab99 100644 --- a/src/main/java/ai/reveng/model/Organisation.java +++ b/src/main/java/ai/reveng/model/Organisation.java @@ -57,7 +57,7 @@ public class Organisation { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String name; public static final String SERIALIZED_NAME_ORGANISATION_ID = "organisation_id"; @@ -92,21 +92,21 @@ public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { } - public Organisation name(@javax.annotation.Nullable String name) { + public Organisation name(@javax.annotation.Nonnull String name) { this.name = name; return this; } /** - * Search is applied to string value + * Get name * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } - public void setName(@javax.annotation.Nullable String name) { + public void setName(@javax.annotation.Nonnull String name) { this.name = name; } @@ -268,7 +268,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/ai/reveng/model/OrganisationGroup.java b/src/main/java/ai/reveng/model/OrganisationGroup.java index 1d01dc8..38939a8 100644 --- a/src/main/java/ai/reveng/model/OrganisationGroup.java +++ b/src/main/java/ai/reveng/model/OrganisationGroup.java @@ -57,7 +57,7 @@ public class OrganisationGroup { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String name; public static final String SERIALIZED_NAME_ORGANISATION_GROUP_ID = "organisation_group_id"; @@ -102,21 +102,21 @@ public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { } - public OrganisationGroup name(@javax.annotation.Nullable String name) { + public OrganisationGroup name(@javax.annotation.Nonnull String name) { this.name = name; return this; } /** - * Search is applied to string value + * Get name * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } - public void setName(@javax.annotation.Nullable String name) { + public void setName(@javax.annotation.Nonnull String name) { this.name = name; } @@ -320,7 +320,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/ai/reveng/model/OrganisationIssuer.java b/src/main/java/ai/reveng/model/OrganisationIssuer.java index b531810..19fc36b 100644 --- a/src/main/java/ai/reveng/model/OrganisationIssuer.java +++ b/src/main/java/ai/reveng/model/OrganisationIssuer.java @@ -67,7 +67,7 @@ public class OrganisationIssuer { public static final String SERIALIZED_NAME_ISSUER_URL = "issuer_url"; @SerializedName(SERIALIZED_NAME_ISSUER_URL) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String issuerUrl; public static final String SERIALIZED_NAME_JWKS_URI = "jwks_uri"; @@ -150,21 +150,21 @@ public void setEnabled(@javax.annotation.Nonnull Boolean enabled) { } - public OrganisationIssuer issuerUrl(@javax.annotation.Nullable String issuerUrl) { + public OrganisationIssuer issuerUrl(@javax.annotation.Nonnull String issuerUrl) { this.issuerUrl = issuerUrl; return this; } /** - * Search is applied to string value + * Get issuerUrl * @return issuerUrl */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getIssuerUrl() { return issuerUrl; } - public void setIssuerUrl(@javax.annotation.Nullable String issuerUrl) { + public void setIssuerUrl(@javax.annotation.Nonnull String issuerUrl) { this.issuerUrl = issuerUrl; } @@ -375,7 +375,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("client_id") != null && !jsonObj.get("client_id").isJsonNull()) && !jsonObj.get("client_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); } - if ((jsonObj.get("issuer_url") != null && !jsonObj.get("issuer_url").isJsonNull()) && !jsonObj.get("issuer_url").isJsonPrimitive()) { + if (!jsonObj.get("issuer_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer_url").toString())); } if ((jsonObj.get("jwks_uri") != null && !jsonObj.get("jwks_uri").isJsonNull()) && !jsonObj.get("jwks_uri").isJsonPrimitive()) { diff --git a/src/main/java/ai/reveng/model/PDBDebugModel.java b/src/main/java/ai/reveng/model/PDBDebugModel.java deleted file mode 100644 index 72d8dc0..0000000 --- a/src/main/java/ai/reveng/model/PDBDebugModel.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.SinglePDBEntryModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * PDBDebugModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class PDBDebugModel { - public static final String SERIALIZED_NAME_DEBUG_ENTRIES = "debug_entries"; - @SerializedName(SERIALIZED_NAME_DEBUG_ENTRIES) - @javax.annotation.Nonnull - private List debugEntries = new ArrayList<>(); - - public PDBDebugModel() { - } - - public PDBDebugModel debugEntries(@javax.annotation.Nonnull List debugEntries) { - this.debugEntries = debugEntries; - return this; - } - - public PDBDebugModel addDebugEntriesItem(SinglePDBEntryModel debugEntriesItem) { - if (this.debugEntries == null) { - this.debugEntries = new ArrayList<>(); - } - this.debugEntries.add(debugEntriesItem); - return this; - } - - /** - * Get debugEntries - * @return debugEntries - */ - @javax.annotation.Nonnull - public List getDebugEntries() { - return debugEntries; - } - - public void setDebugEntries(@javax.annotation.Nonnull List debugEntries) { - this.debugEntries = debugEntries; - } - - /** - * 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 PDBDebugModel instance itself - */ - public PDBDebugModel 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; - } - PDBDebugModel pdBDebugModel = (PDBDebugModel) o; - return Objects.equals(this.debugEntries, pdBDebugModel.debugEntries)&& - Objects.equals(this.additionalProperties, pdBDebugModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(debugEntries, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PDBDebugModel {\n"); - sb.append(" debugEntries: ").append(toIndentedString(debugEntries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("debug_entries")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("debug_entries")); - } - - /** - * 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 PDBDebugModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PDBDebugModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in PDBDebugModel is not found in the empty JSON string", PDBDebugModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PDBDebugModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("debug_entries") != null) { - if (!jsonObj.get("debug_entries").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `debug_entries` to be an array in the JSON string but got `%s`", jsonObj.get("debug_entries").toString())); - } - JsonArray jsonArraydebugEntries = jsonObj.getAsJsonArray("debug_entries"); - // validate the required field `debug_entries` (array) - for (int i = 0; i < jsonArraydebugEntries.size(); i++) { - SinglePDBEntryModel.validateJsonElement(jsonArraydebugEntries.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PDBDebugModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PDBDebugModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PDBDebugModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PDBDebugModel 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 PDBDebugModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PDBDebugModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PDBDebugModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of PDBDebugModel - * @throws IOException if the JSON string is invalid with respect to PDBDebugModel - */ - public static PDBDebugModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PDBDebugModel.class); - } - - /** - * Convert an instance of PDBDebugModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/PEModel.java b/src/main/java/ai/reveng/model/PEModel.java deleted file mode 100644 index 6c068c4..0000000 --- a/src/main/java/ai/reveng/model/PEModel.java +++ /dev/null @@ -1,850 +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 ai.reveng.model.CodeSignatureModel; -import ai.reveng.model.EntrypointModel; -import ai.reveng.model.ExportModel; -import ai.reveng.model.IconModel; -import ai.reveng.model.ImportModel; -import ai.reveng.model.PDBDebugModel; -import ai.reveng.model.SectionModel; -import ai.reveng.model.SecurityModel; -import ai.reveng.model.TimestampModel; -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.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * PEModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class PEModel { - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_TIMESTAMPS = "timestamps"; - @SerializedName(SERIALIZED_NAME_TIMESTAMPS) - @javax.annotation.Nullable - private TimestampModel timestamps; - - public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; - @SerializedName(SERIALIZED_NAME_ARCHITECTURE) - @javax.annotation.Nonnull - private String architecture; - - public static final String SERIALIZED_NAME_CHECKSUM = "checksum"; - @SerializedName(SERIALIZED_NAME_CHECKSUM) - @javax.annotation.Nonnull - private Integer checksum; - - public static final String SERIALIZED_NAME_IMAGE_BASE = "image_base"; - @SerializedName(SERIALIZED_NAME_IMAGE_BASE) - @javax.annotation.Nonnull - private Integer imageBase; - - public static final String SERIALIZED_NAME_SECURITY = "security"; - @SerializedName(SERIALIZED_NAME_SECURITY) - @javax.annotation.Nullable - private SecurityModel security; - - public static final String SERIALIZED_NAME_VERSION_INFO = "version_info"; - @SerializedName(SERIALIZED_NAME_VERSION_INFO) - @javax.annotation.Nullable - private Map versionInfo; - - public static final String SERIALIZED_NAME_DEBUG_INFO = "debug_info"; - @SerializedName(SERIALIZED_NAME_DEBUG_INFO) - @javax.annotation.Nullable - private PDBDebugModel debugInfo; - - public static final String SERIALIZED_NAME_NUMBER_OF_RESOURCES = "number_of_resources"; - @SerializedName(SERIALIZED_NAME_NUMBER_OF_RESOURCES) - @javax.annotation.Nullable - private Integer numberOfResources; - - public static final String SERIALIZED_NAME_ENTRY_POINT = "entry_point"; - @SerializedName(SERIALIZED_NAME_ENTRY_POINT) - @javax.annotation.Nullable - private EntrypointModel entryPoint; - - public static final String SERIALIZED_NAME_SIGNATURE = "signature"; - @SerializedName(SERIALIZED_NAME_SIGNATURE) - @javax.annotation.Nullable - private CodeSignatureModel signature; - - public static final String SERIALIZED_NAME_DOTNET = "dotnet"; - @SerializedName(SERIALIZED_NAME_DOTNET) - @javax.annotation.Nonnull - private Boolean dotnet; - - public static final String SERIALIZED_NAME_DEBUG_STRIPPED = "debug_stripped"; - @SerializedName(SERIALIZED_NAME_DEBUG_STRIPPED) - @javax.annotation.Nonnull - private Boolean debugStripped; - - public static final String SERIALIZED_NAME_IMPORT_HASH = "import_hash"; - @SerializedName(SERIALIZED_NAME_IMPORT_HASH) - @javax.annotation.Nonnull - private String importHash; - - public static final String SERIALIZED_NAME_EXPORT_HASH = "export_hash"; - @SerializedName(SERIALIZED_NAME_EXPORT_HASH) - @javax.annotation.Nonnull - private String exportHash; - - public static final String SERIALIZED_NAME_RICH_HEADER_HASH = "rich_header_hash"; - @SerializedName(SERIALIZED_NAME_RICH_HEADER_HASH) - @javax.annotation.Nonnull - private String richHeaderHash; - - public static final String SERIALIZED_NAME_SECTIONS = "sections"; - @SerializedName(SERIALIZED_NAME_SECTIONS) - @javax.annotation.Nullable - private SectionModel sections; - - public static final String SERIALIZED_NAME_IMPORTS = "imports"; - @SerializedName(SERIALIZED_NAME_IMPORTS) - @javax.annotation.Nullable - private ImportModel imports; - - public static final String SERIALIZED_NAME_EXPORTS = "exports"; - @SerializedName(SERIALIZED_NAME_EXPORTS) - @javax.annotation.Nullable - private ExportModel exports; - - public static final String SERIALIZED_NAME_ICON_DATA = "icon_data"; - @SerializedName(SERIALIZED_NAME_ICON_DATA) - @javax.annotation.Nullable - private IconModel iconData; - - public PEModel() { - } - - public PEModel type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public PEModel timestamps(@javax.annotation.Nullable TimestampModel timestamps) { - this.timestamps = timestamps; - return this; - } - - /** - * Get timestamps - * @return timestamps - */ - @javax.annotation.Nullable - public TimestampModel getTimestamps() { - return timestamps; - } - - public void setTimestamps(@javax.annotation.Nullable TimestampModel timestamps) { - this.timestamps = timestamps; - } - - - public PEModel architecture(@javax.annotation.Nonnull String architecture) { - this.architecture = architecture; - return this; - } - - /** - * Get architecture - * @return architecture - */ - @javax.annotation.Nonnull - public String getArchitecture() { - return architecture; - } - - public void setArchitecture(@javax.annotation.Nonnull String architecture) { - this.architecture = architecture; - } - - - public PEModel checksum(@javax.annotation.Nonnull Integer checksum) { - this.checksum = checksum; - return this; - } - - /** - * Get checksum - * @return checksum - */ - @javax.annotation.Nonnull - public Integer getChecksum() { - return checksum; - } - - public void setChecksum(@javax.annotation.Nonnull Integer checksum) { - this.checksum = checksum; - } - - - public PEModel imageBase(@javax.annotation.Nonnull Integer imageBase) { - this.imageBase = imageBase; - return this; - } - - /** - * Get imageBase - * @return imageBase - */ - @javax.annotation.Nonnull - public Integer getImageBase() { - return imageBase; - } - - public void setImageBase(@javax.annotation.Nonnull Integer imageBase) { - this.imageBase = imageBase; - } - - - public PEModel security(@javax.annotation.Nullable SecurityModel security) { - this.security = security; - return this; - } - - /** - * Get security - * @return security - */ - @javax.annotation.Nullable - public SecurityModel getSecurity() { - return security; - } - - public void setSecurity(@javax.annotation.Nullable SecurityModel security) { - this.security = security; - } - - - public PEModel versionInfo(@javax.annotation.Nullable Map versionInfo) { - this.versionInfo = versionInfo; - return this; - } - - public PEModel putVersionInfoItem(String key, Object versionInfoItem) { - if (this.versionInfo == null) { - this.versionInfo = new HashMap<>(); - } - this.versionInfo.put(key, versionInfoItem); - return this; - } - - /** - * Get versionInfo - * @return versionInfo - */ - @javax.annotation.Nullable - public Map getVersionInfo() { - return versionInfo; - } - - public void setVersionInfo(@javax.annotation.Nullable Map versionInfo) { - this.versionInfo = versionInfo; - } - - - public PEModel debugInfo(@javax.annotation.Nullable PDBDebugModel debugInfo) { - this.debugInfo = debugInfo; - return this; - } - - /** - * Get debugInfo - * @return debugInfo - */ - @javax.annotation.Nullable - public PDBDebugModel getDebugInfo() { - return debugInfo; - } - - public void setDebugInfo(@javax.annotation.Nullable PDBDebugModel debugInfo) { - this.debugInfo = debugInfo; - } - - - public PEModel numberOfResources(@javax.annotation.Nullable Integer numberOfResources) { - this.numberOfResources = numberOfResources; - return this; - } - - /** - * Get numberOfResources - * @return numberOfResources - */ - @javax.annotation.Nullable - public Integer getNumberOfResources() { - return numberOfResources; - } - - public void setNumberOfResources(@javax.annotation.Nullable Integer numberOfResources) { - this.numberOfResources = numberOfResources; - } - - - public PEModel entryPoint(@javax.annotation.Nullable EntrypointModel entryPoint) { - this.entryPoint = entryPoint; - return this; - } - - /** - * Get entryPoint - * @return entryPoint - */ - @javax.annotation.Nullable - public EntrypointModel getEntryPoint() { - return entryPoint; - } - - public void setEntryPoint(@javax.annotation.Nullable EntrypointModel entryPoint) { - this.entryPoint = entryPoint; - } - - - public PEModel signature(@javax.annotation.Nullable CodeSignatureModel signature) { - this.signature = signature; - return this; - } - - /** - * Get signature - * @return signature - */ - @javax.annotation.Nullable - public CodeSignatureModel getSignature() { - return signature; - } - - public void setSignature(@javax.annotation.Nullable CodeSignatureModel signature) { - this.signature = signature; - } - - - public PEModel dotnet(@javax.annotation.Nonnull Boolean dotnet) { - this.dotnet = dotnet; - return this; - } - - /** - * Get dotnet - * @return dotnet - */ - @javax.annotation.Nonnull - public Boolean getDotnet() { - return dotnet; - } - - public void setDotnet(@javax.annotation.Nonnull Boolean dotnet) { - this.dotnet = dotnet; - } - - - public PEModel debugStripped(@javax.annotation.Nonnull Boolean debugStripped) { - this.debugStripped = debugStripped; - return this; - } - - /** - * Get debugStripped - * @return debugStripped - */ - @javax.annotation.Nonnull - public Boolean getDebugStripped() { - return debugStripped; - } - - public void setDebugStripped(@javax.annotation.Nonnull Boolean debugStripped) { - this.debugStripped = debugStripped; - } - - - public PEModel importHash(@javax.annotation.Nonnull String importHash) { - this.importHash = importHash; - return this; - } - - /** - * Get importHash - * @return importHash - */ - @javax.annotation.Nonnull - public String getImportHash() { - return importHash; - } - - public void setImportHash(@javax.annotation.Nonnull String importHash) { - this.importHash = importHash; - } - - - public PEModel exportHash(@javax.annotation.Nonnull String exportHash) { - this.exportHash = exportHash; - return this; - } - - /** - * Get exportHash - * @return exportHash - */ - @javax.annotation.Nonnull - public String getExportHash() { - return exportHash; - } - - public void setExportHash(@javax.annotation.Nonnull String exportHash) { - this.exportHash = exportHash; - } - - - public PEModel richHeaderHash(@javax.annotation.Nonnull String richHeaderHash) { - this.richHeaderHash = richHeaderHash; - return this; - } - - /** - * Get richHeaderHash - * @return richHeaderHash - */ - @javax.annotation.Nonnull - public String getRichHeaderHash() { - return richHeaderHash; - } - - public void setRichHeaderHash(@javax.annotation.Nonnull String richHeaderHash) { - this.richHeaderHash = richHeaderHash; - } - - - public PEModel sections(@javax.annotation.Nullable SectionModel sections) { - this.sections = sections; - return this; - } - - /** - * Get sections - * @return sections - */ - @javax.annotation.Nullable - public SectionModel getSections() { - return sections; - } - - public void setSections(@javax.annotation.Nullable SectionModel sections) { - this.sections = sections; - } - - - public PEModel imports(@javax.annotation.Nullable ImportModel imports) { - this.imports = imports; - return this; - } - - /** - * Get imports - * @return imports - */ - @javax.annotation.Nullable - public ImportModel getImports() { - return imports; - } - - public void setImports(@javax.annotation.Nullable ImportModel imports) { - this.imports = imports; - } - - - public PEModel exports(@javax.annotation.Nullable ExportModel exports) { - this.exports = exports; - return this; - } - - /** - * Get exports - * @return exports - */ - @javax.annotation.Nullable - public ExportModel getExports() { - return exports; - } - - public void setExports(@javax.annotation.Nullable ExportModel exports) { - this.exports = exports; - } - - - public PEModel iconData(@javax.annotation.Nullable IconModel iconData) { - this.iconData = iconData; - return this; - } - - /** - * Get iconData - * @return iconData - */ - @javax.annotation.Nullable - public IconModel getIconData() { - return iconData; - } - - public void setIconData(@javax.annotation.Nullable IconModel iconData) { - this.iconData = iconData; - } - - /** - * 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 PEModel instance itself - */ - public PEModel 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; - } - PEModel peModel = (PEModel) o; - return Objects.equals(this.type, peModel.type) && - Objects.equals(this.timestamps, peModel.timestamps) && - Objects.equals(this.architecture, peModel.architecture) && - Objects.equals(this.checksum, peModel.checksum) && - Objects.equals(this.imageBase, peModel.imageBase) && - Objects.equals(this.security, peModel.security) && - Objects.equals(this.versionInfo, peModel.versionInfo) && - Objects.equals(this.debugInfo, peModel.debugInfo) && - Objects.equals(this.numberOfResources, peModel.numberOfResources) && - Objects.equals(this.entryPoint, peModel.entryPoint) && - Objects.equals(this.signature, peModel.signature) && - Objects.equals(this.dotnet, peModel.dotnet) && - Objects.equals(this.debugStripped, peModel.debugStripped) && - Objects.equals(this.importHash, peModel.importHash) && - Objects.equals(this.exportHash, peModel.exportHash) && - Objects.equals(this.richHeaderHash, peModel.richHeaderHash) && - Objects.equals(this.sections, peModel.sections) && - Objects.equals(this.imports, peModel.imports) && - Objects.equals(this.exports, peModel.exports) && - Objects.equals(this.iconData, peModel.iconData)&& - Objects.equals(this.additionalProperties, peModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(type, timestamps, architecture, checksum, imageBase, security, versionInfo, debugInfo, numberOfResources, entryPoint, signature, dotnet, debugStripped, importHash, exportHash, richHeaderHash, sections, imports, exports, iconData, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PEModel {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" timestamps: ").append(toIndentedString(timestamps)).append("\n"); - sb.append(" architecture: ").append(toIndentedString(architecture)).append("\n"); - sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); - sb.append(" imageBase: ").append(toIndentedString(imageBase)).append("\n"); - sb.append(" security: ").append(toIndentedString(security)).append("\n"); - sb.append(" versionInfo: ").append(toIndentedString(versionInfo)).append("\n"); - sb.append(" debugInfo: ").append(toIndentedString(debugInfo)).append("\n"); - sb.append(" numberOfResources: ").append(toIndentedString(numberOfResources)).append("\n"); - sb.append(" entryPoint: ").append(toIndentedString(entryPoint)).append("\n"); - sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); - sb.append(" dotnet: ").append(toIndentedString(dotnet)).append("\n"); - sb.append(" debugStripped: ").append(toIndentedString(debugStripped)).append("\n"); - sb.append(" importHash: ").append(toIndentedString(importHash)).append("\n"); - sb.append(" exportHash: ").append(toIndentedString(exportHash)).append("\n"); - sb.append(" richHeaderHash: ").append(toIndentedString(richHeaderHash)).append("\n"); - sb.append(" sections: ").append(toIndentedString(sections)).append("\n"); - sb.append(" imports: ").append(toIndentedString(imports)).append("\n"); - sb.append(" exports: ").append(toIndentedString(exports)).append("\n"); - sb.append(" iconData: ").append(toIndentedString(iconData)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("type", "timestamps", "architecture", "checksum", "image_base", "security", "version_info", "debug_info", "number_of_resources", "entry_point", "signature", "dotnet", "debug_stripped", "import_hash", "export_hash", "rich_header_hash", "sections", "imports", "exports", "icon_data")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("type", "timestamps", "architecture", "checksum", "image_base", "security", "version_info", "debug_info", "number_of_resources", "entry_point", "signature", "dotnet", "debug_stripped", "import_hash", "export_hash", "rich_header_hash", "sections", "imports", "exports", "icon_data")); - } - - /** - * 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 PEModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PEModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in PEModel is not found in the empty JSON string", PEModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PEModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (jsonObj.get("timestamps") != null && !jsonObj.get("timestamps").isJsonNull()) { - // validate the required field `timestamps` - TimestampModel.validateJsonElement(jsonObj.get("timestamps")); - } - if (!jsonObj.get("architecture").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `architecture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("architecture").toString())); - } - if (jsonObj.get("security") != null && !jsonObj.get("security").isJsonNull()) { - // validate the required field `security` - SecurityModel.validateJsonElement(jsonObj.get("security")); - } - if (jsonObj.get("debug_info") != null && !jsonObj.get("debug_info").isJsonNull()) { - // validate the required field `debug_info` - PDBDebugModel.validateJsonElement(jsonObj.get("debug_info")); - } - if (jsonObj.get("entry_point") != null && !jsonObj.get("entry_point").isJsonNull()) { - // validate the required field `entry_point` - EntrypointModel.validateJsonElement(jsonObj.get("entry_point")); - } - if (jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) { - // validate the required field `signature` - CodeSignatureModel.validateJsonElement(jsonObj.get("signature")); - } - if (!jsonObj.get("import_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `import_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("import_hash").toString())); - } - if (!jsonObj.get("export_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `export_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("export_hash").toString())); - } - if (!jsonObj.get("rich_header_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rich_header_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rich_header_hash").toString())); - } - if (jsonObj.get("sections") != null && !jsonObj.get("sections").isJsonNull()) { - // validate the required field `sections` - SectionModel.validateJsonElement(jsonObj.get("sections")); - } - if (jsonObj.get("imports") != null && !jsonObj.get("imports").isJsonNull()) { - // validate the required field `imports` - ImportModel.validateJsonElement(jsonObj.get("imports")); - } - if (jsonObj.get("exports") != null && !jsonObj.get("exports").isJsonNull()) { - // validate the required field `exports` - ExportModel.validateJsonElement(jsonObj.get("exports")); - } - if (jsonObj.get("icon_data") != null && !jsonObj.get("icon_data").isJsonNull()) { - // validate the required field `icon_data` - IconModel.validateJsonElement(jsonObj.get("icon_data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PEModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PEModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PEModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PEModel 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 PEModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PEModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PEModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of PEModel - * @throws IOException if the JSON string is invalid with respect to PEModel - */ - public static PEModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PEModel.class); - } - - /** - * Convert an instance of PEModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/PaginationModel.java b/src/main/java/ai/reveng/model/PaginationModel.java deleted file mode 100644 index 7b8cd18..0000000 --- a/src/main/java/ai/reveng/model/PaginationModel.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.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * PaginationModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class PaginationModel { - public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; - @SerializedName(SERIALIZED_NAME_PAGE_SIZE) - @javax.annotation.Nonnull - private Integer pageSize; - - public static final String SERIALIZED_NAME_PAGE_NUMBER = "page_number"; - @SerializedName(SERIALIZED_NAME_PAGE_NUMBER) - @javax.annotation.Nonnull - private Integer pageNumber; - - public static final String SERIALIZED_NAME_HAS_NEXT_PAGE = "has_next_page"; - @SerializedName(SERIALIZED_NAME_HAS_NEXT_PAGE) - @javax.annotation.Nonnull - private Boolean hasNextPage; - - public PaginationModel() { - } - - public PaginationModel pageSize(@javax.annotation.Nonnull Integer pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Get pageSize - * @return pageSize - */ - @javax.annotation.Nonnull - public Integer getPageSize() { - return pageSize; - } - - public void setPageSize(@javax.annotation.Nonnull Integer pageSize) { - this.pageSize = pageSize; - } - - - public PaginationModel pageNumber(@javax.annotation.Nonnull Integer pageNumber) { - this.pageNumber = pageNumber; - return this; - } - - /** - * Get pageNumber - * @return pageNumber - */ - @javax.annotation.Nonnull - public Integer getPageNumber() { - return pageNumber; - } - - public void setPageNumber(@javax.annotation.Nonnull Integer pageNumber) { - this.pageNumber = pageNumber; - } - - - public PaginationModel hasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { - this.hasNextPage = hasNextPage; - return this; - } - - /** - * Get hasNextPage - * @return hasNextPage - */ - @javax.annotation.Nonnull - public Boolean getHasNextPage() { - return hasNextPage; - } - - public void setHasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { - this.hasNextPage = hasNextPage; - } - - /** - * 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 PaginationModel instance itself - */ - public PaginationModel 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; - } - PaginationModel paginationModel = (PaginationModel) o; - return Objects.equals(this.pageSize, paginationModel.pageSize) && - Objects.equals(this.pageNumber, paginationModel.pageNumber) && - Objects.equals(this.hasNextPage, paginationModel.hasNextPage)&& - Objects.equals(this.additionalProperties, paginationModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(pageSize, pageNumber, hasNextPage, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PaginationModel {\n"); - sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); - sb.append(" pageNumber: ").append(toIndentedString(pageNumber)).append("\n"); - sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("page_size", "page_number", "has_next_page")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("page_size", "page_number", "has_next_page")); - } - - /** - * 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 PaginationModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PaginationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in PaginationModel is not found in the empty JSON string", PaginationModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PaginationModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PaginationModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PaginationModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PaginationModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PaginationModel 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 PaginationModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PaginationModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PaginationModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of PaginationModel - * @throws IOException if the JSON string is invalid with respect to PaginationModel - */ - public static PaginationModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PaginationModel.class); - } - - /** - * Convert an instance of PaginationModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Params.java b/src/main/java/ai/reveng/model/Params.java deleted file mode 100644 index 349234b..0000000 --- a/src/main/java/ai/reveng/model/Params.java +++ /dev/null @@ -1,457 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Params - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Params { - public static final String SERIALIZED_NAME_DEBUG_HASH = "debug_hash"; - @SerializedName(SERIALIZED_NAME_DEBUG_HASH) - @javax.annotation.Nullable - private String debugHash; - - public static final String SERIALIZED_NAME_BINARY_SIZE = "binary_size"; - @SerializedName(SERIALIZED_NAME_BINARY_SIZE) - @javax.annotation.Nonnull - private Integer binarySize; - - public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; - @SerializedName(SERIALIZED_NAME_ARCHITECTURE) - @javax.annotation.Nonnull - private String architecture; - - public static final String SERIALIZED_NAME_BINARY_TYPE = "binary_type"; - @SerializedName(SERIALIZED_NAME_BINARY_TYPE) - @javax.annotation.Nonnull - private String binaryType; - - public static final String SERIALIZED_NAME_BINARY_FORMAT = "binary_format"; - @SerializedName(SERIALIZED_NAME_BINARY_FORMAT) - @javax.annotation.Nonnull - private String binaryFormat; - - public static final String SERIALIZED_NAME_BINARY_DYNAMIC = "binary_dynamic"; - @SerializedName(SERIALIZED_NAME_BINARY_DYNAMIC) - @javax.annotation.Nonnull - private Boolean binaryDynamic; - - public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; - @SerializedName(SERIALIZED_NAME_MODEL_NAME) - @javax.annotation.Nonnull - private String modelName; - - public Params() { - } - - public Params debugHash(@javax.annotation.Nullable String debugHash) { - this.debugHash = debugHash; - return this; - } - - /** - * The debug hash, if one was supplied - * @return debugHash - */ - @javax.annotation.Nullable - public String getDebugHash() { - return debugHash; - } - - public void setDebugHash(@javax.annotation.Nullable String debugHash) { - this.debugHash = debugHash; - } - - - public Params binarySize(@javax.annotation.Nonnull Integer binarySize) { - this.binarySize = binarySize; - return this; - } - - /** - * The size of the binary data - * @return binarySize - */ - @javax.annotation.Nonnull - public Integer getBinarySize() { - return binarySize; - } - - public void setBinarySize(@javax.annotation.Nonnull Integer binarySize) { - this.binarySize = binarySize; - } - - - public Params architecture(@javax.annotation.Nonnull String architecture) { - this.architecture = architecture; - return this; - } - - /** - * The architecture of the binary data - * @return architecture - */ - @javax.annotation.Nonnull - public String getArchitecture() { - return architecture; - } - - public void setArchitecture(@javax.annotation.Nonnull String architecture) { - this.architecture = architecture; - } - - - public Params binaryType(@javax.annotation.Nonnull String binaryType) { - this.binaryType = binaryType; - return this; - } - - /** - * The type of binary data - * @return binaryType - */ - @javax.annotation.Nonnull - public String getBinaryType() { - return binaryType; - } - - public void setBinaryType(@javax.annotation.Nonnull String binaryType) { - this.binaryType = binaryType; - } - - - public Params binaryFormat(@javax.annotation.Nonnull String binaryFormat) { - this.binaryFormat = binaryFormat; - return this; - } - - /** - * The format of the binary data - * @return binaryFormat - */ - @javax.annotation.Nonnull - public String getBinaryFormat() { - return binaryFormat; - } - - public void setBinaryFormat(@javax.annotation.Nonnull String binaryFormat) { - this.binaryFormat = binaryFormat; - } - - - public Params binaryDynamic(@javax.annotation.Nonnull Boolean binaryDynamic) { - this.binaryDynamic = binaryDynamic; - return this; - } - - /** - * Whether the binary data is dynamic - * @return binaryDynamic - */ - @javax.annotation.Nonnull - public Boolean getBinaryDynamic() { - return binaryDynamic; - } - - public void setBinaryDynamic(@javax.annotation.Nonnull Boolean binaryDynamic) { - this.binaryDynamic = binaryDynamic; - } - - - public Params modelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - return this; - } - - /** - * The name of the model - * @return modelName - */ - @javax.annotation.Nonnull - public String getModelName() { - return modelName; - } - - public void setModelName(@javax.annotation.Nonnull String modelName) { - this.modelName = modelName; - } - - /** - * 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 Params instance itself - */ - public Params 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; - } - Params params = (Params) o; - return Objects.equals(this.debugHash, params.debugHash) && - Objects.equals(this.binarySize, params.binarySize) && - Objects.equals(this.architecture, params.architecture) && - Objects.equals(this.binaryType, params.binaryType) && - Objects.equals(this.binaryFormat, params.binaryFormat) && - Objects.equals(this.binaryDynamic, params.binaryDynamic) && - Objects.equals(this.modelName, params.modelName)&& - Objects.equals(this.additionalProperties, params.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(debugHash, binarySize, architecture, binaryType, binaryFormat, binaryDynamic, modelName, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Params {\n"); - sb.append(" debugHash: ").append(toIndentedString(debugHash)).append("\n"); - sb.append(" binarySize: ").append(toIndentedString(binarySize)).append("\n"); - sb.append(" architecture: ").append(toIndentedString(architecture)).append("\n"); - sb.append(" binaryType: ").append(toIndentedString(binaryType)).append("\n"); - sb.append(" binaryFormat: ").append(toIndentedString(binaryFormat)).append("\n"); - sb.append(" binaryDynamic: ").append(toIndentedString(binaryDynamic)).append("\n"); - sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("debug_hash", "binary_size", "architecture", "binary_type", "binary_format", "binary_dynamic", "model_name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("debug_hash", "binary_size", "architecture", "binary_type", "binary_format", "binary_dynamic", "model_name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Params - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Params.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Params is not found in the empty JSON string", Params.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Params.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("debug_hash") != null && !jsonObj.get("debug_hash").isJsonNull()) && !jsonObj.get("debug_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `debug_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("debug_hash").toString())); - } - if (!jsonObj.get("architecture").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `architecture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("architecture").toString())); - } - if (!jsonObj.get("binary_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_type").toString())); - } - if (!jsonObj.get("binary_format").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_format").toString())); - } - if (!jsonObj.get("model_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Params.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Params' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Params.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Params 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 Params read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Params instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Params given an JSON string - * - * @param jsonString JSON string - * @return An instance of Params - * @throws IOException if the JSON string is invalid with respect to Params - */ - public static Params fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Params.class); - } - - /** - * Convert an instance of Params to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Platform.java b/src/main/java/ai/reveng/model/Platform.java deleted file mode 100644 index 21d9788..0000000 --- a/src/main/java/ai/reveng/model/Platform.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets Platform - */ -@JsonAdapter(Platform.Adapter.class) -public enum Platform { - - LINUX("linux"), - - WINDOWS("windows"), - - ANDROID("android"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - Platform(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Platform fromValue(String value) { - for (Platform b : Platform.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final Platform enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Platform read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Platform.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - Platform.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/PutAnalysisStringsRequest.java b/src/main/java/ai/reveng/model/PutAnalysisStringsRequest.java deleted file mode 100644 index c09daaf..0000000 --- a/src/main/java/ai/reveng/model/PutAnalysisStringsRequest.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.AnalysisStringInput; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * PutAnalysisStringsRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class PutAnalysisStringsRequest { - public static final String SERIALIZED_NAME_STRINGS = "strings"; - @SerializedName(SERIALIZED_NAME_STRINGS) - @javax.annotation.Nonnull - private List strings = new ArrayList<>(); - - public PutAnalysisStringsRequest() { - } - - public PutAnalysisStringsRequest strings(@javax.annotation.Nonnull List strings) { - this.strings = strings; - return this; - } - - public PutAnalysisStringsRequest addStringsItem(AnalysisStringInput stringsItem) { - if (this.strings == null) { - this.strings = new ArrayList<>(); - } - this.strings.add(stringsItem); - return this; - } - - /** - * The strings to add to the analysis - * @return strings - */ - @javax.annotation.Nonnull - public List getStrings() { - return strings; - } - - public void setStrings(@javax.annotation.Nonnull List strings) { - this.strings = strings; - } - - /** - * 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 PutAnalysisStringsRequest instance itself - */ - public PutAnalysisStringsRequest 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; - } - PutAnalysisStringsRequest putAnalysisStringsRequest = (PutAnalysisStringsRequest) o; - return Objects.equals(this.strings, putAnalysisStringsRequest.strings)&& - Objects.equals(this.additionalProperties, putAnalysisStringsRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(strings, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PutAnalysisStringsRequest {\n"); - sb.append(" strings: ").append(toIndentedString(strings)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("strings")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("strings")); - } - - /** - * 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 PutAnalysisStringsRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PutAnalysisStringsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in PutAnalysisStringsRequest is not found in the empty JSON string", PutAnalysisStringsRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PutAnalysisStringsRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("strings") != null) { - if (!jsonObj.get("strings").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `strings` to be an array in the JSON string but got `%s`", jsonObj.get("strings").toString())); - } - JsonArray jsonArraystrings = jsonObj.getAsJsonArray("strings"); - // validate the required field `strings` (array) - for (int i = 0; i < jsonArraystrings.size(); i++) { - AnalysisStringInput.validateJsonElement(jsonArraystrings.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PutAnalysisStringsRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PutAnalysisStringsRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PutAnalysisStringsRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PutAnalysisStringsRequest 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 PutAnalysisStringsRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - PutAnalysisStringsRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PutAnalysisStringsRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of PutAnalysisStringsRequest - * @throws IOException if the JSON string is invalid with respect to PutAnalysisStringsRequest - */ - public static PutAnalysisStringsRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PutAnalysisStringsRequest.class); - } - - /** - * Convert an instance of PutAnalysisStringsRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/QueuedWorkflowTaskResponse.java b/src/main/java/ai/reveng/model/QueuedWorkflowTaskResponse.java deleted file mode 100644 index 18aeb9f..0000000 --- a/src/main/java/ai/reveng/model/QueuedWorkflowTaskResponse.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * QueuedWorkflowTaskResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class QueuedWorkflowTaskResponse { - public static final String SERIALIZED_NAME_TASK_ID = "task_id"; - @SerializedName(SERIALIZED_NAME_TASK_ID) - @javax.annotation.Nonnull - private String taskId; - - public QueuedWorkflowTaskResponse() { - } - - public QueuedWorkflowTaskResponse taskId(@javax.annotation.Nonnull String taskId) { - this.taskId = taskId; - return this; - } - - /** - * Get taskId - * @return taskId - */ - @javax.annotation.Nonnull - public String getTaskId() { - return taskId; - } - - public void setTaskId(@javax.annotation.Nonnull String taskId) { - this.taskId = taskId; - } - - /** - * 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 QueuedWorkflowTaskResponse instance itself - */ - public QueuedWorkflowTaskResponse 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; - } - QueuedWorkflowTaskResponse queuedWorkflowTaskResponse = (QueuedWorkflowTaskResponse) o; - return Objects.equals(this.taskId, queuedWorkflowTaskResponse.taskId)&& - Objects.equals(this.additionalProperties, queuedWorkflowTaskResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(taskId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueuedWorkflowTaskResponse {\n"); - sb.append(" taskId: ").append(toIndentedString(taskId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("task_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("task_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 QueuedWorkflowTaskResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueuedWorkflowTaskResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in QueuedWorkflowTaskResponse is not found in the empty JSON string", QueuedWorkflowTaskResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : QueuedWorkflowTaskResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("task_id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_id").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueuedWorkflowTaskResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'QueuedWorkflowTaskResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(QueuedWorkflowTaskResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, QueuedWorkflowTaskResponse 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 QueuedWorkflowTaskResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - QueuedWorkflowTaskResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of QueuedWorkflowTaskResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueuedWorkflowTaskResponse - * @throws IOException if the JSON string is invalid with respect to QueuedWorkflowTaskResponse - */ - public static QueuedWorkflowTaskResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, QueuedWorkflowTaskResponse.class); - } - - /** - * Convert an instance of QueuedWorkflowTaskResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ReAnalysisForm.java b/src/main/java/ai/reveng/model/ReAnalysisForm.java deleted file mode 100644 index 66dad14..0000000 --- a/src/main/java/ai/reveng/model/ReAnalysisForm.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Form Model for receiving the analysis request - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ReAnalysisForm { - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - @javax.annotation.Nullable - private List tags = new ArrayList<>(); - - public static final String SERIALIZED_NAME_COMMAND_LINE_ARGS = "command_line_args"; - @SerializedName(SERIALIZED_NAME_COMMAND_LINE_ARGS) - @javax.annotation.Nullable - private String commandLineArgs = ""; - - public static final String SERIALIZED_NAME_PRIORITY = "priority"; - @Deprecated - @SerializedName(SERIALIZED_NAME_PRIORITY) - @javax.annotation.Nullable - private Integer priority = 0; - - public static final String SERIALIZED_NAME_ESSENTIAL = "essential"; - @SerializedName(SERIALIZED_NAME_ESSENTIAL) - @javax.annotation.Nullable - private Boolean essential = true; - - public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; - @SerializedName(SERIALIZED_NAME_MODEL_NAME) - @javax.annotation.Nullable - private String modelName; - - public static final String SERIALIZED_NAME_NO_CACHE = "no_cache"; - @SerializedName(SERIALIZED_NAME_NO_CACHE) - @javax.annotation.Nullable - private Boolean noCache = false; - - public ReAnalysisForm() { - } - - public ReAnalysisForm tags(@javax.annotation.Nullable List tags) { - this.tags = tags; - return this; - } - - public ReAnalysisForm addTagsItem(String tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Tags associated with the analysis - * @return tags - */ - @javax.annotation.Nullable - public List getTags() { - return tags; - } - - public void setTags(@javax.annotation.Nullable List tags) { - this.tags = tags; - } - - - public ReAnalysisForm commandLineArgs(@javax.annotation.Nullable String commandLineArgs) { - this.commandLineArgs = commandLineArgs; - return this; - } - - /** - * Command line arguments for dynamic execution - * @return commandLineArgs - */ - @javax.annotation.Nullable - public String getCommandLineArgs() { - return commandLineArgs; - } - - public void setCommandLineArgs(@javax.annotation.Nullable String commandLineArgs) { - this.commandLineArgs = commandLineArgs; - } - - - @Deprecated - public ReAnalysisForm priority(@javax.annotation.Nullable Integer priority) { - this.priority = priority; - return this; - } - - /** - * Priority of the analysis - * @return priority - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Integer getPriority() { - return priority; - } - - @Deprecated - public void setPriority(@javax.annotation.Nullable Integer priority) { - this.priority = priority; - } - - - public ReAnalysisForm essential(@javax.annotation.Nullable Boolean essential) { - this.essential = essential; - return this; - } - - /** - * Only runs essential parts of the analysis, skips tags/sbom/cves etc. - * @return essential - */ - @javax.annotation.Nullable - public Boolean getEssential() { - return essential; - } - - public void setEssential(@javax.annotation.Nullable Boolean essential) { - this.essential = essential; - } - - - public ReAnalysisForm modelName(@javax.annotation.Nullable String modelName) { - this.modelName = modelName; - return this; - } - - /** - * Model name allows reprocessing using a different model - * @return modelName - */ - @javax.annotation.Nullable - public String getModelName() { - return modelName; - } - - public void setModelName(@javax.annotation.Nullable String modelName) { - this.modelName = modelName; - } - - - public ReAnalysisForm noCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - return this; - } - - /** - * When enabled, skips using cached data within the processing. - * @return noCache - */ - @javax.annotation.Nullable - public Boolean getNoCache() { - return noCache; - } - - public void setNoCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - } - - /** - * 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 ReAnalysisForm instance itself - */ - public ReAnalysisForm 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; - } - ReAnalysisForm reAnalysisForm = (ReAnalysisForm) o; - return Objects.equals(this.tags, reAnalysisForm.tags) && - Objects.equals(this.commandLineArgs, reAnalysisForm.commandLineArgs) && - Objects.equals(this.priority, reAnalysisForm.priority) && - Objects.equals(this.essential, reAnalysisForm.essential) && - Objects.equals(this.modelName, reAnalysisForm.modelName) && - Objects.equals(this.noCache, reAnalysisForm.noCache)&& - Objects.equals(this.additionalProperties, reAnalysisForm.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(tags, commandLineArgs, priority, essential, modelName, noCache, 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 ReAnalysisForm {\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" commandLineArgs: ").append(toIndentedString(commandLineArgs)).append("\n"); - sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); - sb.append(" essential: ").append(toIndentedString(essential)).append("\n"); - sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); - sb.append(" noCache: ").append(toIndentedString(noCache)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("tags", "command_line_args", "priority", "essential", "model_name", "no_cache")); - - // 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 ReAnalysisForm - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReAnalysisForm.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ReAnalysisForm is not found in the empty JSON string", ReAnalysisForm.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); - } - if ((jsonObj.get("command_line_args") != null && !jsonObj.get("command_line_args").isJsonNull()) && !jsonObj.get("command_line_args").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `command_line_args` to be a primitive type in the JSON string but got `%s`", jsonObj.get("command_line_args").toString())); - } - if ((jsonObj.get("model_name") != null && !jsonObj.get("model_name").isJsonNull()) && !jsonObj.get("model_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReAnalysisForm.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReAnalysisForm' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReAnalysisForm.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ReAnalysisForm 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 ReAnalysisForm read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ReAnalysisForm instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ReAnalysisForm given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReAnalysisForm - * @throws IOException if the JSON string is invalid with respect to ReAnalysisForm - */ - public static ReAnalysisForm fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReAnalysisForm.class); - } - - /** - * Convert an instance of ReAnalysisForm to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Recent.java b/src/main/java/ai/reveng/model/Recent.java deleted file mode 100644 index bf19a3d..0000000 --- a/src/main/java/ai/reveng/model/Recent.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.AnalysisRecord; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Recent - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Recent { - public static final String SERIALIZED_NAME_RESULTS = "results"; - @SerializedName(SERIALIZED_NAME_RESULTS) - @javax.annotation.Nonnull - private List results = new ArrayList<>(); - - public Recent() { - } - - public Recent results(@javax.annotation.Nonnull List results) { - this.results = results; - return this; - } - - public Recent addResultsItem(AnalysisRecord resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * 2D List containing the results of the analysis - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(@javax.annotation.Nonnull List results) { - this.results = results; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the Recent instance itself - */ - public Recent 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; - } - Recent recent = (Recent) o; - return Objects.equals(this.results, recent.results)&& - Objects.equals(this.additionalProperties, recent.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(results, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Recent {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("results")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("results")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Recent - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Recent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Recent is not found in the empty JSON string", Recent.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Recent.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("results") != null) { - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); - } - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - AnalysisRecord.validateJsonElement(jsonArrayresults.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Recent.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Recent' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Recent.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Recent 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 Recent read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Recent instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Recent given an JSON string - * - * @param jsonString JSON string - * @return An instance of Recent - * @throws IOException if the JSON string is invalid with respect to Recent - */ - public static Recent fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Recent.class); - } - - /** - * Convert an instance of Recent to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/RelativeBinaryResponse.java b/src/main/java/ai/reveng/model/RelativeBinaryResponse.java deleted file mode 100644 index 92b7f8d..0000000 --- a/src/main/java/ai/reveng/model/RelativeBinaryResponse.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * RelativeBinaryResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class RelativeBinaryResponse { - public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nullable - private Integer analysisId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_SHA256 = "sha256"; - @SerializedName(SERIALIZED_NAME_SHA256) - @javax.annotation.Nonnull - private String sha256; - - public RelativeBinaryResponse() { - } - - public RelativeBinaryResponse binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * ID of the relative binary - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public RelativeBinaryResponse analysisId(@javax.annotation.Nullable Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * ID of the active analysis for this binary - * @return analysisId - */ - @javax.annotation.Nullable - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nullable Integer analysisId) { - this.analysisId = analysisId; - } - - - public RelativeBinaryResponse name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the relative binary - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public RelativeBinaryResponse sha256(@javax.annotation.Nonnull String sha256) { - this.sha256 = sha256; - return this; - } - - /** - * SHA256 hash of the relative binary - * @return sha256 - */ - @javax.annotation.Nonnull - public String getSha256() { - return sha256; - } - - public void setSha256(@javax.annotation.Nonnull String sha256) { - this.sha256 = sha256; - } - - /** - * 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 RelativeBinaryResponse instance itself - */ - public RelativeBinaryResponse 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; - } - RelativeBinaryResponse relativeBinaryResponse = (RelativeBinaryResponse) o; - return Objects.equals(this.binaryId, relativeBinaryResponse.binaryId) && - Objects.equals(this.analysisId, relativeBinaryResponse.analysisId) && - Objects.equals(this.name, relativeBinaryResponse.name) && - Objects.equals(this.sha256, relativeBinaryResponse.sha256)&& - Objects.equals(this.additionalProperties, relativeBinaryResponse.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(binaryId, analysisId, name, sha256, 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 RelativeBinaryResponse {\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sha256: ").append(toIndentedString(sha256)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("binary_id", "analysis_id", "name", "sha256")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("binary_id", "name", "sha256")); - } - - /** - * 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 RelativeBinaryResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RelativeBinaryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RelativeBinaryResponse is not found in the empty JSON string", RelativeBinaryResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RelativeBinaryResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("sha256").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha256` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha256").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RelativeBinaryResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RelativeBinaryResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RelativeBinaryResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RelativeBinaryResponse 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 RelativeBinaryResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - RelativeBinaryResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RelativeBinaryResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of RelativeBinaryResponse - * @throws IOException if the JSON string is invalid with respect to RelativeBinaryResponse - */ - public static RelativeBinaryResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RelativeBinaryResponse.class); - } - - /** - * Convert an instance of RelativeBinaryResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/ReportAnalysisResponse.java b/src/main/java/ai/reveng/model/ReportAnalysisResponse.java deleted file mode 100644 index 5722c0d..0000000 --- a/src/main/java/ai/reveng/model/ReportAnalysisResponse.java +++ /dev/null @@ -1,582 +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 ai.reveng.model.IOC; -import ai.reveng.model.MITRETechnique; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ReportAnalysisResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ReportAnalysisResponse { - public static final String SERIALIZED_NAME_SUMMARY = "summary"; - @SerializedName(SERIALIZED_NAME_SUMMARY) - @javax.annotation.Nonnull - private String summary; - - /** - * The type of software being analyzed - */ - @JsonAdapter(SoftwareTypeEnum.Adapter.class) - public enum SoftwareTypeEnum { - MALICIOUS("Malicious"), - - BENIGN("Benign"), - - POTENTIALLY_UNWANTED_APPLICATION_PUA_("Potentially Unwanted Application (PUA)"), - - LEGITIMATE("Legitimate"), - - BACKDOORED_LEGITIMATE_SOFTWARE("Backdoored Legitimate Software"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - SoftwareTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SoftwareTypeEnum fromValue(String value) { - for (SoftwareTypeEnum b : SoftwareTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SoftwareTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SoftwareTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SoftwareTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SoftwareTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SOFTWARE_TYPE = "software_type"; - @SerializedName(SERIALIZED_NAME_SOFTWARE_TYPE) - @javax.annotation.Nonnull - private SoftwareTypeEnum softwareType; - - public static final String SERIALIZED_NAME_TOTAL_NUMBER_OF_FUNCTIONS = "total_number_of_functions"; - @SerializedName(SERIALIZED_NAME_TOTAL_NUMBER_OF_FUNCTIONS) - @javax.annotation.Nonnull - private Integer totalNumberOfFunctions; - - public static final String SERIALIZED_NAME_NUMBER_OF_ANALYSED_FUNCTIONS = "number_of_analysed_functions"; - @SerializedName(SERIALIZED_NAME_NUMBER_OF_ANALYSED_FUNCTIONS) - @javax.annotation.Nonnull - private Integer numberOfAnalysedFunctions; - - public static final String SERIALIZED_NAME_ATTACK_FLOW_SUMMARY = "attack_flow_summary"; - @SerializedName(SERIALIZED_NAME_ATTACK_FLOW_SUMMARY) - @javax.annotation.Nonnull - private String attackFlowSummary; - - public static final String SERIALIZED_NAME_IO_CS = "IOCs"; - @SerializedName(SERIALIZED_NAME_IO_CS) - @javax.annotation.Nonnull - private List ioCs = new ArrayList<>(); - - public static final String SERIALIZED_NAME_EXECUTABLE_TECHNIQUES = "executable_techniques"; - @SerializedName(SERIALIZED_NAME_EXECUTABLE_TECHNIQUES) - @javax.annotation.Nonnull - private List executableTechniques = new ArrayList<>(); - - public static final String SERIALIZED_NAME_YARA_RULE = "yara_rule"; - @SerializedName(SERIALIZED_NAME_YARA_RULE) - @javax.annotation.Nonnull - private String yaraRule; - - public ReportAnalysisResponse() { - } - - public ReportAnalysisResponse summary(@javax.annotation.Nonnull String summary) { - this.summary = summary; - return this; - } - - /** - * A markdown summary of the report - * @return summary - */ - @javax.annotation.Nonnull - public String getSummary() { - return summary; - } - - public void setSummary(@javax.annotation.Nonnull String summary) { - this.summary = summary; - } - - - public ReportAnalysisResponse softwareType(@javax.annotation.Nonnull SoftwareTypeEnum softwareType) { - this.softwareType = softwareType; - return this; - } - - /** - * The type of software being analyzed - * @return softwareType - */ - @javax.annotation.Nonnull - public SoftwareTypeEnum getSoftwareType() { - return softwareType; - } - - public void setSoftwareType(@javax.annotation.Nonnull SoftwareTypeEnum softwareType) { - this.softwareType = softwareType; - } - - - public ReportAnalysisResponse totalNumberOfFunctions(@javax.annotation.Nonnull Integer totalNumberOfFunctions) { - this.totalNumberOfFunctions = totalNumberOfFunctions; - return this; - } - - /** - * The total number of functions identified in the binary - * @return totalNumberOfFunctions - */ - @javax.annotation.Nonnull - public Integer getTotalNumberOfFunctions() { - return totalNumberOfFunctions; - } - - public void setTotalNumberOfFunctions(@javax.annotation.Nonnull Integer totalNumberOfFunctions) { - this.totalNumberOfFunctions = totalNumberOfFunctions; - } - - - public ReportAnalysisResponse numberOfAnalysedFunctions(@javax.annotation.Nonnull Integer numberOfAnalysedFunctions) { - this.numberOfAnalysedFunctions = numberOfAnalysedFunctions; - return this; - } - - /** - * The number of functions that were analyzed in the binary - * @return numberOfAnalysedFunctions - */ - @javax.annotation.Nonnull - public Integer getNumberOfAnalysedFunctions() { - return numberOfAnalysedFunctions; - } - - public void setNumberOfAnalysedFunctions(@javax.annotation.Nonnull Integer numberOfAnalysedFunctions) { - this.numberOfAnalysedFunctions = numberOfAnalysedFunctions; - } - - - public ReportAnalysisResponse attackFlowSummary(@javax.annotation.Nonnull String attackFlowSummary) { - this.attackFlowSummary = attackFlowSummary; - return this; - } - - /** - * A summary in markdown format of the attack flow - * @return attackFlowSummary - */ - @javax.annotation.Nonnull - public String getAttackFlowSummary() { - return attackFlowSummary; - } - - public void setAttackFlowSummary(@javax.annotation.Nonnull String attackFlowSummary) { - this.attackFlowSummary = attackFlowSummary; - } - - - public ReportAnalysisResponse ioCs(@javax.annotation.Nonnull List ioCs) { - this.ioCs = ioCs; - return this; - } - - public ReportAnalysisResponse addIoCsItem(IOC ioCsItem) { - if (this.ioCs == null) { - this.ioCs = new ArrayList<>(); - } - this.ioCs.add(ioCsItem); - return this; - } - - /** - * A list of IOCs (Indicators of Compromise) found in the analysis - * @return ioCs - */ - @javax.annotation.Nonnull - public List getIoCs() { - return ioCs; - } - - public void setIoCs(@javax.annotation.Nonnull List ioCs) { - this.ioCs = ioCs; - } - - - public ReportAnalysisResponse executableTechniques(@javax.annotation.Nonnull List executableTechniques) { - this.executableTechniques = executableTechniques; - return this; - } - - public ReportAnalysisResponse addExecutableTechniquesItem(MITRETechnique executableTechniquesItem) { - if (this.executableTechniques == null) { - this.executableTechniques = new ArrayList<>(); - } - this.executableTechniques.add(executableTechniquesItem); - return this; - } - - /** - * A series of MITRE Techniques found - * @return executableTechniques - */ - @javax.annotation.Nonnull - public List getExecutableTechniques() { - return executableTechniques; - } - - public void setExecutableTechniques(@javax.annotation.Nonnull List executableTechniques) { - this.executableTechniques = executableTechniques; - } - - - public ReportAnalysisResponse yaraRule(@javax.annotation.Nonnull String yaraRule) { - this.yaraRule = yaraRule; - return this; - } - - /** - * The YARA rule generated for the binary - * @return yaraRule - */ - @javax.annotation.Nonnull - public String getYaraRule() { - return yaraRule; - } - - public void setYaraRule(@javax.annotation.Nonnull String yaraRule) { - this.yaraRule = yaraRule; - } - - /** - * 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 ReportAnalysisResponse instance itself - */ - public ReportAnalysisResponse 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; - } - ReportAnalysisResponse reportAnalysisResponse = (ReportAnalysisResponse) o; - return Objects.equals(this.summary, reportAnalysisResponse.summary) && - Objects.equals(this.softwareType, reportAnalysisResponse.softwareType) && - Objects.equals(this.totalNumberOfFunctions, reportAnalysisResponse.totalNumberOfFunctions) && - Objects.equals(this.numberOfAnalysedFunctions, reportAnalysisResponse.numberOfAnalysedFunctions) && - Objects.equals(this.attackFlowSummary, reportAnalysisResponse.attackFlowSummary) && - Objects.equals(this.ioCs, reportAnalysisResponse.ioCs) && - Objects.equals(this.executableTechniques, reportAnalysisResponse.executableTechniques) && - Objects.equals(this.yaraRule, reportAnalysisResponse.yaraRule)&& - Objects.equals(this.additionalProperties, reportAnalysisResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(summary, softwareType, totalNumberOfFunctions, numberOfAnalysedFunctions, attackFlowSummary, ioCs, executableTechniques, yaraRule, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReportAnalysisResponse {\n"); - sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); - sb.append(" softwareType: ").append(toIndentedString(softwareType)).append("\n"); - sb.append(" totalNumberOfFunctions: ").append(toIndentedString(totalNumberOfFunctions)).append("\n"); - sb.append(" numberOfAnalysedFunctions: ").append(toIndentedString(numberOfAnalysedFunctions)).append("\n"); - sb.append(" attackFlowSummary: ").append(toIndentedString(attackFlowSummary)).append("\n"); - sb.append(" ioCs: ").append(toIndentedString(ioCs)).append("\n"); - sb.append(" executableTechniques: ").append(toIndentedString(executableTechniques)).append("\n"); - sb.append(" yaraRule: ").append(toIndentedString(yaraRule)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("summary", "software_type", "total_number_of_functions", "number_of_analysed_functions", "attack_flow_summary", "IOCs", "executable_techniques", "yara_rule")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("summary", "software_type", "total_number_of_functions", "number_of_analysed_functions", "attack_flow_summary", "IOCs", "executable_techniques", "yara_rule")); - } - - /** - * 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 ReportAnalysisResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReportAnalysisResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ReportAnalysisResponse is not found in the empty JSON string", ReportAnalysisResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReportAnalysisResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("summary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary").toString())); - } - if (!jsonObj.get("software_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `software_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("software_type").toString())); - } - // validate the required field `software_type` - SoftwareTypeEnum.validateJsonElement(jsonObj.get("software_type")); - if (!jsonObj.get("attack_flow_summary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `attack_flow_summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attack_flow_summary").toString())); - } - if (jsonObj.get("IOCs") != null) { - if (!jsonObj.get("IOCs").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `IOCs` to be an array in the JSON string but got `%s`", jsonObj.get("IOCs").toString())); - } - JsonArray jsonArrayioCs = jsonObj.getAsJsonArray("IOCs"); - // validate the required field `IOCs` (array) - for (int i = 0; i < jsonArrayioCs.size(); i++) { - IOC.validateJsonElement(jsonArrayioCs.get(i)); - } - } - if (jsonObj.get("executable_techniques") != null) { - if (!jsonObj.get("executable_techniques").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `executable_techniques` to be an array in the JSON string but got `%s`", jsonObj.get("executable_techniques").toString())); - } - JsonArray jsonArrayexecutableTechniques = jsonObj.getAsJsonArray("executable_techniques"); - // validate the required field `executable_techniques` (array) - for (int i = 0; i < jsonArrayexecutableTechniques.size(); i++) { - MITRETechnique.validateJsonElement(jsonArrayexecutableTechniques.get(i)); - } - } - if (!jsonObj.get("yara_rule").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `yara_rule` to be a primitive type in the JSON string but got `%s`", jsonObj.get("yara_rule").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReportAnalysisResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReportAnalysisResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ReportAnalysisResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ReportAnalysisResponse 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 ReportAnalysisResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ReportAnalysisResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ReportAnalysisResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReportAnalysisResponse - * @throws IOException if the JSON string is invalid with respect to ReportAnalysisResponse - */ - public static ReportAnalysisResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReportAnalysisResponse.class); - } - - /** - * Convert an instance of ReportAnalysisResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SBOM.java b/src/main/java/ai/reveng/model/SBOM.java deleted file mode 100644 index 3de5aca..0000000 --- a/src/main/java/ai/reveng/model/SBOM.java +++ /dev/null @@ -1,347 +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 ai.reveng.model.SBOMPackage; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SBOM - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SBOM { - public static final String SERIALIZED_NAME_PACKAGES = "packages"; - @SerializedName(SERIALIZED_NAME_PACKAGES) - @javax.annotation.Nonnull - private List packages = new ArrayList<>(); - - public static final String SERIALIZED_NAME_IMPORTED_LIBS = "imported_libs"; - @SerializedName(SERIALIZED_NAME_IMPORTED_LIBS) - @javax.annotation.Nonnull - private List importedLibs = new ArrayList<>(); - - public SBOM() { - } - - public SBOM packages(@javax.annotation.Nonnull List packages) { - this.packages = packages; - return this; - } - - public SBOM addPackagesItem(SBOMPackage packagesItem) { - if (this.packages == null) { - this.packages = new ArrayList<>(); - } - this.packages.add(packagesItem); - return this; - } - - /** - * The packages found - * @return packages - */ - @javax.annotation.Nonnull - public List getPackages() { - return packages; - } - - public void setPackages(@javax.annotation.Nonnull List packages) { - this.packages = packages; - } - - - public SBOM importedLibs(@javax.annotation.Nonnull List importedLibs) { - this.importedLibs = importedLibs; - return this; - } - - public SBOM addImportedLibsItem(String importedLibsItem) { - if (this.importedLibs == null) { - this.importedLibs = new ArrayList<>(); - } - this.importedLibs.add(importedLibsItem); - return this; - } - - /** - * The import libraries found - * @return importedLibs - */ - @javax.annotation.Nonnull - public List getImportedLibs() { - return importedLibs; - } - - public void setImportedLibs(@javax.annotation.Nonnull List importedLibs) { - this.importedLibs = importedLibs; - } - - /** - * 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 SBOM instance itself - */ - public SBOM 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; - } - SBOM SBOM = (SBOM) o; - return Objects.equals(this.packages, SBOM.packages) && - Objects.equals(this.importedLibs, SBOM.importedLibs)&& - Objects.equals(this.additionalProperties, SBOM.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(packages, importedLibs, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SBOM {\n"); - sb.append(" packages: ").append(toIndentedString(packages)).append("\n"); - sb.append(" importedLibs: ").append(toIndentedString(importedLibs)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("packages", "imported_libs")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("packages", "imported_libs")); - } - - /** - * 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 SBOM - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SBOM.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SBOM is not found in the empty JSON string", SBOM.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SBOM.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("packages") != null) { - if (!jsonObj.get("packages").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `packages` to be an array in the JSON string but got `%s`", jsonObj.get("packages").toString())); - } - JsonArray jsonArraypackages = jsonObj.getAsJsonArray("packages"); - // validate the required field `packages` (array) - for (int i = 0; i < jsonArraypackages.size(); i++) { - SBOMPackage.validateJsonElement(jsonArraypackages.get(i)); - } - } - // ensure the required json array is present - if (jsonObj.get("imported_libs") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("imported_libs").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `imported_libs` to be an array in the JSON string but got `%s`", jsonObj.get("imported_libs").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SBOM.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SBOM' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SBOM.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SBOM 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 SBOM read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SBOM instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SBOM given an JSON string - * - * @param jsonString JSON string - * @return An instance of SBOM - * @throws IOException if the JSON string is invalid with respect to SBOM - */ - public static SBOM fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SBOM.class); - } - - /** - * Convert an instance of SBOM to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SBOMPackage.java b/src/main/java/ai/reveng/model/SBOMPackage.java deleted file mode 100644 index d0b3fe3..0000000 --- a/src/main/java/ai/reveng/model/SBOMPackage.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SBOMPackage - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SBOMPackage { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - @javax.annotation.Nonnull - private String version; - - public SBOMPackage() { - } - - public SBOMPackage name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name of the package - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public SBOMPackage version(@javax.annotation.Nonnull String version) { - this.version = version; - return this; - } - - /** - * The version of the package - * @return version - */ - @javax.annotation.Nonnull - public String getVersion() { - return version; - } - - public void setVersion(@javax.annotation.Nonnull String version) { - this.version = version; - } - - /** - * 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 SBOMPackage instance itself - */ - public SBOMPackage 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; - } - SBOMPackage sbOMPackage = (SBOMPackage) o; - return Objects.equals(this.name, sbOMPackage.name) && - Objects.equals(this.version, sbOMPackage.version)&& - Objects.equals(this.additionalProperties, sbOMPackage.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, version, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SBOMPackage {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "version")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "version")); - } - - /** - * 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 SBOMPackage - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SBOMPackage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SBOMPackage is not found in the empty JSON string", SBOMPackage.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SBOMPackage.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SBOMPackage.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SBOMPackage' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SBOMPackage.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SBOMPackage 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 SBOMPackage read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SBOMPackage instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SBOMPackage given an JSON string - * - * @param jsonString JSON string - * @return An instance of SBOMPackage - * @throws IOException if the JSON string is invalid with respect to SBOMPackage - */ - public static SBOMPackage fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SBOMPackage.class); - } - - /** - * Convert an instance of SBOMPackage to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SandboxOptions.java b/src/main/java/ai/reveng/model/SandboxOptions.java deleted file mode 100644 index 58222bf..0000000 --- a/src/main/java/ai/reveng/model/SandboxOptions.java +++ /dev/null @@ -1,469 +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 ai.reveng.model.SandboxStartMethod; -import ai.reveng.model.SandboxTimeout; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SandboxOptions - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SandboxOptions { - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - @javax.annotation.Nullable - private Boolean enabled = false; - - public static final String SERIALIZED_NAME_COMMAND_LINE_ARGS = "command_line_args"; - @SerializedName(SERIALIZED_NAME_COMMAND_LINE_ARGS) - @javax.annotation.Nullable - private String commandLineArgs = ""; - - public static final String SERIALIZED_NAME_START_METHOD = "start_method"; - @SerializedName(SERIALIZED_NAME_START_METHOD) - @javax.annotation.Nullable - private SandboxStartMethod startMethod; - - public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; - @SerializedName(SERIALIZED_NAME_TIMEOUT) - @javax.annotation.Nullable - private SandboxTimeout timeout = SandboxTimeout.NUMBER_120; - - public static final String SERIALIZED_NAME_ARCHIVE_SHA256_HASH = "archive_sha_256_hash"; - @SerializedName(SERIALIZED_NAME_ARCHIVE_SHA256_HASH) - @javax.annotation.Nullable - private String archiveSha256Hash; - - public static final String SERIALIZED_NAME_ARCHIVE_ENTRY_PATH = "archive_entry_path"; - @SerializedName(SERIALIZED_NAME_ARCHIVE_ENTRY_PATH) - @javax.annotation.Nullable - private String archiveEntryPath; - - public static final String SERIALIZED_NAME_ARCHIVE_PASSWORD = "archive_password"; - @SerializedName(SERIALIZED_NAME_ARCHIVE_PASSWORD) - @javax.annotation.Nullable - private String archivePassword; - - public SandboxOptions() { - } - - public SandboxOptions enabled(@javax.annotation.Nullable Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * @return enabled - */ - @javax.annotation.Nullable - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(@javax.annotation.Nullable Boolean enabled) { - this.enabled = enabled; - } - - - public SandboxOptions commandLineArgs(@javax.annotation.Nullable String commandLineArgs) { - this.commandLineArgs = commandLineArgs; - return this; - } - - /** - * The command line parameters to pass to the dynamic execution sandbox. Requires `sandbox` to be True. - * @return commandLineArgs - */ - @javax.annotation.Nullable - public String getCommandLineArgs() { - return commandLineArgs; - } - - public void setCommandLineArgs(@javax.annotation.Nullable String commandLineArgs) { - this.commandLineArgs = commandLineArgs; - } - - - public SandboxOptions startMethod(@javax.annotation.Nullable SandboxStartMethod startMethod) { - this.startMethod = startMethod; - return this; - } - - /** - * The method used by the sandbox to launch the sample. - * @return startMethod - */ - @javax.annotation.Nullable - public SandboxStartMethod getStartMethod() { - return startMethod; - } - - public void setStartMethod(@javax.annotation.Nullable SandboxStartMethod startMethod) { - this.startMethod = startMethod; - } - - - public SandboxOptions timeout(@javax.annotation.Nullable SandboxTimeout timeout) { - this.timeout = timeout; - return this; - } - - /** - * Maximum execution time for the sandbox run, in seconds. Allowed values: 120 (2m), 180 (3m), 300 (5m), 600 (10m). - * @return timeout - */ - @javax.annotation.Nullable - public SandboxTimeout getTimeout() { - return timeout; - } - - public void setTimeout(@javax.annotation.Nullable SandboxTimeout timeout) { - this.timeout = timeout; - } - - - public SandboxOptions archiveSha256Hash(@javax.annotation.Nullable String archiveSha256Hash) { - this.archiveSha256Hash = archiveSha256Hash; - return this; - } - - /** - * Hash of the uploaded archive to run in the sandbox. Set this when submitting an archive. - * @return archiveSha256Hash - */ - @javax.annotation.Nullable - public String getArchiveSha256Hash() { - return archiveSha256Hash; - } - - public void setArchiveSha256Hash(@javax.annotation.Nullable String archiveSha256Hash) { - this.archiveSha256Hash = archiveSha256Hash; - } - - - public SandboxOptions archiveEntryPath(@javax.annotation.Nullable String archiveEntryPath) { - this.archiveEntryPath = archiveEntryPath; - return this; - } - - /** - * Path of the file inside the archive to execute. - * @return archiveEntryPath - */ - @javax.annotation.Nullable - public String getArchiveEntryPath() { - return archiveEntryPath; - } - - public void setArchiveEntryPath(@javax.annotation.Nullable String archiveEntryPath) { - this.archiveEntryPath = archiveEntryPath; - } - - - public SandboxOptions archivePassword(@javax.annotation.Nullable String archivePassword) { - this.archivePassword = archivePassword; - return this; - } - - /** - * Password required to extract the archive, if any. - * @return archivePassword - */ - @javax.annotation.Nullable - public String getArchivePassword() { - return archivePassword; - } - - public void setArchivePassword(@javax.annotation.Nullable String archivePassword) { - this.archivePassword = archivePassword; - } - - /** - * 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 SandboxOptions instance itself - */ - public SandboxOptions 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; - } - SandboxOptions sandboxOptions = (SandboxOptions) o; - return Objects.equals(this.enabled, sandboxOptions.enabled) && - Objects.equals(this.commandLineArgs, sandboxOptions.commandLineArgs) && - Objects.equals(this.startMethod, sandboxOptions.startMethod) && - Objects.equals(this.timeout, sandboxOptions.timeout) && - Objects.equals(this.archiveSha256Hash, sandboxOptions.archiveSha256Hash) && - Objects.equals(this.archiveEntryPath, sandboxOptions.archiveEntryPath) && - Objects.equals(this.archivePassword, sandboxOptions.archivePassword)&& - Objects.equals(this.additionalProperties, sandboxOptions.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(enabled, commandLineArgs, startMethod, timeout, archiveSha256Hash, archiveEntryPath, archivePassword, 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 SandboxOptions {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" commandLineArgs: ").append(toIndentedString(commandLineArgs)).append("\n"); - sb.append(" startMethod: ").append(toIndentedString(startMethod)).append("\n"); - sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); - sb.append(" archiveSha256Hash: ").append(toIndentedString(archiveSha256Hash)).append("\n"); - sb.append(" archiveEntryPath: ").append(toIndentedString(archiveEntryPath)).append("\n"); - sb.append(" archivePassword: ").append(toIndentedString(archivePassword)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("enabled", "command_line_args", "start_method", "timeout", "archive_sha_256_hash", "archive_entry_path", "archive_password")); - - // 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 SandboxOptions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SandboxOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SandboxOptions is not found in the empty JSON string", SandboxOptions.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("command_line_args") != null && !jsonObj.get("command_line_args").isJsonNull()) && !jsonObj.get("command_line_args").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `command_line_args` to be a primitive type in the JSON string but got `%s`", jsonObj.get("command_line_args").toString())); - } - // validate the optional field `start_method` - if (jsonObj.get("start_method") != null && !jsonObj.get("start_method").isJsonNull()) { - SandboxStartMethod.validateJsonElement(jsonObj.get("start_method")); - } - // validate the optional field `timeout` - if (jsonObj.get("timeout") != null && !jsonObj.get("timeout").isJsonNull()) { - SandboxTimeout.validateJsonElement(jsonObj.get("timeout")); - } - if ((jsonObj.get("archive_sha_256_hash") != null && !jsonObj.get("archive_sha_256_hash").isJsonNull()) && !jsonObj.get("archive_sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `archive_sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("archive_sha_256_hash").toString())); - } - if ((jsonObj.get("archive_entry_path") != null && !jsonObj.get("archive_entry_path").isJsonNull()) && !jsonObj.get("archive_entry_path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `archive_entry_path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("archive_entry_path").toString())); - } - if ((jsonObj.get("archive_password") != null && !jsonObj.get("archive_password").isJsonNull()) && !jsonObj.get("archive_password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `archive_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("archive_password").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SandboxOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SandboxOptions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SandboxOptions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SandboxOptions 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 SandboxOptions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SandboxOptions instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SandboxOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of SandboxOptions - * @throws IOException if the JSON string is invalid with respect to SandboxOptions - */ - public static SandboxOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SandboxOptions.class); - } - - /** - * Convert an instance of SandboxOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SandboxStartMethod.java b/src/main/java/ai/reveng/model/SandboxStartMethod.java deleted file mode 100644 index 3dc9641..0000000 --- a/src/main/java/ai/reveng/model/SandboxStartMethod.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets SandboxStartMethod - */ -@JsonAdapter(SandboxStartMethod.Adapter.class) -public enum SandboxStartMethod { - - STANDARD_USER_PROCESS("standard_user_process"), - - ADMINISTRATOR_PROCESS("administrator_process"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - SandboxStartMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SandboxStartMethod fromValue(String value) { - for (SandboxStartMethod b : SandboxStartMethod.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SandboxStartMethod enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SandboxStartMethod read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SandboxStartMethod.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SandboxStartMethod.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/SandboxTimeout.java b/src/main/java/ai/reveng/model/SandboxTimeout.java deleted file mode 100644 index 8c39702..0000000 --- a/src/main/java/ai/reveng/model/SandboxTimeout.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets SandboxTimeout - */ -@JsonAdapter(SandboxTimeout.Adapter.class) -public enum SandboxTimeout { - - NUMBER_120(120), - - NUMBER_180(180), - - NUMBER_300(300), - - NUMBER_600(600), - - NUMBER_unknown_default_open_api(11184809); - - private Integer value; - - SandboxTimeout(Integer value) { - this.value = value; - } - - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SandboxTimeout fromValue(Integer value) { - for (SandboxTimeout b : SandboxTimeout.values()) { - if (b.value.equals(value)) { - return b; - } - } - return NUMBER_unknown_default_open_api; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SandboxTimeout enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SandboxTimeout read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); - return SandboxTimeout.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - Integer value = jsonElement.getAsInt(); - SandboxTimeout.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/ScrapeThirdPartyConfig.java b/src/main/java/ai/reveng/model/ScrapeThirdPartyConfig.java deleted file mode 100644 index 0549e4d..0000000 --- a/src/main/java/ai/reveng/model/ScrapeThirdPartyConfig.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * ScrapeThirdPartyConfig - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ScrapeThirdPartyConfig { - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - @javax.annotation.Nullable - private Boolean enabled = false; - - public ScrapeThirdPartyConfig() { - } - - public ScrapeThirdPartyConfig enabled(@javax.annotation.Nullable Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * @return enabled - */ - @javax.annotation.Nullable - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(@javax.annotation.Nullable Boolean enabled) { - this.enabled = enabled; - } - - /** - * 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 ScrapeThirdPartyConfig instance itself - */ - public ScrapeThirdPartyConfig 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; - } - ScrapeThirdPartyConfig scrapeThirdPartyConfig = (ScrapeThirdPartyConfig) o; - return Objects.equals(this.enabled, scrapeThirdPartyConfig.enabled)&& - Objects.equals(this.additionalProperties, scrapeThirdPartyConfig.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(enabled, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ScrapeThirdPartyConfig {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("enabled")); - - // 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 ScrapeThirdPartyConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ScrapeThirdPartyConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ScrapeThirdPartyConfig is not found in the empty JSON string", ScrapeThirdPartyConfig.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ScrapeThirdPartyConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ScrapeThirdPartyConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ScrapeThirdPartyConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ScrapeThirdPartyConfig 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 ScrapeThirdPartyConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ScrapeThirdPartyConfig instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ScrapeThirdPartyConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ScrapeThirdPartyConfig - * @throws IOException if the JSON string is invalid with respect to ScrapeThirdPartyConfig - */ - public static ScrapeThirdPartyConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ScrapeThirdPartyConfig.class); - } - - /** - * Convert an instance of ScrapeThirdPartyConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SectionModel.java b/src/main/java/ai/reveng/model/SectionModel.java deleted file mode 100644 index 8663e76..0000000 --- a/src/main/java/ai/reveng/model/SectionModel.java +++ /dev/null @@ -1,333 +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 ai.reveng.model.SingleSectionModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SectionModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SectionModel { - public static final String SERIALIZED_NAME_NUMBER_OF_SECTIONS = "number_of_sections"; - @SerializedName(SERIALIZED_NAME_NUMBER_OF_SECTIONS) - @javax.annotation.Nonnull - private Integer numberOfSections; - - public static final String SERIALIZED_NAME_SECTIONS = "sections"; - @SerializedName(SERIALIZED_NAME_SECTIONS) - @javax.annotation.Nonnull - private List sections = new ArrayList<>(); - - public SectionModel() { - } - - public SectionModel numberOfSections(@javax.annotation.Nonnull Integer numberOfSections) { - this.numberOfSections = numberOfSections; - return this; - } - - /** - * Get numberOfSections - * @return numberOfSections - */ - @javax.annotation.Nonnull - public Integer getNumberOfSections() { - return numberOfSections; - } - - public void setNumberOfSections(@javax.annotation.Nonnull Integer numberOfSections) { - this.numberOfSections = numberOfSections; - } - - - public SectionModel sections(@javax.annotation.Nonnull List sections) { - this.sections = sections; - return this; - } - - public SectionModel addSectionsItem(SingleSectionModel sectionsItem) { - if (this.sections == null) { - this.sections = new ArrayList<>(); - } - this.sections.add(sectionsItem); - return this; - } - - /** - * Get sections - * @return sections - */ - @javax.annotation.Nonnull - public List getSections() { - return sections; - } - - public void setSections(@javax.annotation.Nonnull List sections) { - this.sections = sections; - } - - /** - * 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 SectionModel instance itself - */ - public SectionModel 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; - } - SectionModel sectionModel = (SectionModel) o; - return Objects.equals(this.numberOfSections, sectionModel.numberOfSections) && - Objects.equals(this.sections, sectionModel.sections)&& - Objects.equals(this.additionalProperties, sectionModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(numberOfSections, sections, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SectionModel {\n"); - sb.append(" numberOfSections: ").append(toIndentedString(numberOfSections)).append("\n"); - sb.append(" sections: ").append(toIndentedString(sections)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("number_of_sections", "sections")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("number_of_sections", "sections")); - } - - /** - * 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 SectionModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SectionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SectionModel is not found in the empty JSON string", SectionModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SectionModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("sections") != null) { - if (!jsonObj.get("sections").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sections` to be an array in the JSON string but got `%s`", jsonObj.get("sections").toString())); - } - JsonArray jsonArraysections = jsonObj.getAsJsonArray("sections"); - // validate the required field `sections` (array) - for (int i = 0; i < jsonArraysections.size(); i++) { - SingleSectionModel.validateJsonElement(jsonArraysections.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SectionModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SectionModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SectionModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SectionModel 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 SectionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SectionModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SectionModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SectionModel - * @throws IOException if the JSON string is invalid with respect to SectionModel - */ - public static SectionModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SectionModel.class); - } - - /** - * Convert an instance of SectionModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SecurityModel.java b/src/main/java/ai/reveng/model/SecurityModel.java deleted file mode 100644 index ac032e9..0000000 --- a/src/main/java/ai/reveng/model/SecurityModel.java +++ /dev/null @@ -1,546 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SecurityModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SecurityModel { - public static final String SERIALIZED_NAME_ASLR = "aslr"; - @SerializedName(SERIALIZED_NAME_ASLR) - @javax.annotation.Nonnull - private Boolean aslr; - - public static final String SERIALIZED_NAME_DEP = "dep"; - @SerializedName(SERIALIZED_NAME_DEP) - @javax.annotation.Nonnull - private Boolean dep; - - public static final String SERIALIZED_NAME_CFG = "cfg"; - @SerializedName(SERIALIZED_NAME_CFG) - @javax.annotation.Nonnull - private Boolean cfg; - - public static final String SERIALIZED_NAME_DRIVER_MODEL = "driver_model"; - @SerializedName(SERIALIZED_NAME_DRIVER_MODEL) - @javax.annotation.Nonnull - private Boolean driverModel; - - public static final String SERIALIZED_NAME_APP_CONTAINER = "app_container"; - @SerializedName(SERIALIZED_NAME_APP_CONTAINER) - @javax.annotation.Nonnull - private Boolean appContainer; - - public static final String SERIALIZED_NAME_TERMINAL_SERVER_AWARE = "terminal_server_aware"; - @SerializedName(SERIALIZED_NAME_TERMINAL_SERVER_AWARE) - @javax.annotation.Nonnull - private Boolean terminalServerAware; - - public static final String SERIALIZED_NAME_IMAGE_ISOLATION = "image_isolation"; - @SerializedName(SERIALIZED_NAME_IMAGE_ISOLATION) - @javax.annotation.Nonnull - private Boolean imageIsolation; - - public static final String SERIALIZED_NAME_CODE_INTEGRITY = "code_integrity"; - @SerializedName(SERIALIZED_NAME_CODE_INTEGRITY) - @javax.annotation.Nonnull - private Boolean codeIntegrity; - - public static final String SERIALIZED_NAME_HIGH_ENTROPY = "high_entropy"; - @SerializedName(SERIALIZED_NAME_HIGH_ENTROPY) - @javax.annotation.Nonnull - private Boolean highEntropy; - - public static final String SERIALIZED_NAME_SEH = "seh"; - @SerializedName(SERIALIZED_NAME_SEH) - @javax.annotation.Nonnull - private Boolean seh; - - public static final String SERIALIZED_NAME_BOUND_IMAGE = "bound_image"; - @SerializedName(SERIALIZED_NAME_BOUND_IMAGE) - @javax.annotation.Nonnull - private Boolean boundImage; - - public SecurityModel() { - } - - public SecurityModel aslr(@javax.annotation.Nonnull Boolean aslr) { - this.aslr = aslr; - return this; - } - - /** - * Get aslr - * @return aslr - */ - @javax.annotation.Nonnull - public Boolean getAslr() { - return aslr; - } - - public void setAslr(@javax.annotation.Nonnull Boolean aslr) { - this.aslr = aslr; - } - - - public SecurityModel dep(@javax.annotation.Nonnull Boolean dep) { - this.dep = dep; - return this; - } - - /** - * Get dep - * @return dep - */ - @javax.annotation.Nonnull - public Boolean getDep() { - return dep; - } - - public void setDep(@javax.annotation.Nonnull Boolean dep) { - this.dep = dep; - } - - - public SecurityModel cfg(@javax.annotation.Nonnull Boolean cfg) { - this.cfg = cfg; - return this; - } - - /** - * Get cfg - * @return cfg - */ - @javax.annotation.Nonnull - public Boolean getCfg() { - return cfg; - } - - public void setCfg(@javax.annotation.Nonnull Boolean cfg) { - this.cfg = cfg; - } - - - public SecurityModel driverModel(@javax.annotation.Nonnull Boolean driverModel) { - this.driverModel = driverModel; - return this; - } - - /** - * Get driverModel - * @return driverModel - */ - @javax.annotation.Nonnull - public Boolean getDriverModel() { - return driverModel; - } - - public void setDriverModel(@javax.annotation.Nonnull Boolean driverModel) { - this.driverModel = driverModel; - } - - - public SecurityModel appContainer(@javax.annotation.Nonnull Boolean appContainer) { - this.appContainer = appContainer; - return this; - } - - /** - * Get appContainer - * @return appContainer - */ - @javax.annotation.Nonnull - public Boolean getAppContainer() { - return appContainer; - } - - public void setAppContainer(@javax.annotation.Nonnull Boolean appContainer) { - this.appContainer = appContainer; - } - - - public SecurityModel terminalServerAware(@javax.annotation.Nonnull Boolean terminalServerAware) { - this.terminalServerAware = terminalServerAware; - return this; - } - - /** - * Get terminalServerAware - * @return terminalServerAware - */ - @javax.annotation.Nonnull - public Boolean getTerminalServerAware() { - return terminalServerAware; - } - - public void setTerminalServerAware(@javax.annotation.Nonnull Boolean terminalServerAware) { - this.terminalServerAware = terminalServerAware; - } - - - public SecurityModel imageIsolation(@javax.annotation.Nonnull Boolean imageIsolation) { - this.imageIsolation = imageIsolation; - return this; - } - - /** - * Get imageIsolation - * @return imageIsolation - */ - @javax.annotation.Nonnull - public Boolean getImageIsolation() { - return imageIsolation; - } - - public void setImageIsolation(@javax.annotation.Nonnull Boolean imageIsolation) { - this.imageIsolation = imageIsolation; - } - - - public SecurityModel codeIntegrity(@javax.annotation.Nonnull Boolean codeIntegrity) { - this.codeIntegrity = codeIntegrity; - return this; - } - - /** - * Get codeIntegrity - * @return codeIntegrity - */ - @javax.annotation.Nonnull - public Boolean getCodeIntegrity() { - return codeIntegrity; - } - - public void setCodeIntegrity(@javax.annotation.Nonnull Boolean codeIntegrity) { - this.codeIntegrity = codeIntegrity; - } - - - public SecurityModel highEntropy(@javax.annotation.Nonnull Boolean highEntropy) { - this.highEntropy = highEntropy; - return this; - } - - /** - * Get highEntropy - * @return highEntropy - */ - @javax.annotation.Nonnull - public Boolean getHighEntropy() { - return highEntropy; - } - - public void setHighEntropy(@javax.annotation.Nonnull Boolean highEntropy) { - this.highEntropy = highEntropy; - } - - - public SecurityModel seh(@javax.annotation.Nonnull Boolean seh) { - this.seh = seh; - return this; - } - - /** - * Get seh - * @return seh - */ - @javax.annotation.Nonnull - public Boolean getSeh() { - return seh; - } - - public void setSeh(@javax.annotation.Nonnull Boolean seh) { - this.seh = seh; - } - - - public SecurityModel boundImage(@javax.annotation.Nonnull Boolean boundImage) { - this.boundImage = boundImage; - return this; - } - - /** - * Get boundImage - * @return boundImage - */ - @javax.annotation.Nonnull - public Boolean getBoundImage() { - return boundImage; - } - - public void setBoundImage(@javax.annotation.Nonnull Boolean boundImage) { - this.boundImage = boundImage; - } - - /** - * 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 SecurityModel instance itself - */ - public SecurityModel 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; - } - SecurityModel securityModel = (SecurityModel) o; - return Objects.equals(this.aslr, securityModel.aslr) && - Objects.equals(this.dep, securityModel.dep) && - Objects.equals(this.cfg, securityModel.cfg) && - Objects.equals(this.driverModel, securityModel.driverModel) && - Objects.equals(this.appContainer, securityModel.appContainer) && - Objects.equals(this.terminalServerAware, securityModel.terminalServerAware) && - Objects.equals(this.imageIsolation, securityModel.imageIsolation) && - Objects.equals(this.codeIntegrity, securityModel.codeIntegrity) && - Objects.equals(this.highEntropy, securityModel.highEntropy) && - Objects.equals(this.seh, securityModel.seh) && - Objects.equals(this.boundImage, securityModel.boundImage)&& - Objects.equals(this.additionalProperties, securityModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(aslr, dep, cfg, driverModel, appContainer, terminalServerAware, imageIsolation, codeIntegrity, highEntropy, seh, boundImage, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SecurityModel {\n"); - sb.append(" aslr: ").append(toIndentedString(aslr)).append("\n"); - sb.append(" dep: ").append(toIndentedString(dep)).append("\n"); - sb.append(" cfg: ").append(toIndentedString(cfg)).append("\n"); - sb.append(" driverModel: ").append(toIndentedString(driverModel)).append("\n"); - sb.append(" appContainer: ").append(toIndentedString(appContainer)).append("\n"); - sb.append(" terminalServerAware: ").append(toIndentedString(terminalServerAware)).append("\n"); - sb.append(" imageIsolation: ").append(toIndentedString(imageIsolation)).append("\n"); - sb.append(" codeIntegrity: ").append(toIndentedString(codeIntegrity)).append("\n"); - sb.append(" highEntropy: ").append(toIndentedString(highEntropy)).append("\n"); - sb.append(" seh: ").append(toIndentedString(seh)).append("\n"); - sb.append(" boundImage: ").append(toIndentedString(boundImage)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("aslr", "dep", "cfg", "driver_model", "app_container", "terminal_server_aware", "image_isolation", "code_integrity", "high_entropy", "seh", "bound_image")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("aslr", "dep", "cfg", "driver_model", "app_container", "terminal_server_aware", "image_isolation", "code_integrity", "high_entropy", "seh", "bound_image")); - } - - /** - * 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 SecurityModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SecurityModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SecurityModel is not found in the empty JSON string", SecurityModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SecurityModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SecurityModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SecurityModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SecurityModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SecurityModel 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 SecurityModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SecurityModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SecurityModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SecurityModel - * @throws IOException if the JSON string is invalid with respect to SecurityModel - */ - public static SecurityModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SecurityModel.class); - } - - /** - * Convert an instance of SecurityModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SegmentInfo.java b/src/main/java/ai/reveng/model/SegmentInfo.java deleted file mode 100644 index b6e66ee..0000000 --- a/src/main/java/ai/reveng/model/SegmentInfo.java +++ /dev/null @@ -1,424 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Represents the information about a segment. Attributes: name: The name of the segment. r: Determines if the segment has read permission. w: Determines if the segment has write permission. x: Determines if the segment has execute permission. start: The start address of the segment. end: The end address of the segment. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SegmentInfo { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable - private String name = ""; - - public static final String SERIALIZED_NAME_R = "r"; - @SerializedName(SERIALIZED_NAME_R) - @javax.annotation.Nullable - private Boolean r; - - public static final String SERIALIZED_NAME_W = "w"; - @SerializedName(SERIALIZED_NAME_W) - @javax.annotation.Nullable - private Boolean w; - - public static final String SERIALIZED_NAME_X = "x"; - @SerializedName(SERIALIZED_NAME_X) - @javax.annotation.Nullable - private Boolean x; - - public static final String SERIALIZED_NAME_START = "start"; - @SerializedName(SERIALIZED_NAME_START) - @javax.annotation.Nullable - private Integer start = 0; - - public static final String SERIALIZED_NAME_END = "end"; - @SerializedName(SERIALIZED_NAME_END) - @javax.annotation.Nullable - private Integer end = 0; - - public SegmentInfo() { - } - - public SegmentInfo name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - - public SegmentInfo r(@javax.annotation.Nullable Boolean r) { - this.r = r; - return this; - } - - /** - * Get r - * @return r - */ - @javax.annotation.Nullable - public Boolean getR() { - return r; - } - - public void setR(@javax.annotation.Nullable Boolean r) { - this.r = r; - } - - - public SegmentInfo w(@javax.annotation.Nullable Boolean w) { - this.w = w; - return this; - } - - /** - * Get w - * @return w - */ - @javax.annotation.Nullable - public Boolean getW() { - return w; - } - - public void setW(@javax.annotation.Nullable Boolean w) { - this.w = w; - } - - - public SegmentInfo x(@javax.annotation.Nullable Boolean x) { - this.x = x; - return this; - } - - /** - * Get x - * @return x - */ - @javax.annotation.Nullable - public Boolean getX() { - return x; - } - - public void setX(@javax.annotation.Nullable Boolean x) { - this.x = x; - } - - - public SegmentInfo start(@javax.annotation.Nullable Integer start) { - this.start = start; - return this; - } - - /** - * Get start - * @return start - */ - @javax.annotation.Nullable - public Integer getStart() { - return start; - } - - public void setStart(@javax.annotation.Nullable Integer start) { - this.start = start; - } - - - public SegmentInfo end(@javax.annotation.Nullable Integer end) { - this.end = end; - return this; - } - - /** - * Get end - * @return end - */ - @javax.annotation.Nullable - public Integer getEnd() { - return end; - } - - public void setEnd(@javax.annotation.Nullable Integer end) { - this.end = end; - } - - /** - * 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 SegmentInfo instance itself - */ - public SegmentInfo 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; - } - SegmentInfo segmentInfo = (SegmentInfo) o; - return Objects.equals(this.name, segmentInfo.name) && - Objects.equals(this.r, segmentInfo.r) && - Objects.equals(this.w, segmentInfo.w) && - Objects.equals(this.x, segmentInfo.x) && - Objects.equals(this.start, segmentInfo.start) && - Objects.equals(this.end, segmentInfo.end)&& - Objects.equals(this.additionalProperties, segmentInfo.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(name, r, w, x, start, end, 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 SegmentInfo {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" r: ").append(toIndentedString(r)).append("\n"); - sb.append(" w: ").append(toIndentedString(w)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" start: ").append(toIndentedString(start)).append("\n"); - sb.append(" end: ").append(toIndentedString(end)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "r", "w", "x", "start", "end")); - - // 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 SegmentInfo - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SegmentInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SegmentInfo is not found in the empty JSON string", SegmentInfo.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SegmentInfo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SegmentInfo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SegmentInfo.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SegmentInfo 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 SegmentInfo read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SegmentInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SegmentInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of SegmentInfo - * @throws IOException if the JSON string is invalid with respect to SegmentInfo - */ - public static SegmentInfo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SegmentInfo.class); - } - - /** - * Convert an instance of SegmentInfo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SingleCodeCertificateModel.java b/src/main/java/ai/reveng/model/SingleCodeCertificateModel.java deleted file mode 100644 index 3177e66..0000000 --- a/src/main/java/ai/reveng/model/SingleCodeCertificateModel.java +++ /dev/null @@ -1,431 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SingleCodeCertificateModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SingleCodeCertificateModel { - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - @javax.annotation.Nonnull - private Integer version; - - public static final String SERIALIZED_NAME_ISSUED_ON = "issued_on"; - @SerializedName(SERIALIZED_NAME_ISSUED_ON) - @javax.annotation.Nonnull - private String issuedOn; - - public static final String SERIALIZED_NAME_EXPIRES_ON = "expires_on"; - @SerializedName(SERIALIZED_NAME_EXPIRES_ON) - @javax.annotation.Nonnull - private String expiresOn; - - public static final String SERIALIZED_NAME_ISSUER_NAME = "issuer_name"; - @SerializedName(SERIALIZED_NAME_ISSUER_NAME) - @javax.annotation.Nonnull - private String issuerName; - - public static final String SERIALIZED_NAME_SERIAL_NUMBER = "serial_number"; - @SerializedName(SERIALIZED_NAME_SERIAL_NUMBER) - @javax.annotation.Nonnull - private String serialNumber; - - public static final String SERIALIZED_NAME_SUBJECT_NAME = "subject_name"; - @SerializedName(SERIALIZED_NAME_SUBJECT_NAME) - @javax.annotation.Nonnull - private String subjectName; - - public SingleCodeCertificateModel() { - } - - public SingleCodeCertificateModel version(@javax.annotation.Nonnull Integer version) { - this.version = version; - return this; - } - - /** - * Get version - * @return version - */ - @javax.annotation.Nonnull - public Integer getVersion() { - return version; - } - - public void setVersion(@javax.annotation.Nonnull Integer version) { - this.version = version; - } - - - public SingleCodeCertificateModel issuedOn(@javax.annotation.Nonnull String issuedOn) { - this.issuedOn = issuedOn; - return this; - } - - /** - * Get issuedOn - * @return issuedOn - */ - @javax.annotation.Nonnull - public String getIssuedOn() { - return issuedOn; - } - - public void setIssuedOn(@javax.annotation.Nonnull String issuedOn) { - this.issuedOn = issuedOn; - } - - - public SingleCodeCertificateModel expiresOn(@javax.annotation.Nonnull String expiresOn) { - this.expiresOn = expiresOn; - return this; - } - - /** - * Get expiresOn - * @return expiresOn - */ - @javax.annotation.Nonnull - public String getExpiresOn() { - return expiresOn; - } - - public void setExpiresOn(@javax.annotation.Nonnull String expiresOn) { - this.expiresOn = expiresOn; - } - - - public SingleCodeCertificateModel issuerName(@javax.annotation.Nonnull String issuerName) { - this.issuerName = issuerName; - return this; - } - - /** - * Get issuerName - * @return issuerName - */ - @javax.annotation.Nonnull - public String getIssuerName() { - return issuerName; - } - - public void setIssuerName(@javax.annotation.Nonnull String issuerName) { - this.issuerName = issuerName; - } - - - public SingleCodeCertificateModel serialNumber(@javax.annotation.Nonnull String serialNumber) { - this.serialNumber = serialNumber; - return this; - } - - /** - * Get serialNumber - * @return serialNumber - */ - @javax.annotation.Nonnull - public String getSerialNumber() { - return serialNumber; - } - - public void setSerialNumber(@javax.annotation.Nonnull String serialNumber) { - this.serialNumber = serialNumber; - } - - - public SingleCodeCertificateModel subjectName(@javax.annotation.Nonnull String subjectName) { - this.subjectName = subjectName; - return this; - } - - /** - * Get subjectName - * @return subjectName - */ - @javax.annotation.Nonnull - public String getSubjectName() { - return subjectName; - } - - public void setSubjectName(@javax.annotation.Nonnull String subjectName) { - this.subjectName = subjectName; - } - - /** - * 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 SingleCodeCertificateModel instance itself - */ - public SingleCodeCertificateModel 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; - } - SingleCodeCertificateModel singleCodeCertificateModel = (SingleCodeCertificateModel) o; - return Objects.equals(this.version, singleCodeCertificateModel.version) && - Objects.equals(this.issuedOn, singleCodeCertificateModel.issuedOn) && - Objects.equals(this.expiresOn, singleCodeCertificateModel.expiresOn) && - Objects.equals(this.issuerName, singleCodeCertificateModel.issuerName) && - Objects.equals(this.serialNumber, singleCodeCertificateModel.serialNumber) && - Objects.equals(this.subjectName, singleCodeCertificateModel.subjectName)&& - Objects.equals(this.additionalProperties, singleCodeCertificateModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(version, issuedOn, expiresOn, issuerName, serialNumber, subjectName, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SingleCodeCertificateModel {\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" issuedOn: ").append(toIndentedString(issuedOn)).append("\n"); - sb.append(" expiresOn: ").append(toIndentedString(expiresOn)).append("\n"); - sb.append(" issuerName: ").append(toIndentedString(issuerName)).append("\n"); - sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); - sb.append(" subjectName: ").append(toIndentedString(subjectName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("version", "issued_on", "expires_on", "issuer_name", "serial_number", "subject_name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("version", "issued_on", "expires_on", "issuer_name", "serial_number", "subject_name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SingleCodeCertificateModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SingleCodeCertificateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SingleCodeCertificateModel is not found in the empty JSON string", SingleCodeCertificateModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SingleCodeCertificateModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("issued_on").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issued_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issued_on").toString())); - } - if (!jsonObj.get("expires_on").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `expires_on` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires_on").toString())); - } - if (!jsonObj.get("issuer_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer_name").toString())); - } - if (!jsonObj.get("serial_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `serial_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serial_number").toString())); - } - if (!jsonObj.get("subject_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `subject_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SingleCodeCertificateModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SingleCodeCertificateModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SingleCodeCertificateModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SingleCodeCertificateModel 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 SingleCodeCertificateModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SingleCodeCertificateModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SingleCodeCertificateModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SingleCodeCertificateModel - * @throws IOException if the JSON string is invalid with respect to SingleCodeCertificateModel - */ - public static SingleCodeCertificateModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SingleCodeCertificateModel.class); - } - - /** - * Convert an instance of SingleCodeCertificateModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SingleCodeSignatureModel.java b/src/main/java/ai/reveng/model/SingleCodeSignatureModel.java deleted file mode 100644 index 39df97d..0000000 --- a/src/main/java/ai/reveng/model/SingleCodeSignatureModel.java +++ /dev/null @@ -1,336 +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 ai.reveng.model.SingleCodeCertificateModel; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SingleCodeSignatureModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SingleCodeSignatureModel { - public static final String SERIALIZED_NAME_CERTIFICATES = "certificates"; - @SerializedName(SERIALIZED_NAME_CERTIFICATES) - @javax.annotation.Nonnull - private List certificates = new ArrayList<>(); - - public static final String SERIALIZED_NAME_AUTHENTICODE_DIGEST = "authenticode_digest"; - @SerializedName(SERIALIZED_NAME_AUTHENTICODE_DIGEST) - @javax.annotation.Nonnull - private String authenticodeDigest; - - public SingleCodeSignatureModel() { - } - - public SingleCodeSignatureModel certificates(@javax.annotation.Nonnull List certificates) { - this.certificates = certificates; - return this; - } - - public SingleCodeSignatureModel addCertificatesItem(SingleCodeCertificateModel certificatesItem) { - if (this.certificates == null) { - this.certificates = new ArrayList<>(); - } - this.certificates.add(certificatesItem); - return this; - } - - /** - * Get certificates - * @return certificates - */ - @javax.annotation.Nonnull - public List getCertificates() { - return certificates; - } - - public void setCertificates(@javax.annotation.Nonnull List certificates) { - this.certificates = certificates; - } - - - public SingleCodeSignatureModel authenticodeDigest(@javax.annotation.Nonnull String authenticodeDigest) { - this.authenticodeDigest = authenticodeDigest; - return this; - } - - /** - * Get authenticodeDigest - * @return authenticodeDigest - */ - @javax.annotation.Nonnull - public String getAuthenticodeDigest() { - return authenticodeDigest; - } - - public void setAuthenticodeDigest(@javax.annotation.Nonnull String authenticodeDigest) { - this.authenticodeDigest = authenticodeDigest; - } - - /** - * 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 SingleCodeSignatureModel instance itself - */ - public SingleCodeSignatureModel 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; - } - SingleCodeSignatureModel singleCodeSignatureModel = (SingleCodeSignatureModel) o; - return Objects.equals(this.certificates, singleCodeSignatureModel.certificates) && - Objects.equals(this.authenticodeDigest, singleCodeSignatureModel.authenticodeDigest)&& - Objects.equals(this.additionalProperties, singleCodeSignatureModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(certificates, authenticodeDigest, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SingleCodeSignatureModel {\n"); - sb.append(" certificates: ").append(toIndentedString(certificates)).append("\n"); - sb.append(" authenticodeDigest: ").append(toIndentedString(authenticodeDigest)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("certificates", "authenticode_digest")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("certificates", "authenticode_digest")); - } - - /** - * 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 SingleCodeSignatureModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SingleCodeSignatureModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SingleCodeSignatureModel is not found in the empty JSON string", SingleCodeSignatureModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SingleCodeSignatureModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("certificates") != null) { - if (!jsonObj.get("certificates").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `certificates` to be an array in the JSON string but got `%s`", jsonObj.get("certificates").toString())); - } - JsonArray jsonArraycertificates = jsonObj.getAsJsonArray("certificates"); - // validate the required field `certificates` (array) - for (int i = 0; i < jsonArraycertificates.size(); i++) { - SingleCodeCertificateModel.validateJsonElement(jsonArraycertificates.get(i)); - } - } - if (!jsonObj.get("authenticode_digest").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `authenticode_digest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticode_digest").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SingleCodeSignatureModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SingleCodeSignatureModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SingleCodeSignatureModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SingleCodeSignatureModel 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 SingleCodeSignatureModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SingleCodeSignatureModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SingleCodeSignatureModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SingleCodeSignatureModel - * @throws IOException if the JSON string is invalid with respect to SingleCodeSignatureModel - */ - public static SingleCodeSignatureModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SingleCodeSignatureModel.class); - } - - /** - * Convert an instance of SingleCodeSignatureModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SinglePDBEntryModel.java b/src/main/java/ai/reveng/model/SinglePDBEntryModel.java deleted file mode 100644 index 24226b2..0000000 --- a/src/main/java/ai/reveng/model/SinglePDBEntryModel.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SinglePDBEntryModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SinglePDBEntryModel { - public static final String SERIALIZED_NAME_GUID = "guid"; - @SerializedName(SERIALIZED_NAME_GUID) - @javax.annotation.Nonnull - private String guid; - - public static final String SERIALIZED_NAME_AGE = "age"; - @SerializedName(SERIALIZED_NAME_AGE) - @javax.annotation.Nonnull - private Integer age; - - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - @javax.annotation.Nonnull - private String path; - - public SinglePDBEntryModel() { - } - - public SinglePDBEntryModel guid(@javax.annotation.Nonnull String guid) { - this.guid = guid; - return this; - } - - /** - * Get guid - * @return guid - */ - @javax.annotation.Nonnull - public String getGuid() { - return guid; - } - - public void setGuid(@javax.annotation.Nonnull String guid) { - this.guid = guid; - } - - - public SinglePDBEntryModel age(@javax.annotation.Nonnull Integer age) { - this.age = age; - return this; - } - - /** - * Get age - * @return age - */ - @javax.annotation.Nonnull - public Integer getAge() { - return age; - } - - public void setAge(@javax.annotation.Nonnull Integer age) { - this.age = age; - } - - - public SinglePDBEntryModel path(@javax.annotation.Nonnull String path) { - this.path = path; - return this; - } - - /** - * Get path - * @return path - */ - @javax.annotation.Nonnull - public String getPath() { - return path; - } - - public void setPath(@javax.annotation.Nonnull String path) { - this.path = path; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the SinglePDBEntryModel instance itself - */ - public SinglePDBEntryModel 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; - } - SinglePDBEntryModel singlePDBEntryModel = (SinglePDBEntryModel) o; - return Objects.equals(this.guid, singlePDBEntryModel.guid) && - Objects.equals(this.age, singlePDBEntryModel.age) && - Objects.equals(this.path, singlePDBEntryModel.path)&& - Objects.equals(this.additionalProperties, singlePDBEntryModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(guid, age, path, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SinglePDBEntryModel {\n"); - sb.append(" guid: ").append(toIndentedString(guid)).append("\n"); - sb.append(" age: ").append(toIndentedString(age)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("guid", "age", "path")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("guid", "age", "path")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SinglePDBEntryModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SinglePDBEntryModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SinglePDBEntryModel is not found in the empty JSON string", SinglePDBEntryModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SinglePDBEntryModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("guid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `guid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("guid").toString())); - } - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SinglePDBEntryModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SinglePDBEntryModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SinglePDBEntryModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SinglePDBEntryModel 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 SinglePDBEntryModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SinglePDBEntryModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SinglePDBEntryModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SinglePDBEntryModel - * @throws IOException if the JSON string is invalid with respect to SinglePDBEntryModel - */ - public static SinglePDBEntryModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SinglePDBEntryModel.class); - } - - /** - * Convert an instance of SinglePDBEntryModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SingleSectionModel.java b/src/main/java/ai/reveng/model/SingleSectionModel.java deleted file mode 100644 index c16fa31..0000000 --- a/src/main/java/ai/reveng/model/SingleSectionModel.java +++ /dev/null @@ -1,452 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SingleSectionModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SingleSectionModel { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_VIRTUAL_ADDRESS = "virtual_address"; - @SerializedName(SERIALIZED_NAME_VIRTUAL_ADDRESS) - @javax.annotation.Nonnull - private Integer virtualAddress; - - public static final String SERIALIZED_NAME_VIRTUAL_SIZE = "virtual_size"; - @SerializedName(SERIALIZED_NAME_VIRTUAL_SIZE) - @javax.annotation.Nonnull - private Integer virtualSize; - - public static final String SERIALIZED_NAME_CHARACTERISTICS = "characteristics"; - @SerializedName(SERIALIZED_NAME_CHARACTERISTICS) - @javax.annotation.Nonnull - private String characteristics; - - public static final String SERIALIZED_NAME_RAW_SIZE = "raw_size"; - @SerializedName(SERIALIZED_NAME_RAW_SIZE) - @javax.annotation.Nonnull - private Integer rawSize; - - public static final String SERIALIZED_NAME_ENTROPY = "entropy"; - @SerializedName(SERIALIZED_NAME_ENTROPY) - @javax.annotation.Nonnull - private BigDecimal entropy; - - public static final String SERIALIZED_NAME_SHA3256 = "sha3_256"; - @SerializedName(SERIALIZED_NAME_SHA3256) - @javax.annotation.Nonnull - private String sha3256; - - public SingleSectionModel() { - } - - public SingleSectionModel 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 SingleSectionModel virtualAddress(@javax.annotation.Nonnull Integer virtualAddress) { - this.virtualAddress = virtualAddress; - return this; - } - - /** - * Get virtualAddress - * @return virtualAddress - */ - @javax.annotation.Nonnull - public Integer getVirtualAddress() { - return virtualAddress; - } - - public void setVirtualAddress(@javax.annotation.Nonnull Integer virtualAddress) { - this.virtualAddress = virtualAddress; - } - - - public SingleSectionModel virtualSize(@javax.annotation.Nonnull Integer virtualSize) { - this.virtualSize = virtualSize; - return this; - } - - /** - * Get virtualSize - * @return virtualSize - */ - @javax.annotation.Nonnull - public Integer getVirtualSize() { - return virtualSize; - } - - public void setVirtualSize(@javax.annotation.Nonnull Integer virtualSize) { - this.virtualSize = virtualSize; - } - - - public SingleSectionModel characteristics(@javax.annotation.Nonnull String characteristics) { - this.characteristics = characteristics; - return this; - } - - /** - * Get characteristics - * @return characteristics - */ - @javax.annotation.Nonnull - public String getCharacteristics() { - return characteristics; - } - - public void setCharacteristics(@javax.annotation.Nonnull String characteristics) { - this.characteristics = characteristics; - } - - - public SingleSectionModel rawSize(@javax.annotation.Nonnull Integer rawSize) { - this.rawSize = rawSize; - return this; - } - - /** - * Get rawSize - * @return rawSize - */ - @javax.annotation.Nonnull - public Integer getRawSize() { - return rawSize; - } - - public void setRawSize(@javax.annotation.Nonnull Integer rawSize) { - this.rawSize = rawSize; - } - - - public SingleSectionModel entropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; - return this; - } - - /** - * Get entropy - * @return entropy - */ - @javax.annotation.Nonnull - public BigDecimal getEntropy() { - return entropy; - } - - public void setEntropy(@javax.annotation.Nonnull BigDecimal entropy) { - this.entropy = entropy; - } - - - public SingleSectionModel sha3256(@javax.annotation.Nonnull String sha3256) { - this.sha3256 = sha3256; - return this; - } - - /** - * Get sha3256 - * @return sha3256 - */ - @javax.annotation.Nonnull - public String getSha3256() { - return sha3256; - } - - public void setSha3256(@javax.annotation.Nonnull String sha3256) { - this.sha3256 = sha3256; - } - - /** - * 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 SingleSectionModel instance itself - */ - public SingleSectionModel 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; - } - SingleSectionModel singleSectionModel = (SingleSectionModel) o; - return Objects.equals(this.name, singleSectionModel.name) && - Objects.equals(this.virtualAddress, singleSectionModel.virtualAddress) && - Objects.equals(this.virtualSize, singleSectionModel.virtualSize) && - Objects.equals(this.characteristics, singleSectionModel.characteristics) && - Objects.equals(this.rawSize, singleSectionModel.rawSize) && - Objects.equals(this.entropy, singleSectionModel.entropy) && - Objects.equals(this.sha3256, singleSectionModel.sha3256)&& - Objects.equals(this.additionalProperties, singleSectionModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, virtualAddress, virtualSize, characteristics, rawSize, entropy, sha3256, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SingleSectionModel {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" virtualAddress: ").append(toIndentedString(virtualAddress)).append("\n"); - sb.append(" virtualSize: ").append(toIndentedString(virtualSize)).append("\n"); - sb.append(" characteristics: ").append(toIndentedString(characteristics)).append("\n"); - sb.append(" rawSize: ").append(toIndentedString(rawSize)).append("\n"); - sb.append(" entropy: ").append(toIndentedString(entropy)).append("\n"); - sb.append(" sha3256: ").append(toIndentedString(sha3256)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "virtual_address", "virtual_size", "characteristics", "raw_size", "entropy", "sha3_256")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "virtual_address", "virtual_size", "characteristics", "raw_size", "entropy", "sha3_256")); - } - - /** - * 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 SingleSectionModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SingleSectionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SingleSectionModel is not found in the empty JSON string", SingleSectionModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SingleSectionModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("characteristics").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `characteristics` to be a primitive type in the JSON string but got `%s`", jsonObj.get("characteristics").toString())); - } - if (!jsonObj.get("sha3_256").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha3_256` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3_256").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SingleSectionModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SingleSectionModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SingleSectionModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SingleSectionModel 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 SingleSectionModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SingleSectionModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SingleSectionModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of SingleSectionModel - * @throws IOException if the JSON string is invalid with respect to SingleSectionModel - */ - public static SingleSectionModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SingleSectionModel.class); - } - - /** - * Convert an instance of SingleSectionModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/StackVariable.java b/src/main/java/ai/reveng/model/StackVariable.java deleted file mode 100644 index 22793bf..0000000 --- a/src/main/java/ai/reveng/model/StackVariable.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * StackVariable - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StackVariable { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_OFFSET = "offset"; - @SerializedName(SERIALIZED_NAME_OFFSET) - @javax.annotation.Nonnull - private Integer offset; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - 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 static final String SERIALIZED_NAME_ADDR = "addr"; - @SerializedName(SERIALIZED_NAME_ADDR) - @javax.annotation.Nonnull - private Integer addr; - - public StackVariable() { - } - - public StackVariable lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this stack variable - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public StackVariable offset(@javax.annotation.Nonnull Integer offset) { - this.offset = offset; - return this; - } - - /** - * Offset of the stack variable - * @return offset - */ - @javax.annotation.Nonnull - public Integer getOffset() { - return offset; - } - - public void setOffset(@javax.annotation.Nonnull Integer offset) { - this.offset = offset; - } - - - public StackVariable name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the stack variable - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public StackVariable type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Data type of the stack variable - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public StackVariable size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Size of the stack variable in bytes - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - - public StackVariable addr(@javax.annotation.Nonnull Integer addr) { - this.addr = addr; - return this; - } - - /** - * Memory address of the stack variable - * @return addr - */ - @javax.annotation.Nonnull - public Integer getAddr() { - return addr; - } - - public void setAddr(@javax.annotation.Nonnull Integer addr) { - this.addr = addr; - } - - /** - * 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 StackVariable instance itself - */ - public StackVariable 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; - } - StackVariable stackVariable = (StackVariable) o; - return Objects.equals(this.lastChange, stackVariable.lastChange) && - Objects.equals(this.offset, stackVariable.offset) && - Objects.equals(this.name, stackVariable.name) && - Objects.equals(this.type, stackVariable.type) && - Objects.equals(this.size, stackVariable.size) && - Objects.equals(this.addr, stackVariable.addr)&& - Objects.equals(this.additionalProperties, stackVariable.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(lastChange, offset, name, type, size, addr, 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 StackVariable {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "offset", "name", "type", "size", "addr")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("offset", "name", "type", "size", "addr")); - } - - /** - * 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 StackVariable - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!StackVariable.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StackVariable is not found in the empty JSON string", StackVariable.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : StackVariable.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!StackVariable.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StackVariable' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(StackVariable.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, StackVariable 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 StackVariable read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - StackVariable instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of StackVariable given an JSON string - * - * @param jsonString JSON string - * @return An instance of StackVariable - * @throws IOException if the JSON string is invalid with respect to StackVariable - */ - public static StackVariable fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StackVariable.class); - } - - /** - * Convert an instance of StackVariable to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/StatusInput.java b/src/main/java/ai/reveng/model/StatusInput.java deleted file mode 100644 index dff9efd..0000000 --- a/src/main/java/ai/reveng/model/StatusInput.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Custom enum for the analysis status - */ -@JsonAdapter(StatusInput.Adapter.class) -public enum StatusInput { - - UPLOADED("Uploaded"), - - QUEUED("Queued"), - - COMPLETE("Complete"), - - ERROR("Error"), - - PROCESSING("Processing"), - - ALL("All"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - StatusInput(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusInput fromValue(String value) { - for (StatusInput b : StatusInput.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusInput enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusInput read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusInput.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusInput.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/StatusOutput.java b/src/main/java/ai/reveng/model/StatusOutput.java deleted file mode 100644 index f86c984..0000000 --- a/src/main/java/ai/reveng/model/StatusOutput.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * StatusOutput - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StatusOutput { - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_ANALYSIS_STATUS = "analysis_status"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_STATUS) - @javax.annotation.Nonnull - private String analysisStatus; - - public StatusOutput() { - } - - public StatusOutput analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * The ID corresponding to the checked status - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public StatusOutput analysisStatus(@javax.annotation.Nonnull String analysisStatus) { - this.analysisStatus = analysisStatus; - return this; - } - - /** - * The status of the checked analysis - * @return analysisStatus - */ - @javax.annotation.Nonnull - public String getAnalysisStatus() { - return analysisStatus; - } - - public void setAnalysisStatus(@javax.annotation.Nonnull String analysisStatus) { - this.analysisStatus = analysisStatus; - } - - /** - * 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 StatusOutput instance itself - */ - public StatusOutput 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; - } - StatusOutput statusOutput = (StatusOutput) o; - return Objects.equals(this.analysisId, statusOutput.analysisId) && - Objects.equals(this.analysisStatus, statusOutput.analysisStatus)&& - Objects.equals(this.additionalProperties, statusOutput.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(analysisId, analysisStatus, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StatusOutput {\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" analysisStatus: ").append(toIndentedString(analysisStatus)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("analysis_id", "analysis_status")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("analysis_id", "analysis_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 StatusOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!StatusOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StatusOutput is not found in the empty JSON string", StatusOutput.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : StatusOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("analysis_status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `analysis_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("analysis_status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!StatusOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StatusOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(StatusOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, StatusOutput 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 StatusOutput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - StatusOutput instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of StatusOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of StatusOutput - * @throws IOException if the JSON string is invalid with respect to StatusOutput - */ - public static StatusOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StatusOutput.class); - } - - /** - * Convert an instance of StatusOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/StringFunctions.java b/src/main/java/ai/reveng/model/StringFunctions.java deleted file mode 100644 index 37c2809..0000000 --- a/src/main/java/ai/reveng/model/StringFunctions.java +++ /dev/null @@ -1,367 +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 ai.reveng.model.AppApiRestV2FunctionsResponsesFunction; -import ai.reveng.model.StringSource; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * This is a string with the functions where the string is used. A function string is a string literal referenced within a function. When analyzing stripped or obfuscated binaries, function strings can help identify the function’s purpose. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StringFunctions { - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nonnull - private String value; - - public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; - @SerializedName(SERIALIZED_NAME_FUNCTIONS) - @javax.annotation.Nonnull - private List functions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - @javax.annotation.Nullable - private StringSource source = StringSource.SYSTEM; - - public StringFunctions() { - } - - public StringFunctions value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * The value of the string literal - * @return value - */ - @javax.annotation.Nonnull - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; - } - - - public StringFunctions functions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - return this; - } - - public StringFunctions addFunctionsItem(AppApiRestV2FunctionsResponsesFunction functionsItem) { - if (this.functions == null) { - this.functions = new ArrayList<>(); - } - this.functions.add(functionsItem); - return this; - } - - /** - * The function ids the string literal was found within - * @return functions - */ - @javax.annotation.Nonnull - public List getFunctions() { - return functions; - } - - public void setFunctions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - } - - - public StringFunctions source(@javax.annotation.Nullable StringSource source) { - this.source = source; - return this; - } - - /** - * The source of the string - * @return source - */ - @javax.annotation.Nullable - public StringSource getSource() { - return source; - } - - public void setSource(@javax.annotation.Nullable StringSource source) { - this.source = source; - } - - /** - * 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 StringFunctions instance itself - */ - public StringFunctions 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; - } - StringFunctions stringFunctions = (StringFunctions) o; - return Objects.equals(this.value, stringFunctions.value) && - Objects.equals(this.functions, stringFunctions.functions) && - Objects.equals(this.source, stringFunctions.source)&& - Objects.equals(this.additionalProperties, stringFunctions.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(value, functions, source, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringFunctions {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("value", "functions", "source")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("value", "functions")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StringFunctions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!StringFunctions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StringFunctions is not found in the empty JSON string", StringFunctions.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : StringFunctions.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - if (jsonObj.get("functions") != null) { - if (!jsonObj.get("functions").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `functions` to be an array in the JSON string but got `%s`", jsonObj.get("functions").toString())); - } - JsonArray jsonArrayfunctions = jsonObj.getAsJsonArray("functions"); - // validate the required field `functions` (array) - for (int i = 0; i < jsonArrayfunctions.size(); i++) { - AppApiRestV2FunctionsResponsesFunction.validateJsonElement(jsonArrayfunctions.get(i)); - } - } - // validate the optional field `source` - if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { - StringSource.validateJsonElement(jsonObj.get("source")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!StringFunctions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StringFunctions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(StringFunctions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, StringFunctions 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 StringFunctions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - StringFunctions instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of StringFunctions given an JSON string - * - * @param jsonString JSON string - * @return An instance of StringFunctions - * @throws IOException if the JSON string is invalid with respect to StringFunctions - */ - public static StringFunctions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StringFunctions.class); - } - - /** - * Convert an instance of StringFunctions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/StringSource.java b/src/main/java/ai/reveng/model/StringSource.java deleted file mode 100644 index 432b9e4..0000000 --- a/src/main/java/ai/reveng/model/StringSource.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets StringSource - */ -@JsonAdapter(StringSource.Adapter.class) -public enum StringSource { - - SYSTEM("SYSTEM"), - - USER("USER"), - - AI_AGENT("AI_AGENT"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - StringSource(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StringSource fromValue(String value) { - for (StringSource b : StringSource.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StringSource enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StringSource read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StringSource.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StringSource.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/Structure.java b/src/main/java/ai/reveng/model/Structure.java deleted file mode 100644 index b7790a7..0000000 --- a/src/main/java/ai/reveng/model/Structure.java +++ /dev/null @@ -1,422 +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 ai.reveng.model.StructureMember; -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.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Structure - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Structure { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nullable - private Integer size; - - public static final String SERIALIZED_NAME_MEMBERS = "members"; - @SerializedName(SERIALIZED_NAME_MEMBERS) - @javax.annotation.Nonnull - private Map members = new HashMap<>(); - - public static final String SERIALIZED_NAME_ARTIFACT_TYPE = "artifact_type"; - @SerializedName(SERIALIZED_NAME_ARTIFACT_TYPE) - @javax.annotation.Nullable - private String artifactType; - - public Structure() { - } - - public Structure lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this structure - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public Structure name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the structure - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public Structure size(@javax.annotation.Nullable Integer size) { - this.size = size; - return this; - } - - /** - * Total size of the structure in bytes - * @return size - */ - @javax.annotation.Nullable - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nullable Integer size) { - this.size = size; - } - - - public Structure members(@javax.annotation.Nonnull Map members) { - this.members = members; - return this; - } - - public Structure putMembersItem(String key, StructureMember membersItem) { - if (this.members == null) { - this.members = new HashMap<>(); - } - this.members.put(key, membersItem); - return this; - } - - /** - * Dictionary of structure members - * @return members - */ - @javax.annotation.Nonnull - public Map getMembers() { - return members; - } - - public void setMembers(@javax.annotation.Nonnull Map members) { - this.members = members; - } - - - public Structure artifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - return this; - } - - /** - * Type of artifact that the structure is associated with - * @return artifactType - */ - @javax.annotation.Nullable - public String getArtifactType() { - return artifactType; - } - - public void setArtifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - } - - /** - * 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 Structure instance itself - */ - public Structure 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; - } - Structure structure = (Structure) o; - return Objects.equals(this.lastChange, structure.lastChange) && - Objects.equals(this.name, structure.name) && - Objects.equals(this.size, structure.size) && - Objects.equals(this.members, structure.members) && - Objects.equals(this.artifactType, structure.artifactType)&& - Objects.equals(this.additionalProperties, structure.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(lastChange, name, size, members, artifactType, 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 Structure {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" members: ").append(toIndentedString(members)).append("\n"); - sb.append(" artifactType: ").append(toIndentedString(artifactType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "name", "size", "members", "artifact_type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "members")); - } - - /** - * 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 Structure - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Structure.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Structure is not found in the empty JSON string", Structure.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Structure.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("artifact_type") != null && !jsonObj.get("artifact_type").isJsonNull()) && !jsonObj.get("artifact_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `artifact_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("artifact_type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Structure.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Structure' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Structure.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Structure 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 Structure read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Structure instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Structure given an JSON string - * - * @param jsonString JSON string - * @return An instance of Structure - * @throws IOException if the JSON string is invalid with respect to Structure - */ - public static Structure fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Structure.class); - } - - /** - * Convert an instance of Structure to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/StructureMember.java b/src/main/java/ai/reveng/model/StructureMember.java deleted file mode 100644 index 7ac675d..0000000 --- a/src/main/java/ai/reveng/model/StructureMember.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * StructureMember - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StructureMember { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_OFFSET = "offset"; - @SerializedName(SERIALIZED_NAME_OFFSET) - @javax.annotation.Nonnull - private Integer offset; - - 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 StructureMember() { - } - - public StructureMember lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this structure member - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public StructureMember name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the structure member - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public StructureMember offset(@javax.annotation.Nonnull Integer offset) { - this.offset = offset; - return this; - } - - /** - * Offset of the member within the structure - * @return offset - */ - @javax.annotation.Nonnull - public Integer getOffset() { - return offset; - } - - public void setOffset(@javax.annotation.Nonnull Integer offset) { - this.offset = offset; - } - - - public StructureMember type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Data type of the structure member - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public StructureMember size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Size of the structure member in bytes - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the StructureMember instance itself - */ - public StructureMember 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; - } - StructureMember structureMember = (StructureMember) o; - return Objects.equals(this.lastChange, structureMember.lastChange) && - Objects.equals(this.name, structureMember.name) && - Objects.equals(this.offset, structureMember.offset) && - Objects.equals(this.type, structureMember.type) && - Objects.equals(this.size, structureMember.size)&& - Objects.equals(this.additionalProperties, structureMember.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(lastChange, name, offset, type, size, 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 StructureMember {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" offset: ").append(toIndentedString(offset)).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(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "name", "offset", "type", "size")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "offset", "type", "size")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StructureMember - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!StructureMember.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StructureMember is not found in the empty JSON string", StructureMember.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : StructureMember.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!StructureMember.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StructureMember' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(StructureMember.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, StructureMember 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 StructureMember read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - StructureMember instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of StructureMember given an JSON string - * - * @param jsonString JSON string - * @return An instance of StructureMember - * @throws IOException if the JSON string is invalid with respect to StructureMember - */ - public static StructureMember fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StructureMember.class); - } - - /** - * Convert an instance of StructureMember to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/SubmitUserFeedbackRequest.java b/src/main/java/ai/reveng/model/SubmitUserFeedbackRequest.java deleted file mode 100644 index 846c6fb..0000000 --- a/src/main/java/ai/reveng/model/SubmitUserFeedbackRequest.java +++ /dev/null @@ -1,359 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * SubmitUserFeedbackRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SubmitUserFeedbackRequest { - public static final String SERIALIZED_NAME_CURRENT_ROUTE = "current_route"; - @SerializedName(SERIALIZED_NAME_CURRENT_ROUTE) - @javax.annotation.Nonnull - private String currentRoute; - - public static final String SERIALIZED_NAME_FEEDBACK = "feedback"; - @SerializedName(SERIALIZED_NAME_FEEDBACK) - @javax.annotation.Nonnull - private String feedback; - - public static final String SERIALIZED_NAME_SCREEN_CAPTURE_URL = "screen_capture_url"; - @SerializedName(SERIALIZED_NAME_SCREEN_CAPTURE_URL) - @javax.annotation.Nullable - private String screenCaptureUrl; - - public SubmitUserFeedbackRequest() { - } - - public SubmitUserFeedbackRequest currentRoute(@javax.annotation.Nonnull String currentRoute) { - this.currentRoute = currentRoute; - return this; - } - - /** - * The route from where the feedback was submitted - * @return currentRoute - */ - @javax.annotation.Nonnull - public String getCurrentRoute() { - return currentRoute; - } - - public void setCurrentRoute(@javax.annotation.Nonnull String currentRoute) { - this.currentRoute = currentRoute; - } - - - public SubmitUserFeedbackRequest feedback(@javax.annotation.Nonnull String feedback) { - this.feedback = feedback; - return this; - } - - /** - * The user's feedback - * @return feedback - */ - @javax.annotation.Nonnull - public String getFeedback() { - return feedback; - } - - public void setFeedback(@javax.annotation.Nonnull String feedback) { - this.feedback = feedback; - } - - - public SubmitUserFeedbackRequest screenCaptureUrl(@javax.annotation.Nullable String screenCaptureUrl) { - this.screenCaptureUrl = screenCaptureUrl; - return this; - } - - /** - * An optional URL to a screen capture related to the feedback - * @return screenCaptureUrl - */ - @javax.annotation.Nullable - public String getScreenCaptureUrl() { - return screenCaptureUrl; - } - - public void setScreenCaptureUrl(@javax.annotation.Nullable String screenCaptureUrl) { - this.screenCaptureUrl = screenCaptureUrl; - } - - /** - * 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 SubmitUserFeedbackRequest instance itself - */ - public SubmitUserFeedbackRequest 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; - } - SubmitUserFeedbackRequest submitUserFeedbackRequest = (SubmitUserFeedbackRequest) o; - return Objects.equals(this.currentRoute, submitUserFeedbackRequest.currentRoute) && - Objects.equals(this.feedback, submitUserFeedbackRequest.feedback) && - Objects.equals(this.screenCaptureUrl, submitUserFeedbackRequest.screenCaptureUrl)&& - Objects.equals(this.additionalProperties, submitUserFeedbackRequest.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(currentRoute, feedback, screenCaptureUrl, 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 SubmitUserFeedbackRequest {\n"); - sb.append(" currentRoute: ").append(toIndentedString(currentRoute)).append("\n"); - sb.append(" feedback: ").append(toIndentedString(feedback)).append("\n"); - sb.append(" screenCaptureUrl: ").append(toIndentedString(screenCaptureUrl)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("current_route", "feedback", "screen_capture_url")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("current_route", "feedback")); - } - - /** - * 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 SubmitUserFeedbackRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SubmitUserFeedbackRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SubmitUserFeedbackRequest is not found in the empty JSON string", SubmitUserFeedbackRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SubmitUserFeedbackRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("current_route").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `current_route` to be a primitive type in the JSON string but got `%s`", jsonObj.get("current_route").toString())); - } - if (!jsonObj.get("feedback").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `feedback` to be a primitive type in the JSON string but got `%s`", jsonObj.get("feedback").toString())); - } - if ((jsonObj.get("screen_capture_url") != null && !jsonObj.get("screen_capture_url").isJsonNull()) && !jsonObj.get("screen_capture_url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `screen_capture_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("screen_capture_url").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SubmitUserFeedbackRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SubmitUserFeedbackRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SubmitUserFeedbackRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SubmitUserFeedbackRequest 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 SubmitUserFeedbackRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - SubmitUserFeedbackRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SubmitUserFeedbackRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of SubmitUserFeedbackRequest - * @throws IOException if the JSON string is invalid with respect to SubmitUserFeedbackRequest - */ - public static SubmitUserFeedbackRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SubmitUserFeedbackRequest.class); - } - - /** - * Convert an instance of SubmitUserFeedbackRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Symbols.java b/src/main/java/ai/reveng/model/Symbols.java deleted file mode 100644 index abdd4bd..0000000 --- a/src/main/java/ai/reveng/model/Symbols.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.model; - -import java.util.Objects; -import ai.reveng.model.FunctionBoundary; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Symbols - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Symbols { - public static final String SERIALIZED_NAME_BASE_ADDRESS = "base_address"; - @SerializedName(SERIALIZED_NAME_BASE_ADDRESS) - @javax.annotation.Nonnull - private BigInteger baseAddress; - - public static final String SERIALIZED_NAME_FUNCTION_BOUNDARIES = "function_boundaries"; - @SerializedName(SERIALIZED_NAME_FUNCTION_BOUNDARIES) - @javax.annotation.Nullable - private List functionBoundaries = new ArrayList<>(); - - public Symbols() { - } - - public Symbols baseAddress(@javax.annotation.Nonnull BigInteger baseAddress) { - this.baseAddress = baseAddress; - return this; - } - - /** - * The starting address of the execution - * @return baseAddress - */ - @javax.annotation.Nonnull - public BigInteger getBaseAddress() { - return baseAddress; - } - - public void setBaseAddress(@javax.annotation.Nonnull BigInteger baseAddress) { - this.baseAddress = baseAddress; - } - - - public Symbols functionBoundaries(@javax.annotation.Nullable List functionBoundaries) { - this.functionBoundaries = functionBoundaries; - return this; - } - - public Symbols addFunctionBoundariesItem(FunctionBoundary functionBoundariesItem) { - if (this.functionBoundaries == null) { - this.functionBoundaries = new ArrayList<>(); - } - this.functionBoundaries.add(functionBoundariesItem); - return this; - } - - /** - * List of user defined function boundaries - * @return functionBoundaries - */ - @javax.annotation.Nullable - public List getFunctionBoundaries() { - return functionBoundaries; - } - - public void setFunctionBoundaries(@javax.annotation.Nullable List functionBoundaries) { - this.functionBoundaries = functionBoundaries; - } - - /** - * 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 Symbols instance itself - */ - public Symbols 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; - } - Symbols symbols = (Symbols) o; - return Objects.equals(this.baseAddress, symbols.baseAddress) && - Objects.equals(this.functionBoundaries, symbols.functionBoundaries)&& - Objects.equals(this.additionalProperties, symbols.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(baseAddress, functionBoundaries, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Symbols {\n"); - sb.append(" baseAddress: ").append(toIndentedString(baseAddress)).append("\n"); - sb.append(" functionBoundaries: ").append(toIndentedString(functionBoundaries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("base_address", "function_boundaries")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("base_address")); - } - - /** - * 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 Symbols - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Symbols.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Symbols is not found in the empty JSON string", Symbols.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Symbols.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("function_boundaries") != null && !jsonObj.get("function_boundaries").isJsonNull()) { - JsonArray jsonArrayfunctionBoundaries = jsonObj.getAsJsonArray("function_boundaries"); - if (jsonArrayfunctionBoundaries != null) { - // ensure the json data is an array - if (!jsonObj.get("function_boundaries").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_boundaries` to be an array in the JSON string but got `%s`", jsonObj.get("function_boundaries").toString())); - } - - // validate the optional field `function_boundaries` (array) - for (int i = 0; i < jsonArrayfunctionBoundaries.size(); i++) { - FunctionBoundary.validateJsonElement(jsonArrayfunctionBoundaries.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Symbols.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Symbols' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Symbols.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Symbols 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 Symbols read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Symbols instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Symbols given an JSON string - * - * @param jsonString JSON string - * @return An instance of Symbols - * @throws IOException if the JSON string is invalid with respect to Symbols - */ - public static Symbols fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Symbols.class); - } - - /** - * Convert an instance of Symbols to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Tag.java b/src/main/java/ai/reveng/model/Tag.java deleted file mode 100644 index abb9d57..0000000 --- a/src/main/java/ai/reveng/model/Tag.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Tag - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Tag { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public Tag() { - } - - public Tag 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; - } - - /** - * 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 Tag instance itself - */ - public Tag 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; - } - Tag tag = (Tag) o; - return Objects.equals(this.name, tag.name)&& - Objects.equals(this.additionalProperties, tag.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Tag - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Tag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Tag.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Tag.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Tag' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Tag.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Tag 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 Tag read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Tag instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Tag given an JSON string - * - * @param jsonString JSON string - * @return An instance of Tag - * @throws IOException if the JSON string is invalid with respect to Tag - */ - public static Tag fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Tag.class); - } - - /** - * Convert an instance of Tag to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TagItem.java b/src/main/java/ai/reveng/model/TagItem.java deleted file mode 100644 index 74e54fa..0000000 --- a/src/main/java/ai/reveng/model/TagItem.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TagItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TagItem { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - @javax.annotation.Nonnull - private String origin; - - public static final String SERIALIZED_NAME_COLLECTION_ID = "collection_id"; - @SerializedName(SERIALIZED_NAME_COLLECTION_ID) - @javax.annotation.Nullable - private Integer collectionId; - - public TagItem() { - } - - public TagItem 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 TagItem origin(@javax.annotation.Nonnull String origin) { - this.origin = origin; - return this; - } - - /** - * Get origin - * @return origin - */ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(@javax.annotation.Nonnull String origin) { - this.origin = origin; - } - - - public TagItem collectionId(@javax.annotation.Nullable Integer collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * The ID of the analysis owner's associated collection - * @return collectionId - */ - @javax.annotation.Nullable - public Integer getCollectionId() { - return collectionId; - } - - public void setCollectionId(@javax.annotation.Nullable Integer collectionId) { - this.collectionId = collectionId; - } - - /** - * 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 TagItem instance itself - */ - public TagItem 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; - } - TagItem tagItem = (TagItem) o; - return Objects.equals(this.name, tagItem.name) && - Objects.equals(this.origin, tagItem.origin) && - Objects.equals(this.collectionId, tagItem.collectionId)&& - Objects.equals(this.additionalProperties, tagItem.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(name, origin, collectionId, 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 TagItem {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "origin", "collection_id")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "origin")); - } - - /** - * 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 TagItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TagItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TagItem is not found in the empty JSON string", TagItem.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TagItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TagItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TagItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TagItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TagItem 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 TagItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TagItem instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TagItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of TagItem - * @throws IOException if the JSON string is invalid with respect to TagItem - */ - public static TagItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TagItem.class); - } - - /** - * Convert an instance of TagItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TagResponse.java b/src/main/java/ai/reveng/model/TagResponse.java deleted file mode 100644 index f61e009..0000000 --- a/src/main/java/ai/reveng/model/TagResponse.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TagResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TagResponse { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - @javax.annotation.Nonnull - private String origin; - - public TagResponse() { - } - - public TagResponse name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the tag - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public TagResponse origin(@javax.annotation.Nonnull String origin) { - this.origin = origin; - return this; - } - - /** - * Origin of tag - * @return origin - */ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(@javax.annotation.Nonnull String origin) { - this.origin = origin; - } - - /** - * 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 TagResponse instance itself - */ - public TagResponse 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; - } - TagResponse tagResponse = (TagResponse) o; - return Objects.equals(this.name, tagResponse.name) && - Objects.equals(this.origin, tagResponse.origin)&& - Objects.equals(this.additionalProperties, tagResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, origin, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TagResponse {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "origin")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "origin")); - } - - /** - * 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 TagResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TagResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TagResponse is not found in the empty JSON string", TagResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TagResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TagResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TagResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TagResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TagResponse 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 TagResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TagResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TagResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of TagResponse - * @throws IOException if the JSON string is invalid with respect to TagResponse - */ - public static TagResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TagResponse.class); - } - - /** - * Convert an instance of TagResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TagSearchResponse.java b/src/main/java/ai/reveng/model/TagSearchResponse.java deleted file mode 100644 index 9b7b3e7..0000000 --- a/src/main/java/ai/reveng/model/TagSearchResponse.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.TagSearchResult; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TagSearchResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TagSearchResponse { - public static final String SERIALIZED_NAME_RESULTS = "results"; - @SerializedName(SERIALIZED_NAME_RESULTS) - @javax.annotation.Nonnull - private List results = new ArrayList<>(); - - public TagSearchResponse() { - } - - public TagSearchResponse results(@javax.annotation.Nonnull List results) { - this.results = results; - return this; - } - - public TagSearchResponse addResultsItem(TagSearchResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * The results of the search - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(@javax.annotation.Nonnull List results) { - this.results = results; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the TagSearchResponse instance itself - */ - public TagSearchResponse 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; - } - TagSearchResponse tagSearchResponse = (TagSearchResponse) o; - return Objects.equals(this.results, tagSearchResponse.results)&& - Objects.equals(this.additionalProperties, tagSearchResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(results, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TagSearchResponse {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("results")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("results")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TagSearchResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TagSearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TagSearchResponse is not found in the empty JSON string", TagSearchResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TagSearchResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("results") != null) { - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); - } - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - TagSearchResult.validateJsonElement(jsonArrayresults.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TagSearchResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TagSearchResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TagSearchResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TagSearchResponse 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 TagSearchResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TagSearchResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TagSearchResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of TagSearchResponse - * @throws IOException if the JSON string is invalid with respect to TagSearchResponse - */ - public static TagSearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TagSearchResponse.class); - } - - /** - * Convert an instance of TagSearchResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TagSearchResult.java b/src/main/java/ai/reveng/model/TagSearchResult.java deleted file mode 100644 index ba31482..0000000 --- a/src/main/java/ai/reveng/model/TagSearchResult.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TagSearchResult - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TagSearchResult { - public static final String SERIALIZED_NAME_TAG_ID = "tag_id"; - @SerializedName(SERIALIZED_NAME_TAG_ID) - @javax.annotation.Nonnull - private Integer tagId; - - public static final String SERIALIZED_NAME_TAG = "tag"; - @SerializedName(SERIALIZED_NAME_TAG) - @javax.annotation.Nonnull - private String tag; - - public TagSearchResult() { - } - - public TagSearchResult tagId(@javax.annotation.Nonnull Integer tagId) { - this.tagId = tagId; - return this; - } - - /** - * The ID of the tag - * @return tagId - */ - @javax.annotation.Nonnull - public Integer getTagId() { - return tagId; - } - - public void setTagId(@javax.annotation.Nonnull Integer tagId) { - this.tagId = tagId; - } - - - public TagSearchResult tag(@javax.annotation.Nonnull String tag) { - this.tag = tag; - return this; - } - - /** - * The name of the tag - * @return tag - */ - @javax.annotation.Nonnull - public String getTag() { - return tag; - } - - public void setTag(@javax.annotation.Nonnull String tag) { - this.tag = tag; - } - - /** - * 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 TagSearchResult instance itself - */ - public TagSearchResult 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; - } - TagSearchResult tagSearchResult = (TagSearchResult) o; - return Objects.equals(this.tagId, tagSearchResult.tagId) && - Objects.equals(this.tag, tagSearchResult.tag)&& - Objects.equals(this.additionalProperties, tagSearchResult.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(tagId, tag, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TagSearchResult {\n"); - sb.append(" tagId: ").append(toIndentedString(tagId)).append("\n"); - sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("tag_id", "tag")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("tag_id", "tag")); - } - - /** - * 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 TagSearchResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TagSearchResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TagSearchResult is not found in the empty JSON string", TagSearchResult.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TagSearchResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("tag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TagSearchResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TagSearchResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TagSearchResult.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TagSearchResult 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 TagSearchResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TagSearchResult instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TagSearchResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of TagSearchResult - * @throws IOException if the JSON string is invalid with respect to TagSearchResult - */ - public static TagSearchResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TagSearchResult.class); - } - - /** - * Convert an instance of TagSearchResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TaskResponse.java b/src/main/java/ai/reveng/model/TaskResponse.java deleted file mode 100644 index 932ce9a..0000000 --- a/src/main/java/ai/reveng/model/TaskResponse.java +++ /dev/null @@ -1,325 +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 ai.reveng.model.TaskStatus; -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 org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TaskResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TaskResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable - private TaskStatus status = TaskStatus.UNINITIALISED; - - public static final String SERIALIZED_NAME_ERROR_MESSAGE = "error_message"; - @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) - @javax.annotation.Nullable - private String errorMessage; - - public TaskResponse() { - } - - public TaskResponse status(@javax.annotation.Nullable TaskStatus status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - */ - @javax.annotation.Nullable - public TaskStatus getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable TaskStatus status) { - this.status = status; - } - - - public TaskResponse errorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; - return this; - } - - /** - * Get errorMessage - * @return errorMessage - */ - @javax.annotation.Nullable - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; - } - - /** - * 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 TaskResponse instance itself - */ - public TaskResponse 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; - } - TaskResponse taskResponse = (TaskResponse) o; - return Objects.equals(this.status, taskResponse.status) && - Objects.equals(this.errorMessage, taskResponse.errorMessage)&& - Objects.equals(this.additionalProperties, taskResponse.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(status, errorMessage, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TaskResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "error_message")); - - // 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 TaskResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TaskResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TaskResponse is not found in the empty JSON string", TaskResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `status` - if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { - TaskStatus.validateJsonElement(jsonObj.get("status")); - } - if ((jsonObj.get("error_message") != null && !jsonObj.get("error_message").isJsonNull()) && !jsonObj.get("error_message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_message").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TaskResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TaskResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TaskResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TaskResponse 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 TaskResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TaskResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TaskResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskResponse - * @throws IOException if the JSON string is invalid with respect to TaskResponse - */ - public static TaskResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TaskResponse.class); - } - - /** - * Convert an instance of TaskResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TaskStatus.java b/src/main/java/ai/reveng/model/TaskStatus.java deleted file mode 100644 index b5b0b21..0000000 --- a/src/main/java/ai/reveng/model/TaskStatus.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets TaskStatus - */ -@JsonAdapter(TaskStatus.Adapter.class) -public enum TaskStatus { - - UNINITIALISED("UNINITIALISED"), - - PENDING("PENDING"), - - RUNNING("RUNNING"), - - COMPLETED("COMPLETED"), - - FAILED("FAILED"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TaskStatus(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TaskStatus fromValue(String value) { - for (TaskStatus b : TaskStatus.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TaskStatus enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TaskStatus read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TaskStatus.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TaskStatus.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/TaskStatusResponse.java b/src/main/java/ai/reveng/model/TaskStatusResponse.java deleted file mode 100644 index c3fc232..0000000 --- a/src/main/java/ai/reveng/model/TaskStatusResponse.java +++ /dev/null @@ -1,341 +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 ai.reveng.model.BinaryTaskStatus; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TaskStatusResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TaskStatusResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private BinaryTaskStatus status; - - public static final String SERIALIZED_NAME_LOG_HISTORY = "log_history"; - @SerializedName(SERIALIZED_NAME_LOG_HISTORY) - @javax.annotation.Nullable - private List> logHistory; - - public TaskStatusResponse() { - } - - public TaskStatusResponse status(@javax.annotation.Nonnull BinaryTaskStatus status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - */ - @javax.annotation.Nonnull - public BinaryTaskStatus getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull BinaryTaskStatus status) { - this.status = status; - } - - - public TaskStatusResponse logHistory(@javax.annotation.Nullable List> logHistory) { - this.logHistory = logHistory; - return this; - } - - public TaskStatusResponse addLogHistoryItem(List logHistoryItem) { - if (this.logHistory == null) { - this.logHistory = new ArrayList<>(); - } - this.logHistory.add(logHistoryItem); - return this; - } - - /** - * Get logHistory - * @return logHistory - */ - @javax.annotation.Nullable - public List> getLogHistory() { - return logHistory; - } - - public void setLogHistory(@javax.annotation.Nullable List> logHistory) { - this.logHistory = logHistory; - } - - /** - * 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 TaskStatusResponse instance itself - */ - public TaskStatusResponse 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; - } - TaskStatusResponse taskStatusResponse = (TaskStatusResponse) o; - return Objects.equals(this.status, taskStatusResponse.status) && - Objects.equals(this.logHistory, taskStatusResponse.logHistory)&& - Objects.equals(this.additionalProperties, taskStatusResponse.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, logHistory, 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 TaskStatusResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" logHistory: ").append(toIndentedString(logHistory)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("status", "log_history")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("status")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TaskStatusResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TaskStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TaskStatusResponse is not found in the empty JSON string", TaskStatusResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TaskStatusResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `status` - BinaryTaskStatus.validateJsonElement(jsonObj.get("status")); - // ensure the optional json data is an array if present - if (jsonObj.get("log_history") != null && !jsonObj.get("log_history").isJsonNull() && !jsonObj.get("log_history").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `log_history` to be an array in the JSON string but got `%s`", jsonObj.get("log_history").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TaskStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TaskStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TaskStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TaskStatusResponse 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 TaskStatusResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TaskStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TaskStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskStatusResponse - * @throws IOException if the JSON string is invalid with respect to TaskStatusResponse - */ - public static TaskStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TaskStatusResponse.class); - } - - /** - * Convert an instance of TaskStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TeamMember.java b/src/main/java/ai/reveng/model/TeamMember.java index a103cf2..d1a1498 100644 --- a/src/main/java/ai/reveng/model/TeamMember.java +++ b/src/main/java/ai/reveng/model/TeamMember.java @@ -51,7 +51,7 @@ public class TeamMember { public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String email; public static final String SERIALIZED_NAME_IS_ADMIN = "is_admin"; @@ -129,27 +129,27 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String username; public TeamMember() { } - public TeamMember email(@javax.annotation.Nullable String email) { + public TeamMember email(@javax.annotation.Nonnull String email) { this.email = email; return this; } /** - * Search is applied to string value + * Get email * @return email */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getEmail() { return email; } - public void setEmail(@javax.annotation.Nullable String email) { + public void setEmail(@javax.annotation.Nonnull String email) { this.email = email; } @@ -211,21 +211,21 @@ public void setUserId(@javax.annotation.Nonnull Long userId) { } - public TeamMember username(@javax.annotation.Nullable String username) { + public TeamMember username(@javax.annotation.Nonnull String username) { this.username = username; return this; } /** - * Search is applied to string value + * Get username * @return username */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getUsername() { return username; } - public void setUsername(@javax.annotation.Nullable String username) { + public void setUsername(@javax.annotation.Nonnull String username) { this.username = username; } @@ -351,7 +351,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + if (!jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } if (!jsonObj.get("role").isJsonPrimitive()) { @@ -359,7 +359,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `role` RoleEnum.validateJsonElement(jsonObj.get("role")); - if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + if (!jsonObj.get("username").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/ai/reveng/model/TimestampModel.java b/src/main/java/ai/reveng/model/TimestampModel.java deleted file mode 100644 index 22081d5..0000000 --- a/src/main/java/ai/reveng/model/TimestampModel.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.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TimestampModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TimestampModel { - public static final String SERIALIZED_NAME_PE_TIMESTAMP = "pe_timestamp"; - @SerializedName(SERIALIZED_NAME_PE_TIMESTAMP) - @javax.annotation.Nonnull - private Integer peTimestamp; - - public static final String SERIALIZED_NAME_EXPORT_TIMESTAMP = "export_timestamp"; - @SerializedName(SERIALIZED_NAME_EXPORT_TIMESTAMP) - @javax.annotation.Nonnull - private Integer exportTimestamp; - - public static final String SERIALIZED_NAME_DEBUG_TIMESTAMP = "debug_timestamp"; - @SerializedName(SERIALIZED_NAME_DEBUG_TIMESTAMP) - @javax.annotation.Nonnull - private Integer debugTimestamp; - - public TimestampModel() { - } - - public TimestampModel peTimestamp(@javax.annotation.Nonnull Integer peTimestamp) { - this.peTimestamp = peTimestamp; - return this; - } - - /** - * Get peTimestamp - * @return peTimestamp - */ - @javax.annotation.Nonnull - public Integer getPeTimestamp() { - return peTimestamp; - } - - public void setPeTimestamp(@javax.annotation.Nonnull Integer peTimestamp) { - this.peTimestamp = peTimestamp; - } - - - public TimestampModel exportTimestamp(@javax.annotation.Nonnull Integer exportTimestamp) { - this.exportTimestamp = exportTimestamp; - return this; - } - - /** - * Get exportTimestamp - * @return exportTimestamp - */ - @javax.annotation.Nonnull - public Integer getExportTimestamp() { - return exportTimestamp; - } - - public void setExportTimestamp(@javax.annotation.Nonnull Integer exportTimestamp) { - this.exportTimestamp = exportTimestamp; - } - - - public TimestampModel debugTimestamp(@javax.annotation.Nonnull Integer debugTimestamp) { - this.debugTimestamp = debugTimestamp; - return this; - } - - /** - * Get debugTimestamp - * @return debugTimestamp - */ - @javax.annotation.Nonnull - public Integer getDebugTimestamp() { - return debugTimestamp; - } - - public void setDebugTimestamp(@javax.annotation.Nonnull Integer debugTimestamp) { - this.debugTimestamp = debugTimestamp; - } - - /** - * 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 TimestampModel instance itself - */ - public TimestampModel 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; - } - TimestampModel timestampModel = (TimestampModel) o; - return Objects.equals(this.peTimestamp, timestampModel.peTimestamp) && - Objects.equals(this.exportTimestamp, timestampModel.exportTimestamp) && - Objects.equals(this.debugTimestamp, timestampModel.debugTimestamp)&& - Objects.equals(this.additionalProperties, timestampModel.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(peTimestamp, exportTimestamp, debugTimestamp, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TimestampModel {\n"); - sb.append(" peTimestamp: ").append(toIndentedString(peTimestamp)).append("\n"); - sb.append(" exportTimestamp: ").append(toIndentedString(exportTimestamp)).append("\n"); - sb.append(" debugTimestamp: ").append(toIndentedString(debugTimestamp)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("pe_timestamp", "export_timestamp", "debug_timestamp")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("pe_timestamp", "export_timestamp", "debug_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 TimestampModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TimestampModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TimestampModel is not found in the empty JSON string", TimestampModel.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TimestampModel.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TimestampModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TimestampModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TimestampModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TimestampModel 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 TimestampModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TimestampModel instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TimestampModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of TimestampModel - * @throws IOException if the JSON string is invalid with respect to TimestampModel - */ - public static TimestampModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TimestampModel.class); - } - - /** - * Convert an instance of TimestampModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TriageFunctionResponse.java b/src/main/java/ai/reveng/model/TriageFunctionResponse.java deleted file mode 100644 index 6fc748a..0000000 --- a/src/main/java/ai/reveng/model/TriageFunctionResponse.java +++ /dev/null @@ -1,484 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TriageFunctionResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TriageFunctionResponse { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private Integer id; - - public static final String SERIALIZED_NAME_ADDRESS = "address"; - @SerializedName(SERIALIZED_NAME_ADDRESS) - @javax.annotation.Nonnull - private Integer address; - - public static final String SERIALIZED_NAME_SUMMARY = "summary"; - @SerializedName(SERIALIZED_NAME_SUMMARY) - @javax.annotation.Nonnull - private String summary; - - public static final String SERIALIZED_NAME_SCORE = "score"; - @SerializedName(SERIALIZED_NAME_SCORE) - @javax.annotation.Nonnull - private BigDecimal score; - - /** - * Gets or Sets capabilities - */ - @JsonAdapter(CapabilitiesEnum.Adapter.class) - public enum CapabilitiesEnum { - PACKING_AND_OBFUSCATION("packing_and_obfuscation"), - - DEFENSE_EVASION("defense_evasion"), - - PRIVILEGE_ESCALATION("privilege_escalation"), - - PERSISTENCE_MECHANISMS("persistence_mechanisms"), - - DISCOVERY_AND_RECONNAISSANCE("discovery_and_reconnaissance"), - - CREDENTIAL_AND_DATA_COLLECTION("credential_and_data_collection"), - - COMMUNICATION_AND_C2("communication_and_c2"), - - CRYPTOGRAPHIC_OPERATIONS("cryptographic_operations"), - - PROCESS_AND_MEMORY_MANIPULATION("process_and_memory_manipulation"), - - PROCESS_AND_COMMAND_EXECUTION("process_and_command_execution"), - - FILE_ACTIVITY("file_activity"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - CapabilitiesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CapabilitiesEnum fromValue(String value) { - for (CapabilitiesEnum b : CapabilitiesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CapabilitiesEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CapabilitiesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CapabilitiesEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - CapabilitiesEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; - @SerializedName(SERIALIZED_NAME_CAPABILITIES) - @javax.annotation.Nonnull - private List capabilities = new ArrayList<>(); - - public TriageFunctionResponse() { - } - - public TriageFunctionResponse id(@javax.annotation.Nonnull Integer id) { - this.id = id; - return this; - } - - /** - * Unique identifier of the function - * @return id - */ - @javax.annotation.Nonnull - public Integer getId() { - return id; - } - - public void setId(@javax.annotation.Nonnull Integer id) { - this.id = id; - } - - - public TriageFunctionResponse address(@javax.annotation.Nonnull Integer address) { - this.address = address; - return this; - } - - /** - * Address of the function in the binary - * @return address - */ - @javax.annotation.Nonnull - public Integer getAddress() { - return address; - } - - public void setAddress(@javax.annotation.Nonnull Integer address) { - this.address = address; - } - - - public TriageFunctionResponse summary(@javax.annotation.Nonnull String summary) { - this.summary = summary; - return this; - } - - /** - * Summary of the function's behaviour - * @return summary - */ - @javax.annotation.Nonnull - public String getSummary() { - return summary; - } - - public void setSummary(@javax.annotation.Nonnull String summary) { - this.summary = summary; - } - - - public TriageFunctionResponse score(@javax.annotation.Nonnull BigDecimal score) { - this.score = score; - return this; - } - - /** - * Score indicating the function's relevance - * minimum: 0 - * maximum: 1 - * @return score - */ - @javax.annotation.Nonnull - public BigDecimal getScore() { - return score; - } - - public void setScore(@javax.annotation.Nonnull BigDecimal score) { - this.score = score; - } - - - public TriageFunctionResponse capabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - return this; - } - - public TriageFunctionResponse addCapabilitiesItem(CapabilitiesEnum capabilitiesItem) { - if (this.capabilities == null) { - this.capabilities = new ArrayList<>(); - } - this.capabilities.add(capabilitiesItem); - return this; - } - - /** - * List of capabilities exhibited by the function - * @return capabilities - */ - @javax.annotation.Nonnull - public List getCapabilities() { - return capabilities; - } - - public void setCapabilities(@javax.annotation.Nonnull List capabilities) { - this.capabilities = capabilities; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the TriageFunctionResponse instance itself - */ - public TriageFunctionResponse 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; - } - TriageFunctionResponse triageFunctionResponse = (TriageFunctionResponse) o; - return Objects.equals(this.id, triageFunctionResponse.id) && - Objects.equals(this.address, triageFunctionResponse.address) && - Objects.equals(this.summary, triageFunctionResponse.summary) && - Objects.equals(this.score, triageFunctionResponse.score) && - Objects.equals(this.capabilities, triageFunctionResponse.capabilities)&& - Objects.equals(this.additionalProperties, triageFunctionResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(id, address, summary, score, capabilities, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TriageFunctionResponse {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" address: ").append(toIndentedString(address)).append("\n"); - sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); - sb.append(" score: ").append(toIndentedString(score)).append("\n"); - sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "address", "summary", "score", "capabilities")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "address", "summary", "score", "capabilities")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TriageFunctionResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TriageFunctionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TriageFunctionResponse is not found in the empty JSON string", TriageFunctionResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TriageFunctionResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("summary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary").toString())); - } - // ensure the required json array is present - if (jsonObj.get("capabilities") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("capabilities").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TriageFunctionResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TriageFunctionResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TriageFunctionResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TriageFunctionResponse 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 TriageFunctionResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TriageFunctionResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TriageFunctionResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of TriageFunctionResponse - * @throws IOException if the JSON string is invalid with respect to TriageFunctionResponse - */ - public static TriageFunctionResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TriageFunctionResponse.class); - } - - /** - * Convert an instance of TriageFunctionResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TriageReportResponse.java b/src/main/java/ai/reveng/model/TriageReportResponse.java deleted file mode 100644 index 1ba506d..0000000 --- a/src/main/java/ai/reveng/model/TriageReportResponse.java +++ /dev/null @@ -1,365 +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 ai.reveng.model.TriageFunctionResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TriageReportResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TriageReportResponse { - public static final String SERIALIZED_NAME_SOFTWARE_SCORE = "software_score"; - @SerializedName(SERIALIZED_NAME_SOFTWARE_SCORE) - @javax.annotation.Nonnull - private BigDecimal softwareScore; - - public static final String SERIALIZED_NAME_SUMMARY = "summary"; - @SerializedName(SERIALIZED_NAME_SUMMARY) - @javax.annotation.Nonnull - private String summary; - - public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; - @SerializedName(SERIALIZED_NAME_FUNCTIONS) - @javax.annotation.Nonnull - private List functions = new ArrayList<>(); - - public TriageReportResponse() { - } - - public TriageReportResponse softwareScore(@javax.annotation.Nonnull BigDecimal softwareScore) { - this.softwareScore = softwareScore; - return this; - } - - /** - * Overall triage score for the software - * minimum: 0 - * maximum: 1 - * @return softwareScore - */ - @javax.annotation.Nonnull - public BigDecimal getSoftwareScore() { - return softwareScore; - } - - public void setSoftwareScore(@javax.annotation.Nonnull BigDecimal softwareScore) { - this.softwareScore = softwareScore; - } - - - public TriageReportResponse summary(@javax.annotation.Nonnull String summary) { - this.summary = summary; - return this; - } - - /** - * Summary of the triage analysis - * @return summary - */ - @javax.annotation.Nonnull - public String getSummary() { - return summary; - } - - public void setSummary(@javax.annotation.Nonnull String summary) { - this.summary = summary; - } - - - public TriageReportResponse functions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - return this; - } - - public TriageReportResponse addFunctionsItem(TriageFunctionResponse functionsItem) { - if (this.functions == null) { - this.functions = new ArrayList<>(); - } - this.functions.add(functionsItem); - return this; - } - - /** - * List of triaged functions - * @return functions - */ - @javax.annotation.Nonnull - public List getFunctions() { - return functions; - } - - public void setFunctions(@javax.annotation.Nonnull List functions) { - this.functions = functions; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the TriageReportResponse instance itself - */ - public TriageReportResponse 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; - } - TriageReportResponse triageReportResponse = (TriageReportResponse) o; - return Objects.equals(this.softwareScore, triageReportResponse.softwareScore) && - Objects.equals(this.summary, triageReportResponse.summary) && - Objects.equals(this.functions, triageReportResponse.functions)&& - Objects.equals(this.additionalProperties, triageReportResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(softwareScore, summary, functions, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TriageReportResponse {\n"); - sb.append(" softwareScore: ").append(toIndentedString(softwareScore)).append("\n"); - sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); - sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("software_score", "summary", "functions")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("software_score", "summary", "functions")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TriageReportResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TriageReportResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TriageReportResponse is not found in the empty JSON string", TriageReportResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TriageReportResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("summary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary").toString())); - } - if (jsonObj.get("functions") != null) { - if (!jsonObj.get("functions").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `functions` to be an array in the JSON string but got `%s`", jsonObj.get("functions").toString())); - } - JsonArray jsonArrayfunctions = jsonObj.getAsJsonArray("functions"); - // validate the required field `functions` (array) - for (int i = 0; i < jsonArrayfunctions.size(); i++) { - TriageFunctionResponse.validateJsonElement(jsonArrayfunctions.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TriageReportResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TriageReportResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TriageReportResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TriageReportResponse 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 TriageReportResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TriageReportResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TriageReportResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of TriageReportResponse - * @throws IOException if the JSON string is invalid with respect to TriageReportResponse - */ - public static TriageReportResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TriageReportResponse.class); - } - - /** - * Convert an instance of TriageReportResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/TypeDefinition.java b/src/main/java/ai/reveng/model/TypeDefinition.java deleted file mode 100644 index f7e29f5..0000000 --- a/src/main/java/ai/reveng/model/TypeDefinition.java +++ /dev/null @@ -1,388 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * TypeDefinition - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TypeDefinition { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_ARTIFACT_TYPE = "artifact_type"; - @SerializedName(SERIALIZED_NAME_ARTIFACT_TYPE) - @javax.annotation.Nullable - private String artifactType; - - public TypeDefinition() { - } - - public TypeDefinition lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this type definition - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public TypeDefinition name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the type definition - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public TypeDefinition type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Underlying type of the type definition - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public TypeDefinition artifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - return this; - } - - /** - * Type of artifact the type definition is associated with - * @return artifactType - */ - @javax.annotation.Nullable - public String getArtifactType() { - return artifactType; - } - - public void setArtifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - } - - /** - * 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 TypeDefinition instance itself - */ - public TypeDefinition 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; - } - TypeDefinition typeDefinition = (TypeDefinition) o; - return Objects.equals(this.lastChange, typeDefinition.lastChange) && - Objects.equals(this.name, typeDefinition.name) && - Objects.equals(this.type, typeDefinition.type) && - Objects.equals(this.artifactType, typeDefinition.artifactType)&& - Objects.equals(this.additionalProperties, typeDefinition.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(lastChange, name, type, artifactType, 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 TypeDefinition {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" artifactType: ").append(toIndentedString(artifactType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "name", "type", "artifact_type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TypeDefinition - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TypeDefinition.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in TypeDefinition is not found in the empty JSON string", TypeDefinition.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TypeDefinition.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if ((jsonObj.get("artifact_type") != null && !jsonObj.get("artifact_type").isJsonNull()) && !jsonObj.get("artifact_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `artifact_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("artifact_type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TypeDefinition.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TypeDefinition' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TypeDefinition.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TypeDefinition 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 TypeDefinition read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - TypeDefinition instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TypeDefinition given an JSON string - * - * @param jsonString JSON string - * @return An instance of TypeDefinition - * @throws IOException if the JSON string is invalid with respect to TypeDefinition - */ - public static TypeDefinition fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TypeDefinition.class); - } - - /** - * Convert an instance of TypeDefinition to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/UploadFileType.java b/src/main/java/ai/reveng/model/UploadFileType.java deleted file mode 100644 index 2241000..0000000 --- a/src/main/java/ai/reveng/model/UploadFileType.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets UploadFileType - */ -@JsonAdapter(UploadFileType.Adapter.class) -public enum UploadFileType { - - BINARY("BINARY"), - - DEBUG("DEBUG"), - - PACKED("PACKED"), - - FIRMWARE("FIRMWARE"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - UploadFileType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static UploadFileType fromValue(String value) { - for (UploadFileType b : UploadFileType.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final UploadFileType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public UploadFileType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return UploadFileType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - UploadFileType.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/UploadResponse.java b/src/main/java/ai/reveng/model/UploadResponse.java deleted file mode 100644 index e2637ba..0000000 --- a/src/main/java/ai/reveng/model/UploadResponse.java +++ /dev/null @@ -1,454 +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 ai.reveng.model.UploadFileType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * UploadResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class UploadResponse { - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_FILE_TYPE = "file_type"; - @SerializedName(SERIALIZED_NAME_FILE_TYPE) - @javax.annotation.Nonnull - private UploadFileType fileType; - - public static final String SERIALIZED_NAME_FILENAME = "filename"; - @SerializedName(SERIALIZED_NAME_FILENAME) - @javax.annotation.Nonnull - private String filename; - - public static final String SERIALIZED_NAME_MIME = "mime"; - @SerializedName(SERIALIZED_NAME_MIME) - @javax.annotation.Nonnull - private String mime; - - public static final String SERIALIZED_NAME_IS_ARCHIVE = "is_archive"; - @SerializedName(SERIALIZED_NAME_IS_ARCHIVE) - @javax.annotation.Nonnull - private Boolean isArchive; - - public static final String SERIALIZED_NAME_CAN_SANDBOX = "can_sandbox"; - @SerializedName(SERIALIZED_NAME_CAN_SANDBOX) - @javax.annotation.Nonnull - private Boolean canSandbox; - - public static final String SERIALIZED_NAME_CAN_EXTRACT = "can_extract"; - @SerializedName(SERIALIZED_NAME_CAN_EXTRACT) - @javax.annotation.Nonnull - private Boolean canExtract; - - public UploadResponse() { - } - - public UploadResponse sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * Get sha256Hash - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public UploadResponse fileType(@javax.annotation.Nonnull UploadFileType fileType) { - this.fileType = fileType; - return this; - } - - /** - * Get fileType - * @return fileType - */ - @javax.annotation.Nonnull - public UploadFileType getFileType() { - return fileType; - } - - public void setFileType(@javax.annotation.Nonnull UploadFileType fileType) { - this.fileType = fileType; - } - - - public UploadResponse filename(@javax.annotation.Nonnull String filename) { - this.filename = filename; - return this; - } - - /** - * Get filename - * @return filename - */ - @javax.annotation.Nonnull - public String getFilename() { - return filename; - } - - public void setFilename(@javax.annotation.Nonnull String filename) { - this.filename = filename; - } - - - public UploadResponse mime(@javax.annotation.Nonnull String mime) { - this.mime = mime; - return this; - } - - /** - * Get mime - * @return mime - */ - @javax.annotation.Nonnull - public String getMime() { - return mime; - } - - public void setMime(@javax.annotation.Nonnull String mime) { - this.mime = mime; - } - - - public UploadResponse isArchive(@javax.annotation.Nonnull Boolean isArchive) { - this.isArchive = isArchive; - return this; - } - - /** - * Get isArchive - * @return isArchive - */ - @javax.annotation.Nonnull - public Boolean getIsArchive() { - return isArchive; - } - - public void setIsArchive(@javax.annotation.Nonnull Boolean isArchive) { - this.isArchive = isArchive; - } - - - public UploadResponse canSandbox(@javax.annotation.Nonnull Boolean canSandbox) { - this.canSandbox = canSandbox; - return this; - } - - /** - * Get canSandbox - * @return canSandbox - */ - @javax.annotation.Nonnull - public Boolean getCanSandbox() { - return canSandbox; - } - - public void setCanSandbox(@javax.annotation.Nonnull Boolean canSandbox) { - this.canSandbox = canSandbox; - } - - - public UploadResponse canExtract(@javax.annotation.Nonnull Boolean canExtract) { - this.canExtract = canExtract; - return this; - } - - /** - * Get canExtract - * @return canExtract - */ - @javax.annotation.Nonnull - public Boolean getCanExtract() { - return canExtract; - } - - public void setCanExtract(@javax.annotation.Nonnull Boolean canExtract) { - this.canExtract = canExtract; - } - - /** - * 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 UploadResponse instance itself - */ - public UploadResponse 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; - } - UploadResponse uploadResponse = (UploadResponse) o; - return Objects.equals(this.sha256Hash, uploadResponse.sha256Hash) && - Objects.equals(this.fileType, uploadResponse.fileType) && - Objects.equals(this.filename, uploadResponse.filename) && - Objects.equals(this.mime, uploadResponse.mime) && - Objects.equals(this.isArchive, uploadResponse.isArchive) && - Objects.equals(this.canSandbox, uploadResponse.canSandbox) && - Objects.equals(this.canExtract, uploadResponse.canExtract)&& - Objects.equals(this.additionalProperties, uploadResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(sha256Hash, fileType, filename, mime, isArchive, canSandbox, canExtract, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UploadResponse {\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" fileType: ").append(toIndentedString(fileType)).append("\n"); - sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); - sb.append(" mime: ").append(toIndentedString(mime)).append("\n"); - sb.append(" isArchive: ").append(toIndentedString(isArchive)).append("\n"); - sb.append(" canSandbox: ").append(toIndentedString(canSandbox)).append("\n"); - sb.append(" canExtract: ").append(toIndentedString(canExtract)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("sha_256_hash", "file_type", "filename", "mime", "is_archive", "can_sandbox", "can_extract")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("sha_256_hash", "file_type", "filename", "mime", "is_archive", "can_sandbox", "can_extract")); - } - - /** - * 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 UploadResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UploadResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UploadResponse is not found in the empty JSON string", UploadResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UploadResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - // validate the required field `file_type` - UploadFileType.validateJsonElement(jsonObj.get("file_type")); - if (!jsonObj.get("filename").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); - } - if (!jsonObj.get("mime").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `mime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mime").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UploadResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UploadResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UploadResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UploadResponse 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 UploadResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UploadResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UploadResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of UploadResponse - * @throws IOException if the JSON string is invalid with respect to UploadResponse - */ - public static UploadResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UploadResponse.class); - } - - /** - * Convert an instance of UploadResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/UpsertAiDecomplationRatingRequest.java b/src/main/java/ai/reveng/model/UpsertAiDecomplationRatingRequest.java deleted file mode 100644 index 1c0efd7..0000000 --- a/src/main/java/ai/reveng/model/UpsertAiDecomplationRatingRequest.java +++ /dev/null @@ -1,318 +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 ai.reveng.model.AiDecompilationRating; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * UpsertAiDecomplationRatingRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class UpsertAiDecomplationRatingRequest { - public static final String SERIALIZED_NAME_RATING = "rating"; - @SerializedName(SERIALIZED_NAME_RATING) - @javax.annotation.Nonnull - private AiDecompilationRating rating; - - public static final String SERIALIZED_NAME_REASON = "reason"; - @SerializedName(SERIALIZED_NAME_REASON) - @javax.annotation.Nullable - private String reason; - - public UpsertAiDecomplationRatingRequest() { - } - - public UpsertAiDecomplationRatingRequest rating(@javax.annotation.Nonnull AiDecompilationRating rating) { - this.rating = rating; - return this; - } - - /** - * The rating for the AI decompilation response - * @return rating - */ - @javax.annotation.Nonnull - public AiDecompilationRating getRating() { - return rating; - } - - public void setRating(@javax.annotation.Nonnull AiDecompilationRating rating) { - this.rating = rating; - } - - - public UpsertAiDecomplationRatingRequest reason(@javax.annotation.Nullable String reason) { - this.reason = reason; - return this; - } - - /** - * An optional reason for the rating - * @return reason - */ - @javax.annotation.Nullable - public String getReason() { - return reason; - } - - public void setReason(@javax.annotation.Nullable String reason) { - this.reason = reason; - } - - /** - * 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 UpsertAiDecomplationRatingRequest instance itself - */ - public UpsertAiDecomplationRatingRequest 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; - } - UpsertAiDecomplationRatingRequest upsertAiDecomplationRatingRequest = (UpsertAiDecomplationRatingRequest) o; - return Objects.equals(this.rating, upsertAiDecomplationRatingRequest.rating) && - Objects.equals(this.reason, upsertAiDecomplationRatingRequest.reason)&& - Objects.equals(this.additionalProperties, upsertAiDecomplationRatingRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(rating, reason, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpsertAiDecomplationRatingRequest {\n"); - sb.append(" rating: ").append(toIndentedString(rating)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("rating", "reason")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("rating", "reason")); - } - - /** - * 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 UpsertAiDecomplationRatingRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpsertAiDecomplationRatingRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpsertAiDecomplationRatingRequest is not found in the empty JSON string", UpsertAiDecomplationRatingRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpsertAiDecomplationRatingRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `rating` - AiDecompilationRating.validateJsonElement(jsonObj.get("rating")); - if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) && !jsonObj.get("reason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpsertAiDecomplationRatingRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpsertAiDecomplationRatingRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpsertAiDecomplationRatingRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UpsertAiDecomplationRatingRequest 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 UpsertAiDecomplationRatingRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UpsertAiDecomplationRatingRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UpsertAiDecomplationRatingRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpsertAiDecomplationRatingRequest - * @throws IOException if the JSON string is invalid with respect to UpsertAiDecomplationRatingRequest - */ - public static UpsertAiDecomplationRatingRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpsertAiDecomplationRatingRequest.class); - } - - /** - * Convert an instance of UpsertAiDecomplationRatingRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/UserActivityResponse.java b/src/main/java/ai/reveng/model/UserActivityResponse.java deleted file mode 100644 index 9c013cd..0000000 --- a/src/main/java/ai/reveng/model/UserActivityResponse.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * UserActivityResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class UserActivityResponse { - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - @javax.annotation.Nonnull - private String actions; - - public static final String SERIALIZED_NAME_ACTIVITY_SCOPE = "activity_scope"; - @SerializedName(SERIALIZED_NAME_ACTIVITY_SCOPE) - @javax.annotation.Nonnull - private String activityScope; - - public static final String SERIALIZED_NAME_CREATION = "creation"; - @SerializedName(SERIALIZED_NAME_CREATION) - @javax.annotation.Nonnull - private OffsetDateTime creation; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - @javax.annotation.Nonnull - private String message; - - public static final String SERIALIZED_NAME_SOURCES = "sources"; - @SerializedName(SERIALIZED_NAME_SOURCES) - @javax.annotation.Nonnull - private String sources; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - @javax.annotation.Nonnull - private String username; - - public UserActivityResponse() { - } - - public UserActivityResponse actions(@javax.annotation.Nonnull String actions) { - this.actions = actions; - return this; - } - - /** - * Get actions - * @return actions - */ - @javax.annotation.Nonnull - public String getActions() { - return actions; - } - - public void setActions(@javax.annotation.Nonnull String actions) { - this.actions = actions; - } - - - public UserActivityResponse activityScope(@javax.annotation.Nonnull String activityScope) { - this.activityScope = activityScope; - return this; - } - - /** - * Get activityScope - * @return activityScope - */ - @javax.annotation.Nonnull - public String getActivityScope() { - return activityScope; - } - - public void setActivityScope(@javax.annotation.Nonnull String activityScope) { - this.activityScope = activityScope; - } - - - public UserActivityResponse creation(@javax.annotation.Nonnull OffsetDateTime creation) { - this.creation = creation; - return this; - } - - /** - * Get creation - * @return creation - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreation() { - return creation; - } - - public void setCreation(@javax.annotation.Nonnull OffsetDateTime creation) { - this.creation = creation; - } - - - public UserActivityResponse message(@javax.annotation.Nonnull String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(@javax.annotation.Nonnull String message) { - this.message = message; - } - - - public UserActivityResponse sources(@javax.annotation.Nonnull String sources) { - this.sources = sources; - return this; - } - - /** - * Get sources - * @return sources - */ - @javax.annotation.Nonnull - public String getSources() { - return sources; - } - - public void setSources(@javax.annotation.Nonnull String sources) { - this.sources = sources; - } - - - public UserActivityResponse username(@javax.annotation.Nonnull String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(@javax.annotation.Nonnull String username) { - this.username = username; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the UserActivityResponse instance itself - */ - public UserActivityResponse 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; - } - UserActivityResponse userActivityResponse = (UserActivityResponse) o; - return Objects.equals(this.actions, userActivityResponse.actions) && - Objects.equals(this.activityScope, userActivityResponse.activityScope) && - Objects.equals(this.creation, userActivityResponse.creation) && - Objects.equals(this.message, userActivityResponse.message) && - Objects.equals(this.sources, userActivityResponse.sources) && - Objects.equals(this.username, userActivityResponse.username)&& - Objects.equals(this.additionalProperties, userActivityResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(actions, activityScope, creation, message, sources, username, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserActivityResponse {\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" activityScope: ").append(toIndentedString(activityScope)).append("\n"); - sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" sources: ").append(toIndentedString(sources)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("actions", "activity_scope", "creation", "message", "sources", "username")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("actions", "activity_scope", "creation", "message", "sources", "username")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserActivityResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserActivityResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UserActivityResponse is not found in the empty JSON string", UserActivityResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserActivityResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("actions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `actions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - if (!jsonObj.get("activity_scope").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `activity_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activity_scope").toString())); - } - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - if (!jsonObj.get("sources").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sources` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sources").toString())); - } - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserActivityResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserActivityResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserActivityResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserActivityResponse 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 UserActivityResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - UserActivityResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserActivityResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserActivityResponse - * @throws IOException if the JSON string is invalid with respect to UserActivityResponse - */ - public static UserActivityResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserActivityResponse.class); - } - - /** - * Convert an instance of UserActivityResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/UserIdentity.java b/src/main/java/ai/reveng/model/UserIdentity.java index 40e1bc9..d24bf32 100644 --- a/src/main/java/ai/reveng/model/UserIdentity.java +++ b/src/main/java/ai/reveng/model/UserIdentity.java @@ -57,12 +57,12 @@ public class UserIdentity { public static final String SERIALIZED_NAME_ISSUER_URL = "issuer_url"; @SerializedName(SERIALIZED_NAME_ISSUER_URL) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String issuerUrl; public static final String SERIALIZED_NAME_SUBJECT = "subject"; @SerializedName(SERIALIZED_NAME_SUBJECT) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String subject; public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; @@ -102,40 +102,40 @@ public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { } - public UserIdentity issuerUrl(@javax.annotation.Nullable String issuerUrl) { + public UserIdentity issuerUrl(@javax.annotation.Nonnull String issuerUrl) { this.issuerUrl = issuerUrl; return this; } /** - * Search is applied to string value + * Get issuerUrl * @return issuerUrl */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getIssuerUrl() { return issuerUrl; } - public void setIssuerUrl(@javax.annotation.Nullable String issuerUrl) { + public void setIssuerUrl(@javax.annotation.Nonnull String issuerUrl) { this.issuerUrl = issuerUrl; } - public UserIdentity subject(@javax.annotation.Nullable String subject) { + public UserIdentity subject(@javax.annotation.Nonnull String subject) { this.subject = subject; return this; } /** - * Search is applied to string value + * Get subject * @return subject */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getSubject() { return subject; } - public void setSubject(@javax.annotation.Nullable String subject) { + public void setSubject(@javax.annotation.Nonnull String subject) { this.subject = subject; } @@ -320,10 +320,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("issuer_url") != null && !jsonObj.get("issuer_url").isJsonNull()) && !jsonObj.get("issuer_url").isJsonPrimitive()) { + if (!jsonObj.get("issuer_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `issuer_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer_url").toString())); } - if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) { + if (!jsonObj.get("subject").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString())); } } diff --git a/src/main/java/ai/reveng/model/V2FunctionHeader.java b/src/main/java/ai/reveng/model/V2FunctionHeader.java deleted file mode 100644 index 119e912..0000000 --- a/src/main/java/ai/reveng/model/V2FunctionHeader.java +++ /dev/null @@ -1,422 +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 ai.reveng.model.Argument; -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.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * V2FunctionHeader - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class V2FunctionHeader { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_ADDR = "addr"; - @SerializedName(SERIALIZED_NAME_ADDR) - @javax.annotation.Nonnull - private Integer addr; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_ARGS = "args"; - @SerializedName(SERIALIZED_NAME_ARGS) - @javax.annotation.Nonnull - private Map args = new HashMap<>(); - - public V2FunctionHeader() { - } - - public V2FunctionHeader lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this function header - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public V2FunctionHeader name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the function - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public V2FunctionHeader addr(@javax.annotation.Nonnull Integer addr) { - this.addr = addr; - return this; - } - - /** - * Memory address of the function - * @return addr - */ - @javax.annotation.Nonnull - public Integer getAddr() { - return addr; - } - - public void setAddr(@javax.annotation.Nonnull Integer addr) { - this.addr = addr; - } - - - public V2FunctionHeader type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Return type of the function - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public V2FunctionHeader args(@javax.annotation.Nonnull Map args) { - this.args = args; - return this; - } - - public V2FunctionHeader putArgsItem(String key, Argument argsItem) { - if (this.args == null) { - this.args = new HashMap<>(); - } - this.args.put(key, argsItem); - return this; - } - - /** - * Dictionary of function arguments - * @return args - */ - @javax.annotation.Nonnull - public Map getArgs() { - return args; - } - - public void setArgs(@javax.annotation.Nonnull Map args) { - this.args = args; - } - - /** - * 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 V2FunctionHeader instance itself - */ - public V2FunctionHeader 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; - } - V2FunctionHeader v2FunctionHeader = (V2FunctionHeader) o; - return Objects.equals(this.lastChange, v2FunctionHeader.lastChange) && - Objects.equals(this.name, v2FunctionHeader.name) && - Objects.equals(this.addr, v2FunctionHeader.addr) && - Objects.equals(this.type, v2FunctionHeader.type) && - Objects.equals(this.args, v2FunctionHeader.args)&& - Objects.equals(this.additionalProperties, v2FunctionHeader.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(lastChange, name, addr, type, args, 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 V2FunctionHeader {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" args: ").append(toIndentedString(args)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "name", "addr", "type", "args")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "addr", "type", "args")); - } - - /** - * 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 V2FunctionHeader - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!V2FunctionHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in V2FunctionHeader is not found in the empty JSON string", V2FunctionHeader.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V2FunctionHeader.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V2FunctionHeader.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V2FunctionHeader' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V2FunctionHeader.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V2FunctionHeader 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 V2FunctionHeader read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - V2FunctionHeader instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V2FunctionHeader given an JSON string - * - * @param jsonString JSON string - * @return An instance of V2FunctionHeader - * @throws IOException if the JSON string is invalid with respect to V2FunctionHeader - */ - public static V2FunctionHeader fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V2FunctionHeader.class); - } - - /** - * Convert an instance of V2FunctionHeader to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/V2FunctionInfo.java b/src/main/java/ai/reveng/model/V2FunctionInfo.java deleted file mode 100644 index f9637f3..0000000 --- a/src/main/java/ai/reveng/model/V2FunctionInfo.java +++ /dev/null @@ -1,350 +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 ai.reveng.model.FuncDepsInner; -import ai.reveng.model.V2FunctionType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * V2FunctionInfo - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class V2FunctionInfo { - public static final String SERIALIZED_NAME_FUNC_TYPES = "func_types"; - @SerializedName(SERIALIZED_NAME_FUNC_TYPES) - @javax.annotation.Nullable - private V2FunctionType funcTypes; - - public static final String SERIALIZED_NAME_FUNC_DEPS = "func_deps"; - @SerializedName(SERIALIZED_NAME_FUNC_DEPS) - @javax.annotation.Nonnull - private List funcDeps = new ArrayList<>(); - - public V2FunctionInfo() { - } - - public V2FunctionInfo funcTypes(@javax.annotation.Nullable V2FunctionType funcTypes) { - this.funcTypes = funcTypes; - return this; - } - - /** - * Function type information - * @return funcTypes - */ - @javax.annotation.Nullable - public V2FunctionType getFuncTypes() { - return funcTypes; - } - - public void setFuncTypes(@javax.annotation.Nullable V2FunctionType funcTypes) { - this.funcTypes = funcTypes; - } - - - public V2FunctionInfo funcDeps(@javax.annotation.Nonnull List funcDeps) { - this.funcDeps = funcDeps; - return this; - } - - public V2FunctionInfo addFuncDepsItem(FuncDepsInner funcDepsItem) { - if (this.funcDeps == null) { - this.funcDeps = new ArrayList<>(); - } - this.funcDeps.add(funcDepsItem); - return this; - } - - /** - * List of function dependencies - * @return funcDeps - */ - @javax.annotation.Nonnull - public List getFuncDeps() { - return funcDeps; - } - - public void setFuncDeps(@javax.annotation.Nonnull List funcDeps) { - this.funcDeps = funcDeps; - } - - /** - * 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 V2FunctionInfo instance itself - */ - public V2FunctionInfo 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; - } - V2FunctionInfo v2FunctionInfo = (V2FunctionInfo) o; - return Objects.equals(this.funcTypes, v2FunctionInfo.funcTypes) && - Objects.equals(this.funcDeps, v2FunctionInfo.funcDeps)&& - Objects.equals(this.additionalProperties, v2FunctionInfo.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(funcTypes, funcDeps, 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 V2FunctionInfo {\n"); - sb.append(" funcTypes: ").append(toIndentedString(funcTypes)).append("\n"); - sb.append(" funcDeps: ").append(toIndentedString(funcDeps)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("func_types", "func_deps")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("func_deps")); - } - - /** - * 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 V2FunctionInfo - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!V2FunctionInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in V2FunctionInfo is not found in the empty JSON string", V2FunctionInfo.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V2FunctionInfo.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `func_types` - if (jsonObj.get("func_types") != null && !jsonObj.get("func_types").isJsonNull()) { - V2FunctionType.validateJsonElement(jsonObj.get("func_types")); - } - if (jsonObj.get("func_deps") != null) { - if (!jsonObj.get("func_deps").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `func_deps` to be an array in the JSON string but got `%s`", jsonObj.get("func_deps").toString())); - } - JsonArray jsonArrayfuncDeps = jsonObj.getAsJsonArray("func_deps"); - // validate the required field `func_deps` (array) - for (int i = 0; i < jsonArrayfuncDeps.size(); i++) { - FuncDepsInner.validateJsonElement(jsonArrayfuncDeps.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V2FunctionInfo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V2FunctionInfo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V2FunctionInfo.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V2FunctionInfo 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 V2FunctionInfo read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - V2FunctionInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V2FunctionInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of V2FunctionInfo - * @throws IOException if the JSON string is invalid with respect to V2FunctionInfo - */ - public static V2FunctionInfo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V2FunctionInfo.class); - } - - /** - * Convert an instance of V2FunctionInfo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/V2FunctionType.java b/src/main/java/ai/reveng/model/V2FunctionType.java deleted file mode 100644 index 38d6fe3..0000000 --- a/src/main/java/ai/reveng/model/V2FunctionType.java +++ /dev/null @@ -1,506 +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 ai.reveng.model.StackVariable; -import ai.reveng.model.V2FunctionHeader; -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.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * V2FunctionType - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class V2FunctionType { - public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; - @SerializedName(SERIALIZED_NAME_LAST_CHANGE) - @javax.annotation.Nullable - private String lastChange; - - public static final String SERIALIZED_NAME_ADDR = "addr"; - @SerializedName(SERIALIZED_NAME_ADDR) - @javax.annotation.Nonnull - private Integer addr; - - public static final String SERIALIZED_NAME_SIZE = "size"; - @SerializedName(SERIALIZED_NAME_SIZE) - @javax.annotation.Nonnull - private Integer size; - - public static final String SERIALIZED_NAME_HEADER = "header"; - @SerializedName(SERIALIZED_NAME_HEADER) - @javax.annotation.Nonnull - private V2FunctionHeader header; - - public static final String SERIALIZED_NAME_STACK_VARS = "stack_vars"; - @SerializedName(SERIALIZED_NAME_STACK_VARS) - @javax.annotation.Nullable - private Map stackVars; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_ARTIFACT_TYPE = "artifact_type"; - @SerializedName(SERIALIZED_NAME_ARTIFACT_TYPE) - @javax.annotation.Nullable - private String artifactType = "Function"; - - public V2FunctionType() { - } - - public V2FunctionType lastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - return this; - } - - /** - * Timestamp of the last change to this function type - * @return lastChange - */ - @javax.annotation.Nullable - public String getLastChange() { - return lastChange; - } - - public void setLastChange(@javax.annotation.Nullable String lastChange) { - this.lastChange = lastChange; - } - - - public V2FunctionType addr(@javax.annotation.Nonnull Integer addr) { - this.addr = addr; - return this; - } - - /** - * Memory address of the function - * @return addr - */ - @javax.annotation.Nonnull - public Integer getAddr() { - return addr; - } - - public void setAddr(@javax.annotation.Nonnull Integer addr) { - this.addr = addr; - } - - - public V2FunctionType size(@javax.annotation.Nonnull Integer size) { - this.size = size; - return this; - } - - /** - * Size of the function in bytes - * @return size - */ - @javax.annotation.Nonnull - public Integer getSize() { - return size; - } - - public void setSize(@javax.annotation.Nonnull Integer size) { - this.size = size; - } - - - public V2FunctionType header(@javax.annotation.Nonnull V2FunctionHeader header) { - this.header = header; - return this; - } - - /** - * Function header information - * @return header - */ - @javax.annotation.Nonnull - public V2FunctionHeader getHeader() { - return header; - } - - public void setHeader(@javax.annotation.Nonnull V2FunctionHeader header) { - this.header = header; - } - - - public V2FunctionType stackVars(@javax.annotation.Nullable Map stackVars) { - this.stackVars = stackVars; - return this; - } - - public V2FunctionType putStackVarsItem(String key, StackVariable stackVarsItem) { - if (this.stackVars == null) { - this.stackVars = new HashMap<>(); - } - this.stackVars.put(key, stackVarsItem); - return this; - } - - /** - * Dictionary of stack variables - * @return stackVars - */ - @javax.annotation.Nullable - public Map getStackVars() { - return stackVars; - } - - public void setStackVars(@javax.annotation.Nullable Map stackVars) { - this.stackVars = stackVars; - } - - - public V2FunctionType name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * Name of the function - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public V2FunctionType type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Return type of the function - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public V2FunctionType artifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - return this; - } - - /** - * Type of artifact that the structure is associated with - * @return artifactType - */ - @javax.annotation.Nullable - public String getArtifactType() { - return artifactType; - } - - public void setArtifactType(@javax.annotation.Nullable String artifactType) { - this.artifactType = artifactType; - } - - /** - * 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 V2FunctionType instance itself - */ - public V2FunctionType 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; - } - V2FunctionType v2FunctionType = (V2FunctionType) o; - return Objects.equals(this.lastChange, v2FunctionType.lastChange) && - Objects.equals(this.addr, v2FunctionType.addr) && - Objects.equals(this.size, v2FunctionType.size) && - Objects.equals(this.header, v2FunctionType.header) && - Objects.equals(this.stackVars, v2FunctionType.stackVars) && - Objects.equals(this.name, v2FunctionType.name) && - Objects.equals(this.type, v2FunctionType.type) && - Objects.equals(this.artifactType, v2FunctionType.artifactType)&& - Objects.equals(this.additionalProperties, v2FunctionType.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(lastChange, addr, size, header, stackVars, name, type, artifactType, 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 V2FunctionType {\n"); - sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); - sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" header: ").append(toIndentedString(header)).append("\n"); - sb.append(" stackVars: ").append(toIndentedString(stackVars)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" artifactType: ").append(toIndentedString(artifactType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("last_change", "addr", "size", "header", "stack_vars", "name", "type", "artifact_type")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("addr", "size", "header", "name", "type")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to V2FunctionType - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!V2FunctionType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in V2FunctionType is not found in the empty JSON string", V2FunctionType.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V2FunctionType.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("last_change") != null && !jsonObj.get("last_change").isJsonNull()) && !jsonObj.get("last_change").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `last_change` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_change").toString())); - } - // validate the required field `header` - V2FunctionHeader.validateJsonElement(jsonObj.get("header")); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if ((jsonObj.get("artifact_type") != null && !jsonObj.get("artifact_type").isJsonNull()) && !jsonObj.get("artifact_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `artifact_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("artifact_type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V2FunctionType.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V2FunctionType' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V2FunctionType.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V2FunctionType 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 V2FunctionType read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - V2FunctionType instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V2FunctionType given an JSON string - * - * @param jsonString JSON string - * @return An instance of V2FunctionType - * @throws IOException if the JSON string is invalid with respect to V2FunctionType - */ - public static V2FunctionType fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V2FunctionType.class); - } - - /** - * Convert an instance of V2FunctionType to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Vulnerabilities.java b/src/main/java/ai/reveng/model/Vulnerabilities.java deleted file mode 100644 index 6e2086f..0000000 --- a/src/main/java/ai/reveng/model/Vulnerabilities.java +++ /dev/null @@ -1,307 +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 ai.reveng.model.Vulnerability; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Vulnerabilities - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Vulnerabilities { - public static final String SERIALIZED_NAME_VULNERABILITIES = "vulnerabilities"; - @SerializedName(SERIALIZED_NAME_VULNERABILITIES) - @javax.annotation.Nonnull - private List vulnerabilities = new ArrayList<>(); - - public Vulnerabilities() { - } - - public Vulnerabilities vulnerabilities(@javax.annotation.Nonnull List vulnerabilities) { - this.vulnerabilities = vulnerabilities; - return this; - } - - public Vulnerabilities addVulnerabilitiesItem(Vulnerability vulnerabilitiesItem) { - if (this.vulnerabilities == null) { - this.vulnerabilities = new ArrayList<>(); - } - this.vulnerabilities.add(vulnerabilitiesItem); - return this; - } - - /** - * Get vulnerabilities - * @return vulnerabilities - */ - @javax.annotation.Nonnull - public List getVulnerabilities() { - return vulnerabilities; - } - - public void setVulnerabilities(@javax.annotation.Nonnull List vulnerabilities) { - this.vulnerabilities = vulnerabilities; - } - - /** - * 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 Vulnerabilities instance itself - */ - public Vulnerabilities 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; - } - Vulnerabilities vulnerabilities = (Vulnerabilities) o; - return Objects.equals(this.vulnerabilities, vulnerabilities.vulnerabilities)&& - Objects.equals(this.additionalProperties, vulnerabilities.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(vulnerabilities, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Vulnerabilities {\n"); - sb.append(" vulnerabilities: ").append(toIndentedString(vulnerabilities)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("vulnerabilities")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("vulnerabilities")); - } - - /** - * 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 Vulnerabilities - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Vulnerabilities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Vulnerabilities is not found in the empty JSON string", Vulnerabilities.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Vulnerabilities.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("vulnerabilities") != null) { - if (!jsonObj.get("vulnerabilities").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `vulnerabilities` to be an array in the JSON string but got `%s`", jsonObj.get("vulnerabilities").toString())); - } - JsonArray jsonArrayvulnerabilities = jsonObj.getAsJsonArray("vulnerabilities"); - // validate the required field `vulnerabilities` (array) - for (int i = 0; i < jsonArrayvulnerabilities.size(); i++) { - Vulnerability.validateJsonElement(jsonArrayvulnerabilities.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Vulnerabilities.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Vulnerabilities' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Vulnerabilities.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Vulnerabilities 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 Vulnerabilities read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Vulnerabilities instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Vulnerabilities given an JSON string - * - * @param jsonString JSON string - * @return An instance of Vulnerabilities - * @throws IOException if the JSON string is invalid with respect to Vulnerabilities - */ - public static Vulnerabilities fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Vulnerabilities.class); - } - - /** - * Convert an instance of Vulnerabilities to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Vulnerability.java b/src/main/java/ai/reveng/model/Vulnerability.java deleted file mode 100644 index 9a540ba..0000000 --- a/src/main/java/ai/reveng/model/Vulnerability.java +++ /dev/null @@ -1,636 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * Vulnerability - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Vulnerability { - public static final String SERIALIZED_NAME_VENDOR = "vendor"; - @SerializedName(SERIALIZED_NAME_VENDOR) - @javax.annotation.Nonnull - private String vendor; - - public static final String SERIALIZED_NAME_PRODUCT = "product"; - @SerializedName(SERIALIZED_NAME_PRODUCT) - @javax.annotation.Nonnull - private String product; - - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - @javax.annotation.Nonnull - private String version; - - public static final String SERIALIZED_NAME_CVE_NUMBER = "cve_number"; - @SerializedName(SERIALIZED_NAME_CVE_NUMBER) - @javax.annotation.Nonnull - private String cveNumber; - - /** - * Gets or Sets severity - */ - @JsonAdapter(SeverityEnum.Adapter.class) - public enum SeverityEnum { - CRITICAL("CRITICAL"), - - HIGH("HIGH"), - - MEDIUM("MEDIUM"), - - LOW("LOW"), - - UNKNOWN("UNKNOWN"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - SeverityEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SeverityEnum fromValue(String value) { - for (SeverityEnum b : SeverityEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SeverityEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SeverityEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SeverityEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SeverityEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SEVERITY = "severity"; - @SerializedName(SERIALIZED_NAME_SEVERITY) - @javax.annotation.Nonnull - private SeverityEnum severity; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - @javax.annotation.Nonnull - private String source; - - public static final String SERIALIZED_NAME_CVSS_VERSION = "cvss_version"; - @SerializedName(SERIALIZED_NAME_CVSS_VERSION) - @javax.annotation.Nonnull - private String cvssVersion; - - public static final String SERIALIZED_NAME_CVSS_VECTOR = "cvss_vector"; - @SerializedName(SERIALIZED_NAME_CVSS_VECTOR) - @javax.annotation.Nonnull - private String cvssVector; - - public static final String SERIALIZED_NAME_REMARKS = "remarks"; - @SerializedName(SERIALIZED_NAME_REMARKS) - @javax.annotation.Nonnull - private String remarks; - - public static final String SERIALIZED_NAME_SCORE = "score"; - @SerializedName(SERIALIZED_NAME_SCORE) - @javax.annotation.Nonnull - private BigDecimal score; - - public static final String SERIALIZED_NAME_IS_UNKNOWN = "is_unknown"; - @SerializedName(SERIALIZED_NAME_IS_UNKNOWN) - @javax.annotation.Nullable - private Boolean isUnknown = false; - - public Vulnerability() { - } - - public Vulnerability vendor(@javax.annotation.Nonnull String vendor) { - this.vendor = vendor; - return this; - } - - /** - * Get vendor - * @return vendor - */ - @javax.annotation.Nonnull - public String getVendor() { - return vendor; - } - - public void setVendor(@javax.annotation.Nonnull String vendor) { - this.vendor = vendor; - } - - - public Vulnerability product(@javax.annotation.Nonnull String product) { - this.product = product; - return this; - } - - /** - * Get product - * @return product - */ - @javax.annotation.Nonnull - public String getProduct() { - return product; - } - - public void setProduct(@javax.annotation.Nonnull String product) { - this.product = product; - } - - - public Vulnerability version(@javax.annotation.Nonnull String version) { - this.version = version; - return this; - } - - /** - * Get version - * @return version - */ - @javax.annotation.Nonnull - public String getVersion() { - return version; - } - - public void setVersion(@javax.annotation.Nonnull String version) { - this.version = version; - } - - - public Vulnerability cveNumber(@javax.annotation.Nonnull String cveNumber) { - this.cveNumber = cveNumber; - return this; - } - - /** - * Get cveNumber - * @return cveNumber - */ - @javax.annotation.Nonnull - public String getCveNumber() { - return cveNumber; - } - - public void setCveNumber(@javax.annotation.Nonnull String cveNumber) { - this.cveNumber = cveNumber; - } - - - public Vulnerability severity(@javax.annotation.Nonnull SeverityEnum severity) { - this.severity = severity; - return this; - } - - /** - * Get severity - * @return severity - */ - @javax.annotation.Nonnull - public SeverityEnum getSeverity() { - return severity; - } - - public void setSeverity(@javax.annotation.Nonnull SeverityEnum severity) { - this.severity = severity; - } - - - public Vulnerability source(@javax.annotation.Nonnull String source) { - this.source = source; - return this; - } - - /** - * Get source - * @return source - */ - @javax.annotation.Nonnull - public String getSource() { - return source; - } - - public void setSource(@javax.annotation.Nonnull String source) { - this.source = source; - } - - - public Vulnerability cvssVersion(@javax.annotation.Nonnull String cvssVersion) { - this.cvssVersion = cvssVersion; - return this; - } - - /** - * Get cvssVersion - * @return cvssVersion - */ - @javax.annotation.Nonnull - public String getCvssVersion() { - return cvssVersion; - } - - public void setCvssVersion(@javax.annotation.Nonnull String cvssVersion) { - this.cvssVersion = cvssVersion; - } - - - public Vulnerability cvssVector(@javax.annotation.Nonnull String cvssVector) { - this.cvssVector = cvssVector; - return this; - } - - /** - * Get cvssVector - * @return cvssVector - */ - @javax.annotation.Nonnull - public String getCvssVector() { - return cvssVector; - } - - public void setCvssVector(@javax.annotation.Nonnull String cvssVector) { - this.cvssVector = cvssVector; - } - - - public Vulnerability remarks(@javax.annotation.Nonnull String remarks) { - this.remarks = remarks; - return this; - } - - /** - * Get remarks - * @return remarks - */ - @javax.annotation.Nonnull - public String getRemarks() { - return remarks; - } - - public void setRemarks(@javax.annotation.Nonnull String remarks) { - this.remarks = remarks; - } - - - public Vulnerability score(@javax.annotation.Nonnull BigDecimal score) { - this.score = score; - return this; - } - - /** - * Get score - * @return score - */ - @javax.annotation.Nonnull - public BigDecimal getScore() { - return score; - } - - public void setScore(@javax.annotation.Nonnull BigDecimal score) { - this.score = score; - } - - - public Vulnerability isUnknown(@javax.annotation.Nullable Boolean isUnknown) { - this.isUnknown = isUnknown; - return this; - } - - /** - * Get isUnknown - * @return isUnknown - */ - @javax.annotation.Nullable - public Boolean getIsUnknown() { - return isUnknown; - } - - public void setIsUnknown(@javax.annotation.Nullable Boolean isUnknown) { - this.isUnknown = isUnknown; - } - - /** - * 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 Vulnerability instance itself - */ - public Vulnerability 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; - } - Vulnerability vulnerability = (Vulnerability) o; - return Objects.equals(this.vendor, vulnerability.vendor) && - Objects.equals(this.product, vulnerability.product) && - Objects.equals(this.version, vulnerability.version) && - Objects.equals(this.cveNumber, vulnerability.cveNumber) && - Objects.equals(this.severity, vulnerability.severity) && - Objects.equals(this.source, vulnerability.source) && - Objects.equals(this.cvssVersion, vulnerability.cvssVersion) && - Objects.equals(this.cvssVector, vulnerability.cvssVector) && - Objects.equals(this.remarks, vulnerability.remarks) && - Objects.equals(this.score, vulnerability.score) && - Objects.equals(this.isUnknown, vulnerability.isUnknown)&& - Objects.equals(this.additionalProperties, vulnerability.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(vendor, product, version, cveNumber, severity, source, cvssVersion, cvssVector, remarks, score, isUnknown, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Vulnerability {\n"); - sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); - sb.append(" product: ").append(toIndentedString(product)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" cveNumber: ").append(toIndentedString(cveNumber)).append("\n"); - sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append(" cvssVersion: ").append(toIndentedString(cvssVersion)).append("\n"); - sb.append(" cvssVector: ").append(toIndentedString(cvssVector)).append("\n"); - sb.append(" remarks: ").append(toIndentedString(remarks)).append("\n"); - sb.append(" score: ").append(toIndentedString(score)).append("\n"); - sb.append(" isUnknown: ").append(toIndentedString(isUnknown)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("vendor", "product", "version", "cve_number", "severity", "source", "cvss_version", "cvss_vector", "remarks", "score", "is_unknown")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("vendor", "product", "version", "cve_number", "severity", "source", "cvss_version", "cvss_vector", "remarks", "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 Vulnerability - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Vulnerability.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in Vulnerability is not found in the empty JSON string", Vulnerability.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Vulnerability.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("vendor").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor").toString())); - } - if (!jsonObj.get("product").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `product` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product").toString())); - } - if (!jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); - } - if (!jsonObj.get("cve_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `cve_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cve_number").toString())); - } - if (!jsonObj.get("severity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").toString())); - } - // validate the required field `severity` - SeverityEnum.validateJsonElement(jsonObj.get("severity")); - if (!jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); - } - if (!jsonObj.get("cvss_version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `cvss_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvss_version").toString())); - } - if (!jsonObj.get("cvss_vector").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `cvss_vector` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvss_vector").toString())); - } - if (!jsonObj.get("remarks").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Vulnerability.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Vulnerability' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Vulnerability.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Vulnerability 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 Vulnerability read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Vulnerability instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Vulnerability given an JSON string - * - * @param jsonString JSON string - * @return An instance of Vulnerability - * @throws IOException if the JSON string is invalid with respect to Vulnerability - */ - public static Vulnerability fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Vulnerability.class); - } - - /** - * Convert an instance of Vulnerability to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/Workspace.java b/src/main/java/ai/reveng/model/Workspace.java deleted file mode 100644 index 86b3015..0000000 --- a/src/main/java/ai/reveng/model/Workspace.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 com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets Workspace - */ -@JsonAdapter(Workspace.Adapter.class) -public enum Workspace { - - PERSONAL("personal"), - - TEAM("team"), - - PUBLIC("public"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - Workspace(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Workspace fromValue(String value) { - for (Workspace b : Workspace.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final Workspace enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Workspace read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Workspace.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - Workspace.fromValue(value); - } -} - diff --git a/src/main/java/ai/reveng/model/XrefFromResponse.java b/src/main/java/ai/reveng/model/XrefFromResponse.java deleted file mode 100644 index 10d0ab9..0000000 --- a/src/main/java/ai/reveng/model/XrefFromResponse.java +++ /dev/null @@ -1,521 +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 ai.reveng.model.SegmentInfo; -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.File; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * XrefFromResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class XrefFromResponse { - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nullable - private String value; - - public static final String SERIALIZED_NAME_IS_SCALAR = "is_scalar"; - @SerializedName(SERIALIZED_NAME_IS_SCALAR) - @javax.annotation.Nullable - private Boolean isScalar; - - public static final String SERIALIZED_NAME_IS_CALL = "is_call"; - @SerializedName(SERIALIZED_NAME_IS_CALL) - @javax.annotation.Nullable - private Boolean isCall; - - public static final String SERIALIZED_NAME_IS_DATA = "is_data"; - @SerializedName(SERIALIZED_NAME_IS_DATA) - @javax.annotation.Nullable - private Boolean isData; - - public static final String SERIALIZED_NAME_IS_STRING = "is_string"; - @SerializedName(SERIALIZED_NAME_IS_STRING) - @javax.annotation.Nullable - private Boolean isString; - - public static final String SERIALIZED_NAME_RAW_DATA = "raw_data"; - @SerializedName(SERIALIZED_NAME_RAW_DATA) - @javax.annotation.Nullable - private File rawData; - - public static final String SERIALIZED_NAME_SEGMENT = "segment"; - @SerializedName(SERIALIZED_NAME_SEGMENT) - @javax.annotation.Nullable - private SegmentInfo segment; - - public static final String SERIALIZED_NAME_ORIG_STR_ENCODING = "orig_str_encoding"; - @SerializedName(SERIALIZED_NAME_ORIG_STR_ENCODING) - @javax.annotation.Nullable - private String origStrEncoding; - - public static final String SERIALIZED_NAME_XREF_TO = "xref_to"; - @SerializedName(SERIALIZED_NAME_XREF_TO) - @javax.annotation.Nullable - private String xrefTo; - - public XrefFromResponse() { - } - - public XrefFromResponse value(@javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - */ - @javax.annotation.Nullable - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } - - - public XrefFromResponse isScalar(@javax.annotation.Nullable Boolean isScalar) { - this.isScalar = isScalar; - return this; - } - - /** - * Get isScalar - * @return isScalar - */ - @javax.annotation.Nullable - public Boolean getIsScalar() { - return isScalar; - } - - public void setIsScalar(@javax.annotation.Nullable Boolean isScalar) { - this.isScalar = isScalar; - } - - - public XrefFromResponse isCall(@javax.annotation.Nullable Boolean isCall) { - this.isCall = isCall; - return this; - } - - /** - * Get isCall - * @return isCall - */ - @javax.annotation.Nullable - public Boolean getIsCall() { - return isCall; - } - - public void setIsCall(@javax.annotation.Nullable Boolean isCall) { - this.isCall = isCall; - } - - - public XrefFromResponse isData(@javax.annotation.Nullable Boolean isData) { - this.isData = isData; - return this; - } - - /** - * Get isData - * @return isData - */ - @javax.annotation.Nullable - public Boolean getIsData() { - return isData; - } - - public void setIsData(@javax.annotation.Nullable Boolean isData) { - this.isData = isData; - } - - - public XrefFromResponse isString(@javax.annotation.Nullable Boolean isString) { - this.isString = isString; - return this; - } - - /** - * Get isString - * @return isString - */ - @javax.annotation.Nullable - public Boolean getIsString() { - return isString; - } - - public void setIsString(@javax.annotation.Nullable Boolean isString) { - this.isString = isString; - } - - - public XrefFromResponse rawData(@javax.annotation.Nullable File rawData) { - this.rawData = rawData; - return this; - } - - /** - * Get rawData - * @return rawData - */ - @javax.annotation.Nullable - public File getRawData() { - return rawData; - } - - public void setRawData(@javax.annotation.Nullable File rawData) { - this.rawData = rawData; - } - - - public XrefFromResponse segment(@javax.annotation.Nullable SegmentInfo segment) { - this.segment = segment; - return this; - } - - /** - * Get segment - * @return segment - */ - @javax.annotation.Nullable - public SegmentInfo getSegment() { - return segment; - } - - public void setSegment(@javax.annotation.Nullable SegmentInfo segment) { - this.segment = segment; - } - - - public XrefFromResponse origStrEncoding(@javax.annotation.Nullable String origStrEncoding) { - this.origStrEncoding = origStrEncoding; - return this; - } - - /** - * Get origStrEncoding - * @return origStrEncoding - */ - @javax.annotation.Nullable - public String getOrigStrEncoding() { - return origStrEncoding; - } - - public void setOrigStrEncoding(@javax.annotation.Nullable String origStrEncoding) { - this.origStrEncoding = origStrEncoding; - } - - - public XrefFromResponse xrefTo(@javax.annotation.Nullable String xrefTo) { - this.xrefTo = xrefTo; - return this; - } - - /** - * Get xrefTo - * @return xrefTo - */ - @javax.annotation.Nullable - public String getXrefTo() { - return xrefTo; - } - - public void setXrefTo(@javax.annotation.Nullable String xrefTo) { - this.xrefTo = xrefTo; - } - - /** - * 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 XrefFromResponse instance itself - */ - public XrefFromResponse 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; - } - XrefFromResponse xrefFromResponse = (XrefFromResponse) o; - return Objects.equals(this.value, xrefFromResponse.value) && - Objects.equals(this.isScalar, xrefFromResponse.isScalar) && - Objects.equals(this.isCall, xrefFromResponse.isCall) && - Objects.equals(this.isData, xrefFromResponse.isData) && - Objects.equals(this.isString, xrefFromResponse.isString) && - Objects.equals(this.rawData, xrefFromResponse.rawData) && - Objects.equals(this.segment, xrefFromResponse.segment) && - Objects.equals(this.origStrEncoding, xrefFromResponse.origStrEncoding) && - Objects.equals(this.xrefTo, xrefFromResponse.xrefTo)&& - Objects.equals(this.additionalProperties, xrefFromResponse.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(value, isScalar, isCall, isData, isString, rawData, segment, origStrEncoding, xrefTo, 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 XrefFromResponse {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" isScalar: ").append(toIndentedString(isScalar)).append("\n"); - sb.append(" isCall: ").append(toIndentedString(isCall)).append("\n"); - sb.append(" isData: ").append(toIndentedString(isData)).append("\n"); - sb.append(" isString: ").append(toIndentedString(isString)).append("\n"); - sb.append(" rawData: ").append(toIndentedString(rawData)).append("\n"); - sb.append(" segment: ").append(toIndentedString(segment)).append("\n"); - sb.append(" origStrEncoding: ").append(toIndentedString(origStrEncoding)).append("\n"); - sb.append(" xrefTo: ").append(toIndentedString(xrefTo)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("value", "is_scalar", "is_call", "is_data", "is_string", "raw_data", "segment", "orig_str_encoding", "xref_to")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("value", "xref_to")); - } - - /** - * 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 XrefFromResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!XrefFromResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in XrefFromResponse is not found in the empty JSON string", XrefFromResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : XrefFromResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - // validate the optional field `segment` - if (jsonObj.get("segment") != null && !jsonObj.get("segment").isJsonNull()) { - SegmentInfo.validateJsonElement(jsonObj.get("segment")); - } - if ((jsonObj.get("orig_str_encoding") != null && !jsonObj.get("orig_str_encoding").isJsonNull()) && !jsonObj.get("orig_str_encoding").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `orig_str_encoding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orig_str_encoding").toString())); - } - if ((jsonObj.get("xref_to") != null && !jsonObj.get("xref_to").isJsonNull()) && !jsonObj.get("xref_to").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `xref_to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xref_to").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!XrefFromResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'XrefFromResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(XrefFromResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, XrefFromResponse 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 XrefFromResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - XrefFromResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of XrefFromResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of XrefFromResponse - * @throws IOException if the JSON string is invalid with respect to XrefFromResponse - */ - public static XrefFromResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, XrefFromResponse.class); - } - - /** - * Convert an instance of XrefFromResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/XrefResponse.java b/src/main/java/ai/reveng/model/XrefResponse.java deleted file mode 100644 index acb029e..0000000 --- a/src/main/java/ai/reveng/model/XrefResponse.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 ai.reveng.model.XrefFromResponse; -import ai.reveng.model.XrefToResponse; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * XrefResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class XrefResponse { - public static final String SERIALIZED_NAME_XREF_TO_LIST = "xref_to_list"; - @SerializedName(SERIALIZED_NAME_XREF_TO_LIST) - @javax.annotation.Nonnull - private List xrefToList = new ArrayList<>(); - - public static final String SERIALIZED_NAME_XREF_FROM_LIST = "xref_from_list"; - @SerializedName(SERIALIZED_NAME_XREF_FROM_LIST) - @javax.annotation.Nonnull - private List xrefFromList = new ArrayList<>(); - - public XrefResponse() { - } - - public XrefResponse xrefToList(@javax.annotation.Nonnull List xrefToList) { - this.xrefToList = xrefToList; - return this; - } - - public XrefResponse addXrefToListItem(XrefToResponse xrefToListItem) { - if (this.xrefToList == null) { - this.xrefToList = new ArrayList<>(); - } - this.xrefToList.add(xrefToListItem); - return this; - } - - /** - * Get xrefToList - * @return xrefToList - */ - @javax.annotation.Nonnull - public List getXrefToList() { - return xrefToList; - } - - public void setXrefToList(@javax.annotation.Nonnull List xrefToList) { - this.xrefToList = xrefToList; - } - - - public XrefResponse xrefFromList(@javax.annotation.Nonnull List xrefFromList) { - this.xrefFromList = xrefFromList; - return this; - } - - public XrefResponse addXrefFromListItem(XrefFromResponse xrefFromListItem) { - if (this.xrefFromList == null) { - this.xrefFromList = new ArrayList<>(); - } - this.xrefFromList.add(xrefFromListItem); - return this; - } - - /** - * Get xrefFromList - * @return xrefFromList - */ - @javax.annotation.Nonnull - public List getXrefFromList() { - return xrefFromList; - } - - public void setXrefFromList(@javax.annotation.Nonnull List xrefFromList) { - this.xrefFromList = xrefFromList; - } - - /** - * 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 XrefResponse instance itself - */ - public XrefResponse 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; - } - XrefResponse xrefResponse = (XrefResponse) o; - return Objects.equals(this.xrefToList, xrefResponse.xrefToList) && - Objects.equals(this.xrefFromList, xrefResponse.xrefFromList)&& - Objects.equals(this.additionalProperties, xrefResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(xrefToList, xrefFromList, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XrefResponse {\n"); - sb.append(" xrefToList: ").append(toIndentedString(xrefToList)).append("\n"); - sb.append(" xrefFromList: ").append(toIndentedString(xrefFromList)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("xref_to_list", "xref_from_list")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("xref_to_list", "xref_from_list")); - } - - /** - * 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 XrefResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!XrefResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in XrefResponse is not found in the empty JSON string", XrefResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : XrefResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("xref_to_list") != null) { - if (!jsonObj.get("xref_to_list").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `xref_to_list` to be an array in the JSON string but got `%s`", jsonObj.get("xref_to_list").toString())); - } - JsonArray jsonArrayxrefToList = jsonObj.getAsJsonArray("xref_to_list"); - // validate the required field `xref_to_list` (array) - for (int i = 0; i < jsonArrayxrefToList.size(); i++) { - XrefToResponse.validateJsonElement(jsonArrayxrefToList.get(i)); - } - } - if (jsonObj.get("xref_from_list") != null) { - if (!jsonObj.get("xref_from_list").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `xref_from_list` to be an array in the JSON string but got `%s`", jsonObj.get("xref_from_list").toString())); - } - JsonArray jsonArrayxrefFromList = jsonObj.getAsJsonArray("xref_from_list"); - // validate the required field `xref_from_list` (array) - for (int i = 0; i < jsonArrayxrefFromList.size(); i++) { - XrefFromResponse.validateJsonElement(jsonArrayxrefFromList.get(i)); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!XrefResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'XrefResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(XrefResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, XrefResponse 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 XrefResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - XrefResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of XrefResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of XrefResponse - * @throws IOException if the JSON string is invalid with respect to XrefResponse - */ - public static XrefResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, XrefResponse.class); - } - - /** - * Convert an instance of XrefResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/XrefToResponse.java b/src/main/java/ai/reveng/model/XrefToResponse.java deleted file mode 100644 index ead21da..0000000 --- a/src/main/java/ai/reveng/model/XrefToResponse.java +++ /dev/null @@ -1,521 +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 ai.reveng.model.SegmentInfo; -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.File; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * XrefToResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class XrefToResponse { - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - @javax.annotation.Nullable - private String value; - - public static final String SERIALIZED_NAME_IS_SCALAR = "is_scalar"; - @SerializedName(SERIALIZED_NAME_IS_SCALAR) - @javax.annotation.Nullable - private Boolean isScalar; - - public static final String SERIALIZED_NAME_IS_CALL = "is_call"; - @SerializedName(SERIALIZED_NAME_IS_CALL) - @javax.annotation.Nullable - private Boolean isCall; - - public static final String SERIALIZED_NAME_IS_DATA = "is_data"; - @SerializedName(SERIALIZED_NAME_IS_DATA) - @javax.annotation.Nullable - private Boolean isData; - - public static final String SERIALIZED_NAME_IS_STRING = "is_string"; - @SerializedName(SERIALIZED_NAME_IS_STRING) - @javax.annotation.Nullable - private Boolean isString; - - public static final String SERIALIZED_NAME_RAW_DATA = "raw_data"; - @SerializedName(SERIALIZED_NAME_RAW_DATA) - @javax.annotation.Nullable - private File rawData; - - public static final String SERIALIZED_NAME_SEGMENT = "segment"; - @SerializedName(SERIALIZED_NAME_SEGMENT) - @javax.annotation.Nullable - private SegmentInfo segment; - - public static final String SERIALIZED_NAME_ORIG_STR_ENCODING = "orig_str_encoding"; - @SerializedName(SERIALIZED_NAME_ORIG_STR_ENCODING) - @javax.annotation.Nullable - private String origStrEncoding; - - public static final String SERIALIZED_NAME_XREF_FROM = "xref_from"; - @SerializedName(SERIALIZED_NAME_XREF_FROM) - @javax.annotation.Nullable - private String xrefFrom; - - public XrefToResponse() { - } - - public XrefToResponse value(@javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - */ - @javax.annotation.Nullable - public String getValue() { - return value; - } - - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } - - - public XrefToResponse isScalar(@javax.annotation.Nullable Boolean isScalar) { - this.isScalar = isScalar; - return this; - } - - /** - * Get isScalar - * @return isScalar - */ - @javax.annotation.Nullable - public Boolean getIsScalar() { - return isScalar; - } - - public void setIsScalar(@javax.annotation.Nullable Boolean isScalar) { - this.isScalar = isScalar; - } - - - public XrefToResponse isCall(@javax.annotation.Nullable Boolean isCall) { - this.isCall = isCall; - return this; - } - - /** - * Get isCall - * @return isCall - */ - @javax.annotation.Nullable - public Boolean getIsCall() { - return isCall; - } - - public void setIsCall(@javax.annotation.Nullable Boolean isCall) { - this.isCall = isCall; - } - - - public XrefToResponse isData(@javax.annotation.Nullable Boolean isData) { - this.isData = isData; - return this; - } - - /** - * Get isData - * @return isData - */ - @javax.annotation.Nullable - public Boolean getIsData() { - return isData; - } - - public void setIsData(@javax.annotation.Nullable Boolean isData) { - this.isData = isData; - } - - - public XrefToResponse isString(@javax.annotation.Nullable Boolean isString) { - this.isString = isString; - return this; - } - - /** - * Get isString - * @return isString - */ - @javax.annotation.Nullable - public Boolean getIsString() { - return isString; - } - - public void setIsString(@javax.annotation.Nullable Boolean isString) { - this.isString = isString; - } - - - public XrefToResponse rawData(@javax.annotation.Nullable File rawData) { - this.rawData = rawData; - return this; - } - - /** - * Get rawData - * @return rawData - */ - @javax.annotation.Nullable - public File getRawData() { - return rawData; - } - - public void setRawData(@javax.annotation.Nullable File rawData) { - this.rawData = rawData; - } - - - public XrefToResponse segment(@javax.annotation.Nullable SegmentInfo segment) { - this.segment = segment; - return this; - } - - /** - * Get segment - * @return segment - */ - @javax.annotation.Nullable - public SegmentInfo getSegment() { - return segment; - } - - public void setSegment(@javax.annotation.Nullable SegmentInfo segment) { - this.segment = segment; - } - - - public XrefToResponse origStrEncoding(@javax.annotation.Nullable String origStrEncoding) { - this.origStrEncoding = origStrEncoding; - return this; - } - - /** - * Get origStrEncoding - * @return origStrEncoding - */ - @javax.annotation.Nullable - public String getOrigStrEncoding() { - return origStrEncoding; - } - - public void setOrigStrEncoding(@javax.annotation.Nullable String origStrEncoding) { - this.origStrEncoding = origStrEncoding; - } - - - public XrefToResponse xrefFrom(@javax.annotation.Nullable String xrefFrom) { - this.xrefFrom = xrefFrom; - return this; - } - - /** - * Get xrefFrom - * @return xrefFrom - */ - @javax.annotation.Nullable - public String getXrefFrom() { - return xrefFrom; - } - - public void setXrefFrom(@javax.annotation.Nullable String xrefFrom) { - this.xrefFrom = xrefFrom; - } - - /** - * 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 XrefToResponse instance itself - */ - public XrefToResponse 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; - } - XrefToResponse xrefToResponse = (XrefToResponse) o; - return Objects.equals(this.value, xrefToResponse.value) && - Objects.equals(this.isScalar, xrefToResponse.isScalar) && - Objects.equals(this.isCall, xrefToResponse.isCall) && - Objects.equals(this.isData, xrefToResponse.isData) && - Objects.equals(this.isString, xrefToResponse.isString) && - Objects.equals(this.rawData, xrefToResponse.rawData) && - Objects.equals(this.segment, xrefToResponse.segment) && - Objects.equals(this.origStrEncoding, xrefToResponse.origStrEncoding) && - Objects.equals(this.xrefFrom, xrefToResponse.xrefFrom)&& - Objects.equals(this.additionalProperties, xrefToResponse.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(value, isScalar, isCall, isData, isString, rawData, segment, origStrEncoding, xrefFrom, 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 XrefToResponse {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" isScalar: ").append(toIndentedString(isScalar)).append("\n"); - sb.append(" isCall: ").append(toIndentedString(isCall)).append("\n"); - sb.append(" isData: ").append(toIndentedString(isData)).append("\n"); - sb.append(" isString: ").append(toIndentedString(isString)).append("\n"); - sb.append(" rawData: ").append(toIndentedString(rawData)).append("\n"); - sb.append(" segment: ").append(toIndentedString(segment)).append("\n"); - sb.append(" origStrEncoding: ").append(toIndentedString(origStrEncoding)).append("\n"); - sb.append(" xrefFrom: ").append(toIndentedString(xrefFrom)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("value", "is_scalar", "is_call", "is_data", "is_string", "raw_data", "segment", "orig_str_encoding", "xref_from")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("value", "xref_from")); - } - - /** - * 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 XrefToResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!XrefToResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in XrefToResponse is not found in the empty JSON string", XrefToResponse.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : XrefToResponse.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - // validate the optional field `segment` - if (jsonObj.get("segment") != null && !jsonObj.get("segment").isJsonNull()) { - SegmentInfo.validateJsonElement(jsonObj.get("segment")); - } - if ((jsonObj.get("orig_str_encoding") != null && !jsonObj.get("orig_str_encoding").isJsonNull()) && !jsonObj.get("orig_str_encoding").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `orig_str_encoding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orig_str_encoding").toString())); - } - if ((jsonObj.get("xref_from") != null && !jsonObj.get("xref_from").isJsonNull()) && !jsonObj.get("xref_from").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `xref_from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xref_from").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!XrefToResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'XrefToResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(XrefToResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, XrefToResponse 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 XrefToResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - XrefToResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of XrefToResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of XrefToResponse - * @throws IOException if the JSON string is invalid with respect to XrefToResponse - */ - public static XrefToResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, XrefToResponse.class); - } - - /** - * Convert an instance of XrefToResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} -