diff --git a/.sdk-version b/.sdk-version index e5bccb1..723fa07 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.95.1 +v3.96.2 diff --git a/README.md b/README.md index 98ff318..51620ae 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.95.1 + 3.96.2 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.95.1" + implementation "ai.reveng:sdk:3.96.2" } ``` @@ -98,6 +98,8 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**getAnalysisBasicInfo_0**](docs/AnalysesCoreApi.md#getAnalysisBasicInfo_0) | **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 @@ -108,6 +110,7 @@ Class | Method | HTTP request | Description *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 @@ -187,18 +190,30 @@ Class | Method | HTTP request | Description *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* | [**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* | [**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 +*FunctionsCoreApi* | [**listAnalysisFunctions**](docs/FunctionsCoreApi.md#listAnalysisFunctions) | **GET** /v3/analyses/{analysis_id}/functions | List functions in an analysis +*FunctionsCoreApi* | [**startFunctionsMatching**](docs/FunctionsCoreApi.md#startFunctionsMatching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions *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** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types +*FunctionsDataTypesApi* | [**getFunctionDataTypes_0**](docs/FunctionsDataTypesApi.md#getFunctionDataTypes_0) | **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 *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 @@ -238,6 +253,7 @@ Class | Method | HTTP request | Description - [AnalysisCreateRequest](docs/AnalysisCreateRequest.md) - [AnalysisCreateResponse](docs/AnalysisCreateResponse.md) - [AnalysisDetailResponse](docs/AnalysisDetailResponse.md) + - [AnalysisFunctionEntry](docs/AnalysisFunctionEntry.md) - [AnalysisFunctionMapping](docs/AnalysisFunctionMapping.md) - [AnalysisFunctionMatchingRequest](docs/AnalysisFunctionMatchingRequest.md) - [AnalysisFunctions](docs/AnalysisFunctions.md) @@ -336,6 +352,8 @@ Class | Method | HTTP request | Description - [BaseResponseVulnerabilities](docs/BaseResponseVulnerabilities.md) - [BaseResponseXrefResponse](docs/BaseResponseXrefResponse.md) - [Basic](docs/Basic.md) + - [BatchBinaryMatchResult](docs/BatchBinaryMatchResult.md) + - [BatchMatchingOutputBody](docs/BatchMatchingOutputBody.md) - [BatchRenameInputBody](docs/BatchRenameInputBody.md) - [BatchRenameItem](docs/BatchRenameItem.md) - [BatchRenameOutputBody](docs/BatchRenameOutputBody.md) @@ -355,11 +373,15 @@ Class | Method | HTTP request | Description - [BinarySearchResult](docs/BinarySearchResult.md) - [BinaryTaskStatus](docs/BinaryTaskStatus.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) - [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) @@ -395,11 +417,13 @@ Class | Method | HTTP request | Description - [CreateConversationRequest](docs/CreateConversationRequest.md) - [CreatePortalSessionInputBody](docs/CreatePortalSessionInputBody.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) @@ -451,16 +475,20 @@ Class | Method | HTTP request | Description - [FileMetadata](docs/FileMetadata.md) - [Filters](docs/Filters.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) @@ -477,6 +505,7 @@ Class | Method | HTTP request | Description - [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) @@ -491,6 +520,8 @@ Class | Method | HTTP request | Description - [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) @@ -503,12 +534,16 @@ Class | Method | HTTP request | Description - [ImportModel](docs/ImportModel.md) - [InlineComment](docs/InlineComment.md) - [InsertAnalysisLogRequest](docs/InsertAnalysisLogRequest.md) + - [ListAnalysisFunctionsDataTypesOutputBody](docs/ListAnalysisFunctionsDataTypesOutputBody.md) + - [ListAnalysisFunctionsOutputBody](docs/ListAnalysisFunctionsOutputBody.md) - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) - [ListCollectionResults](docs/ListCollectionResults.md) - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) + - [ListFunctionsDataTypesOutputBody](docs/ListFunctionsDataTypesOutputBody.md) - [Logs](docs/Logs.md) - [MITRETechnique](docs/MITRETechnique.md) + - [MatchFilters](docs/MatchFilters.md) - [MatchedFunction](docs/MatchedFunction.md) - [MatchedFunctionSuggestion](docs/MatchedFunctionSuggestion.md) - [MemdumpEntry](docs/MemdumpEntry.md) @@ -597,6 +632,10 @@ Class | Method | HTTP request | Description - [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) diff --git a/build.gradle b/build.gradle index 16f4217..3d77d8d 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.95.1' +version = '3.96.2' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.95.1") + coordinates("ai.reveng", "sdk", "3.96.2") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index b8bbafa..5231f16 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "3.95.1", + version := "3.96.2", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index a29b2b8..78738bb 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -11,6 +11,8 @@ All URIs are relative to *https://api.reveng.ai* | [**getAnalysisBasicInfo_0**](AnalysesCoreApi.md#getAnalysisBasicInfo_0) | **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 | @@ -21,6 +23,7 @@ All URIs are relative to *https://api.reveng.ai* | [**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 | @@ -537,6 +540,152 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **getAnalysisFunctionMatches** +> GetMatchesOutputBody getAnalysisFunctionMatches(analysisId) + +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 + +### 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"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + GetMatchesOutputBody result = apiInstance.getAnalysisFunctionMatches(analysisId); + System.out.println(result); + } catch (ApiException e) { + 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()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **analysisId** | **Long**| Analysis ID | | + +### Return type + +[**GetMatchesOutputBody**](GetMatchesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **getAnalysisFunctionMatchingStatus** +> GetMatchesStatusOutputBody getAnalysisFunctionMatchingStatus(analysisId) + +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 + +### 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"); + + AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + try { + GetMatchesStatusOutputBody result = apiInstance.getAnalysisFunctionMatchingStatus(analysisId); + System.out.println(result); + } catch (ApiException e) { + 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()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **analysisId** | **Long**| Analysis ID | | + +### Return type + +[**GetMatchesStatusOutputBody**](GetMatchesStatusOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **getAnalysisLogs** > BaseResponseLogs getAnalysisLogs(analysisId) @@ -1272,6 +1421,82 @@ public class Example { | **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"); + + 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) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **updateAnalysis** > BaseResponseAnalysisDetailResponse updateAnalysis(analysisId, analysisUpdateRequest) diff --git a/docs/AnalysisFunctionEntry.md b/docs/AnalysisFunctionEntry.md new file mode 100644 index 0000000..18842e9 --- /dev/null +++ b/docs/AnalysisFunctionEntry.md @@ -0,0 +1,21 @@ + + +# AnalysisFunctionEntry + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaryId** | **Long** | | | +|**debug** | **Boolean** | | | +|**functionId** | **Long** | | | +|**functionName** | **String** | | | +|**functionSize** | **Long** | | | +|**functionVaddr** | **Long** | | | +|**mangledName** | **String** | Search is applied to string value | [optional] | +|**sourceBinaryId** | **Long** | | [optional] | +|**sourceType** | **String** | | | + + + diff --git a/docs/BatchBinaryMatchResult.md b/docs/BatchBinaryMatchResult.md new file mode 100644 index 0000000..b86fc2f --- /dev/null +++ b/docs/BatchBinaryMatchResult.md @@ -0,0 +1,29 @@ + + +# BatchBinaryMatchResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaryId** | **Long** | Target binary | | +|**errorMessage** | **String** | Error description when status=FAILED. | [optional] | +|**matchedFunctionCount** | **Long** | Number of source functions that received at least one candidate match. Only meaningful when status=COMPLETED. | | +|**status** | [**StatusEnum**](#StatusEnum) | Per-binary workflow status | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/BatchMatchingOutputBody.md b/docs/BatchMatchingOutputBody.md new file mode 100644 index 0000000..20652ad --- /dev/null +++ b/docs/BatchMatchingOutputBody.md @@ -0,0 +1,27 @@ + + +# BatchMatchingOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**perBinary** | [**List<BatchBinaryMatchResult>**](BatchBinaryMatchResult.md) | Per-binary status (order matches the request). | | +|**status** | [**StatusEnum**](#StatusEnum) | Aggregate status across the batch: COMPLETED when every binary is completed, FAILED if any failed, RUNNING/PENDING otherwise. | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/CallEdge.md b/docs/CallEdge.md new file mode 100644 index 0000000..cf78857 --- /dev/null +++ b/docs/CallEdge.md @@ -0,0 +1,20 @@ + + +# CallEdge + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**calleeFunctionId** | **Long** | | [optional] | +|**calleeName** | **String** | | [optional] | +|**calleeVaddr** | **Long** | | | +|**callerFunctionId** | **Long** | | | +|**callerName** | **String** | | [optional] | +|**callerVaddr** | **Long** | Entry vaddr of the caller function (joined from function_t). | | +|**isExternal** | **Boolean** | | | +|**thunkedVaddr** | **Long** | | [optional] | + + + diff --git a/docs/CallEdgesOutputBody.md b/docs/CallEdgesOutputBody.md new file mode 100644 index 0000000..2f306ad --- /dev/null +++ b/docs/CallEdgesOutputBody.md @@ -0,0 +1,13 @@ + + +# CallEdgesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**edges** | [**List<FunctionCallEdges>**](FunctionCallEdges.md) | | | + + + diff --git a/docs/CapabilitiesOutputBody.md b/docs/CapabilitiesOutputBody.md new file mode 100644 index 0000000..1e074c8 --- /dev/null +++ b/docs/CapabilitiesOutputBody.md @@ -0,0 +1,13 @@ + + +# CapabilitiesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**capabilities** | [**List<CapabilityEntry>**](CapabilityEntry.md) | | | + + + diff --git a/docs/CapabilityEntry.md b/docs/CapabilityEntry.md new file mode 100644 index 0000000..64794ef --- /dev/null +++ b/docs/CapabilityEntry.md @@ -0,0 +1,18 @@ + + +# CapabilityEntry + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**capability** | **String** | | | +|**description** | **String** | | | +|**functionId** | **Long** | | | +|**functionName** | **String** | | | +|**type** | **String** | | | +|**vaddr** | **Long** | | | + + + diff --git a/docs/DataTypesEntry.md b/docs/DataTypesEntry.md new file mode 100644 index 0000000..97c0e98 --- /dev/null +++ b/docs/DataTypesEntry.md @@ -0,0 +1,14 @@ + + +# DataTypesEntry + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dataTypes** | [**FunctionInfo**](FunctionInfo.md) | | [optional] | +|**functionId** | **Long** | | | + + + diff --git a/docs/DisassemblyOutputBody.md b/docs/DisassemblyOutputBody.md new file mode 100644 index 0000000..1c5ed12 --- /dev/null +++ b/docs/DisassemblyOutputBody.md @@ -0,0 +1,18 @@ + + +# DisassemblyOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**basicBlocks** | **Object** | | [optional] | +|**functionId** | **Long** | | | +|**localVariables** | **Object** | | [optional] | +|**params** | **Object** | | [optional] | +|**returnType** | **String** | Search is applied to string value | [optional] | +|**returns** | **Boolean** | | | + + + diff --git a/docs/ErrorBody.md b/docs/ErrorBody.md index f2fc09a..74c34f3 100644 --- a/docs/ErrorBody.md +++ b/docs/ErrorBody.md @@ -31,6 +31,7 @@ | ALREADY_EXISTS | "ALREADY_EXISTS" | | ANALYSIS_NOT_READY | "ANALYSIS_NOT_READY" | | BAD_REQUEST | "BAD_REQUEST" | +| CLIENT_CLOSED_REQUEST | "CLIENT_CLOSED_REQUEST" | | CONFLICT | "CONFLICT" | | CONVERSATION_NOT_FOUND | "CONVERSATION_NOT_FOUND" | | DOMAIN_ALREADY_CLAIMED | "DOMAIN_ALREADY_CLAIMED" | diff --git a/docs/FunctionArgument.md b/docs/FunctionArgument.md new file mode 100644 index 0000000..65108e1 --- /dev/null +++ b/docs/FunctionArgument.md @@ -0,0 +1,18 @@ + + +# FunctionArgument + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lastChange** | **String** | Search is applied to string value | [optional] | +|**name** | **String** | Search is applied to string value | | +|**offset** | **Long** | | | +|**scope** | **String** | Search is applied to string value | [optional] | +|**size** | **Long** | | | +|**type** | **String** | Search is applied to string value | | + + + diff --git a/docs/FunctionCallEdges.md b/docs/FunctionCallEdges.md new file mode 100644 index 0000000..7946e09 --- /dev/null +++ b/docs/FunctionCallEdges.md @@ -0,0 +1,15 @@ + + +# FunctionCallEdges + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**callees** | [**List<CallEdge>**](CallEdge.md) | | | +|**callers** | [**List<CallEdge>**](CallEdge.md) | | | +|**functionId** | **Long** | | | + + + diff --git a/docs/FunctionDependency.md b/docs/FunctionDependency.md new file mode 100644 index 0000000..675790a --- /dev/null +++ b/docs/FunctionDependency.md @@ -0,0 +1,20 @@ + + +# FunctionDependency + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**addr** | **Long** | Memory address (GlobalVariable). | [optional] | +|**artifactType** | **String** | | [optional] | +|**lastChange** | **String** | Search is applied to string value | [optional] | +|**members** | **Object** | | [optional] | +|**name** | **String** | Search is applied to string value | | +|**scope** | **String** | Search is applied to string value | [optional] | +|**size** | **Long** | Total byte size (Struct, GlobalVariable). | [optional] | +|**type** | **String** | Underlying type (TypeDefinition, GlobalVariable). | [optional] | + + + diff --git a/docs/FunctionDetailsOutputBody.md b/docs/FunctionDetailsOutputBody.md new file mode 100644 index 0000000..94c23be --- /dev/null +++ b/docs/FunctionDetailsOutputBody.md @@ -0,0 +1,21 @@ + + +# FunctionDetailsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaryId** | **Long** | | | +|**creation** | **OffsetDateTime** | | | +|**debug** | **Boolean** | | | +|**functionId** | **Long** | | | +|**functionName** | **String** | | | +|**functionSize** | **Long** | | | +|**functionVaddr** | **Long** | | | +|**mangledName** | **String** | | [optional] | +|**sourceFunctionId** | **Long** | | [optional] | + + + diff --git a/docs/FunctionStackVariable.md b/docs/FunctionStackVariable.md new file mode 100644 index 0000000..1d4a3fe --- /dev/null +++ b/docs/FunctionStackVariable.md @@ -0,0 +1,19 @@ + + +# FunctionStackVariable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**addr** | **Long** | | | +|**lastChange** | **String** | Search is applied to string value | [optional] | +|**name** | **String** | Search is applied to string value | | +|**offset** | **Long** | | | +|**scope** | **String** | Search is applied to string value | [optional] | +|**size** | **Long** | | | +|**type** | **String** | Search is applied to string value | | + + + diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 43c2fc9..b76e10e 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -15,12 +15,21 @@ All URIs are relative to *https://api.reveng.ai* | [**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 | | [**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. | +| [**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 | +| [**listAnalysisFunctions**](FunctionsCoreApi.md#listAnalysisFunctions) | **GET** /v3/analyses/{analysis_id}/functions | List functions in an analysis | +| [**startFunctionsMatching**](FunctionsCoreApi.md#startFunctionsMatching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions | @@ -823,6 +832,79 @@ public class Example { | **422** | Invalid request parameters | - | | **404** | Not Found | - | + +# **getFunctionBlocks_0** +> DisassemblyOutputBody getFunctionBlocks_0(functionId) + +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 + +### 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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + Long functionId = 56L; // Long | Function ID + try { + DisassemblyOutputBody result = apiInstance.getFunctionBlocks_0(functionId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getFunctionBlocks_0"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **functionId** | **Long**| Function ID | | + +### Return type + +[**DisassemblyOutputBody**](DisassemblyOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **getFunctionCalleesCallers** > BaseResponseCalleesCallerFunctionsResponse getFunctionCalleesCallers(functionId) @@ -959,6 +1041,79 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **getFunctionCalleesCallers_0** +> CallEdgesOutputBody getFunctionCalleesCallers_0(functionId) + +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 + +### 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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + Long functionId = 56L; // Long | Function ID + try { + CallEdgesOutputBody result = apiInstance.getFunctionCalleesCallers_0(functionId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getFunctionCalleesCallers_0"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **functionId** | **Long**| Function ID | | + +### Return type + +[**CallEdgesOutputBody**](CallEdgesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **getFunctionCapabilities** > BaseResponseFunctionCapabilityResponse getFunctionCapabilities(functionId) @@ -1028,6 +1183,79 @@ public class Example { | **422** | Invalid request parameters | - | | **404** | Not Found | - | + +# **getFunctionCapabilities_0** +> CapabilitiesOutputBody getFunctionCapabilities_0(functionId) + +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 + +### 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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + Long functionId = 56L; // Long | Function ID + try { + CapabilitiesOutputBody result = apiInstance.getFunctionCapabilities_0(functionId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getFunctionCapabilities_0"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **functionId** | **Long**| Function ID | | + +### Return type + +[**CapabilitiesOutputBody**](CapabilitiesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **getFunctionDetails** > BaseResponseFunctionsDetailResponse getFunctionDetails(functionId) @@ -1096,13 +1324,13 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **getFunctionStrings** -> BaseResponseFunctionStringsResponse getFunctionStrings(functionId, page, pageSize, search) + +# **getFunctionDetails_0** +> FunctionDetailsOutputBody getFunctionDetails_0(functionId) -Get string information found in the function +Get function details -Get string information found in the function +Returns metadata for a single function — name, virtual address, size, debug status, binary it belongs to. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found ### Example ```java @@ -1126,15 +1354,12 @@ public class Example { //APIKey.setApiKeyPrefix("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 + Long functionId = 56L; // Long | Function ID try { - BaseResponseFunctionStringsResponse result = apiInstance.getFunctionStrings(functionId, page, pageSize, search); + FunctionDetailsOutputBody result = apiInstance.getFunctionDetails_0(functionId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#getFunctionStrings"); + System.err.println("Exception when calling FunctionsCoreApi#getFunctionDetails_0"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1148,14 +1373,11 @@ public class Example { | 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] | +| **functionId** | **Long**| Function ID | | ### Return type -[**BaseResponseFunctionStringsResponse**](BaseResponseFunctionStringsResponse.md) +[**FunctionDetailsOutputBody**](FunctionDetailsOutputBody.md) ### Authorization @@ -1169,16 +1391,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 | - | - -# **getFunctionStrings_0** -> ListFunctionStringsOutputBody getFunctionStrings_0(functionId, page, pageSize, search) + +# **getFunctionStrings** +> BaseResponseFunctionStringsResponse getFunctionStrings(functionId, page, pageSize, search) -List strings for a function. +Get string information found in the function -Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +Get string information found in the function ### Example ```java @@ -1202,15 +1427,15 @@ public class Example { //APIKey.setApiKeyPrefix("Token"); FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Long functionId = 56L; // Long | Function ID - Long page = 1L; // Long | Page number (1-indexed). - Long pageSize = 100L; // Long | Number of results per page. - String search = "search_example"; // String | Filter by string value (case-insensitive substring match). + 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 { - ListFunctionStringsOutputBody result = apiInstance.getFunctionStrings_0(functionId, page, pageSize, search); + BaseResponseFunctionStringsResponse 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()); @@ -1224,14 +1449,14 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **functionId** | **Long**| Function ID | | -| **page** | **Long**| Page number (1-indexed). | [optional] [default to 1] | -| **pageSize** | **Long**| Number of results per page. | [optional] [default to 100] | -| **search** | **String**| Filter by string value (case-insensitive substring match). | [optional] | +| **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 -[**ListFunctionStringsOutputBody**](ListFunctionStringsOutputBody.md) +[**BaseResponseFunctionStringsResponse**](BaseResponseFunctionStringsResponse.md) ### Authorization @@ -1245,7 +1470,456 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **200** | Successful Response | - | +| **422** | Invalid request parameters | - | + + +# **getFunctionStrings_0** +> ListFunctionStringsOutputBody getFunctionStrings_0(functionId, page, pageSize, search) + +List strings for a function. + +Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.FunctionsCoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + Long functionId = 56L; // Long | Function ID + Long page = 1L; // Long | Page number (1-indexed). + Long pageSize = 100L; // Long | Number of results per page. + String search = "search_example"; // String | Filter by string value (case-insensitive substring match). + try { + ListFunctionStringsOutputBody result = apiInstance.getFunctionStrings_0(functionId, page, pageSize, search); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getFunctionStrings_0"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **functionId** | **Long**| Function ID | | +| **page** | **Long**| Page number (1-indexed). | [optional] [default to 1] | +| **pageSize** | **Long**| Number of results per page. | [optional] [default to 100] | +| **search** | **String**| Filter by string value (case-insensitive substring match). | [optional] | + +### Return type + +[**ListFunctionStringsOutputBody**](ListFunctionStringsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **getFunctionsCalleesCallers** +> CallEdgesOutputBody getFunctionsCalleesCallers(functionIds) + +Get callees and callers for many functions + +Bulk variant — pass `function_ids` as a query parameter (comma-separated or repeated). Caller must have access to every supplied function or the whole request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### 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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + List functionIds = Arrays.asList(); // List | Function IDs to fetch edges for. + try { + CallEdgesOutputBody result = apiInstance.getFunctionsCalleesCallers(functionIds); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getFunctionsCalleesCallers"); + 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<Long>**](Long.md)| Function IDs to fetch edges for. | | + +### Return type + +[**CallEdgesOutputBody**](CallEdgesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **getFunctionsMatches** +> GetMatchesOutputBody getFunctionsMatches(functionIds) + +Get function-matching results for an explicit set of functions + +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 +// 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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + List functionIds = Arrays.asList(); // List | Source function IDs whose matches to fetch. + try { + GetMatchesOutputBody result = apiInstance.getFunctionsMatches(functionIds); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getFunctionsMatches"); + 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<Long>**](Long.md)| Source function IDs whose matches to fetch. | | + +### Return type + +[**GetMatchesOutputBody**](GetMatchesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **getFunctionsMatchingStatus** +> GetMatchesStatusOutputBody getFunctionsMatchingStatus(functionIds) + +Get function-matching status for an explicit set of functions + +Returns the matching workflow's current status for the supplied function IDs. 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 +// 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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + List functionIds = Arrays.asList(); // List | Source function IDs whose matches to fetch. + try { + GetMatchesStatusOutputBody result = apiInstance.getFunctionsMatchingStatus(functionIds); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#getFunctionsMatchingStatus"); + 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<Long>**](Long.md)| Source function IDs whose matches to fetch. | | + +### Return type + +[**GetMatchesStatusOutputBody**](GetMatchesStatusOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **listAnalysisFunctions** +> ListAnalysisFunctionsOutputBody listAnalysisFunctions(analysisId, offset, limit) + +List functions in an analysis + +Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + Long offset = 56L; // Long | Pagination offset. Defaults to 0. + Long limit = 56L; // Long | Page size. Defaults to 100. + try { + ListAnalysisFunctionsOutputBody result = apiInstance.listAnalysisFunctions(analysisId, offset, limit); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#listAnalysisFunctions"); + 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 | | +| **offset** | **Long**| Pagination offset. Defaults to 0. | [optional] | +| **limit** | **Long**| Page size. Defaults to 100. | [optional] | + +### Return type + +[**ListAnalysisFunctionsOutputBody**](ListAnalysisFunctionsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **startFunctionsMatching** +> StartMatchingOutputBody startFunctionsMatching(startMatchingForFunctionsInputBody) + +Start function matching for an explicit set of functions + +Dispatches the function-matching workflow against the provided function IDs. 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.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"); + + FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); + StartMatchingForFunctionsInputBody startMatchingForFunctionsInputBody = new StartMatchingForFunctionsInputBody(); // StartMatchingForFunctionsInputBody | + try { + StartMatchingOutputBody result = apiInstance.startFunctionsMatching(startMatchingForFunctionsInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsCoreApi#startFunctionsMatching"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **startMatchingForFunctionsInputBody** | [**StartMatchingForFunctionsInputBody**](StartMatchingForFunctionsInputBody.md)| | | + +### Return type + +[**StartMatchingOutputBody**](StartMatchingOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted | - | +| **400** | Bad Request | - | | **403** | Forbidden | - | | **404** | Not Found | - | | **422** | Unprocessable Entity | - | diff --git a/docs/FunctionsDataTypesApi.md b/docs/FunctionsDataTypesApi.md index 3111466..b7449e8 100644 --- a/docs/FunctionsDataTypesApi.md +++ b/docs/FunctionsDataTypesApi.md @@ -8,8 +8,11 @@ All URIs are relative to *https://api.reveng.ai* | [**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** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types | +| [**getFunctionDataTypes_0**](FunctionsDataTypesApi.md#getFunctionDataTypes_0) | **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 | @@ -302,6 +305,158 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **getFunctionDataTypes_0** +> DataTypesEntry getFunctionDataTypes_0(analysisId, functionId) + +Get data types for a single function + +Returns the stored data-types blob for one function. The function must belong to the supplied analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.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"); + + FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + Long functionId = 56L; // Long | Function ID + try { + DataTypesEntry result = apiInstance.getFunctionDataTypes_0(analysisId, functionId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsDataTypesApi#getFunctionDataTypes_0"); + 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 | | +| **functionId** | **Long**| Function ID | | + +### Return type + +[**DataTypesEntry**](DataTypesEntry.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **listAnalysisFunctionsDataTypes** +> ListAnalysisFunctionsDataTypesOutputBody listAnalysisFunctionsDataTypes(analysisId, offset, limit) + +List data types for all functions in an analysis + +Paginated read of the stored data-types blob for each function in the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.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"); + + FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); + Long analysisId = 56L; // Long | Analysis ID + Long offset = 56L; // Long | Pagination offset. Defaults to 0. + Long limit = 56L; // Long | Page size. Defaults to 100. + try { + ListAnalysisFunctionsDataTypesOutputBody result = apiInstance.listAnalysisFunctionsDataTypes(analysisId, offset, limit); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsDataTypesApi#listAnalysisFunctionsDataTypes"); + 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 | | +| **offset** | **Long**| Pagination offset. Defaults to 0. | [optional] | +| **limit** | **Long**| Page size. Defaults to 100. | [optional] | + +### Return type + +[**ListAnalysisFunctionsDataTypesOutputBody**](ListAnalysisFunctionsDataTypesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + # **listFunctionDataTypesForAnalysis** > BaseResponseFunctionDataTypesList listFunctionDataTypesForAnalysis(analysisId, functionIds) @@ -444,3 +599,77 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **listFunctionsDataTypes** +> ListFunctionsDataTypesOutputBody listFunctionsDataTypes(functionIds) + +Get data types for many functions + +Returns the stored data-types blob for each supplied function ID. Caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### 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"); + + FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); + List functionIds = Arrays.asList(); // List | Function IDs to fetch data-types for. + try { + ListFunctionsDataTypesOutputBody result = apiInstance.listFunctionsDataTypes(functionIds); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FunctionsDataTypesApi#listFunctionsDataTypes"); + 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<Long>**](Long.md)| Function IDs to fetch data-types for. | | + +### Return type + +[**ListFunctionsDataTypesOutputBody**](ListFunctionsDataTypesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + diff --git a/docs/GetMatchesOutputBody.md b/docs/GetMatchesOutputBody.md new file mode 100644 index 0000000..1e0350f --- /dev/null +++ b/docs/GetMatchesOutputBody.md @@ -0,0 +1,27 @@ + + +# GetMatchesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**matches** | [**List<FunctionMatch>**](FunctionMatch.md) | Per-source-function matches. Populated when status=COMPLETED; empty otherwise. | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Current workflow status | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/GetMatchesStatusOutputBody.md b/docs/GetMatchesStatusOutputBody.md new file mode 100644 index 0000000..4ec4279 --- /dev/null +++ b/docs/GetMatchesStatusOutputBody.md @@ -0,0 +1,30 @@ + + +# GetMatchesStatusOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**messages** | [**List<ProgressMessage>**](ProgressMessage.md) | Log messages emitted during execution | | +|**status** | [**StatusEnum**](#StatusEnum) | Current workflow status | | +|**step** | **String** | Name of the current step | | +|**stepIndex** | **Long** | Zero-based index of the current step | | +|**stepsTotal** | **Long** | Total number of steps in the workflow | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/ListAnalysisFunctionsDataTypesOutputBody.md b/docs/ListAnalysisFunctionsDataTypesOutputBody.md new file mode 100644 index 0000000..e1765ac --- /dev/null +++ b/docs/ListAnalysisFunctionsDataTypesOutputBody.md @@ -0,0 +1,14 @@ + + +# ListAnalysisFunctionsDataTypesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**items** | [**List<DataTypesEntry>**](DataTypesEntry.md) | | | +|**totalCount** | **Long** | Total functions in the analysis, ignoring pagination. | | + + + diff --git a/docs/ListAnalysisFunctionsOutputBody.md b/docs/ListAnalysisFunctionsOutputBody.md new file mode 100644 index 0000000..5e11ad7 --- /dev/null +++ b/docs/ListAnalysisFunctionsOutputBody.md @@ -0,0 +1,14 @@ + + +# ListAnalysisFunctionsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**functions** | [**List<AnalysisFunctionEntry>**](AnalysisFunctionEntry.md) | | | +|**totalCount** | **Long** | Total functions in the analysis, ignoring pagination. | | + + + diff --git a/docs/ListFunctionsDataTypesOutputBody.md b/docs/ListFunctionsDataTypesOutputBody.md new file mode 100644 index 0000000..baaef68 --- /dev/null +++ b/docs/ListFunctionsDataTypesOutputBody.md @@ -0,0 +1,13 @@ + + +# ListFunctionsDataTypesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**items** | [**List<DataTypesEntry>**](DataTypesEntry.md) | | | + + + diff --git a/docs/MatchFilters.md b/docs/MatchFilters.md new file mode 100644 index 0000000..092536d --- /dev/null +++ b/docs/MatchFilters.md @@ -0,0 +1,17 @@ + + +# MatchFilters + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaryIds** | **List<Long>** | Restrict the candidate pool to these binary IDs. | [optional] | +|**collectionIds** | **List<Long>** | Restrict the candidate pool to binaries in these collection IDs. | [optional] | +|**debugTypes** | **List<String>** | Restrict matches to candidates with these debug source types. Accepted: SYSTEM, USER. | [optional] | +|**functionIds** | **List<Long>** | Restrict the candidate pool to these function IDs. | [optional] | +|**userIds** | **List<Long>** | Restrict the candidate pool to functions owned by these user IDs. | [optional] | + + + diff --git a/docs/StartBatchMatchingInputBody.md b/docs/StartBatchMatchingInputBody.md new file mode 100644 index 0000000..a44c817 --- /dev/null +++ b/docs/StartBatchMatchingInputBody.md @@ -0,0 +1,16 @@ + + +# StartBatchMatchingInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaryIds** | **List<Long>** | Binary IDs to match the analysis against, one workflow per binary. | | +|**debugTypes** | **List<String>** | Restrict matches to candidates with these debug source types. Defaults to [\"SYSTEM\"]. | [optional] | +|**minSimilarity** | **Double** | Similarity floor as a percentage. Defaults to 90. | [optional] | +|**resultsPerFunction** | **Long** | Max matches returned per source function. Defaults to 1. | [optional] | + + + diff --git a/docs/StartMatchingForAnalysisInputBody.md b/docs/StartMatchingForAnalysisInputBody.md new file mode 100644 index 0000000..852cedc --- /dev/null +++ b/docs/StartMatchingForAnalysisInputBody.md @@ -0,0 +1,15 @@ + + +# StartMatchingForAnalysisInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filters** | [**MatchFilters**](MatchFilters.md) | Narrow the candidate pool. | [optional] | +|**minSimilarity** | **Double** | Similarity floor as a percentage. Defaults to 90. | [optional] | +|**resultsPerFunction** | **Long** | Max matches returned per source function. Defaults to 1. | [optional] | + + + diff --git a/docs/StartMatchingForFunctionsInputBody.md b/docs/StartMatchingForFunctionsInputBody.md new file mode 100644 index 0000000..300062c --- /dev/null +++ b/docs/StartMatchingForFunctionsInputBody.md @@ -0,0 +1,16 @@ + + +# StartMatchingForFunctionsInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**filters** | [**MatchFilters**](MatchFilters.md) | Narrow the candidate pool. | [optional] | +|**functionIds** | **List<Long>** | Source function IDs to match against the rest of the corpus. | | +|**minSimilarity** | **Double** | Similarity floor as a percentage. Defaults to 90. | [optional] | +|**resultsPerFunction** | **Long** | Max matches returned per source function. Defaults to 1. | [optional] | + + + diff --git a/docs/StartMatchingOutputBody.md b/docs/StartMatchingOutputBody.md new file mode 100644 index 0000000..3e2f8fc --- /dev/null +++ b/docs/StartMatchingOutputBody.md @@ -0,0 +1,30 @@ + + +# StartMatchingOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**messages** | [**List<ProgressMessage>**](ProgressMessage.md) | Log messages emitted during execution | | +|**status** | [**StatusEnum**](#StatusEnum) | Current workflow status | | +|**step** | **String** | Name of the current step | | +|**stepIndex** | **Long** | Zero-based index of the current step | | +|**stepsTotal** | **Long** | Total number of steps in the workflow | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/pom.xml b/pom.xml index d1cc553..d57dbbd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.95.1 + 3.96.2 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AnalysesCoreApi.java b/src/main/java/ai/reveng/api/AnalysesCoreApi.java index 2fd6355..63150dc 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -51,12 +51,16 @@ 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.ListAnalysisStringsOutputBody; 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; @@ -1109,6 +1113,292 @@ public okhttp3.Call getAnalysisFunctionMapAsync(@javax.annotation.Nonnull Intege localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getAnalysisFunctionMatches + * @param analysisId Analysis ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getAnalysisFunctionMatchesCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/functions/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 = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAnalysisFunctionMatchesValidateBeforeCall(@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)"); + } + + return getAnalysisFunctionMatchesCall(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 + * @param analysisId Analysis ID (required) + * @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 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public GetMatchesOutputBody getAnalysisFunctionMatches(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = getAnalysisFunctionMatchesWithHttpInfo(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 + * @param analysisId Analysis ID (required) + * @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 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse getAnalysisFunctionMatchesWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = getAnalysisFunctionMatchesValidateBeforeCall(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 + * @param analysisId Analysis ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getAnalysisFunctionMatchesAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAnalysisFunctionMatchesValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAnalysisFunctionMatchingStatus + * @param analysisId Analysis ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getAnalysisFunctionMatchingStatusCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/functions/matches/status" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAnalysisFunctionMatchingStatusValidateBeforeCall(@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 getAnalysisFunctionMatchingStatus(Async)"); + } + + return getAnalysisFunctionMatchingStatusCall(analysisId, _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 + * @param analysisId Analysis ID (required) + * @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 -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public GetMatchesStatusOutputBody getAnalysisFunctionMatchingStatus(@javax.annotation.Nonnull Long analysisId) throws ApiException { + ApiResponse localVarResp = getAnalysisFunctionMatchingStatusWithHttpInfo(analysisId); + 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 + * @param analysisId Analysis ID (required) + * @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 -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse getAnalysisFunctionMatchingStatusWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { + okhttp3.Call localVarCall = getAnalysisFunctionMatchingStatusValidateBeforeCall(analysisId, 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 + * @param analysisId Analysis ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getAnalysisFunctionMatchingStatusAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAnalysisFunctionMatchingStatusValidateBeforeCall(analysisId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getAnalysisLogs * @param analysisId (required) @@ -2564,6 +2854,163 @@ public okhttp3.Call requeueAnalysisAsync(@javax.annotation.Nonnull Integer analy 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" }; + 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) diff --git a/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java b/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java index 77b4a37..1898c20 100644 --- a/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java +++ b/src/main/java/ai/reveng/api/AnalysesResultsMetadataApi.java @@ -92,7 +92,9 @@ public void setCustomBaseUrl(String customBaseUrl) { 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 @@ -146,6 +148,7 @@ public okhttp3.Call getAnalysisFunctionsPaginatedCall(@javax.annotation.Nonnull 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 @@ -172,7 +175,9 @@ private okhttp3.Call getAnalysisFunctionsPaginatedValidateBeforeCall(@javax.anno 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(); @@ -193,7 +198,9 @@ public BaseResponseAnalysisFunctionsList getAnalysisFunctionsPaginated(@javax.an 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(); @@ -216,7 +223,9 @@ public ApiResponse getAnalysisFunctionsPagina 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); diff --git a/src/main/java/ai/reveng/api/FunctionsCoreApi.java b/src/main/java/ai/reveng/api/FunctionsCoreApi.java index c9bfff6..90f0fe9 100644 --- a/src/main/java/ai/reveng/api/FunctionsCoreApi.java +++ b/src/main/java/ai/reveng/api/FunctionsCoreApi.java @@ -42,9 +42,18 @@ import ai.reveng.model.BaseResponseFunctionStringsResponse; import ai.reveng.model.BaseResponseFunctionsDetailResponse; import ai.reveng.model.BaseResponseListCalleesCallerFunctionsResponse; +import ai.reveng.model.CallEdgesOutputBody; +import ai.reveng.model.CapabilitiesOutputBody; +import ai.reveng.model.DisassemblyOutputBody; +import ai.reveng.model.FunctionDetailsOutputBody; import ai.reveng.model.FunctionMatchingRequest; import ai.reveng.model.FunctionMatchingResponse; +import ai.reveng.model.GetMatchesOutputBody; +import ai.reveng.model.GetMatchesStatusOutputBody; +import ai.reveng.model.ListAnalysisFunctionsOutputBody; import ai.reveng.model.ListFunctionStringsOutputBody; +import ai.reveng.model.StartMatchingForFunctionsInputBody; +import ai.reveng.model.StartMatchingOutputBody; import java.lang.reflect.Type; import java.util.ArrayList; @@ -413,7 +422,9 @@ public okhttp3.Call addUserStringToFunctionAsync(@javax.annotation.Nonnull Long 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call aiUnstripCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AiUnstripRequest aiUnstripRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -460,6 +471,7 @@ public okhttp3.Call aiUnstripCall(@javax.annotation.Nonnull Integer analysisId, return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call aiUnstripValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AiUnstripRequest aiUnstripRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set @@ -490,7 +502,9 @@ private okhttp3.Call aiUnstripValidateBeforeCall(@javax.annotation.Nonnull Integ 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public AutoUnstripResponse aiUnstrip(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AiUnstripRequest aiUnstripRequest) throws ApiException { ApiResponse localVarResp = aiUnstripWithHttpInfo(analysisId, aiUnstripRequest); return localVarResp.getData(); @@ -510,7 +524,9 @@ public AutoUnstripResponse aiUnstrip(@javax.annotation.Nonnull Integer analysisI 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse aiUnstripWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AiUnstripRequest aiUnstripRequest) throws ApiException { okhttp3.Call localVarCall = aiUnstripValidateBeforeCall(analysisId, aiUnstripRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -532,7 +548,9 @@ public ApiResponse aiUnstripWithHttpInfo(@javax.annotation. 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call aiUnstripAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AiUnstripRequest aiUnstripRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = aiUnstripValidateBeforeCall(analysisId, aiUnstripRequest, _callback); @@ -554,7 +572,9 @@ public okhttp3.Call aiUnstripAsync(@javax.annotation.Nonnull Integer analysisId, 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call analysisFunctionMatchingCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -601,6 +621,7 @@ public okhttp3.Call analysisFunctionMatchingCall(@javax.annotation.Nonnull Integ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call analysisFunctionMatchingValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set @@ -631,7 +652,9 @@ private okhttp3.Call analysisFunctionMatchingValidateBeforeCall(@javax.annotatio 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public FunctionMatchingResponse analysisFunctionMatching(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest) throws ApiException { ApiResponse localVarResp = analysisFunctionMatchingWithHttpInfo(analysisId, analysisFunctionMatchingRequest); return localVarResp.getData(); @@ -651,7 +674,9 @@ public FunctionMatchingResponse analysisFunctionMatching(@javax.annotation.Nonnu 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse analysisFunctionMatchingWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest) throws ApiException { okhttp3.Call localVarCall = analysisFunctionMatchingValidateBeforeCall(analysisId, analysisFunctionMatchingRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -673,7 +698,9 @@ public ApiResponse analysisFunctionMatchingWithHttpInf 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call analysisFunctionMatchingAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = analysisFunctionMatchingValidateBeforeCall(analysisId, analysisFunctionMatchingRequest, _callback); @@ -695,7 +722,9 @@ public okhttp3.Call analysisFunctionMatchingAsync(@javax.annotation.Nonnull Inte 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call autoUnstripCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AutoUnstripRequest autoUnstripRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -742,6 +771,7 @@ public okhttp3.Call autoUnstripCall(@javax.annotation.Nonnull Integer analysisId return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call autoUnstripValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AutoUnstripRequest autoUnstripRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set @@ -772,7 +802,9 @@ private okhttp3.Call autoUnstripValidateBeforeCall(@javax.annotation.Nonnull Int 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public AutoUnstripResponse autoUnstrip(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AutoUnstripRequest autoUnstripRequest) throws ApiException { ApiResponse localVarResp = autoUnstripWithHttpInfo(analysisId, autoUnstripRequest); return localVarResp.getData(); @@ -792,7 +824,9 @@ public AutoUnstripResponse autoUnstrip(@javax.annotation.Nonnull Integer analysi 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse autoUnstripWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AutoUnstripRequest autoUnstripRequest) throws ApiException { okhttp3.Call localVarCall = autoUnstripValidateBeforeCall(analysisId, autoUnstripRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -814,7 +848,9 @@ public ApiResponse autoUnstripWithHttpInfo(@javax.annotatio 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call autoUnstripAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AutoUnstripRequest autoUnstripRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = autoUnstripValidateBeforeCall(analysisId, autoUnstripRequest, _callback); @@ -835,7 +871,9 @@ public okhttp3.Call autoUnstripAsync(@javax.annotation.Nonnull Integer analysisI 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call batchFunctionMatchingCall(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -881,6 +919,7 @@ public okhttp3.Call batchFunctionMatchingCall(@javax.annotation.Nonnull Function return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call batchFunctionMatchingValidateBeforeCall(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'functionMatchingRequest' is set @@ -905,7 +944,9 @@ private okhttp3.Call batchFunctionMatchingValidateBeforeCall(@javax.annotation.N 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public FunctionMatchingResponse batchFunctionMatching(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest) throws ApiException { ApiResponse localVarResp = batchFunctionMatchingWithHttpInfo(functionMatchingRequest); return localVarResp.getData(); @@ -924,7 +965,9 @@ public FunctionMatchingResponse batchFunctionMatching(@javax.annotation.Nonnull 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse batchFunctionMatchingWithHttpInfo(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest) throws ApiException { okhttp3.Call localVarCall = batchFunctionMatchingValidateBeforeCall(functionMatchingRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -945,7 +988,9 @@ public ApiResponse batchFunctionMatchingWithHttpInfo(@ 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call batchFunctionMatchingAsync(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = batchFunctionMatchingValidateBeforeCall(functionMatchingRequest, _callback); @@ -966,7 +1011,9 @@ public okhttp3.Call batchFunctionMatchingAsync(@javax.annotation.Nonnull Functio 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call cancelAiUnstripCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1012,6 +1059,7 @@ public okhttp3.Call cancelAiUnstripCall(@javax.annotation.Nonnull Integer analys return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call cancelAiUnstripValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set @@ -1036,7 +1084,9 @@ private okhttp3.Call cancelAiUnstripValidateBeforeCall(@javax.annotation.Nonnull 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public AutoUnstripResponse cancelAiUnstrip(@javax.annotation.Nonnull Integer analysisId) throws ApiException { ApiResponse localVarResp = cancelAiUnstripWithHttpInfo(analysisId); return localVarResp.getData(); @@ -1055,7 +1105,9 @@ public AutoUnstripResponse cancelAiUnstrip(@javax.annotation.Nonnull Integer ana 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse cancelAiUnstripWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { okhttp3.Call localVarCall = cancelAiUnstripValidateBeforeCall(analysisId, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -1076,7 +1128,9 @@ public ApiResponse cancelAiUnstripWithHttpInfo(@javax.annot 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call cancelAiUnstripAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = cancelAiUnstripValidateBeforeCall(analysisId, _callback); @@ -1097,7 +1151,9 @@ public okhttp3.Call cancelAiUnstripAsync(@javax.annotation.Nonnull Integer analy 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call cancelAutoUnstripCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1143,6 +1199,7 @@ public okhttp3.Call cancelAutoUnstripCall(@javax.annotation.Nonnull Integer anal return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call cancelAutoUnstripValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set @@ -1167,7 +1224,9 @@ private okhttp3.Call cancelAutoUnstripValidateBeforeCall(@javax.annotation.Nonnu 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public AutoUnstripResponse cancelAutoUnstrip(@javax.annotation.Nonnull Integer analysisId) throws ApiException { ApiResponse localVarResp = cancelAutoUnstripWithHttpInfo(analysisId); return localVarResp.getData(); @@ -1186,7 +1245,9 @@ public AutoUnstripResponse cancelAutoUnstrip(@javax.annotation.Nonnull Integer a 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse cancelAutoUnstripWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { okhttp3.Call localVarCall = cancelAutoUnstripValidateBeforeCall(analysisId, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -1207,7 +1268,9 @@ public ApiResponse cancelAutoUnstripWithHttpInfo(@javax.ann 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call cancelAutoUnstripAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = cancelAutoUnstripValidateBeforeCall(analysisId, _callback); @@ -1557,7 +1620,9 @@ public okhttp3.Call getAnalysisStringsStatusAsync(@javax.annotation.Nonnull Inte 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 @@ -1603,6 +1668,7 @@ public okhttp3.Call getFunctionBlocksCall(@javax.annotation.Nonnull Integer func 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 @@ -1628,7 +1694,9 @@ private okhttp3.Call getFunctionBlocksValidateBeforeCall(@javax.annotation.Nonnu 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(); @@ -1648,7 +1716,9 @@ public BaseResponseFunctionBlocksResponse getFunctionBlocks(@javax.annotation.No 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(); @@ -1670,7 +1740,9 @@ public ApiResponse getFunctionBlocksWithHttp 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); @@ -1678,6 +1750,149 @@ public okhttp3.Call getFunctionBlocksAsync(@javax.annotation.Nonnull Integer fun 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" }; + 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) @@ -1691,7 +1906,9 @@ public okhttp3.Call getFunctionBlocksAsync(@javax.annotation.Nonnull Integer fun 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 @@ -1737,6 +1954,7 @@ public okhttp3.Call getFunctionCalleesCallersCall(@javax.annotation.Nonnull Inte 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 @@ -1761,7 +1979,9 @@ private okhttp3.Call getFunctionCalleesCallersValidateBeforeCall(@javax.annotati 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(); @@ -1780,7 +2000,9 @@ public BaseResponseCalleesCallerFunctionsResponse getFunctionCalleesCallers(@jav 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(); @@ -1801,7 +2023,9 @@ public ApiResponse getFunctionCallee 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); @@ -1822,7 +2046,9 @@ public okhttp3.Call getFunctionCalleesCallersAsync(@javax.annotation.Nonnull Int 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 @@ -1871,6 +2097,7 @@ public okhttp3.Call getFunctionCalleesCallersBulkCall(@javax.annotation.Nonnull 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 @@ -1895,7 +2122,9 @@ private okhttp3.Call getFunctionCalleesCallersBulkValidateBeforeCall(@javax.anno 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(); @@ -1914,7 +2143,9 @@ public BaseResponseListCalleesCallerFunctionsResponse getFunctionCalleesCallersB 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(); @@ -1935,7 +2166,9 @@ public ApiResponse getFunctionCa 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); @@ -1944,8 +2177,8 @@ public okhttp3.Call getFunctionCalleesCallersBulkAsync(@javax.annotation.Nonnull return localVarCall; } /** - * Build call for getFunctionCapabilities - * @param functionId (required) + * 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 @@ -1953,12 +2186,14 @@ public okhttp3.Call getFunctionCalleesCallersBulkAsync(@javax.annotation.Nonnull - - + + + +
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 -
*/ - public okhttp3.Call getFunctionCapabilitiesCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionCalleesCallers_0Call(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1975,7 +2210,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}/callees-callers" .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -2004,61 +2239,65 @@ public okhttp3.Call getFunctionCapabilitiesCall(@javax.annotation.Nonnull Intege } @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionCapabilitiesValidateBeforeCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + 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 getFunctionCapabilities(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionCalleesCallers_0(Async)"); } - return getFunctionCapabilitiesCall(functionId, _callback); + return getFunctionCalleesCallers_0Call(functionId, _callback); } /** - * Retrieve a functions capabilities - * - * @param functionId (required) - * @return BaseResponseFunctionCapabilityResponse + * 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 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public BaseResponseFunctionCapabilityResponse getFunctionCapabilities(@javax.annotation.Nonnull Integer functionId) throws ApiException { - ApiResponse localVarResp = getFunctionCapabilitiesWithHttpInfo(functionId); + public CallEdgesOutputBody getFunctionCalleesCallers_0(@javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = getFunctionCalleesCallers_0WithHttpInfo(functionId); return localVarResp.getData(); } /** - * Retrieve a functions capabilities - * - * @param functionId (required) - * @return ApiResponse<BaseResponseFunctionCapabilityResponse> + * 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 Successful Response -
422 Invalid request parameters -
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
*/ - public ApiResponse getFunctionCapabilitiesWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionCapabilitiesValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + 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); } /** - * Retrieve a functions capabilities (asynchronously) - * - * @param functionId (required) + * 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 * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -2066,20 +2305,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 -
*/ - public okhttp3.Call getFunctionCapabilitiesAsync(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionCalleesCallers_0Async(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFunctionCapabilitiesValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getFunctionCalleesCallers_0ValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getFunctionDetails + * Build call for getFunctionCapabilities * @param functionId (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -2090,9 +2331,12 @@ public okhttp3.Call getFunctionCapabilitiesAsync(@javax.annotation.Nonnull Integ Status Code Description Response Headers 200 Successful Response - 422 Invalid request parameters - + 404 Not Found - + * @deprecated */ - public okhttp3.Call getFunctionDetailsCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + @Deprecated + public okhttp3.Call getFunctionCapabilitiesCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2109,7 +2353,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 = "/v2/functions/{function_id}/capabilities" .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -2137,22 +2381,23 @@ 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 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 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 + * Retrieve a functions capabilities * * @param functionId (required) - * @return BaseResponseFunctionsDetailResponse + * @return BaseResponseFunctionCapabilityResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2160,18 +2405,21 @@ private okhttp3.Call getFunctionDetailsValidateBeforeCall(@javax.annotation.Nonn +
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
+ * @deprecated */ - public BaseResponseFunctionsDetailResponse getFunctionDetails(@javax.annotation.Nonnull Integer functionId) throws ApiException { - ApiResponse localVarResp = getFunctionDetailsWithHttpInfo(functionId); + @Deprecated + public BaseResponseFunctionCapabilityResponse getFunctionCapabilities(@javax.annotation.Nonnull Integer functionId) throws ApiException { + ApiResponse localVarResp = getFunctionCapabilitiesWithHttpInfo(functionId); return localVarResp.getData(); } /** - * Get function details + * Retrieve a functions capabilities * * @param functionId (required) - * @return ApiResponse<BaseResponseFunctionsDetailResponse> + * @return ApiResponse<BaseResponseFunctionCapabilityResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2179,16 +2427,19 @@ public BaseResponseFunctionsDetailResponse getFunctionDetails(@javax.annotation. +
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
404 Not Found -
+ * @deprecated */ - public ApiResponse getFunctionDetailsWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { - okhttp3.Call localVarCall = getFunctionDetailsValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + @Deprecated + public ApiResponse getFunctionCapabilitiesWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionCapabilitiesValidateBeforeCall(functionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get function details (asynchronously) + * Retrieve a functions capabilities (asynchronously) * * @param functionId (required) * @param _callback The callback to be executed when the API call finishes @@ -2200,21 +2451,21 @@ public ApiResponse getFunctionDetailsWithHt Status Code Description Response Headers 200 Successful Response - 422 Invalid request parameters - + 404 Not Found - + * @deprecated */ - public okhttp3.Call getFunctionDetailsAsync(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { + @Deprecated + public okhttp3.Call getFunctionCapabilitiesAsync(@javax.annotation.Nonnull Integer 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 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) + * Build call for getFunctionCapabilities_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 @@ -2222,13 +2473,14 @@ public okhttp3.Call getFunctionDetailsAsync(@javax.annotation.Nonnull Integer fu - - + + + + +
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 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 { + public okhttp3.Call getFunctionCapabilities_0Call(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2245,7 +2497,7 @@ public okhttp3.Call getFunctionStringsCall(@javax.annotation.Nonnull Integer fun Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v2/functions/{function_id}/strings" + String localVarPath = "/v3/functions/{function_id}/capabilities" .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -2254,18 +2506,6 @@ public okhttp3.Call getFunctionStringsCall(@javax.annotation.Nonnull Integer fun 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" }; @@ -2285,74 +2525,66 @@ public okhttp3.Call getFunctionStringsCall(@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 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 { + private okhttp3.Call getFunctionCapabilities_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 getFunctionStrings(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionCapabilities_0(Async)"); } - return getFunctionStringsCall(functionId, page, pageSize, search, _callback); + return getFunctionCapabilities_0Call(functionId, _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 + * 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 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); + public CapabilitiesOutputBody getFunctionCapabilities_0(@javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = getFunctionCapabilities_0WithHttpInfo(functionId); 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> + * 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 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(); + public ApiResponse getFunctionCapabilities_0WithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionCapabilities_0ValidateBeforeCall(functionId, 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) + * 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 @@ -2360,25 +2592,23 @@ public ApiResponse getFunctionStringsWithHt - - + + + + +
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 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 { + public okhttp3.Call getFunctionCapabilities_0Async(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFunctionStringsValidateBeforeCall(functionId, page, pageSize, search, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getFunctionCapabilities_0ValidateBeforeCall(functionId, _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) - * @param search Filter by string value (case-insensitive substring match). (optional) + * Build call for getFunctionDetails + * @param functionId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2386,14 +2616,13 @@ public okhttp3.Call getFunctionStringsAsync(@javax.annotation.Nonnull Integer fu - - - - - + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
200 Successful Response -
422 Invalid request parameters -
+ * @deprecated */ - 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 { + @Deprecated + public okhttp3.Call getFunctionDetailsCall(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2410,7 +2639,7 @@ public okhttp3.Call getFunctionStrings_0Call(@javax.annotation.Nonnull Long func Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v3/functions/{function_id}/strings" + String localVarPath = "/v2/functions/{function_id}" .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -2419,18 +2648,6 @@ public okhttp3.Call getFunctionStrings_0Call(@javax.annotation.Nonnull Long func 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" }; @@ -2450,75 +2667,65 @@ public okhttp3.Call getFunctionStrings_0Call(@javax.annotation.Nonnull Long func return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @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 getFunctionDetailsValidateBeforeCall(@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 getFunctionStrings_0(Async)"); + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionDetails(Async)"); } - return getFunctionStrings_0Call(functionId, page, pageSize, search, _callback); + return getFunctionDetailsCall(functionId, _callback); } /** - * List strings for a function. - * Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @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) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @return ListFunctionStringsOutputBody + * Get function details + * + * @param functionId (required) + * @return BaseResponseFunctionsDetailResponse * @throws ApiException If fail to 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 -
200 Successful Response -
422 Invalid request parameters -
+ * @deprecated */ - 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); + @Deprecated + public BaseResponseFunctionsDetailResponse getFunctionDetails(@javax.annotation.Nonnull Integer functionId) throws ApiException { + ApiResponse localVarResp = getFunctionDetailsWithHttpInfo(functionId); return localVarResp.getData(); } /** - * List strings for a function. - * Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @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) - * @param search Filter by string value (case-insensitive substring match). (optional) - * @return ApiResponse<ListFunctionStringsOutputBody> + * Get function details + * + * @param functionId (required) + * @return ApiResponse<BaseResponseFunctionsDetailResponse> * @throws ApiException If fail to 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 -
200 Successful Response -
422 Invalid request parameters -
+ * @deprecated */ - 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); - Type localVarReturnType = new TypeToken(){}.getType(); + @Deprecated + public ApiResponse getFunctionDetailsWithHttpInfo(@javax.annotation.Nonnull Integer functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionDetailsValidateBeforeCall(functionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List strings for a function. (asynchronously) - * Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @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) - * @param search Filter by string value (case-insensitive substring match). (optional) + * Get function details (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 @@ -2526,17 +2733,1246 @@ public ApiResponse getFunctionStrings_0WithHttpIn - - - - - + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
200 Successful Response -
422 Invalid request parameters -
+ * @deprecated */ - 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 { + @Deprecated + public okhttp3.Call getFunctionDetailsAsync(@javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getFunctionStrings_0ValidateBeforeCall(functionId, page, pageSize, search, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getFunctionDetailsValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getFunctionDetails_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 getFunctionDetails_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}" + .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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFunctionDetails_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 getFunctionDetails_0(Async)"); + } + + return getFunctionDetails_0Call(functionId, _callback); + + } + + /** + * Get function details + * Returns metadata for a single function — name, virtual address, size, debug status, binary it belongs to. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param functionId Function ID (required) + * @return FunctionDetailsOutputBody + * @throws ApiException If fail to 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 FunctionDetailsOutputBody getFunctionDetails_0(@javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = getFunctionDetails_0WithHttpInfo(functionId); + return localVarResp.getData(); + } + + /** + * Get function details + * Returns metadata for a single function — name, virtual address, size, debug status, binary it belongs to. **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<FunctionDetailsOutputBody> + * @throws ApiException If fail to 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 getFunctionDetails_0WithHttpInfo(@javax.annotation.Nonnull Long functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionDetails_0ValidateBeforeCall(functionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get function details (asynchronously) + * Returns metadata for a single function — name, virtual address, size, debug status, binary it belongs to. **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 getFunctionDetails_0Async(@javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFunctionDetails_0ValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * 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" }; + 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) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
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 { + 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}/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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @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 { + // verify the required parameter 'functionId' is set + if (functionId == null) { + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionStrings_0(Async)"); + } + + return getFunctionStrings_0Call(functionId, page, pageSize, search, _callback); + + } + + /** + * List strings for a function. + * Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @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) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @return ListFunctionStringsOutputBody + * @throws ApiException If fail to 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 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); + return localVarResp.getData(); + } + + /** + * List strings for a function. + * Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @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) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @return ApiResponse<ListFunctionStringsOutputBody> + * @throws ApiException If fail to 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 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); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List strings for a function. (asynchronously) + * Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + * @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) + * @param search Filter by string value (case-insensitive substring match). (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
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 { + + okhttp3.Call localVarCall = getFunctionStrings_0ValidateBeforeCall(functionId, page, pageSize, search, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getFunctionsCalleesCallers + * @param functionIds Function IDs to fetch edges for. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getFunctionsCalleesCallersCall(@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 = "/v3/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("csv", "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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFunctionsCalleesCallersValidateBeforeCall(@javax.annotation.Nullable 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 getFunctionsCalleesCallers(Async)"); + } + + return getFunctionsCalleesCallersCall(functionIds, _callback); + + } + + /** + * Get callees and callers for many functions + * Bulk variant — pass `function_ids` as a query parameter (comma-separated or repeated). Caller must have access to every supplied function or the whole request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param functionIds Function IDs to fetch edges for. (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 -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public CallEdgesOutputBody getFunctionsCalleesCallers(@javax.annotation.Nullable List functionIds) throws ApiException { + ApiResponse localVarResp = getFunctionsCalleesCallersWithHttpInfo(functionIds); + return localVarResp.getData(); + } + + /** + * Get callees and callers for many functions + * Bulk variant — pass `function_ids` as a query parameter (comma-separated or repeated). Caller must have access to every supplied function or the whole request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param functionIds Function IDs to fetch edges for. (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 -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse getFunctionsCalleesCallersWithHttpInfo(@javax.annotation.Nullable List functionIds) throws ApiException { + okhttp3.Call localVarCall = getFunctionsCalleesCallersValidateBeforeCall(functionIds, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get callees and callers for many functions (asynchronously) + * Bulk variant — pass `function_ids` as a query parameter (comma-separated or repeated). Caller must have access to every supplied function or the whole request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param functionIds Function IDs to fetch edges for. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getFunctionsCalleesCallersAsync(@javax.annotation.Nullable List functionIds, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFunctionsCalleesCallersValidateBeforeCall(functionIds, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getFunctionsMatches + * @param functionIds Source function IDs whose matches to fetch. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getFunctionsMatchesCall(@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 = "/v3/functions/matches"; + + 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("csv", "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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFunctionsMatchesValidateBeforeCall(@javax.annotation.Nullable 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 getFunctionsMatches(Async)"); + } + + return getFunctionsMatchesCall(functionIds, _callback); + + } + + /** + * Get function-matching results for an explicit set of functions + * 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 functionIds Source function IDs whose matches to fetch. (required) + * @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 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public GetMatchesOutputBody getFunctionsMatches(@javax.annotation.Nullable List functionIds) throws ApiException { + ApiResponse localVarResp = getFunctionsMatchesWithHttpInfo(functionIds); + return localVarResp.getData(); + } + + /** + * Get function-matching results for an explicit set of functions + * 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 functionIds Source function IDs whose matches to fetch. (required) + * @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 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse getFunctionsMatchesWithHttpInfo(@javax.annotation.Nullable List functionIds) throws ApiException { + okhttp3.Call localVarCall = getFunctionsMatchesValidateBeforeCall(functionIds, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get function-matching results for an explicit set of functions (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 functionIds Source function IDs whose matches to fetch. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getFunctionsMatchesAsync(@javax.annotation.Nullable List functionIds, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFunctionsMatchesValidateBeforeCall(functionIds, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getFunctionsMatchingStatus + * @param functionIds Source function IDs whose matches to fetch. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getFunctionsMatchingStatusCall(@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 = "/v3/functions/matches/status"; + + 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("csv", "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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFunctionsMatchingStatusValidateBeforeCall(@javax.annotation.Nullable 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 getFunctionsMatchingStatus(Async)"); + } + + return getFunctionsMatchingStatusCall(functionIds, _callback); + + } + + /** + * Get function-matching status for an explicit set of functions + * Returns the matching workflow's current status for the supplied function IDs. 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 functionIds Source function IDs whose matches to fetch. (required) + * @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 GetMatchesStatusOutputBody getFunctionsMatchingStatus(@javax.annotation.Nullable List functionIds) throws ApiException { + ApiResponse localVarResp = getFunctionsMatchingStatusWithHttpInfo(functionIds); + return localVarResp.getData(); + } + + /** + * Get function-matching status for an explicit set of functions + * Returns the matching workflow's current status for the supplied function IDs. 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 functionIds Source function IDs whose matches to fetch. (required) + * @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 getFunctionsMatchingStatusWithHttpInfo(@javax.annotation.Nullable List functionIds) throws ApiException { + okhttp3.Call localVarCall = getFunctionsMatchingStatusValidateBeforeCall(functionIds, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get function-matching status for an explicit set of functions (asynchronously) + * Returns the matching workflow's current status for the supplied function IDs. 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 functionIds Source function IDs whose matches to fetch. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call getFunctionsMatchingStatusAsync(@javax.annotation.Nullable List functionIds, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFunctionsMatchingStatusValidateBeforeCall(functionIds, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listAnalysisFunctions + * @param analysisId Analysis ID (required) + * @param offset Pagination offset. Defaults to 0. (optional) + * @param limit Page size. Defaults to 100. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call listAnalysisFunctionsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/functions" + .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 (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAnalysisFunctionsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit, 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 listAnalysisFunctions(Async)"); + } + + return listAnalysisFunctionsCall(analysisId, offset, limit, _callback); + + } + + /** + * List functions in an analysis + * Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @param offset Pagination offset. Defaults to 0. (optional) + * @param limit Page size. Defaults to 100. (optional) + * @return ListAnalysisFunctionsOutputBody + * @throws ApiException If fail to 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 ListAnalysisFunctionsOutputBody listAnalysisFunctions(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit) throws ApiException { + ApiResponse localVarResp = listAnalysisFunctionsWithHttpInfo(analysisId, offset, limit); + return localVarResp.getData(); + } + + /** + * List functions in an analysis + * Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @param offset Pagination offset. Defaults to 0. (optional) + * @param limit Page size. Defaults to 100. (optional) + * @return ApiResponse<ListAnalysisFunctionsOutputBody> + * @throws ApiException If fail to 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 listAnalysisFunctionsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit) throws ApiException { + okhttp3.Call localVarCall = listAnalysisFunctionsValidateBeforeCall(analysisId, offset, limit, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List functions in an analysis (asynchronously) + * Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @param offset Pagination offset. Defaults to 0. (optional) + * @param limit Page size. Defaults to 100. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call listAnalysisFunctionsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listAnalysisFunctionsValidateBeforeCall(analysisId, offset, limit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for startFunctionsMatching + * @param startMatchingForFunctionsInputBody (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 startFunctionsMatchingCall(@javax.annotation.Nonnull StartMatchingForFunctionsInputBody startMatchingForFunctionsInputBody, 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 = startMatchingForFunctionsInputBody; + + // create path and map variables + String localVarPath = "/v3/functions/matches"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call startFunctionsMatchingValidateBeforeCall(@javax.annotation.Nonnull StartMatchingForFunctionsInputBody startMatchingForFunctionsInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'startMatchingForFunctionsInputBody' is set + if (startMatchingForFunctionsInputBody == null) { + throw new ApiException("Missing the required parameter 'startMatchingForFunctionsInputBody' when calling startFunctionsMatching(Async)"); + } + + return startFunctionsMatchingCall(startMatchingForFunctionsInputBody, _callback); + + } + + /** + * Start function matching for an explicit set of functions + * Dispatches the function-matching workflow against the provided function IDs. 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 startMatchingForFunctionsInputBody (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 startFunctionsMatching(@javax.annotation.Nonnull StartMatchingForFunctionsInputBody startMatchingForFunctionsInputBody) throws ApiException { + ApiResponse localVarResp = startFunctionsMatchingWithHttpInfo(startMatchingForFunctionsInputBody); + return localVarResp.getData(); + } + + /** + * Start function matching for an explicit set of functions + * Dispatches the function-matching workflow against the provided function IDs. 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 startMatchingForFunctionsInputBody (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 startFunctionsMatchingWithHttpInfo(@javax.annotation.Nonnull StartMatchingForFunctionsInputBody startMatchingForFunctionsInputBody) throws ApiException { + okhttp3.Call localVarCall = startFunctionsMatchingValidateBeforeCall(startMatchingForFunctionsInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Start function matching for an explicit set of functions (asynchronously) + * Dispatches the function-matching workflow against the provided function IDs. 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 startMatchingForFunctionsInputBody (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 startFunctionsMatchingAsync(@javax.annotation.Nonnull StartMatchingForFunctionsInputBody startMatchingForFunctionsInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = startFunctionsMatchingValidateBeforeCall(startMatchingForFunctionsInputBody, _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 3229b1e..8e3adff 100644 --- a/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java +++ b/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java @@ -34,7 +34,10 @@ 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 java.lang.reflect.Type; import java.util.ArrayList; @@ -522,7 +525,9 @@ public okhttp3.Call generateFunctionDataTypesForFunctionsAsync(@javax.annotation 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getFunctionDataTypesCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -569,6 +574,7 @@ public okhttp3.Call getFunctionDataTypesCall(@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 getFunctionDataTypesValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set @@ -599,7 +605,9 @@ private okhttp3.Call getFunctionDataTypesValidateBeforeCall(@javax.annotation.No 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public BaseResponseFunctionDataTypes getFunctionDataTypes(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId) throws ApiException { ApiResponse localVarResp = getFunctionDataTypesWithHttpInfo(analysisId, functionId); return localVarResp.getData(); @@ -619,7 +627,9 @@ public BaseResponseFunctionDataTypes getFunctionDataTypes(@javax.annotation.Nonn 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public ApiResponse getFunctionDataTypesWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId) throws ApiException { okhttp3.Call localVarCall = getFunctionDataTypesValidateBeforeCall(analysisId, functionId, null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -641,7 +651,9 @@ public ApiResponse getFunctionDataTypesWithHttpIn 200 Successful Response - 422 Invalid request parameters - + * @deprecated */ + @Deprecated public okhttp3.Call getFunctionDataTypesAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getFunctionDataTypesValidateBeforeCall(analysisId, functionId, _callback); @@ -649,6 +661,318 @@ public okhttp3.Call getFunctionDataTypesAsync(@javax.annotation.Nonnull Integer localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getFunctionDataTypes_0 + * @param analysisId Analysis ID (required) + * @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 getFunctionDataTypes_0Call(@javax.annotation.Nonnull Long analysisId, @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/analyses/{analysis_id}/functions/{function_id}/data-types" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) + .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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFunctionDataTypes_0ValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long functionId, 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 getFunctionDataTypes_0(Async)"); + } + + // verify the required parameter 'functionId' is set + if (functionId == null) { + throw new ApiException("Missing the required parameter 'functionId' when calling getFunctionDataTypes_0(Async)"); + } + + return getFunctionDataTypes_0Call(analysisId, functionId, _callback); + + } + + /** + * Get data types for a single function + * Returns the stored data-types blob for one function. The function must belong to the supplied analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @param functionId Function ID (required) + * @return DataTypesEntry + * @throws ApiException If fail to 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 DataTypesEntry getFunctionDataTypes_0(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long functionId) throws ApiException { + ApiResponse localVarResp = getFunctionDataTypes_0WithHttpInfo(analysisId, functionId); + return localVarResp.getData(); + } + + /** + * Get data types for a single function + * Returns the stored data-types blob for one function. The function must belong to the supplied analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @param functionId Function ID (required) + * @return ApiResponse<DataTypesEntry> + * @throws ApiException If fail to 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 getFunctionDataTypes_0WithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long functionId) throws ApiException { + okhttp3.Call localVarCall = getFunctionDataTypes_0ValidateBeforeCall(analysisId, functionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get data types for a single function (asynchronously) + * Returns the stored data-types blob for one function. The function must belong to the supplied analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @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 getFunctionDataTypes_0Async(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull Long functionId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFunctionDataTypes_0ValidateBeforeCall(analysisId, functionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listAnalysisFunctionsDataTypes + * @param analysisId Analysis ID (required) + * @param offset Pagination offset. Defaults to 0. (optional) + * @param limit Page size. Defaults to 100. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call listAnalysisFunctionsDataTypesCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/functions/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 (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAnalysisFunctionsDataTypesValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit, 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 listAnalysisFunctionsDataTypes(Async)"); + } + + return listAnalysisFunctionsDataTypesCall(analysisId, offset, limit, _callback); + + } + + /** + * List data types for all functions in an analysis + * Paginated read of the stored data-types blob for each function in the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @param offset Pagination offset. Defaults to 0. (optional) + * @param limit Page size. Defaults to 100. (optional) + * @return ListAnalysisFunctionsDataTypesOutputBody + * @throws ApiException If fail to 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 ListAnalysisFunctionsDataTypesOutputBody listAnalysisFunctionsDataTypes(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit) throws ApiException { + ApiResponse localVarResp = listAnalysisFunctionsDataTypesWithHttpInfo(analysisId, offset, limit); + return localVarResp.getData(); + } + + /** + * List data types for all functions in an analysis + * Paginated read of the stored data-types blob for each function in the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @param offset Pagination offset. Defaults to 0. (optional) + * @param limit Page size. Defaults to 100. (optional) + * @return ApiResponse<ListAnalysisFunctionsDataTypesOutputBody> + * @throws ApiException If fail to 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 listAnalysisFunctionsDataTypesWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit) throws ApiException { + okhttp3.Call localVarCall = listAnalysisFunctionsDataTypesValidateBeforeCall(analysisId, offset, limit, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List data types for all functions in an analysis (asynchronously) + * Paginated read of the stored data-types blob for each function in the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param analysisId Analysis ID (required) + * @param offset Pagination offset. Defaults to 0. (optional) + * @param limit Page size. Defaults to 100. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call listAnalysisFunctionsDataTypesAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable Long limit, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listAnalysisFunctionsDataTypesValidateBeforeCall(analysisId, offset, limit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for listFunctionDataTypesForAnalysis * @param analysisId (required) @@ -663,7 +987,9 @@ public okhttp3.Call getFunctionDataTypesAsync(@javax.annotation.Nonnull Integer 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 @@ -713,6 +1039,7 @@ public okhttp3.Call listFunctionDataTypesForAnalysisCall(@javax.annotation.Nonnu 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 @@ -738,7 +1065,9 @@ private okhttp3.Call listFunctionDataTypesForAnalysisValidateBeforeCall(@javax.a 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(); @@ -758,7 +1087,9 @@ public BaseResponseFunctionDataTypesList listFunctionDataTypesForAnalysis(@javax 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(); @@ -780,7 +1111,9 @@ public ApiResponse listFunctionDataTypesForAn 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); @@ -801,7 +1134,9 @@ public okhttp3.Call listFunctionDataTypesForAnalysisAsync(@javax.annotation.Nonn 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 @@ -850,6 +1185,7 @@ public okhttp3.Call listFunctionDataTypesForFunctionsCall(@javax.annotation.Null 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); @@ -869,7 +1205,9 @@ private okhttp3.Call listFunctionDataTypesForFunctionsValidateBeforeCall(@javax. 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(); @@ -888,7 +1226,9 @@ public BaseResponseFunctionDataTypesList listFunctionDataTypesForFunctions(@java 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(); @@ -909,7 +1249,9 @@ public ApiResponse listFunctionDataTypesForFu 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); @@ -917,4 +1259,154 @@ public okhttp3.Call listFunctionDataTypesForFunctionsAsync(@javax.annotation.Nul localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for listFunctionsDataTypes + * @param functionIds Function IDs to fetch data-types for. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call listFunctionsDataTypesCall(@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 = "/v3/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("csv", "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" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFunctionsDataTypesValidateBeforeCall(@javax.annotation.Nullable 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 listFunctionsDataTypes(Async)"); + } + + return listFunctionsDataTypesCall(functionIds, _callback); + + } + + /** + * Get data types for many functions + * Returns the stored data-types blob for each supplied function ID. Caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param functionIds Function IDs to fetch data-types for. (required) + * @return ListFunctionsDataTypesOutputBody + * @throws ApiException If fail to 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 ListFunctionsDataTypesOutputBody listFunctionsDataTypes(@javax.annotation.Nullable List functionIds) throws ApiException { + ApiResponse localVarResp = listFunctionsDataTypesWithHttpInfo(functionIds); + return localVarResp.getData(); + } + + /** + * Get data types for many functions + * Returns the stored data-types blob for each supplied function ID. Caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param functionIds Function IDs to fetch data-types for. (required) + * @return ApiResponse<ListFunctionsDataTypesOutputBody> + * @throws ApiException If fail to 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 listFunctionsDataTypesWithHttpInfo(@javax.annotation.Nullable List functionIds) throws ApiException { + okhttp3.Call localVarCall = listFunctionsDataTypesValidateBeforeCall(functionIds, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get data types for many functions (asynchronously) + * Returns the stored data-types blob for each supplied function ID. Caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param functionIds Function IDs to fetch data-types for. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call listFunctionsDataTypesAsync(@javax.annotation.Nullable List functionIds, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listFunctionsDataTypesValidateBeforeCall(functionIds, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 2d14024..99d200f 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -146,7 +146,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/3.95.1/java"); + setUserAgent("OpenAPI-Generator/3.96.2/java"); authentications = new HashMap(); } diff --git a/src/main/java/ai/reveng/invoker/Configuration.java b/src/main/java/ai/reveng/invoker/Configuration.java index 5e86c45..c9fa7ab 100644 --- a/src/main/java/ai/reveng/invoker/Configuration.java +++ b/src/main/java/ai/reveng/invoker/Configuration.java @@ -18,7 +18,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "3.95.1"; + public static final String VERSION = "3.96.2"; private static final AtomicReference defaultApiClient = new AtomicReference<>(); private static volatile Supplier apiClientFactory = ApiClient::new; diff --git a/src/main/java/ai/reveng/invoker/JSON.java b/src/main/java/ai/reveng/invoker/JSON.java index 47def18..8a1f86b 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -116,6 +116,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.AnalysisFunctionMatchingRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctions.CustomTypeAdapterFactory()); @@ -211,6 +212,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchRenameItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchRenameOutputBody.CustomTypeAdapterFactory()); @@ -228,11 +231,15 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinarySearchResult.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.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()); @@ -267,11 +274,13 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreateConversationRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CreatePortalSessionInputBody.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()); @@ -320,16 +329,20 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileHashes.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FileMetadata.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()); @@ -345,6 +358,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); @@ -359,6 +373,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); @@ -370,12 +386,16 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ImportModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InlineComment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InsertAnalysisLogRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisFunctionsDataTypesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisFunctionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisStringsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionResults.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionStringsOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionsDataTypesOutputBody.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.MatchedFunctionSuggestion.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MemdumpEntry.CustomTypeAdapterFactory()); @@ -459,6 +479,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); diff --git a/src/main/java/ai/reveng/model/AnalysisFunctionEntry.java b/src/main/java/ai/reveng/model/AnalysisFunctionEntry.java new file mode 100644 index 0000000..dd87a20 --- /dev/null +++ b/src/main/java/ai/reveng/model/AnalysisFunctionEntry.java @@ -0,0 +1,515 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * AnalysisFunctionEntry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnalysisFunctionEntry { + public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; + @SerializedName(SERIALIZED_NAME_BINARY_ID) + @javax.annotation.Nonnull + private Long binaryId; + + 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_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_SIZE = "function_size"; + @SerializedName(SERIALIZED_NAME_FUNCTION_SIZE) + @javax.annotation.Nonnull + private Long functionSize; + + 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_MANGLED_NAME = "mangled_name"; + @SerializedName(SERIALIZED_NAME_MANGLED_NAME) + @javax.annotation.Nullable + private String mangledName; + + public static final String SERIALIZED_NAME_SOURCE_BINARY_ID = "source_binary_id"; + @SerializedName(SERIALIZED_NAME_SOURCE_BINARY_ID) + @javax.annotation.Nullable + private Long sourceBinaryId; + + public static final String SERIALIZED_NAME_SOURCE_TYPE = "source_type"; + @SerializedName(SERIALIZED_NAME_SOURCE_TYPE) + @javax.annotation.Nonnull + private String sourceType; + + public AnalysisFunctionEntry() { + } + + public AnalysisFunctionEntry binaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + return this; + } + + /** + * Get binaryId + * @return binaryId + */ + @javax.annotation.Nonnull + public Long getBinaryId() { + return binaryId; + } + + public void setBinaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + } + + + public AnalysisFunctionEntry 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 AnalysisFunctionEntry functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Get functionId + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + public AnalysisFunctionEntry 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 AnalysisFunctionEntry functionSize(@javax.annotation.Nonnull Long functionSize) { + this.functionSize = functionSize; + return this; + } + + /** + * Get functionSize + * @return functionSize + */ + @javax.annotation.Nonnull + public Long getFunctionSize() { + return functionSize; + } + + public void setFunctionSize(@javax.annotation.Nonnull Long functionSize) { + this.functionSize = functionSize; + } + + + public AnalysisFunctionEntry 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 AnalysisFunctionEntry mangledName(@javax.annotation.Nullable String mangledName) { + this.mangledName = mangledName; + return this; + } + + /** + * Search is applied to string value + * @return mangledName + */ + @javax.annotation.Nullable + public String getMangledName() { + return mangledName; + } + + public void setMangledName(@javax.annotation.Nullable String mangledName) { + this.mangledName = mangledName; + } + + + public AnalysisFunctionEntry sourceBinaryId(@javax.annotation.Nullable Long sourceBinaryId) { + this.sourceBinaryId = sourceBinaryId; + return this; + } + + /** + * Get sourceBinaryId + * @return sourceBinaryId + */ + @javax.annotation.Nullable + public Long getSourceBinaryId() { + return sourceBinaryId; + } + + public void setSourceBinaryId(@javax.annotation.Nullable Long sourceBinaryId) { + this.sourceBinaryId = sourceBinaryId; + } + + + public AnalysisFunctionEntry sourceType(@javax.annotation.Nonnull String sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get sourceType + * @return sourceType + */ + @javax.annotation.Nonnull + public String getSourceType() { + return sourceType; + } + + public void setSourceType(@javax.annotation.Nonnull String sourceType) { + this.sourceType = sourceType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AnalysisFunctionEntry instance itself + */ + public AnalysisFunctionEntry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnalysisFunctionEntry analysisFunctionEntry = (AnalysisFunctionEntry) o; + return Objects.equals(this.binaryId, analysisFunctionEntry.binaryId) && + Objects.equals(this.debug, analysisFunctionEntry.debug) && + Objects.equals(this.functionId, analysisFunctionEntry.functionId) && + Objects.equals(this.functionName, analysisFunctionEntry.functionName) && + Objects.equals(this.functionSize, analysisFunctionEntry.functionSize) && + Objects.equals(this.functionVaddr, analysisFunctionEntry.functionVaddr) && + Objects.equals(this.mangledName, analysisFunctionEntry.mangledName) && + Objects.equals(this.sourceBinaryId, analysisFunctionEntry.sourceBinaryId) && + Objects.equals(this.sourceType, analysisFunctionEntry.sourceType)&& + 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, sourceBinaryId, 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(); + sb.append("class AnalysisFunctionEntry {\n"); + sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); + sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" functionSize: ").append(toIndentedString(functionSize)).append("\n"); + sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); + sb.append(" mangledName: ").append(toIndentedString(mangledName)).append("\n"); + sb.append(" sourceBinaryId: ").append(toIndentedString(sourceBinaryId)).append("\n"); + sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\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", "debug", "function_id", "function_name", "function_size", "function_vaddr", "mangled_name", "source_binary_id", "source_type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("binary_id", "debug", "function_id", "function_name", "function_size", "function_vaddr", "source_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 AnalysisFunctionEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnalysisFunctionEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisFunctionEntry is not found in the empty JSON string", AnalysisFunctionEntry.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnalysisFunctionEntry.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("mangled_name") != null && !jsonObj.get("mangled_name").isJsonNull()) && !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())); + } + if (!jsonObj.get("source_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnalysisFunctionEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnalysisFunctionEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AnalysisFunctionEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AnalysisFunctionEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AnalysisFunctionEntry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnalysisFunctionEntry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AnalysisFunctionEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnalysisFunctionEntry + * @throws IOException if the JSON string is invalid with respect to AnalysisFunctionEntry + */ + public static AnalysisFunctionEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnalysisFunctionEntry.class); + } + + /** + * Convert an instance of AnalysisFunctionEntry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BatchBinaryMatchResult.java b/src/main/java/ai/reveng/model/BatchBinaryMatchResult.java new file mode 100644 index 0000000..2826711 --- /dev/null +++ b/src/main/java/ai/reveng/model/BatchBinaryMatchResult.java @@ -0,0 +1,432 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * BatchBinaryMatchResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BatchBinaryMatchResult { + public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; + @SerializedName(SERIALIZED_NAME_BINARY_ID) + @javax.annotation.Nonnull + private Long binaryId; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "error_message"; + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + @javax.annotation.Nullable + private String errorMessage; + + public static final String SERIALIZED_NAME_MATCHED_FUNCTION_COUNT = "matched_function_count"; + @SerializedName(SERIALIZED_NAME_MATCHED_FUNCTION_COUNT) + @javax.annotation.Nonnull + private Long matchedFunctionCount; + + /** + * Per-binary workflow status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UNINITIALISED("UNINITIALISED"), + + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public BatchBinaryMatchResult() { + } + + public BatchBinaryMatchResult binaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + return this; + } + + /** + * Target binary + * @return binaryId + */ + @javax.annotation.Nonnull + public Long getBinaryId() { + return binaryId; + } + + public void setBinaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + } + + + public BatchBinaryMatchResult errorMessage(@javax.annotation.Nullable String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Error description when status=FAILED. + * @return errorMessage + */ + @javax.annotation.Nullable + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(@javax.annotation.Nullable String errorMessage) { + this.errorMessage = errorMessage; + } + + + public BatchBinaryMatchResult matchedFunctionCount(@javax.annotation.Nonnull Long matchedFunctionCount) { + this.matchedFunctionCount = matchedFunctionCount; + return this; + } + + /** + * Number of source functions that received at least one candidate match. Only meaningful when status=COMPLETED. + * @return matchedFunctionCount + */ + @javax.annotation.Nonnull + public Long getMatchedFunctionCount() { + return matchedFunctionCount; + } + + public void setMatchedFunctionCount(@javax.annotation.Nonnull Long matchedFunctionCount) { + this.matchedFunctionCount = matchedFunctionCount; + } + + + public BatchBinaryMatchResult status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Per-binary workflow status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BatchBinaryMatchResult instance itself + */ + public BatchBinaryMatchResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchBinaryMatchResult batchBinaryMatchResult = (BatchBinaryMatchResult) o; + return Objects.equals(this.binaryId, batchBinaryMatchResult.binaryId) && + Objects.equals(this.errorMessage, batchBinaryMatchResult.errorMessage) && + Objects.equals(this.matchedFunctionCount, batchBinaryMatchResult.matchedFunctionCount) && + Objects.equals(this.status, batchBinaryMatchResult.status)&& + Objects.equals(this.additionalProperties, batchBinaryMatchResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(binaryId, errorMessage, matchedFunctionCount, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchBinaryMatchResult {\n"); + sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" matchedFunctionCount: ").append(toIndentedString(matchedFunctionCount)).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("binary_id", "error_message", "matched_function_count", "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("binary_id", "matched_function_count", "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 BatchBinaryMatchResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchBinaryMatchResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BatchBinaryMatchResult is not found in the empty JSON string", BatchBinaryMatchResult.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchBinaryMatchResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("error_message") != null && !jsonObj.get("error_message").isJsonNull()) && !jsonObj.get("error_message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_message").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchBinaryMatchResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchBinaryMatchResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchBinaryMatchResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchBinaryMatchResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BatchBinaryMatchResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BatchBinaryMatchResult instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchBinaryMatchResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchBinaryMatchResult + * @throws IOException if the JSON string is invalid with respect to BatchBinaryMatchResult + */ + public static BatchBinaryMatchResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchBinaryMatchResult.class); + } + + /** + * Convert an instance of BatchBinaryMatchResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BatchMatchingOutputBody.java b/src/main/java/ai/reveng/model/BatchMatchingOutputBody.java new file mode 100644 index 0000000..0dc05fe --- /dev/null +++ b/src/main/java/ai/reveng/model/BatchMatchingOutputBody.java @@ -0,0 +1,398 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.BatchBinaryMatchResult; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * BatchMatchingOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BatchMatchingOutputBody { + public static final String SERIALIZED_NAME_PER_BINARY = "per_binary"; + @SerializedName(SERIALIZED_NAME_PER_BINARY) + @javax.annotation.Nullable + private List perBinary; + + /** + * Aggregate status across the batch: COMPLETED when every binary is completed, FAILED if any failed, RUNNING/PENDING otherwise. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UNINITIALISED("UNINITIALISED"), + + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public BatchMatchingOutputBody() { + } + + public BatchMatchingOutputBody perBinary(@javax.annotation.Nullable List perBinary) { + this.perBinary = perBinary; + return this; + } + + public BatchMatchingOutputBody addPerBinaryItem(BatchBinaryMatchResult perBinaryItem) { + if (this.perBinary == null) { + this.perBinary = new ArrayList<>(); + } + this.perBinary.add(perBinaryItem); + return this; + } + + /** + * Per-binary status (order matches the request). + * @return perBinary + */ + @javax.annotation.Nullable + public List getPerBinary() { + return perBinary; + } + + public void setPerBinary(@javax.annotation.Nullable List perBinary) { + this.perBinary = perBinary; + } + + + public BatchMatchingOutputBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Aggregate status across the batch: COMPLETED when every binary is completed, FAILED if any failed, RUNNING/PENDING otherwise. + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BatchMatchingOutputBody instance itself + */ + public BatchMatchingOutputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchMatchingOutputBody batchMatchingOutputBody = (BatchMatchingOutputBody) o; + return Objects.equals(this.perBinary, batchMatchingOutputBody.perBinary) && + Objects.equals(this.status, batchMatchingOutputBody.status)&& + Objects.equals(this.additionalProperties, batchMatchingOutputBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(perBinary, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchMatchingOutputBody {\n"); + sb.append(" perBinary: ").append(toIndentedString(perBinary)).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("per_binary", "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("per_binary", "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 BatchMatchingOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchMatchingOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BatchMatchingOutputBody is not found in the empty JSON string", BatchMatchingOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchMatchingOutputBody.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("per_binary") != null && !jsonObj.get("per_binary").isJsonNull()) { + if (!jsonObj.get("per_binary").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `per_binary` to be an array in the JSON string but got `%s`", jsonObj.get("per_binary").toString())); + } + JsonArray jsonArrayperBinary = jsonObj.getAsJsonArray("per_binary"); + // validate the required field `per_binary` (array) + for (int i = 0; i < jsonArrayperBinary.size(); i++) { + BatchBinaryMatchResult.validateJsonElement(jsonArrayperBinary.get(i)); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchMatchingOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchMatchingOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchMatchingOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchMatchingOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BatchMatchingOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BatchMatchingOutputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchMatchingOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchMatchingOutputBody + * @throws IOException if the JSON string is invalid with respect to BatchMatchingOutputBody + */ + public static BatchMatchingOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchMatchingOutputBody.class); + } + + /** + * Convert an instance of BatchMatchingOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CallEdge.java b/src/main/java/ai/reveng/model/CallEdge.java new file mode 100644 index 0000000..c54aba4 --- /dev/null +++ b/src/main/java/ai/reveng/model/CallEdge.java @@ -0,0 +1,393 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * CallEdge + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CallEdge { + public static final String SERIALIZED_NAME_CALLEE_FUNCTION_ID = "callee_function_id"; + @SerializedName(SERIALIZED_NAME_CALLEE_FUNCTION_ID) + @javax.annotation.Nullable + private Long calleeFunctionId; + + public static final String SERIALIZED_NAME_CALLEE_NAME = "callee_name"; + @SerializedName(SERIALIZED_NAME_CALLEE_NAME) + @javax.annotation.Nullable + private String calleeName; + + public static final String SERIALIZED_NAME_CALLEE_VADDR = "callee_vaddr"; + @SerializedName(SERIALIZED_NAME_CALLEE_VADDR) + @javax.annotation.Nonnull + private Long calleeVaddr; + + public static final String SERIALIZED_NAME_CALLER_FUNCTION_ID = "caller_function_id"; + @SerializedName(SERIALIZED_NAME_CALLER_FUNCTION_ID) + @javax.annotation.Nonnull + private Long callerFunctionId; + + public static final String SERIALIZED_NAME_CALLER_NAME = "caller_name"; + @SerializedName(SERIALIZED_NAME_CALLER_NAME) + @javax.annotation.Nullable + private String callerName; + + public static final String SERIALIZED_NAME_CALLER_VADDR = "caller_vaddr"; + @SerializedName(SERIALIZED_NAME_CALLER_VADDR) + @javax.annotation.Nonnull + private Long callerVaddr; + + public static final String SERIALIZED_NAME_IS_EXTERNAL = "is_external"; + @SerializedName(SERIALIZED_NAME_IS_EXTERNAL) + @javax.annotation.Nonnull + private Boolean isExternal; + + public static final String SERIALIZED_NAME_THUNKED_VADDR = "thunked_vaddr"; + @SerializedName(SERIALIZED_NAME_THUNKED_VADDR) + @javax.annotation.Nullable + private Long thunkedVaddr; + + public CallEdge() { + } + + public CallEdge calleeFunctionId(@javax.annotation.Nullable Long calleeFunctionId) { + this.calleeFunctionId = calleeFunctionId; + return this; + } + + /** + * Get calleeFunctionId + * @return calleeFunctionId + */ + @javax.annotation.Nullable + public Long getCalleeFunctionId() { + return calleeFunctionId; + } + + public void setCalleeFunctionId(@javax.annotation.Nullable Long calleeFunctionId) { + this.calleeFunctionId = calleeFunctionId; + } + + + public CallEdge calleeName(@javax.annotation.Nullable String calleeName) { + this.calleeName = calleeName; + return this; + } + + /** + * Get calleeName + * @return calleeName + */ + @javax.annotation.Nullable + public String getCalleeName() { + return calleeName; + } + + public void setCalleeName(@javax.annotation.Nullable String calleeName) { + this.calleeName = calleeName; + } + + + public CallEdge calleeVaddr(@javax.annotation.Nonnull Long calleeVaddr) { + this.calleeVaddr = calleeVaddr; + return this; + } + + /** + * Get calleeVaddr + * @return calleeVaddr + */ + @javax.annotation.Nonnull + public Long getCalleeVaddr() { + return calleeVaddr; + } + + public void setCalleeVaddr(@javax.annotation.Nonnull Long calleeVaddr) { + this.calleeVaddr = calleeVaddr; + } + + + public CallEdge callerFunctionId(@javax.annotation.Nonnull Long callerFunctionId) { + this.callerFunctionId = callerFunctionId; + return this; + } + + /** + * Get callerFunctionId + * @return callerFunctionId + */ + @javax.annotation.Nonnull + public Long getCallerFunctionId() { + return callerFunctionId; + } + + public void setCallerFunctionId(@javax.annotation.Nonnull Long callerFunctionId) { + this.callerFunctionId = callerFunctionId; + } + + + public CallEdge callerName(@javax.annotation.Nullable String callerName) { + this.callerName = callerName; + return this; + } + + /** + * Get callerName + * @return callerName + */ + @javax.annotation.Nullable + public String getCallerName() { + return callerName; + } + + public void setCallerName(@javax.annotation.Nullable String callerName) { + this.callerName = callerName; + } + + + public CallEdge callerVaddr(@javax.annotation.Nonnull Long callerVaddr) { + this.callerVaddr = callerVaddr; + return this; + } + + /** + * Entry vaddr of the caller function (joined from function_t). + * @return callerVaddr + */ + @javax.annotation.Nonnull + public Long getCallerVaddr() { + return callerVaddr; + } + + public void setCallerVaddr(@javax.annotation.Nonnull Long callerVaddr) { + this.callerVaddr = callerVaddr; + } + + + public CallEdge isExternal(@javax.annotation.Nonnull Boolean isExternal) { + this.isExternal = isExternal; + return this; + } + + /** + * Get isExternal + * @return isExternal + */ + @javax.annotation.Nonnull + public Boolean getIsExternal() { + return isExternal; + } + + public void setIsExternal(@javax.annotation.Nonnull Boolean isExternal) { + this.isExternal = isExternal; + } + + + public CallEdge thunkedVaddr(@javax.annotation.Nullable Long thunkedVaddr) { + this.thunkedVaddr = thunkedVaddr; + return this; + } + + /** + * Get thunkedVaddr + * @return thunkedVaddr + */ + @javax.annotation.Nullable + public Long getThunkedVaddr() { + return thunkedVaddr; + } + + public void setThunkedVaddr(@javax.annotation.Nullable Long thunkedVaddr) { + this.thunkedVaddr = thunkedVaddr; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallEdge callEdge = (CallEdge) o; + return Objects.equals(this.calleeFunctionId, callEdge.calleeFunctionId) && + Objects.equals(this.calleeName, callEdge.calleeName) && + Objects.equals(this.calleeVaddr, callEdge.calleeVaddr) && + Objects.equals(this.callerFunctionId, callEdge.callerFunctionId) && + Objects.equals(this.callerName, callEdge.callerName) && + Objects.equals(this.callerVaddr, callEdge.callerVaddr) && + Objects.equals(this.isExternal, callEdge.isExternal) && + Objects.equals(this.thunkedVaddr, callEdge.thunkedVaddr); + } + + @Override + public int hashCode() { + return Objects.hash(calleeFunctionId, calleeName, calleeVaddr, callerFunctionId, callerName, callerVaddr, isExternal, thunkedVaddr); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallEdge {\n"); + sb.append(" calleeFunctionId: ").append(toIndentedString(calleeFunctionId)).append("\n"); + sb.append(" calleeName: ").append(toIndentedString(calleeName)).append("\n"); + sb.append(" calleeVaddr: ").append(toIndentedString(calleeVaddr)).append("\n"); + sb.append(" callerFunctionId: ").append(toIndentedString(callerFunctionId)).append("\n"); + sb.append(" callerName: ").append(toIndentedString(callerName)).append("\n"); + sb.append(" callerVaddr: ").append(toIndentedString(callerVaddr)).append("\n"); + sb.append(" isExternal: ").append(toIndentedString(isExternal)).append("\n"); + sb.append(" thunkedVaddr: ").append(toIndentedString(thunkedVaddr)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("callee_function_id", "callee_name", "callee_vaddr", "caller_function_id", "caller_name", "caller_vaddr", "is_external", "thunked_vaddr")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("callee_vaddr", "caller_function_id", "caller_vaddr", "is_external")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CallEdge + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CallEdge.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CallEdge is not found in the empty JSON string", CallEdge.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CallEdge.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `CallEdge` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CallEdge.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("callee_name") != null && !jsonObj.get("callee_name").isJsonNull()) && !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("caller_name") != null && !jsonObj.get("caller_name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CallEdge.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CallEdge' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CallEdge.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CallEdge value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CallEdge read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CallEdge given an JSON string + * + * @param jsonString JSON string + * @return An instance of CallEdge + * @throws IOException if the JSON string is invalid with respect to CallEdge + */ + public static CallEdge fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CallEdge.class); + } + + /** + * Convert an instance of CallEdge to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CallEdgesOutputBody.java b/src/main/java/ai/reveng/model/CallEdgesOutputBody.java new file mode 100644 index 0000000..1e09023 --- /dev/null +++ b/src/main/java/ai/reveng/model/CallEdgesOutputBody.java @@ -0,0 +1,226 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.FunctionCallEdges; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * CallEdgesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CallEdgesOutputBody { + public static final String SERIALIZED_NAME_EDGES = "edges"; + @SerializedName(SERIALIZED_NAME_EDGES) + @javax.annotation.Nullable + private List edges; + + public CallEdgesOutputBody() { + } + + public CallEdgesOutputBody edges(@javax.annotation.Nullable List edges) { + this.edges = edges; + return this; + } + + public CallEdgesOutputBody addEdgesItem(FunctionCallEdges edgesItem) { + if (this.edges == null) { + this.edges = new ArrayList<>(); + } + this.edges.add(edgesItem); + return this; + } + + /** + * Get edges + * @return edges + */ + @javax.annotation.Nullable + public List getEdges() { + return edges; + } + + public void setEdges(@javax.annotation.Nullable List edges) { + this.edges = edges; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallEdgesOutputBody callEdgesOutputBody = (CallEdgesOutputBody) o; + return Objects.equals(this.edges, callEdgesOutputBody.edges); + } + + @Override + public int hashCode() { + return Objects.hash(edges); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallEdgesOutputBody {\n"); + sb.append(" edges: ").append(toIndentedString(edges)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("edges")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("edges")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CallEdgesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CallEdgesOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CallEdgesOutputBody is not found in the empty JSON string", CallEdgesOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CallEdgesOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `CallEdgesOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CallEdgesOutputBody.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("edges") != null && !jsonObj.get("edges").isJsonNull()) { + if (!jsonObj.get("edges").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `edges` to be an array in the JSON string but got `%s`", jsonObj.get("edges").toString())); + } + JsonArray jsonArrayedges = jsonObj.getAsJsonArray("edges"); + // validate the required field `edges` (array) + for (int i = 0; i < jsonArrayedges.size(); i++) { + FunctionCallEdges.validateJsonElement(jsonArrayedges.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CallEdgesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CallEdgesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CallEdgesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CallEdgesOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CallEdgesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CallEdgesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CallEdgesOutputBody + * @throws IOException if the JSON string is invalid with respect to CallEdgesOutputBody + */ + public static CallEdgesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CallEdgesOutputBody.class); + } + + /** + * Convert an instance of CallEdgesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CapabilitiesOutputBody.java b/src/main/java/ai/reveng/model/CapabilitiesOutputBody.java new file mode 100644 index 0000000..f24a620 --- /dev/null +++ b/src/main/java/ai/reveng/model/CapabilitiesOutputBody.java @@ -0,0 +1,226 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.CapabilityEntry; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * CapabilitiesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CapabilitiesOutputBody { + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + @javax.annotation.Nullable + private List capabilities; + + public CapabilitiesOutputBody() { + } + + public CapabilitiesOutputBody capabilities(@javax.annotation.Nullable List capabilities) { + this.capabilities = capabilities; + return this; + } + + public CapabilitiesOutputBody addCapabilitiesItem(CapabilityEntry capabilitiesItem) { + if (this.capabilities == null) { + this.capabilities = new ArrayList<>(); + } + this.capabilities.add(capabilitiesItem); + return this; + } + + /** + * Get capabilities + * @return capabilities + */ + @javax.annotation.Nullable + public List getCapabilities() { + return capabilities; + } + + public void setCapabilities(@javax.annotation.Nullable List capabilities) { + this.capabilities = capabilities; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapabilitiesOutputBody capabilitiesOutputBody = (CapabilitiesOutputBody) o; + return Objects.equals(this.capabilities, capabilitiesOutputBody.capabilities); + } + + @Override + public int hashCode() { + return Objects.hash(capabilities); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapabilitiesOutputBody {\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\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 CapabilitiesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CapabilitiesOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CapabilitiesOutputBody is not found in the empty JSON string", CapabilitiesOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CapabilitiesOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `CapabilitiesOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CapabilitiesOutputBody.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 && !jsonObj.get("capabilities").isJsonNull()) { + 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++) { + CapabilityEntry.validateJsonElement(jsonArraycapabilities.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CapabilitiesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapabilitiesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapabilitiesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapabilitiesOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapabilitiesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapabilitiesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapabilitiesOutputBody + * @throws IOException if the JSON string is invalid with respect to CapabilitiesOutputBody + */ + public static CapabilitiesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapabilitiesOutputBody.class); + } + + /** + * Convert an instance of CapabilitiesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/CapabilityEntry.java b/src/main/java/ai/reveng/model/CapabilityEntry.java new file mode 100644 index 0000000..0df567b --- /dev/null +++ b/src/main/java/ai/reveng/model/CapabilityEntry.java @@ -0,0 +1,347 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * CapabilityEntry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CapabilityEntry { + public static final String SERIALIZED_NAME_CAPABILITY = "capability"; + @SerializedName(SERIALIZED_NAME_CAPABILITY) + @javax.annotation.Nonnull + private String capability; + + 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 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_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_VADDR = "vaddr"; + @SerializedName(SERIALIZED_NAME_VADDR) + @javax.annotation.Nonnull + private Long vaddr; + + public CapabilityEntry() { + } + + public CapabilityEntry capability(@javax.annotation.Nonnull String capability) { + this.capability = capability; + return this; + } + + /** + * Get capability + * @return capability + */ + @javax.annotation.Nonnull + public String getCapability() { + return capability; + } + + public void setCapability(@javax.annotation.Nonnull String capability) { + this.capability = capability; + } + + + public CapabilityEntry 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 CapabilityEntry functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Get functionId + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + public CapabilityEntry 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 CapabilityEntry 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 CapabilityEntry vaddr(@javax.annotation.Nonnull Long vaddr) { + this.vaddr = vaddr; + return this; + } + + /** + * Get vaddr + * @return vaddr + */ + @javax.annotation.Nonnull + public Long getVaddr() { + return vaddr; + } + + public void setVaddr(@javax.annotation.Nonnull Long vaddr) { + this.vaddr = vaddr; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapabilityEntry capabilityEntry = (CapabilityEntry) o; + return Objects.equals(this.capability, capabilityEntry.capability) && + Objects.equals(this.description, capabilityEntry.description) && + Objects.equals(this.functionId, capabilityEntry.functionId) && + Objects.equals(this.functionName, capabilityEntry.functionName) && + Objects.equals(this.type, capabilityEntry.type) && + Objects.equals(this.vaddr, capabilityEntry.vaddr); + } + + @Override + public int hashCode() { + return Objects.hash(capability, description, functionId, functionName, type, vaddr); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapabilityEntry {\n"); + sb.append(" capability: ").append(toIndentedString(capability)).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(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" vaddr: ").append(toIndentedString(vaddr)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("capability", "description", "function_id", "function_name", "type", "vaddr")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("capability", "description", "function_id", "function_name", "type", "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 CapabilityEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CapabilityEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CapabilityEntry is not found in the empty JSON string", CapabilityEntry.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CapabilityEntry.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `CapabilityEntry` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CapabilityEntry.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("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("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("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 (!CapabilityEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapabilityEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapabilityEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapabilityEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapabilityEntry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapabilityEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapabilityEntry + * @throws IOException if the JSON string is invalid with respect to CapabilityEntry + */ + public static CapabilityEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapabilityEntry.class); + } + + /** + * Convert an instance of CapabilityEntry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/DataTypesEntry.java b/src/main/java/ai/reveng/model/DataTypesEntry.java new file mode 100644 index 0000000..78e6aaf --- /dev/null +++ b/src/main/java/ai/reveng/model/DataTypesEntry.java @@ -0,0 +1,236 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.FunctionInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * DataTypesEntry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DataTypesEntry { + public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; + @SerializedName(SERIALIZED_NAME_DATA_TYPES) + @javax.annotation.Nullable + private FunctionInfo dataTypes; + + public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + @javax.annotation.Nonnull + private Long functionId; + + public DataTypesEntry() { + } + + public DataTypesEntry dataTypes(@javax.annotation.Nullable FunctionInfo dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Get dataTypes + * @return dataTypes + */ + @javax.annotation.Nullable + public FunctionInfo getDataTypes() { + return dataTypes; + } + + public void setDataTypes(@javax.annotation.Nullable FunctionInfo dataTypes) { + this.dataTypes = dataTypes; + } + + + public DataTypesEntry functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Get functionId + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataTypesEntry dataTypesEntry = (DataTypesEntry) o; + return Objects.equals(this.dataTypes, dataTypesEntry.dataTypes) && + Objects.equals(this.functionId, dataTypesEntry.functionId); + } + + @Override + public int hashCode() { + return Objects.hash(dataTypes, functionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataTypesEntry {\n"); + sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data_types", "function_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 DataTypesEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DataTypesEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in DataTypesEntry is not found in the empty JSON string", DataTypesEntry.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DataTypesEntry.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `DataTypesEntry` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DataTypesEntry.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 `data_types` + if (jsonObj.get("data_types") != null && !jsonObj.get("data_types").isJsonNull()) { + FunctionInfo.validateJsonElement(jsonObj.get("data_types")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DataTypesEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DataTypesEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DataTypesEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DataTypesEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DataTypesEntry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DataTypesEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataTypesEntry + * @throws IOException if the JSON string is invalid with respect to DataTypesEntry + */ + public static DataTypesEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DataTypesEntry.class); + } + + /** + * Convert an instance of DataTypesEntry 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 new file mode 100644 index 0000000..e725db4 --- /dev/null +++ b/src/main/java/ai/reveng/model/DisassemblyOutputBody.java @@ -0,0 +1,431 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * DisassemblyOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DisassemblyOutputBody { + public static final String SERIALIZED_NAME_BASIC_BLOCKS = "basic_blocks"; + @SerializedName(SERIALIZED_NAME_BASIC_BLOCKS) + @javax.annotation.Nullable + private Object basicBlocks = null; + + 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_LOCAL_VARIABLES = "local_variables"; + @SerializedName(SERIALIZED_NAME_LOCAL_VARIABLES) + @javax.annotation.Nullable + private Object localVariables = null; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + @javax.annotation.Nullable + private Object params = null; + + public static final String SERIALIZED_NAME_RETURN_TYPE = "return_type"; + @SerializedName(SERIALIZED_NAME_RETURN_TYPE) + @javax.annotation.Nullable + private String returnType; + + public static final String SERIALIZED_NAME_RETURNS = "returns"; + @SerializedName(SERIALIZED_NAME_RETURNS) + @javax.annotation.Nonnull + private Boolean returns; + + public DisassemblyOutputBody() { + } + + public DisassemblyOutputBody basicBlocks(@javax.annotation.Nullable Object basicBlocks) { + this.basicBlocks = basicBlocks; + return this; + } + + /** + * Get basicBlocks + * @return basicBlocks + */ + @javax.annotation.Nullable + public Object getBasicBlocks() { + return basicBlocks; + } + + public void setBasicBlocks(@javax.annotation.Nullable Object basicBlocks) { + this.basicBlocks = basicBlocks; + } + + + public DisassemblyOutputBody functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Get functionId + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + public DisassemblyOutputBody localVariables(@javax.annotation.Nullable Object localVariables) { + this.localVariables = localVariables; + return this; + } + + /** + * Get localVariables + * @return localVariables + */ + @javax.annotation.Nullable + public Object getLocalVariables() { + return localVariables; + } + + public void setLocalVariables(@javax.annotation.Nullable Object localVariables) { + this.localVariables = localVariables; + } + + + public DisassemblyOutputBody params(@javax.annotation.Nullable Object params) { + this.params = params; + return this; + } + + /** + * Get params + * @return params + */ + @javax.annotation.Nullable + public Object getParams() { + return params; + } + + public void setParams(@javax.annotation.Nullable Object params) { + this.params = params; + } + + + public DisassemblyOutputBody returnType(@javax.annotation.Nullable String returnType) { + this.returnType = returnType; + return this; + } + + /** + * Search is applied to string value + * @return returnType + */ + @javax.annotation.Nullable + public String getReturnType() { + return returnType; + } + + public void setReturnType(@javax.annotation.Nullable String returnType) { + this.returnType = returnType; + } + + + public DisassemblyOutputBody returns(@javax.annotation.Nonnull Boolean returns) { + this.returns = returns; + return this; + } + + /** + * Get returns + * @return returns + */ + @javax.annotation.Nonnull + public Boolean getReturns() { + return returns; + } + + public void setReturns(@javax.annotation.Nonnull Boolean returns) { + this.returns = returns; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DisassemblyOutputBody instance itself + */ + public DisassemblyOutputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisassemblyOutputBody disassemblyOutputBody = (DisassemblyOutputBody) o; + return Objects.equals(this.basicBlocks, disassemblyOutputBody.basicBlocks) && + Objects.equals(this.functionId, disassemblyOutputBody.functionId) && + Objects.equals(this.localVariables, disassemblyOutputBody.localVariables) && + Objects.equals(this.params, disassemblyOutputBody.params) && + Objects.equals(this.returnType, disassemblyOutputBody.returnType) && + Objects.equals(this.returns, disassemblyOutputBody.returns)&& + Objects.equals(this.additionalProperties, disassemblyOutputBody.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(basicBlocks, functionId, localVariables, params, returnType, returns, 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 DisassemblyOutputBody {\n"); + sb.append(" basicBlocks: ").append(toIndentedString(basicBlocks)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append(" localVariables: ").append(toIndentedString(localVariables)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" returnType: ").append(toIndentedString(returnType)).append("\n"); + sb.append(" returns: ").append(toIndentedString(returns)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("basic_blocks", "function_id", "local_variables", "params", "return_type", "returns")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("function_id", "returns")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DisassemblyOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DisassemblyOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in DisassemblyOutputBody is not found in the empty JSON string", DisassemblyOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DisassemblyOutputBody.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("return_type") != null && !jsonObj.get("return_type").isJsonNull()) && !jsonObj.get("return_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `return_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("return_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DisassemblyOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DisassemblyOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DisassemblyOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DisassemblyOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DisassemblyOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DisassemblyOutputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DisassemblyOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisassemblyOutputBody + * @throws IOException if the JSON string is invalid with respect to DisassemblyOutputBody + */ + public static DisassemblyOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DisassemblyOutputBody.class); + } + + /** + * Convert an instance of DisassemblyOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ErrorBody.java b/src/main/java/ai/reveng/model/ErrorBody.java index 0c8ae8b..fdd7d09 100644 --- a/src/main/java/ai/reveng/model/ErrorBody.java +++ b/src/main/java/ai/reveng/model/ErrorBody.java @@ -78,6 +78,8 @@ public enum CodeEnum { BAD_REQUEST("BAD_REQUEST"), + CLIENT_CLOSED_REQUEST("CLIENT_CLOSED_REQUEST"), + CONFLICT("CONFLICT"), CONVERSATION_NOT_FOUND("CONVERSATION_NOT_FOUND"), diff --git a/src/main/java/ai/reveng/model/FunctionArgument.java b/src/main/java/ai/reveng/model/FunctionArgument.java new file mode 100644 index 0000000..d3938dd --- /dev/null +++ b/src/main/java/ai/reveng/model/FunctionArgument.java @@ -0,0 +1,440 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * FunctionArgument + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FunctionArgument { + 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.Nullable + private String name; + + public static final String SERIALIZED_NAME_OFFSET = "offset"; + @SerializedName(SERIALIZED_NAME_OFFSET) + @javax.annotation.Nonnull + private Long offset; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Long size; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public FunctionArgument() { + } + + public FunctionArgument lastChange(@javax.annotation.Nullable String lastChange) { + this.lastChange = lastChange; + return this; + } + + /** + * Search is applied to string value + * @return lastChange + */ + @javax.annotation.Nullable + public String getLastChange() { + return lastChange; + } + + public void setLastChange(@javax.annotation.Nullable String lastChange) { + this.lastChange = lastChange; + } + + + public FunctionArgument name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Search is applied to string value + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public FunctionArgument offset(@javax.annotation.Nonnull Long offset) { + this.offset = offset; + return this; + } + + /** + * Get offset + * @return offset + */ + @javax.annotation.Nonnull + public Long getOffset() { + return offset; + } + + public void setOffset(@javax.annotation.Nonnull Long offset) { + this.offset = offset; + } + + + public FunctionArgument scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Search is applied to string value + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public FunctionArgument size(@javax.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Get size + * @return size + */ + @javax.annotation.Nonnull + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Long size) { + this.size = size; + } + + + public FunctionArgument type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Search is applied to string value + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FunctionArgument instance itself + */ + public FunctionArgument putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FunctionArgument functionArgument = (FunctionArgument) o; + return Objects.equals(this.lastChange, functionArgument.lastChange) && + Objects.equals(this.name, functionArgument.name) && + Objects.equals(this.offset, functionArgument.offset) && + Objects.equals(this.scope, functionArgument.scope) && + Objects.equals(this.size, functionArgument.size) && + Objects.equals(this.type, functionArgument.type)&& + Objects.equals(this.additionalProperties, functionArgument.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, scope, size, type, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionArgument {\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(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("last_change", "name", "offset", "scope", "size", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "offset", "size", "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 FunctionArgument + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FunctionArgument.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionArgument is not found in the empty JSON string", FunctionArgument.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionArgument.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") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FunctionArgument.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionArgument' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionArgument.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionArgument value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FunctionArgument read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FunctionArgument instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FunctionArgument given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionArgument + * @throws IOException if the JSON string is invalid with respect to FunctionArgument + */ + public static FunctionArgument fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionArgument.class); + } + + /** + * Convert an instance of FunctionArgument to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FunctionCallEdges.java b/src/main/java/ai/reveng/model/FunctionCallEdges.java new file mode 100644 index 0000000..8d6f28e --- /dev/null +++ b/src/main/java/ai/reveng/model/FunctionCallEdges.java @@ -0,0 +1,296 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.CallEdge; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * FunctionCallEdges + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FunctionCallEdges { + public static final String SERIALIZED_NAME_CALLEES = "callees"; + @SerializedName(SERIALIZED_NAME_CALLEES) + @javax.annotation.Nullable + private List callees; + + public static final String SERIALIZED_NAME_CALLERS = "callers"; + @SerializedName(SERIALIZED_NAME_CALLERS) + @javax.annotation.Nullable + private List callers; + + public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + @javax.annotation.Nonnull + private Long functionId; + + public FunctionCallEdges() { + } + + public FunctionCallEdges callees(@javax.annotation.Nullable List callees) { + this.callees = callees; + return this; + } + + public FunctionCallEdges addCalleesItem(CallEdge calleesItem) { + if (this.callees == null) { + this.callees = new ArrayList<>(); + } + this.callees.add(calleesItem); + return this; + } + + /** + * Get callees + * @return callees + */ + @javax.annotation.Nullable + public List getCallees() { + return callees; + } + + public void setCallees(@javax.annotation.Nullable List callees) { + this.callees = callees; + } + + + public FunctionCallEdges callers(@javax.annotation.Nullable List callers) { + this.callers = callers; + return this; + } + + public FunctionCallEdges addCallersItem(CallEdge callersItem) { + if (this.callers == null) { + this.callers = new ArrayList<>(); + } + this.callers.add(callersItem); + return this; + } + + /** + * Get callers + * @return callers + */ + @javax.annotation.Nullable + public List getCallers() { + return callers; + } + + public void setCallers(@javax.annotation.Nullable List callers) { + this.callers = callers; + } + + + public FunctionCallEdges functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Get functionId + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FunctionCallEdges functionCallEdges = (FunctionCallEdges) o; + return Objects.equals(this.callees, functionCallEdges.callees) && + Objects.equals(this.callers, functionCallEdges.callers) && + Objects.equals(this.functionId, functionCallEdges.functionId); + } + + @Override + public int hashCode() { + return Objects.hash(callees, callers, functionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionCallEdges {\n"); + sb.append(" callees: ").append(toIndentedString(callees)).append("\n"); + sb.append(" callers: ").append(toIndentedString(callers)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("callees", "callers", "function_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("callees", "callers", "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 FunctionCallEdges + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FunctionCallEdges.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionCallEdges is not found in the empty JSON string", FunctionCallEdges.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FunctionCallEdges.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `FunctionCallEdges` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionCallEdges.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 && !jsonObj.get("callees").isJsonNull()) { + 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++) { + CallEdge.validateJsonElement(jsonArraycallees.get(i)); + } + } + if (jsonObj.get("callers") != null && !jsonObj.get("callers").isJsonNull()) { + 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++) { + CallEdge.validateJsonElement(jsonArraycallers.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FunctionCallEdges.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionCallEdges' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionCallEdges.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionCallEdges value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FunctionCallEdges read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FunctionCallEdges given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionCallEdges + * @throws IOException if the JSON string is invalid with respect to FunctionCallEdges + */ + public static FunctionCallEdges fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionCallEdges.class); + } + + /** + * Convert an instance of FunctionCallEdges to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FunctionDependency.java b/src/main/java/ai/reveng/model/FunctionDependency.java new file mode 100644 index 0000000..eb42e28 --- /dev/null +++ b/src/main/java/ai/reveng/model/FunctionDependency.java @@ -0,0 +1,495 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * FunctionDependency + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FunctionDependency { + public static final String SERIALIZED_NAME_ADDR = "addr"; + @SerializedName(SERIALIZED_NAME_ADDR) + @javax.annotation.Nullable + private Long addr; + + public static final String SERIALIZED_NAME_ARTIFACT_TYPE = "artifact_type"; + @SerializedName(SERIALIZED_NAME_ARTIFACT_TYPE) + @javax.annotation.Nullable + private String artifactType; + + 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_MEMBERS = "members"; + @SerializedName(SERIALIZED_NAME_MEMBERS) + @javax.annotation.Nullable + private Object members = null; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable + private Long size; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public FunctionDependency() { + } + + public FunctionDependency addr(@javax.annotation.Nullable Long addr) { + this.addr = addr; + return this; + } + + /** + * Memory address (GlobalVariable). + * @return addr + */ + @javax.annotation.Nullable + public Long getAddr() { + return addr; + } + + public void setAddr(@javax.annotation.Nullable Long addr) { + this.addr = addr; + } + + + public FunctionDependency artifactType(@javax.annotation.Nullable String artifactType) { + this.artifactType = artifactType; + return this; + } + + /** + * Get artifactType + * @return artifactType + */ + @javax.annotation.Nullable + public String getArtifactType() { + return artifactType; + } + + public void setArtifactType(@javax.annotation.Nullable String artifactType) { + this.artifactType = artifactType; + } + + + public FunctionDependency lastChange(@javax.annotation.Nullable String lastChange) { + this.lastChange = lastChange; + return this; + } + + /** + * Search is applied to string value + * @return lastChange + */ + @javax.annotation.Nullable + public String getLastChange() { + return lastChange; + } + + public void setLastChange(@javax.annotation.Nullable String lastChange) { + this.lastChange = lastChange; + } + + + public FunctionDependency members(@javax.annotation.Nullable Object members) { + this.members = members; + return this; + } + + /** + * Get members + * @return members + */ + @javax.annotation.Nullable + public Object getMembers() { + return members; + } + + public void setMembers(@javax.annotation.Nullable Object members) { + this.members = members; + } + + + public FunctionDependency name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Search is applied to string value + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public FunctionDependency scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Search is applied to string value + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public FunctionDependency size(@javax.annotation.Nullable Long size) { + this.size = size; + return this; + } + + /** + * Total byte size (Struct, GlobalVariable). + * @return size + */ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Long size) { + this.size = size; + } + + + public FunctionDependency type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Underlying type (TypeDefinition, GlobalVariable). + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FunctionDependency instance itself + */ + public FunctionDependency putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FunctionDependency functionDependency = (FunctionDependency) o; + return Objects.equals(this.addr, functionDependency.addr) && + Objects.equals(this.artifactType, functionDependency.artifactType) && + Objects.equals(this.lastChange, functionDependency.lastChange) && + Objects.equals(this.members, functionDependency.members) && + Objects.equals(this.name, functionDependency.name) && + Objects.equals(this.scope, functionDependency.scope) && + Objects.equals(this.size, functionDependency.size) && + Objects.equals(this.type, functionDependency.type)&& + Objects.equals(this.additionalProperties, functionDependency.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(addr, artifactType, lastChange, members, name, scope, size, type, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionDependency {\n"); + sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); + sb.append(" artifactType: ").append(toIndentedString(artifactType)).append("\n"); + sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); + sb.append(" members: ").append(toIndentedString(members)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("addr", "artifact_type", "last_change", "members", "name", "scope", "size", "type")); + + // 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 FunctionDependency + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FunctionDependency.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionDependency is not found in the empty JSON string", FunctionDependency.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionDependency.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("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())); + } + 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") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FunctionDependency.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionDependency' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionDependency.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionDependency value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FunctionDependency read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FunctionDependency instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FunctionDependency given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionDependency + * @throws IOException if the JSON string is invalid with respect to FunctionDependency + */ + public static FunctionDependency fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionDependency.class); + } + + /** + * Convert an instance of FunctionDependency to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FunctionDetailsOutputBody.java b/src/main/java/ai/reveng/model/FunctionDetailsOutputBody.java new file mode 100644 index 0000000..557b807 --- /dev/null +++ b/src/main/java/ai/reveng/model/FunctionDetailsOutputBody.java @@ -0,0 +1,420 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * FunctionDetailsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FunctionDetailsOutputBody { + public static final String SERIALIZED_NAME_BINARY_ID = "binary_id"; + @SerializedName(SERIALIZED_NAME_BINARY_ID) + @javax.annotation.Nonnull + private Long binaryId; + + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + @javax.annotation.Nonnull + private OffsetDateTime creation; + + 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_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_SIZE = "function_size"; + @SerializedName(SERIALIZED_NAME_FUNCTION_SIZE) + @javax.annotation.Nonnull + private Long functionSize; + + 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_MANGLED_NAME = "mangled_name"; + @SerializedName(SERIALIZED_NAME_MANGLED_NAME) + @javax.annotation.Nullable + private String mangledName; + + public static final String SERIALIZED_NAME_SOURCE_FUNCTION_ID = "source_function_id"; + @SerializedName(SERIALIZED_NAME_SOURCE_FUNCTION_ID) + @javax.annotation.Nullable + private Long sourceFunctionId; + + public FunctionDetailsOutputBody() { + } + + public FunctionDetailsOutputBody binaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + return this; + } + + /** + * Get binaryId + * @return binaryId + */ + @javax.annotation.Nonnull + public Long getBinaryId() { + return binaryId; + } + + public void setBinaryId(@javax.annotation.Nonnull Long binaryId) { + this.binaryId = binaryId; + } + + + public FunctionDetailsOutputBody 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 FunctionDetailsOutputBody 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 FunctionDetailsOutputBody functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Get functionId + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + public FunctionDetailsOutputBody 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 FunctionDetailsOutputBody functionSize(@javax.annotation.Nonnull Long functionSize) { + this.functionSize = functionSize; + return this; + } + + /** + * Get functionSize + * @return functionSize + */ + @javax.annotation.Nonnull + public Long getFunctionSize() { + return functionSize; + } + + public void setFunctionSize(@javax.annotation.Nonnull Long functionSize) { + this.functionSize = functionSize; + } + + + public FunctionDetailsOutputBody 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 FunctionDetailsOutputBody mangledName(@javax.annotation.Nullable String mangledName) { + this.mangledName = mangledName; + return this; + } + + /** + * Get mangledName + * @return mangledName + */ + @javax.annotation.Nullable + public String getMangledName() { + return mangledName; + } + + public void setMangledName(@javax.annotation.Nullable String mangledName) { + this.mangledName = mangledName; + } + + + public FunctionDetailsOutputBody sourceFunctionId(@javax.annotation.Nullable Long sourceFunctionId) { + this.sourceFunctionId = sourceFunctionId; + return this; + } + + /** + * Get sourceFunctionId + * @return sourceFunctionId + */ + @javax.annotation.Nullable + public Long getSourceFunctionId() { + return sourceFunctionId; + } + + public void setSourceFunctionId(@javax.annotation.Nullable Long sourceFunctionId) { + this.sourceFunctionId = sourceFunctionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FunctionDetailsOutputBody functionDetailsOutputBody = (FunctionDetailsOutputBody) o; + return Objects.equals(this.binaryId, functionDetailsOutputBody.binaryId) && + Objects.equals(this.creation, functionDetailsOutputBody.creation) && + Objects.equals(this.debug, functionDetailsOutputBody.debug) && + Objects.equals(this.functionId, functionDetailsOutputBody.functionId) && + Objects.equals(this.functionName, functionDetailsOutputBody.functionName) && + Objects.equals(this.functionSize, functionDetailsOutputBody.functionSize) && + Objects.equals(this.functionVaddr, functionDetailsOutputBody.functionVaddr) && + Objects.equals(this.mangledName, functionDetailsOutputBody.mangledName) && + Objects.equals(this.sourceFunctionId, functionDetailsOutputBody.sourceFunctionId); + } + + @Override + public int hashCode() { + return Objects.hash(binaryId, creation, debug, functionId, functionName, functionSize, functionVaddr, mangledName, sourceFunctionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionDetailsOutputBody {\n"); + sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" functionSize: ").append(toIndentedString(functionSize)).append("\n"); + sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); + sb.append(" mangledName: ").append(toIndentedString(mangledName)).append("\n"); + sb.append(" sourceFunctionId: ").append(toIndentedString(sourceFunctionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\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", "creation", "debug", "function_id", "function_name", "function_size", "function_vaddr", "mangled_name", "source_function_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("binary_id", "creation", "debug", "function_id", "function_name", "function_size", "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 FunctionDetailsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FunctionDetailsOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionDetailsOutputBody is not found in the empty JSON string", FunctionDetailsOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FunctionDetailsOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `FunctionDetailsOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionDetailsOutputBody.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("mangled_name") != null && !jsonObj.get("mangled_name").isJsonNull()) && !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 (!FunctionDetailsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionDetailsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionDetailsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionDetailsOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FunctionDetailsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FunctionDetailsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionDetailsOutputBody + * @throws IOException if the JSON string is invalid with respect to FunctionDetailsOutputBody + */ + public static FunctionDetailsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionDetailsOutputBody.class); + } + + /** + * Convert an instance of FunctionDetailsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FunctionStackVariable.java b/src/main/java/ai/reveng/model/FunctionStackVariable.java new file mode 100644 index 0000000..6a5de23 --- /dev/null +++ b/src/main/java/ai/reveng/model/FunctionStackVariable.java @@ -0,0 +1,466 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * FunctionStackVariable + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FunctionStackVariable { + public static final String SERIALIZED_NAME_ADDR = "addr"; + @SerializedName(SERIALIZED_NAME_ADDR) + @javax.annotation.Nonnull + private Long addr; + + 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.Nullable + private String name; + + public static final String SERIALIZED_NAME_OFFSET = "offset"; + @SerializedName(SERIALIZED_NAME_OFFSET) + @javax.annotation.Nonnull + private Long offset; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Long size; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public FunctionStackVariable() { + } + + public FunctionStackVariable addr(@javax.annotation.Nonnull Long addr) { + this.addr = addr; + return this; + } + + /** + * Get addr + * @return addr + */ + @javax.annotation.Nonnull + public Long getAddr() { + return addr; + } + + public void setAddr(@javax.annotation.Nonnull Long addr) { + this.addr = addr; + } + + + public FunctionStackVariable lastChange(@javax.annotation.Nullable String lastChange) { + this.lastChange = lastChange; + return this; + } + + /** + * Search is applied to string value + * @return lastChange + */ + @javax.annotation.Nullable + public String getLastChange() { + return lastChange; + } + + public void setLastChange(@javax.annotation.Nullable String lastChange) { + this.lastChange = lastChange; + } + + + public FunctionStackVariable name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Search is applied to string value + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public FunctionStackVariable offset(@javax.annotation.Nonnull Long offset) { + this.offset = offset; + return this; + } + + /** + * Get offset + * @return offset + */ + @javax.annotation.Nonnull + public Long getOffset() { + return offset; + } + + public void setOffset(@javax.annotation.Nonnull Long offset) { + this.offset = offset; + } + + + public FunctionStackVariable scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Search is applied to string value + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public FunctionStackVariable size(@javax.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Get size + * @return size + */ + @javax.annotation.Nonnull + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Long size) { + this.size = size; + } + + + public FunctionStackVariable type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Search is applied to string value + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FunctionStackVariable instance itself + */ + public FunctionStackVariable putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FunctionStackVariable functionStackVariable = (FunctionStackVariable) o; + return Objects.equals(this.addr, functionStackVariable.addr) && + Objects.equals(this.lastChange, functionStackVariable.lastChange) && + Objects.equals(this.name, functionStackVariable.name) && + Objects.equals(this.offset, functionStackVariable.offset) && + Objects.equals(this.scope, functionStackVariable.scope) && + Objects.equals(this.size, functionStackVariable.size) && + Objects.equals(this.type, functionStackVariable.type)&& + Objects.equals(this.additionalProperties, functionStackVariable.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(addr, lastChange, name, offset, scope, size, type, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionStackVariable {\n"); + sb.append(" addr: ").append(toIndentedString(addr)).append("\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(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("addr", "last_change", "name", "offset", "scope", "size", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("addr", "name", "offset", "size", "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 FunctionStackVariable + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FunctionStackVariable.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionStackVariable is not found in the empty JSON string", FunctionStackVariable.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionStackVariable.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") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FunctionStackVariable.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionStackVariable' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionStackVariable.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionStackVariable value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FunctionStackVariable read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FunctionStackVariable instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FunctionStackVariable given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionStackVariable + * @throws IOException if the JSON string is invalid with respect to FunctionStackVariable + */ + public static FunctionStackVariable fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionStackVariable.class); + } + + /** + * Convert an instance of FunctionStackVariable to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GetMatchesOutputBody.java b/src/main/java/ai/reveng/model/GetMatchesOutputBody.java new file mode 100644 index 0000000..93f1977 --- /dev/null +++ b/src/main/java/ai/reveng/model/GetMatchesOutputBody.java @@ -0,0 +1,333 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.FunctionMatch; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * GetMatchesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetMatchesOutputBody { + public static final String SERIALIZED_NAME_MATCHES = "matches"; + @SerializedName(SERIALIZED_NAME_MATCHES) + @javax.annotation.Nullable + private List matches; + + /** + * Current workflow status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UNINITIALISED("UNINITIALISED"), + + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public GetMatchesOutputBody() { + } + + public GetMatchesOutputBody matches(@javax.annotation.Nullable List matches) { + this.matches = matches; + return this; + } + + public GetMatchesOutputBody addMatchesItem(FunctionMatch matchesItem) { + if (this.matches == null) { + this.matches = new ArrayList<>(); + } + this.matches.add(matchesItem); + return this; + } + + /** + * Per-source-function matches. Populated when status=COMPLETED; empty otherwise. + * @return matches + */ + @javax.annotation.Nullable + public List getMatches() { + return matches; + } + + public void setMatches(@javax.annotation.Nullable List matches) { + this.matches = matches; + } + + + public GetMatchesOutputBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Current workflow status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMatchesOutputBody getMatchesOutputBody = (GetMatchesOutputBody) o; + return Objects.equals(this.matches, getMatchesOutputBody.matches) && + Objects.equals(this.status, getMatchesOutputBody.status); + } + + 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(matches, status); + } + + 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 GetMatchesOutputBody {\n"); + sb.append(" matches: ").append(toIndentedString(matches)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("matches", "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 GetMatchesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetMatchesOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in GetMatchesOutputBody is not found in the empty JSON string", GetMatchesOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetMatchesOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `GetMatchesOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMatchesOutputBody.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("matches") != null && !jsonObj.get("matches").isJsonNull()) { + JsonArray jsonArraymatches = jsonObj.getAsJsonArray("matches"); + if (jsonArraymatches != null) { + // ensure the json data is an array + if (!jsonObj.get("matches").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `matches` to be an array in the JSON string but got `%s`", jsonObj.get("matches").toString())); + } + + // validate the optional field `matches` (array) + for (int i = 0; i < jsonArraymatches.size(); i++) { + FunctionMatch.validateJsonElement(jsonArraymatches.get(i)); + }; + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMatchesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMatchesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMatchesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMatchesOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMatchesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMatchesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMatchesOutputBody + * @throws IOException if the JSON string is invalid with respect to GetMatchesOutputBody + */ + public static GetMatchesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMatchesOutputBody.class); + } + + /** + * Convert an instance of GetMatchesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GetMatchesStatusOutputBody.java b/src/main/java/ai/reveng/model/GetMatchesStatusOutputBody.java new file mode 100644 index 0000000..dea4316 --- /dev/null +++ b/src/main/java/ai/reveng/model/GetMatchesStatusOutputBody.java @@ -0,0 +1,398 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.ProgressMessage; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * GetMatchesStatusOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetMatchesStatusOutputBody { + public static final String SERIALIZED_NAME_MESSAGES = "messages"; + @SerializedName(SERIALIZED_NAME_MESSAGES) + @javax.annotation.Nullable + private List messages; + + /** + * Current workflow status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UNINITIALISED("UNINITIALISED"), + + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public static final String SERIALIZED_NAME_STEP = "step"; + @SerializedName(SERIALIZED_NAME_STEP) + @javax.annotation.Nonnull + private String step; + + public static final String SERIALIZED_NAME_STEP_INDEX = "step_index"; + @SerializedName(SERIALIZED_NAME_STEP_INDEX) + @javax.annotation.Nonnull + private Long stepIndex; + + public static final String SERIALIZED_NAME_STEPS_TOTAL = "steps_total"; + @SerializedName(SERIALIZED_NAME_STEPS_TOTAL) + @javax.annotation.Nonnull + private Long stepsTotal; + + public GetMatchesStatusOutputBody() { + } + + public GetMatchesStatusOutputBody messages(@javax.annotation.Nullable List messages) { + this.messages = messages; + return this; + } + + public GetMatchesStatusOutputBody addMessagesItem(ProgressMessage messagesItem) { + if (this.messages == null) { + this.messages = new ArrayList<>(); + } + this.messages.add(messagesItem); + return this; + } + + /** + * Log messages emitted during execution + * @return messages + */ + @javax.annotation.Nullable + public List getMessages() { + return messages; + } + + public void setMessages(@javax.annotation.Nullable List messages) { + this.messages = messages; + } + + + public GetMatchesStatusOutputBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Current workflow status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public GetMatchesStatusOutputBody step(@javax.annotation.Nonnull String step) { + this.step = step; + return this; + } + + /** + * Name of the current step + * @return step + */ + @javax.annotation.Nonnull + public String getStep() { + return step; + } + + public void setStep(@javax.annotation.Nonnull String step) { + this.step = step; + } + + + public GetMatchesStatusOutputBody stepIndex(@javax.annotation.Nonnull Long stepIndex) { + this.stepIndex = stepIndex; + return this; + } + + /** + * Zero-based index of the current step + * @return stepIndex + */ + @javax.annotation.Nonnull + public Long getStepIndex() { + return stepIndex; + } + + public void setStepIndex(@javax.annotation.Nonnull Long stepIndex) { + this.stepIndex = stepIndex; + } + + + public GetMatchesStatusOutputBody stepsTotal(@javax.annotation.Nonnull Long stepsTotal) { + this.stepsTotal = stepsTotal; + return this; + } + + /** + * Total number of steps in the workflow + * @return stepsTotal + */ + @javax.annotation.Nonnull + public Long getStepsTotal() { + return stepsTotal; + } + + public void setStepsTotal(@javax.annotation.Nonnull Long stepsTotal) { + this.stepsTotal = stepsTotal; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMatchesStatusOutputBody getMatchesStatusOutputBody = (GetMatchesStatusOutputBody) o; + return Objects.equals(this.messages, getMatchesStatusOutputBody.messages) && + Objects.equals(this.status, getMatchesStatusOutputBody.status) && + Objects.equals(this.step, getMatchesStatusOutputBody.step) && + Objects.equals(this.stepIndex, getMatchesStatusOutputBody.stepIndex) && + Objects.equals(this.stepsTotal, getMatchesStatusOutputBody.stepsTotal); + } + + @Override + public int hashCode() { + return Objects.hash(messages, status, step, stepIndex, stepsTotal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMatchesStatusOutputBody {\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" step: ").append(toIndentedString(step)).append("\n"); + sb.append(" stepIndex: ").append(toIndentedString(stepIndex)).append("\n"); + sb.append(" stepsTotal: ").append(toIndentedString(stepsTotal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("messages", "status", "step", "step_index", "steps_total")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("messages", "status", "step", "step_index", "steps_total")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetMatchesStatusOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetMatchesStatusOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in GetMatchesStatusOutputBody is not found in the empty JSON string", GetMatchesStatusOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetMatchesStatusOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `GetMatchesStatusOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMatchesStatusOutputBody.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("messages") != null && !jsonObj.get("messages").isJsonNull()) { + if (!jsonObj.get("messages").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `messages` to be an array in the JSON string but got `%s`", jsonObj.get("messages").toString())); + } + JsonArray jsonArraymessages = jsonObj.getAsJsonArray("messages"); + // validate the required field `messages` (array) + for (int i = 0; i < jsonArraymessages.size(); i++) { + ProgressMessage.validateJsonElement(jsonArraymessages.get(i)); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("step").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `step` to be a primitive type in the JSON string but got `%s`", jsonObj.get("step").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMatchesStatusOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMatchesStatusOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMatchesStatusOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMatchesStatusOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMatchesStatusOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMatchesStatusOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMatchesStatusOutputBody + * @throws IOException if the JSON string is invalid with respect to GetMatchesStatusOutputBody + */ + public static GetMatchesStatusOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMatchesStatusOutputBody.class); + } + + /** + * Convert an instance of GetMatchesStatusOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListAnalysisFunctionsDataTypesOutputBody.java b/src/main/java/ai/reveng/model/ListAnalysisFunctionsDataTypesOutputBody.java new file mode 100644 index 0000000..301d31b --- /dev/null +++ b/src/main/java/ai/reveng/model/ListAnalysisFunctionsDataTypesOutputBody.java @@ -0,0 +1,252 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.DataTypesEntry; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * ListAnalysisFunctionsDataTypesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListAnalysisFunctionsDataTypesOutputBody { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nullable + private List items; + + public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + @javax.annotation.Nonnull + private Long totalCount; + + public ListAnalysisFunctionsDataTypesOutputBody() { + } + + public ListAnalysisFunctionsDataTypesOutputBody items(@javax.annotation.Nullable List items) { + this.items = items; + return this; + } + + public ListAnalysisFunctionsDataTypesOutputBody addItemsItem(DataTypesEntry itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Get items + * @return items + */ + @javax.annotation.Nullable + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nullable List items) { + this.items = items; + } + + + public ListAnalysisFunctionsDataTypesOutputBody totalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Total functions in the analysis, ignoring pagination. + * @return totalCount + */ + @javax.annotation.Nonnull + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAnalysisFunctionsDataTypesOutputBody listAnalysisFunctionsDataTypesOutputBody = (ListAnalysisFunctionsDataTypesOutputBody) o; + return Objects.equals(this.items, listAnalysisFunctionsDataTypesOutputBody.items) && + Objects.equals(this.totalCount, listAnalysisFunctionsDataTypesOutputBody.totalCount); + } + + @Override + public int hashCode() { + return Objects.hash(items, totalCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAnalysisFunctionsDataTypesOutputBody {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("items", "total_count")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("items", "total_count")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListAnalysisFunctionsDataTypesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAnalysisFunctionsDataTypesOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ListAnalysisFunctionsDataTypesOutputBody is not found in the empty JSON string", ListAnalysisFunctionsDataTypesOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAnalysisFunctionsDataTypesOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ListAnalysisFunctionsDataTypesOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAnalysisFunctionsDataTypesOutputBody.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 && !jsonObj.get("items").isJsonNull()) { + 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++) { + DataTypesEntry.validateJsonElement(jsonArrayitems.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAnalysisFunctionsDataTypesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAnalysisFunctionsDataTypesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListAnalysisFunctionsDataTypesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAnalysisFunctionsDataTypesOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAnalysisFunctionsDataTypesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListAnalysisFunctionsDataTypesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAnalysisFunctionsDataTypesOutputBody + * @throws IOException if the JSON string is invalid with respect to ListAnalysisFunctionsDataTypesOutputBody + */ + public static ListAnalysisFunctionsDataTypesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAnalysisFunctionsDataTypesOutputBody.class); + } + + /** + * Convert an instance of ListAnalysisFunctionsDataTypesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListAnalysisFunctionsOutputBody.java b/src/main/java/ai/reveng/model/ListAnalysisFunctionsOutputBody.java new file mode 100644 index 0000000..ea62c9c --- /dev/null +++ b/src/main/java/ai/reveng/model/ListAnalysisFunctionsOutputBody.java @@ -0,0 +1,252 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.AnalysisFunctionEntry; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * ListAnalysisFunctionsOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListAnalysisFunctionsOutputBody { + public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; + @SerializedName(SERIALIZED_NAME_FUNCTIONS) + @javax.annotation.Nullable + private List functions; + + public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + @javax.annotation.Nonnull + private Long totalCount; + + public ListAnalysisFunctionsOutputBody() { + } + + public ListAnalysisFunctionsOutputBody functions(@javax.annotation.Nullable List functions) { + this.functions = functions; + return this; + } + + public ListAnalysisFunctionsOutputBody addFunctionsItem(AnalysisFunctionEntry functionsItem) { + if (this.functions == null) { + this.functions = new ArrayList<>(); + } + this.functions.add(functionsItem); + return this; + } + + /** + * Get functions + * @return functions + */ + @javax.annotation.Nullable + public List getFunctions() { + return functions; + } + + public void setFunctions(@javax.annotation.Nullable List functions) { + this.functions = functions; + } + + + public ListAnalysisFunctionsOutputBody totalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Total functions in the analysis, ignoring pagination. + * @return totalCount + */ + @javax.annotation.Nonnull + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(@javax.annotation.Nonnull Long totalCount) { + this.totalCount = totalCount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAnalysisFunctionsOutputBody listAnalysisFunctionsOutputBody = (ListAnalysisFunctionsOutputBody) o; + return Objects.equals(this.functions, listAnalysisFunctionsOutputBody.functions) && + Objects.equals(this.totalCount, listAnalysisFunctionsOutputBody.totalCount); + } + + @Override + public int hashCode() { + return Objects.hash(functions, totalCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAnalysisFunctionsOutputBody {\n"); + sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\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", "total_count")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("functions", "total_count")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListAnalysisFunctionsOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAnalysisFunctionsOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ListAnalysisFunctionsOutputBody is not found in the empty JSON string", ListAnalysisFunctionsOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAnalysisFunctionsOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ListAnalysisFunctionsOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAnalysisFunctionsOutputBody.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 && !jsonObj.get("functions").isJsonNull()) { + 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++) { + AnalysisFunctionEntry.validateJsonElement(jsonArrayfunctions.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAnalysisFunctionsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAnalysisFunctionsOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListAnalysisFunctionsOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAnalysisFunctionsOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAnalysisFunctionsOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListAnalysisFunctionsOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAnalysisFunctionsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListAnalysisFunctionsOutputBody + */ + public static ListAnalysisFunctionsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAnalysisFunctionsOutputBody.class); + } + + /** + * Convert an instance of ListAnalysisFunctionsOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ListFunctionsDataTypesOutputBody.java b/src/main/java/ai/reveng/model/ListFunctionsDataTypesOutputBody.java new file mode 100644 index 0000000..a23d010 --- /dev/null +++ b/src/main/java/ai/reveng/model/ListFunctionsDataTypesOutputBody.java @@ -0,0 +1,226 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.DataTypesEntry; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * ListFunctionsDataTypesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListFunctionsDataTypesOutputBody { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nullable + private List items; + + public ListFunctionsDataTypesOutputBody() { + } + + public ListFunctionsDataTypesOutputBody items(@javax.annotation.Nullable List items) { + this.items = items; + return this; + } + + public ListFunctionsDataTypesOutputBody addItemsItem(DataTypesEntry itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Get items + * @return items + */ + @javax.annotation.Nullable + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nullable List items) { + this.items = items; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFunctionsDataTypesOutputBody listFunctionsDataTypesOutputBody = (ListFunctionsDataTypesOutputBody) o; + return Objects.equals(this.items, listFunctionsDataTypesOutputBody.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFunctionsDataTypesOutputBody {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("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 ListFunctionsDataTypesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListFunctionsDataTypesOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in ListFunctionsDataTypesOutputBody is not found in the empty JSON string", ListFunctionsDataTypesOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListFunctionsDataTypesOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ListFunctionsDataTypesOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListFunctionsDataTypesOutputBody.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 && !jsonObj.get("items").isJsonNull()) { + 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++) { + DataTypesEntry.validateJsonElement(jsonArrayitems.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFunctionsDataTypesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFunctionsDataTypesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListFunctionsDataTypesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFunctionsDataTypesOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFunctionsDataTypesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListFunctionsDataTypesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFunctionsDataTypesOutputBody + * @throws IOException if the JSON string is invalid with respect to ListFunctionsDataTypesOutputBody + */ + public static ListFunctionsDataTypesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFunctionsDataTypesOutputBody.class); + } + + /** + * Convert an instance of ListFunctionsDataTypesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/MatchFilters.java b/src/main/java/ai/reveng/model/MatchFilters.java new file mode 100644 index 0000000..58c62b6 --- /dev/null +++ b/src/main/java/ai/reveng/model/MatchFilters.java @@ -0,0 +1,376 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.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; + +/** + * MatchFilters + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MatchFilters { + public static final String SERIALIZED_NAME_BINARY_IDS = "binary_ids"; + @SerializedName(SERIALIZED_NAME_BINARY_IDS) + @javax.annotation.Nullable + private List binaryIds; + + public static final String SERIALIZED_NAME_COLLECTION_IDS = "collection_ids"; + @SerializedName(SERIALIZED_NAME_COLLECTION_IDS) + @javax.annotation.Nullable + private List collectionIds; + + public static final String SERIALIZED_NAME_DEBUG_TYPES = "debug_types"; + @SerializedName(SERIALIZED_NAME_DEBUG_TYPES) + @javax.annotation.Nullable + private List debugTypes; + + public static final String SERIALIZED_NAME_FUNCTION_IDS = "function_ids"; + @SerializedName(SERIALIZED_NAME_FUNCTION_IDS) + @javax.annotation.Nullable + private List functionIds; + + public static final String SERIALIZED_NAME_USER_IDS = "user_ids"; + @SerializedName(SERIALIZED_NAME_USER_IDS) + @javax.annotation.Nullable + private List userIds; + + public MatchFilters() { + } + + public MatchFilters binaryIds(@javax.annotation.Nullable List binaryIds) { + this.binaryIds = binaryIds; + return this; + } + + public MatchFilters addBinaryIdsItem(Long binaryIdsItem) { + if (this.binaryIds == null) { + this.binaryIds = new ArrayList<>(); + } + this.binaryIds.add(binaryIdsItem); + return this; + } + + /** + * Restrict the candidate pool to these binary IDs. + * @return binaryIds + */ + @javax.annotation.Nullable + public List getBinaryIds() { + return binaryIds; + } + + public void setBinaryIds(@javax.annotation.Nullable List binaryIds) { + this.binaryIds = binaryIds; + } + + + public MatchFilters collectionIds(@javax.annotation.Nullable List collectionIds) { + this.collectionIds = collectionIds; + return this; + } + + public MatchFilters addCollectionIdsItem(Long collectionIdsItem) { + if (this.collectionIds == null) { + this.collectionIds = new ArrayList<>(); + } + this.collectionIds.add(collectionIdsItem); + return this; + } + + /** + * Restrict the candidate pool to binaries in these collection IDs. + * @return collectionIds + */ + @javax.annotation.Nullable + public List getCollectionIds() { + return collectionIds; + } + + public void setCollectionIds(@javax.annotation.Nullable List collectionIds) { + this.collectionIds = collectionIds; + } + + + public MatchFilters debugTypes(@javax.annotation.Nullable List debugTypes) { + this.debugTypes = debugTypes; + return this; + } + + public MatchFilters addDebugTypesItem(String debugTypesItem) { + if (this.debugTypes == null) { + this.debugTypes = new ArrayList<>(); + } + this.debugTypes.add(debugTypesItem); + return this; + } + + /** + * Restrict matches to candidates with these debug source types. Accepted: SYSTEM, USER. + * @return debugTypes + */ + @javax.annotation.Nullable + public List getDebugTypes() { + return debugTypes; + } + + public void setDebugTypes(@javax.annotation.Nullable List debugTypes) { + this.debugTypes = debugTypes; + } + + + public MatchFilters functionIds(@javax.annotation.Nullable List functionIds) { + this.functionIds = functionIds; + return this; + } + + public MatchFilters addFunctionIdsItem(Long functionIdsItem) { + if (this.functionIds == null) { + this.functionIds = new ArrayList<>(); + } + this.functionIds.add(functionIdsItem); + return this; + } + + /** + * Restrict the candidate pool to these function IDs. + * @return functionIds + */ + @javax.annotation.Nullable + public List getFunctionIds() { + return functionIds; + } + + public void setFunctionIds(@javax.annotation.Nullable List functionIds) { + this.functionIds = functionIds; + } + + + public MatchFilters userIds(@javax.annotation.Nullable List userIds) { + this.userIds = userIds; + return this; + } + + public MatchFilters addUserIdsItem(Long userIdsItem) { + if (this.userIds == null) { + this.userIds = new ArrayList<>(); + } + this.userIds.add(userIdsItem); + return this; + } + + /** + * Restrict the candidate pool to functions owned by these user IDs. + * @return userIds + */ + @javax.annotation.Nullable + public List getUserIds() { + return userIds; + } + + public void setUserIds(@javax.annotation.Nullable List userIds) { + this.userIds = userIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MatchFilters matchFilters = (MatchFilters) o; + return Objects.equals(this.binaryIds, matchFilters.binaryIds) && + Objects.equals(this.collectionIds, matchFilters.collectionIds) && + Objects.equals(this.debugTypes, matchFilters.debugTypes) && + Objects.equals(this.functionIds, matchFilters.functionIds) && + Objects.equals(this.userIds, matchFilters.userIds); + } + + 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(binaryIds, collectionIds, debugTypes, functionIds, userIds); + } + + 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 MatchFilters {\n"); + sb.append(" binaryIds: ").append(toIndentedString(binaryIds)).append("\n"); + sb.append(" collectionIds: ").append(toIndentedString(collectionIds)).append("\n"); + sb.append(" debugTypes: ").append(toIndentedString(debugTypes)).append("\n"); + sb.append(" functionIds: ").append(toIndentedString(functionIds)).append("\n"); + sb.append(" userIds: ").append(toIndentedString(userIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\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_ids", "collection_ids", "debug_types", "function_ids", "user_ids")); + + // 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 MatchFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MatchFilters.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in MatchFilters is not found in the empty JSON string", MatchFilters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MatchFilters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `MatchFilters` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("binary_ids") != null && !jsonObj.get("binary_ids").isJsonNull() && !jsonObj.get("binary_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_ids` to be an array in the JSON string but got `%s`", jsonObj.get("binary_ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("collection_ids") != null && !jsonObj.get("collection_ids").isJsonNull() && !jsonObj.get("collection_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `collection_ids` to be an array in the JSON string but got `%s`", jsonObj.get("collection_ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("debug_types") != null && !jsonObj.get("debug_types").isJsonNull() && !jsonObj.get("debug_types").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `debug_types` to be an array in the JSON string but got `%s`", jsonObj.get("debug_types").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("function_ids") != null && !jsonObj.get("function_ids").isJsonNull() && !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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("user_ids") != null && !jsonObj.get("user_ids").isJsonNull() && !jsonObj.get("user_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `user_ids` to be an array in the JSON string but got `%s`", jsonObj.get("user_ids").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MatchFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MatchFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MatchFilters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MatchFilters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MatchFilters read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MatchFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of MatchFilters + * @throws IOException if the JSON string is invalid with respect to MatchFilters + */ + public static MatchFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MatchFilters.class); + } + + /** + * Convert an instance of MatchFilters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/StartBatchMatchingInputBody.java b/src/main/java/ai/reveng/model/StartBatchMatchingInputBody.java new file mode 100644 index 0000000..91b8e04 --- /dev/null +++ b/src/main/java/ai/reveng/model/StartBatchMatchingInputBody.java @@ -0,0 +1,408 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * StartBatchMatchingInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartBatchMatchingInputBody { + public static final String SERIALIZED_NAME_BINARY_IDS = "binary_ids"; + @SerializedName(SERIALIZED_NAME_BINARY_IDS) + @javax.annotation.Nullable + private List binaryIds; + + public static final String SERIALIZED_NAME_DEBUG_TYPES = "debug_types"; + @SerializedName(SERIALIZED_NAME_DEBUG_TYPES) + @javax.annotation.Nullable + private List debugTypes; + + public static final String SERIALIZED_NAME_MIN_SIMILARITY = "min_similarity"; + @SerializedName(SERIALIZED_NAME_MIN_SIMILARITY) + @javax.annotation.Nullable + private Double minSimilarity; + + public static final String SERIALIZED_NAME_RESULTS_PER_FUNCTION = "results_per_function"; + @SerializedName(SERIALIZED_NAME_RESULTS_PER_FUNCTION) + @javax.annotation.Nullable + private Long resultsPerFunction; + + public StartBatchMatchingInputBody() { + } + + public StartBatchMatchingInputBody binaryIds(@javax.annotation.Nullable List binaryIds) { + this.binaryIds = binaryIds; + return this; + } + + public StartBatchMatchingInputBody addBinaryIdsItem(Long binaryIdsItem) { + if (this.binaryIds == null) { + this.binaryIds = new ArrayList<>(); + } + this.binaryIds.add(binaryIdsItem); + return this; + } + + /** + * Binary IDs to match the analysis against, one workflow per binary. + * @return binaryIds + */ + @javax.annotation.Nullable + public List getBinaryIds() { + return binaryIds; + } + + public void setBinaryIds(@javax.annotation.Nullable List binaryIds) { + this.binaryIds = binaryIds; + } + + + public StartBatchMatchingInputBody debugTypes(@javax.annotation.Nullable List debugTypes) { + this.debugTypes = debugTypes; + return this; + } + + public StartBatchMatchingInputBody addDebugTypesItem(String debugTypesItem) { + if (this.debugTypes == null) { + this.debugTypes = new ArrayList<>(); + } + this.debugTypes.add(debugTypesItem); + return this; + } + + /** + * Restrict matches to candidates with these debug source types. Defaults to [\"SYSTEM\"]. + * @return debugTypes + */ + @javax.annotation.Nullable + public List getDebugTypes() { + return debugTypes; + } + + public void setDebugTypes(@javax.annotation.Nullable List debugTypes) { + this.debugTypes = debugTypes; + } + + + public StartBatchMatchingInputBody minSimilarity(@javax.annotation.Nullable Double minSimilarity) { + this.minSimilarity = minSimilarity; + return this; + } + + /** + * Similarity floor as a percentage. Defaults to 90. + * minimum: 0 + * maximum: 100 + * @return minSimilarity + */ + @javax.annotation.Nullable + public Double getMinSimilarity() { + return minSimilarity; + } + + public void setMinSimilarity(@javax.annotation.Nullable Double minSimilarity) { + this.minSimilarity = minSimilarity; + } + + + public StartBatchMatchingInputBody resultsPerFunction(@javax.annotation.Nullable Long resultsPerFunction) { + this.resultsPerFunction = resultsPerFunction; + return this; + } + + /** + * Max matches returned per source function. Defaults to 1. + * minimum: 1 + * maximum: 30 + * @return resultsPerFunction + */ + @javax.annotation.Nullable + public Long getResultsPerFunction() { + return resultsPerFunction; + } + + public void setResultsPerFunction(@javax.annotation.Nullable Long resultsPerFunction) { + this.resultsPerFunction = resultsPerFunction; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the StartBatchMatchingInputBody instance itself + */ + public StartBatchMatchingInputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartBatchMatchingInputBody startBatchMatchingInputBody = (StartBatchMatchingInputBody) o; + return Objects.equals(this.binaryIds, startBatchMatchingInputBody.binaryIds) && + Objects.equals(this.debugTypes, startBatchMatchingInputBody.debugTypes) && + Objects.equals(this.minSimilarity, startBatchMatchingInputBody.minSimilarity) && + Objects.equals(this.resultsPerFunction, startBatchMatchingInputBody.resultsPerFunction)&& + Objects.equals(this.additionalProperties, startBatchMatchingInputBody.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(binaryIds, debugTypes, minSimilarity, resultsPerFunction, 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 StartBatchMatchingInputBody {\n"); + sb.append(" binaryIds: ").append(toIndentedString(binaryIds)).append("\n"); + sb.append(" debugTypes: ").append(toIndentedString(debugTypes)).append("\n"); + sb.append(" minSimilarity: ").append(toIndentedString(minSimilarity)).append("\n"); + sb.append(" resultsPerFunction: ").append(toIndentedString(resultsPerFunction)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\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_ids", "debug_types", "min_similarity", "results_per_function")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("binary_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 StartBatchMatchingInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StartBatchMatchingInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StartBatchMatchingInputBody is not found in the empty JSON string", StartBatchMatchingInputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StartBatchMatchingInputBody.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("binary_ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("binary_ids").isJsonArray() && !jsonObj.get("binary_ids").isJsonNull()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_ids` to be an array in the JSON string but got `%s`", jsonObj.get("binary_ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("debug_types") != null && !jsonObj.get("debug_types").isJsonNull() && !jsonObj.get("debug_types").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `debug_types` to be an array in the JSON string but got `%s`", jsonObj.get("debug_types").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StartBatchMatchingInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartBatchMatchingInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartBatchMatchingInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartBatchMatchingInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public StartBatchMatchingInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + StartBatchMatchingInputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartBatchMatchingInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartBatchMatchingInputBody + * @throws IOException if the JSON string is invalid with respect to StartBatchMatchingInputBody + */ + public static StartBatchMatchingInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartBatchMatchingInputBody.class); + } + + /** + * Convert an instance of StartBatchMatchingInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/StartMatchingForAnalysisInputBody.java b/src/main/java/ai/reveng/model/StartMatchingForAnalysisInputBody.java new file mode 100644 index 0000000..bcd265d --- /dev/null +++ b/src/main/java/ai/reveng/model/StartMatchingForAnalysisInputBody.java @@ -0,0 +1,259 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.MatchFilters; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * StartMatchingForAnalysisInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartMatchingForAnalysisInputBody { + public static final String SERIALIZED_NAME_FILTERS = "filters"; + @SerializedName(SERIALIZED_NAME_FILTERS) + @javax.annotation.Nullable + private MatchFilters filters; + + public static final String SERIALIZED_NAME_MIN_SIMILARITY = "min_similarity"; + @SerializedName(SERIALIZED_NAME_MIN_SIMILARITY) + @javax.annotation.Nullable + private Double minSimilarity; + + public static final String SERIALIZED_NAME_RESULTS_PER_FUNCTION = "results_per_function"; + @SerializedName(SERIALIZED_NAME_RESULTS_PER_FUNCTION) + @javax.annotation.Nullable + private Long resultsPerFunction; + + public StartMatchingForAnalysisInputBody() { + } + + public StartMatchingForAnalysisInputBody filters(@javax.annotation.Nullable MatchFilters filters) { + this.filters = filters; + return this; + } + + /** + * Narrow the candidate pool. + * @return filters + */ + @javax.annotation.Nullable + public MatchFilters getFilters() { + return filters; + } + + public void setFilters(@javax.annotation.Nullable MatchFilters filters) { + this.filters = filters; + } + + + public StartMatchingForAnalysisInputBody minSimilarity(@javax.annotation.Nullable Double minSimilarity) { + this.minSimilarity = minSimilarity; + return this; + } + + /** + * Similarity floor as a percentage. Defaults to 90. + * minimum: 0 + * maximum: 100 + * @return minSimilarity + */ + @javax.annotation.Nullable + public Double getMinSimilarity() { + return minSimilarity; + } + + public void setMinSimilarity(@javax.annotation.Nullable Double minSimilarity) { + this.minSimilarity = minSimilarity; + } + + + public StartMatchingForAnalysisInputBody resultsPerFunction(@javax.annotation.Nullable Long resultsPerFunction) { + this.resultsPerFunction = resultsPerFunction; + return this; + } + + /** + * Max matches returned per source function. Defaults to 1. + * minimum: 1 + * maximum: 30 + * @return resultsPerFunction + */ + @javax.annotation.Nullable + public Long getResultsPerFunction() { + return resultsPerFunction; + } + + public void setResultsPerFunction(@javax.annotation.Nullable Long resultsPerFunction) { + this.resultsPerFunction = resultsPerFunction; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartMatchingForAnalysisInputBody startMatchingForAnalysisInputBody = (StartMatchingForAnalysisInputBody) o; + return Objects.equals(this.filters, startMatchingForAnalysisInputBody.filters) && + Objects.equals(this.minSimilarity, startMatchingForAnalysisInputBody.minSimilarity) && + Objects.equals(this.resultsPerFunction, startMatchingForAnalysisInputBody.resultsPerFunction); + } + + @Override + public int hashCode() { + return Objects.hash(filters, minSimilarity, resultsPerFunction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartMatchingForAnalysisInputBody {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" minSimilarity: ").append(toIndentedString(minSimilarity)).append("\n"); + sb.append(" resultsPerFunction: ").append(toIndentedString(resultsPerFunction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("filters", "min_similarity", "results_per_function")); + + // 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 StartMatchingForAnalysisInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StartMatchingForAnalysisInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StartMatchingForAnalysisInputBody is not found in the empty JSON string", StartMatchingForAnalysisInputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StartMatchingForAnalysisInputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `StartMatchingForAnalysisInputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `filters` + if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { + MatchFilters.validateJsonElement(jsonObj.get("filters")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StartMatchingForAnalysisInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartMatchingForAnalysisInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartMatchingForAnalysisInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartMatchingForAnalysisInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartMatchingForAnalysisInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartMatchingForAnalysisInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartMatchingForAnalysisInputBody + * @throws IOException if the JSON string is invalid with respect to StartMatchingForAnalysisInputBody + */ + public static StartMatchingForAnalysisInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartMatchingForAnalysisInputBody.class); + } + + /** + * Convert an instance of StartMatchingForAnalysisInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/StartMatchingForFunctionsInputBody.java b/src/main/java/ai/reveng/model/StartMatchingForFunctionsInputBody.java new file mode 100644 index 0000000..36dbeca --- /dev/null +++ b/src/main/java/ai/reveng/model/StartMatchingForFunctionsInputBody.java @@ -0,0 +1,308 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.MatchFilters; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * StartMatchingForFunctionsInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartMatchingForFunctionsInputBody { + public static final String SERIALIZED_NAME_FILTERS = "filters"; + @SerializedName(SERIALIZED_NAME_FILTERS) + @javax.annotation.Nullable + private MatchFilters filters; + + public static final String SERIALIZED_NAME_FUNCTION_IDS = "function_ids"; + @SerializedName(SERIALIZED_NAME_FUNCTION_IDS) + @javax.annotation.Nullable + private List functionIds; + + public static final String SERIALIZED_NAME_MIN_SIMILARITY = "min_similarity"; + @SerializedName(SERIALIZED_NAME_MIN_SIMILARITY) + @javax.annotation.Nullable + private Double minSimilarity; + + public static final String SERIALIZED_NAME_RESULTS_PER_FUNCTION = "results_per_function"; + @SerializedName(SERIALIZED_NAME_RESULTS_PER_FUNCTION) + @javax.annotation.Nullable + private Long resultsPerFunction; + + public StartMatchingForFunctionsInputBody() { + } + + public StartMatchingForFunctionsInputBody filters(@javax.annotation.Nullable MatchFilters filters) { + this.filters = filters; + return this; + } + + /** + * Narrow the candidate pool. + * @return filters + */ + @javax.annotation.Nullable + public MatchFilters getFilters() { + return filters; + } + + public void setFilters(@javax.annotation.Nullable MatchFilters filters) { + this.filters = filters; + } + + + public StartMatchingForFunctionsInputBody functionIds(@javax.annotation.Nullable List functionIds) { + this.functionIds = functionIds; + return this; + } + + public StartMatchingForFunctionsInputBody addFunctionIdsItem(Long functionIdsItem) { + if (this.functionIds == null) { + this.functionIds = new ArrayList<>(); + } + this.functionIds.add(functionIdsItem); + return this; + } + + /** + * Source function IDs to match against the rest of the corpus. + * @return functionIds + */ + @javax.annotation.Nullable + public List getFunctionIds() { + return functionIds; + } + + public void setFunctionIds(@javax.annotation.Nullable List functionIds) { + this.functionIds = functionIds; + } + + + public StartMatchingForFunctionsInputBody minSimilarity(@javax.annotation.Nullable Double minSimilarity) { + this.minSimilarity = minSimilarity; + return this; + } + + /** + * Similarity floor as a percentage. Defaults to 90. + * minimum: 0 + * maximum: 100 + * @return minSimilarity + */ + @javax.annotation.Nullable + public Double getMinSimilarity() { + return minSimilarity; + } + + public void setMinSimilarity(@javax.annotation.Nullable Double minSimilarity) { + this.minSimilarity = minSimilarity; + } + + + public StartMatchingForFunctionsInputBody resultsPerFunction(@javax.annotation.Nullable Long resultsPerFunction) { + this.resultsPerFunction = resultsPerFunction; + return this; + } + + /** + * Max matches returned per source function. Defaults to 1. + * minimum: 1 + * maximum: 30 + * @return resultsPerFunction + */ + @javax.annotation.Nullable + public Long getResultsPerFunction() { + return resultsPerFunction; + } + + public void setResultsPerFunction(@javax.annotation.Nullable Long resultsPerFunction) { + this.resultsPerFunction = resultsPerFunction; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartMatchingForFunctionsInputBody startMatchingForFunctionsInputBody = (StartMatchingForFunctionsInputBody) o; + return Objects.equals(this.filters, startMatchingForFunctionsInputBody.filters) && + Objects.equals(this.functionIds, startMatchingForFunctionsInputBody.functionIds) && + Objects.equals(this.minSimilarity, startMatchingForFunctionsInputBody.minSimilarity) && + Objects.equals(this.resultsPerFunction, startMatchingForFunctionsInputBody.resultsPerFunction); + } + + @Override + public int hashCode() { + return Objects.hash(filters, functionIds, minSimilarity, resultsPerFunction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartMatchingForFunctionsInputBody {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" functionIds: ").append(toIndentedString(functionIds)).append("\n"); + sb.append(" minSimilarity: ").append(toIndentedString(minSimilarity)).append("\n"); + sb.append(" resultsPerFunction: ").append(toIndentedString(resultsPerFunction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("filters", "function_ids", "min_similarity", "results_per_function")); + + // 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 StartMatchingForFunctionsInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StartMatchingForFunctionsInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StartMatchingForFunctionsInputBody is not found in the empty JSON string", StartMatchingForFunctionsInputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StartMatchingForFunctionsInputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `StartMatchingForFunctionsInputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StartMatchingForFunctionsInputBody.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 `filters` + if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { + MatchFilters.validateJsonElement(jsonObj.get("filters")); + } + // 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() && !jsonObj.get("function_ids").isJsonNull()) { + 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 (!StartMatchingForFunctionsInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartMatchingForFunctionsInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartMatchingForFunctionsInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartMatchingForFunctionsInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartMatchingForFunctionsInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartMatchingForFunctionsInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartMatchingForFunctionsInputBody + * @throws IOException if the JSON string is invalid with respect to StartMatchingForFunctionsInputBody + */ + public static StartMatchingForFunctionsInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartMatchingForFunctionsInputBody.class); + } + + /** + * Convert an instance of StartMatchingForFunctionsInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/StartMatchingOutputBody.java b/src/main/java/ai/reveng/model/StartMatchingOutputBody.java new file mode 100644 index 0000000..2b3730f --- /dev/null +++ b/src/main/java/ai/reveng/model/StartMatchingOutputBody.java @@ -0,0 +1,398 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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.ProgressMessage; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * StartMatchingOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartMatchingOutputBody { + public static final String SERIALIZED_NAME_MESSAGES = "messages"; + @SerializedName(SERIALIZED_NAME_MESSAGES) + @javax.annotation.Nullable + private List messages; + + /** + * Current workflow status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UNINITIALISED("UNINITIALISED"), + + PENDING("PENDING"), + + RUNNING("RUNNING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public static final String SERIALIZED_NAME_STEP = "step"; + @SerializedName(SERIALIZED_NAME_STEP) + @javax.annotation.Nonnull + private String step; + + public static final String SERIALIZED_NAME_STEP_INDEX = "step_index"; + @SerializedName(SERIALIZED_NAME_STEP_INDEX) + @javax.annotation.Nonnull + private Long stepIndex; + + public static final String SERIALIZED_NAME_STEPS_TOTAL = "steps_total"; + @SerializedName(SERIALIZED_NAME_STEPS_TOTAL) + @javax.annotation.Nonnull + private Long stepsTotal; + + public StartMatchingOutputBody() { + } + + public StartMatchingOutputBody messages(@javax.annotation.Nullable List messages) { + this.messages = messages; + return this; + } + + public StartMatchingOutputBody addMessagesItem(ProgressMessage messagesItem) { + if (this.messages == null) { + this.messages = new ArrayList<>(); + } + this.messages.add(messagesItem); + return this; + } + + /** + * Log messages emitted during execution + * @return messages + */ + @javax.annotation.Nullable + public List getMessages() { + return messages; + } + + public void setMessages(@javax.annotation.Nullable List messages) { + this.messages = messages; + } + + + public StartMatchingOutputBody status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Current workflow status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public StartMatchingOutputBody step(@javax.annotation.Nonnull String step) { + this.step = step; + return this; + } + + /** + * Name of the current step + * @return step + */ + @javax.annotation.Nonnull + public String getStep() { + return step; + } + + public void setStep(@javax.annotation.Nonnull String step) { + this.step = step; + } + + + public StartMatchingOutputBody stepIndex(@javax.annotation.Nonnull Long stepIndex) { + this.stepIndex = stepIndex; + return this; + } + + /** + * Zero-based index of the current step + * @return stepIndex + */ + @javax.annotation.Nonnull + public Long getStepIndex() { + return stepIndex; + } + + public void setStepIndex(@javax.annotation.Nonnull Long stepIndex) { + this.stepIndex = stepIndex; + } + + + public StartMatchingOutputBody stepsTotal(@javax.annotation.Nonnull Long stepsTotal) { + this.stepsTotal = stepsTotal; + return this; + } + + /** + * Total number of steps in the workflow + * @return stepsTotal + */ + @javax.annotation.Nonnull + public Long getStepsTotal() { + return stepsTotal; + } + + public void setStepsTotal(@javax.annotation.Nonnull Long stepsTotal) { + this.stepsTotal = stepsTotal; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartMatchingOutputBody startMatchingOutputBody = (StartMatchingOutputBody) o; + return Objects.equals(this.messages, startMatchingOutputBody.messages) && + Objects.equals(this.status, startMatchingOutputBody.status) && + Objects.equals(this.step, startMatchingOutputBody.step) && + Objects.equals(this.stepIndex, startMatchingOutputBody.stepIndex) && + Objects.equals(this.stepsTotal, startMatchingOutputBody.stepsTotal); + } + + @Override + public int hashCode() { + return Objects.hash(messages, status, step, stepIndex, stepsTotal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartMatchingOutputBody {\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" step: ").append(toIndentedString(step)).append("\n"); + sb.append(" stepIndex: ").append(toIndentedString(stepIndex)).append("\n"); + sb.append(" stepsTotal: ").append(toIndentedString(stepsTotal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("messages", "status", "step", "step_index", "steps_total")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("messages", "status", "step", "step_index", "steps_total")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StartMatchingOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StartMatchingOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in StartMatchingOutputBody is not found in the empty JSON string", StartMatchingOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StartMatchingOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `StartMatchingOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StartMatchingOutputBody.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("messages") != null && !jsonObj.get("messages").isJsonNull()) { + if (!jsonObj.get("messages").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `messages` to be an array in the JSON string but got `%s`", jsonObj.get("messages").toString())); + } + JsonArray jsonArraymessages = jsonObj.getAsJsonArray("messages"); + // validate the required field `messages` (array) + for (int i = 0; i < jsonArraymessages.size(); i++) { + ProgressMessage.validateJsonElement(jsonArraymessages.get(i)); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("step").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `step` to be a primitive type in the JSON string but got `%s`", jsonObj.get("step").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StartMatchingOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartMatchingOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartMatchingOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartMatchingOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartMatchingOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartMatchingOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartMatchingOutputBody + * @throws IOException if the JSON string is invalid with respect to StartMatchingOutputBody + */ + public static StartMatchingOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartMatchingOutputBody.class); + } + + /** + * Convert an instance of StartMatchingOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +