From f2cba44c97549e721aa47dbf6166ec12aa46abd4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 15 Jul 2026 07:34:45 +0000 Subject: [PATCH] Update SDK to version v3.116.5 - Generated from OpenAPI spec version v3.116.5 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 21 +- build.gradle | 4 +- build.sbt | 2 +- docs/AiUnstripRequest.md | 13 - docs/AnalysesCoreApi.md | 6 +- docs/AnalysisFunctionMatchingRequest.md | 20 - docs/AutoUnstripRequest.md | 19 - docs/AutoUnstripResponse.md | 18 - docs/CallEdge.md | 1 + docs/DynamicExecutionStatusResponse.md | 15 +- docs/FunctionMatchingFilters.md | 28 - docs/FunctionMatchingRequest.md | 22 - docs/FunctionMatchingResponse.md | 22 - docs/FunctionsCoreApi.md | 456 --------- docs/GetAnalysisStringsStatusOutputBody.md | 15 +- docs/MatchedFunctionSuggestion.md | 16 - docs/V2FunctionMatch.md | 15 - docs/V2MatchedFunction.md | 23 - docs/V2NameConfidence.md | 14 - pom.xml | 2 +- .../java/ai/reveng/api/AnalysesCoreApi.java | 26 +- .../java/ai/reveng/api/FunctionsCoreApi.java | 876 ------------------ .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 11 - .../ai/reveng/model/AiUnstripRequest.java | 279 ------ .../AnalysisFunctionMatchingRequest.java | 501 ---------- .../ai/reveng/model/AutoUnstripRequest.java | 472 ---------- .../ai/reveng/model/AutoUnstripResponse.java | 457 --------- src/main/java/ai/reveng/model/CallEdge.java | 30 +- .../model/DynamicExecutionStatusResponse.java | 72 +- .../reveng/model/FunctionMatchingFilters.java | 501 ---------- .../reveng/model/FunctionMatchingRequest.java | 576 ------------ .../model/FunctionMatchingResponse.java | 559 ----------- .../GetAnalysisStringsStatusOutputBody.java | 72 +- .../model/MatchedFunctionSuggestion.java | 382 -------- .../java/ai/reveng/model/V2FunctionMatch.java | 394 -------- .../ai/reveng/model/V2MatchedFunction.java | 571 ------------ .../ai/reveng/model/V2NameConfidence.java | 318 ------- 40 files changed, 221 insertions(+), 6614 deletions(-) delete mode 100644 docs/AiUnstripRequest.md delete mode 100644 docs/AnalysisFunctionMatchingRequest.md delete mode 100644 docs/AutoUnstripRequest.md delete mode 100644 docs/AutoUnstripResponse.md delete mode 100644 docs/FunctionMatchingFilters.md delete mode 100644 docs/FunctionMatchingRequest.md delete mode 100644 docs/FunctionMatchingResponse.md delete mode 100644 docs/MatchedFunctionSuggestion.md delete mode 100644 docs/V2FunctionMatch.md delete mode 100644 docs/V2MatchedFunction.md delete mode 100644 docs/V2NameConfidence.md delete mode 100644 src/main/java/ai/reveng/model/AiUnstripRequest.java delete mode 100644 src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java delete mode 100644 src/main/java/ai/reveng/model/AutoUnstripRequest.java delete mode 100644 src/main/java/ai/reveng/model/AutoUnstripResponse.java delete mode 100644 src/main/java/ai/reveng/model/FunctionMatchingFilters.java delete mode 100644 src/main/java/ai/reveng/model/FunctionMatchingRequest.java delete mode 100644 src/main/java/ai/reveng/model/FunctionMatchingResponse.java delete mode 100644 src/main/java/ai/reveng/model/MatchedFunctionSuggestion.java delete mode 100644 src/main/java/ai/reveng/model/V2FunctionMatch.java delete mode 100644 src/main/java/ai/reveng/model/V2MatchedFunction.java delete mode 100644 src/main/java/ai/reveng/model/V2NameConfidence.java diff --git a/.sdk-version b/.sdk-version index 4ba18130..ee92a312 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.114.2 +v3.116.5 diff --git a/README.md b/README.md index be9c9f6d..98a05bd1 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.114.2 + 3.116.5 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.114.2" + implementation "ai.reveng:sdk:3.116.5" } ``` @@ -184,12 +184,6 @@ Class | Method | HTTP request | Description *FunctionsAiDecompilationApi* | [**upsertAiDecompilationRating**](docs/FunctionsAiDecompilationApi.md#upsertAiDecompilationRating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation *FunctionsCoreApi* | [**addFunctionCallee**](docs/FunctionsCoreApi.md#addFunctionCallee) | **POST** /v3/functions/{function_id}/callees | Add a callee to a function *FunctionsCoreApi* | [**addUserStringToFunction**](docs/FunctionsCoreApi.md#addUserStringToFunction) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. -*FunctionsCoreApi* | [**aiUnstrip**](docs/FunctionsCoreApi.md#aiUnstrip) | **POST** /v2/analyses/{analysis_id}/functions/ai-unstrip | Performs matching and auto-unstrip for an analysis and its functions -*FunctionsCoreApi* | [**analysisFunctionMatching**](docs/FunctionsCoreApi.md#analysisFunctionMatching) | **POST** /v2/analyses/{analysis_id}/functions/matches | Perform matching for the functions of an analysis -*FunctionsCoreApi* | [**autoUnstrip**](docs/FunctionsCoreApi.md#autoUnstrip) | **POST** /v2/analyses/{analysis_id}/functions/auto-unstrip | Performs matching and auto-unstrip for an analysis and its functions -*FunctionsCoreApi* | [**batchFunctionMatching**](docs/FunctionsCoreApi.md#batchFunctionMatching) | **POST** /v2/functions/matches | Perform function matching for an arbitrary batch of functions, binaries or collections -*FunctionsCoreApi* | [**cancelAiUnstrip**](docs/FunctionsCoreApi.md#cancelAiUnstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel | Cancels a running ai-unstrip -*FunctionsCoreApi* | [**cancelAutoUnstrip**](docs/FunctionsCoreApi.md#cancelAutoUnstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/unstrip/cancel | Cancels a running auto-unstrip *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 @@ -255,7 +249,6 @@ Class | Method | HTTP request | Description - [AddUserStringToFunctionInputBody](docs/AddUserStringToFunctionInputBody.md) - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) - [AiDecompilationRating](docs/AiDecompilationRating.md) - - [AiUnstripRequest](docs/AiUnstripRequest.md) - [AnalysisAccessInfo](docs/AnalysisAccessInfo.md) - [AnalysisBasicInfoOutputBody](docs/AnalysisBasicInfoOutputBody.md) - [AnalysisBulkAddTagsRequest](docs/AnalysisBulkAddTagsRequest.md) @@ -268,7 +261,6 @@ Class | Method | HTTP request | Description - [AnalysisDetailResponse](docs/AnalysisDetailResponse.md) - [AnalysisFunctionEntry](docs/AnalysisFunctionEntry.md) - [AnalysisFunctionMapping](docs/AnalysisFunctionMapping.md) - - [AnalysisFunctionMatchingRequest](docs/AnalysisFunctionMatchingRequest.md) - [AnalysisFunctions](docs/AnalysisFunctions.md) - [AnalysisFunctionsList](docs/AnalysisFunctionsList.md) - [AnalysisLogMessage](docs/AnalysisLogMessage.md) @@ -300,8 +292,6 @@ Class | Method | HTTP request | Description - [AttemptFailedEvent](docs/AttemptFailedEvent.md) - [AttemptStartedEvent](docs/AttemptStartedEvent.md) - [AutoRunAgents](docs/AutoRunAgents.md) - - [AutoUnstripRequest](docs/AutoUnstripRequest.md) - - [AutoUnstripResponse](docs/AutoUnstripResponse.md) - [AutoUnstripStatusOutputBody](docs/AutoUnstripStatusOutputBody.md) - [BaseResponse](docs/BaseResponse.md) - [BaseResponseAdditionalDetailsStatusResponse](docs/BaseResponseAdditionalDetailsStatusResponse.md) @@ -526,9 +516,6 @@ Class | Method | HTTP request | Description - [FunctionLocalVariableResponse](docs/FunctionLocalVariableResponse.md) - [FunctionMapping](docs/FunctionMapping.md) - [FunctionMatch](docs/FunctionMatch.md) - - [FunctionMatchingFilters](docs/FunctionMatchingFilters.md) - - [FunctionMatchingRequest](docs/FunctionMatchingRequest.md) - - [FunctionMatchingResponse](docs/FunctionMatchingResponse.md) - [FunctionNameHistory](docs/FunctionNameHistory.md) - [FunctionParamResponse](docs/FunctionParamResponse.md) - [FunctionRename](docs/FunctionRename.md) @@ -590,7 +577,6 @@ Class | Method | HTTP request | Description - [MITRETechnique](docs/MITRETechnique.md) - [MatchFilters](docs/MatchFilters.md) - [MatchedFunction](docs/MatchedFunction.md) - - [MatchedFunctionSuggestion](docs/MatchedFunctionSuggestion.md) - [MemdumpEntry](docs/MemdumpEntry.md) - [MessageBody](docs/MessageBody.md) - [MetaModel](docs/MetaModel.md) @@ -748,10 +734,7 @@ Class | Method | HTTP request | Description - [UserProfile](docs/UserProfile.md) - [V2FunctionHeader](docs/V2FunctionHeader.md) - [V2FunctionInfo](docs/V2FunctionInfo.md) - - [V2FunctionMatch](docs/V2FunctionMatch.md) - [V2FunctionType](docs/V2FunctionType.md) - - [V2MatchedFunction](docs/V2MatchedFunction.md) - - [V2NameConfidence](docs/V2NameConfidence.md) - [Vulnerabilities](docs/Vulnerabilities.md) - [Vulnerability](docs/Vulnerability.md) - [WarningEvent](docs/WarningEvent.md) diff --git a/build.gradle b/build.gradle index cbd88e7c..a6fa05d0 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.114.2' +version = '3.116.5' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.114.2") + coordinates("ai.reveng", "sdk", "3.116.5") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 5b8faf0a..0ab4525f 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.114.2", + version := "3.116.5", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AiUnstripRequest.md b/docs/AiUnstripRequest.md deleted file mode 100644 index 612499da..00000000 --- a/docs/AiUnstripRequest.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# AiUnstripRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**apply** | **Boolean** | Whether to apply the suggested function names to the target functions, default is False | [optional] | - - - diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 6614dcf5..1dba6a10 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -1895,7 +1895,7 @@ public class Example { # **v3GetAnalysisStrings** -> ListAnalysisStringsOutputBody v3GetAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder) +> ListAnalysisStringsOutputBody v3GetAnalysisStrings(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder) List strings for an analysis. @@ -1931,11 +1931,12 @@ public class Example { 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). + String searchOperator = "CONTAINS"; // String | How the search term matches string values. String functionSearch = "functionSearch_example"; // String | Filter by function name (case-insensitive substring match). String orderBy = "value"; // String | Field to order results by. String sortOrder = "ASC"; // String | Sort direction. try { - ListAnalysisStringsOutputBody result = apiInstance.v3GetAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder); + ListAnalysisStringsOutputBody result = apiInstance.v3GetAnalysisStrings(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnalysesCoreApi#v3GetAnalysisStrings"); @@ -1956,6 +1957,7 @@ public class Example { | **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] | +| **searchOperator** | **String**| How the search term matches string values. | [optional] [default to CONTAINS] [enum: CONTAINS, STARTS_WITH] | | **functionSearch** | **String**| Filter by function name (case-insensitive substring match). | [optional] | | **orderBy** | **String**| Field to order results by. | [optional] [default to value] [enum: value, length] | | **sortOrder** | **String**| Sort direction. | [optional] [default to ASC] [enum: ASC, DESC] | diff --git a/docs/AnalysisFunctionMatchingRequest.md b/docs/AnalysisFunctionMatchingRequest.md deleted file mode 100644 index d7c6de82..00000000 --- a/docs/AnalysisFunctionMatchingRequest.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# AnalysisFunctionMatchingRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**minSimilarity** | **BigDecimal** | Minimum similarity expected for a match as a percentage, default is 90 | [optional] | -|**filters** | [**FunctionMatchingFilters**](FunctionMatchingFilters.md) | Used to limit the search to specific binaries, collections, and functions | [optional] | -|**resultsPerFunction** | **Integer** | Maximum number of matches to return per function, default is 1, max is 30 | [optional] | -|**page** | **Integer** | Page number for paginated results, default is 1 (first page) | [optional] | -|**pageSize** | **Integer** | Number of functions to return per page, default is 0 (all functions), max is 1000 | [optional] | -|**statusOnly** | **Boolean** | If set to true, only returns the status of the matching operation without the actual results | [optional] | -|**noCache** | **Boolean** | If set to true, forces the system to bypass any cached results and perform a fresh computation | [optional] | -|**useCanonicalNames** | **Boolean** | Whether to use canonical function names during function matching for confidence results, default is False | [optional] | - - - diff --git a/docs/AutoUnstripRequest.md b/docs/AutoUnstripRequest.md deleted file mode 100644 index 0a4160a5..00000000 --- a/docs/AutoUnstripRequest.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# AutoUnstripRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**minSimilarity** | **BigDecimal** | Minimum similarity expected for a match as a percentage, default is 90 | [optional] | -|**apply** | **Boolean** | Whether to apply the matched function names to the target binary, default is False | [optional] | -|**confidenceThreshold** | **BigDecimal** | Confidence threshold for applying function names as a percentage, default is 90 | [optional] | -|**minGroupSize** | **Integer** | Minimum number of matching functions required to consider for a match, default is 10 | [optional] | -|**statusOnly** | **Boolean** | If set to true, only returns the status of the auto-unstrip operation without the actual results | [optional] | -|**noCache** | **Boolean** | If set to true, forces the system to bypass any cached results and perform a fresh computation | [optional] | -|**useCanonicalNames** | **Boolean** | Whether to use canonical function names during matching for auto-unstrip, default is False | [optional] | - - - diff --git a/docs/AutoUnstripResponse.md b/docs/AutoUnstripResponse.md deleted file mode 100644 index e32d97cd..00000000 --- a/docs/AutoUnstripResponse.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# AutoUnstripResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**progress** | **Integer** | Progress of the auto-unstrip operation, represented as a percentage | [optional] | -|**status** | **String** | Status of the function matching operation | [optional] | -|**totalTime** | **Integer** | Total time taken for the auto-unstrip operation in seconds | [optional] | -|**matches** | [**List<MatchedFunctionSuggestion>**](MatchedFunctionSuggestion.md) | Map of function IDs to their matching results with best match information | [optional] | -|**applied** | **Boolean** | Indicates whether the matched function names were applied to the target binary | [optional] | -|**errorMessage** | **String** | Error message if the operation failed | [optional] | - - - diff --git a/docs/CallEdge.md b/docs/CallEdge.md index cf78857f..93635294 100644 --- a/docs/CallEdge.md +++ b/docs/CallEdge.md @@ -13,6 +13,7 @@ |**callerFunctionId** | **Long** | | | |**callerName** | **String** | | [optional] | |**callerVaddr** | **Long** | Entry vaddr of the caller function (joined from function_t). | | +|**importedFunctionId** | **Long** | Imported function ID for an external callee, resolved via the thunk/stub address. | [optional] | |**isExternal** | **Boolean** | | | |**thunkedVaddr** | **Long** | | [optional] | diff --git a/docs/DynamicExecutionStatusResponse.md b/docs/DynamicExecutionStatusResponse.md index 750b4c61..10aa0f37 100644 --- a/docs/DynamicExecutionStatusResponse.md +++ b/docs/DynamicExecutionStatusResponse.md @@ -9,7 +9,20 @@ |------------ | ------------- | ------------- | -------------| |**errorMessage** | **String** | Error detail, set when status is FAILED | [optional] | |**logs** | [**AnalysisLogs**](AnalysisLogs.md) | Sandbox status log messages captured during the run. Contains a single \"No logs available\" message when none have been captured yet. | | -|**status** | **String** | Task status: UNINITIALISED, PENDING, RUNNING, COMPLETED, or FAILED | | +|**status** | [**StatusEnum**](#StatusEnum) | Task status | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/FunctionMatchingFilters.md b/docs/FunctionMatchingFilters.md deleted file mode 100644 index 98f0f2b1..00000000 --- a/docs/FunctionMatchingFilters.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# FunctionMatchingFilters - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**binaryIds** | **List<Integer>** | ID's of binaries to limit the search to, if empty, search all scoped binaries | [optional] | -|**collectionIds** | **List<Integer>** | ID's of collections to limit the search to, if empty, search all scoped collections | [optional] | -|**functionIds** | **List<Long>** | ID's of functions to limit the search to, if empty, search all scoped functions | [optional] | -|**userIds** | **List<Integer>** | ID's of users to limit the search to, if empty, search all scoped users | [optional] | -|**debugTypes** | [**List<DebugTypesEnum>**](#List<DebugTypesEnum>) | Limit the search to specific debug types, if empty, search all scoped debug & non-debug functions | [optional] | - - - -## Enum: List<DebugTypesEnum> - -| Name | Value | -|---- | -----| -| USER | "USER" | -| SYSTEM | "SYSTEM" | -| EXTERNAL | "EXTERNAL" | -| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | - - - diff --git a/docs/FunctionMatchingRequest.md b/docs/FunctionMatchingRequest.md deleted file mode 100644 index ecbe7d7a..00000000 --- a/docs/FunctionMatchingRequest.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# FunctionMatchingRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**modelId** | **Integer** | ID of the model used for function matching, used to determine the embedding model | | -|**functionIds** | **List<Long>** | ID's of functions to find matches for, must be at least one function ID | | -|**minSimilarity** | **BigDecimal** | Minimum similarity expected for a match as a percentage, default is 90 | [optional] | -|**filters** | [**FunctionMatchingFilters**](FunctionMatchingFilters.md) | Used to limit the search to specific binaries, collections, and functions | [optional] | -|**resultsPerFunction** | **Integer** | Maximum number of matches to return per function, default is 1, max is 50 | [optional] | -|**page** | **Integer** | Page number for paginated results, default is 1 (first page) | [optional] | -|**pageSize** | **Integer** | Number of functions to return per page, default is 0 (all functions), max is 1000 | [optional] | -|**statusOnly** | **Boolean** | If set to true, only returns the status of the matching operation without the actual results | [optional] | -|**noCache** | **Boolean** | If set to true, forces the system to bypass any cached results and perform a fresh computation | [optional] | -|**useCanonicalNames** | **Boolean** | Whether to use canonical function names during function matching for confidence results, default is False | [optional] | - - - diff --git a/docs/FunctionMatchingResponse.md b/docs/FunctionMatchingResponse.md deleted file mode 100644 index 6b78b1e4..00000000 --- a/docs/FunctionMatchingResponse.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# FunctionMatchingResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**progress** | **Integer** | Progress of the matching operation, represented as a percentage | [optional] | -|**status** | **String** | Status of the function matching operation | [optional] | -|**totalTime** | **Integer** | Total time taken for the matching operation in seconds | [optional] | -|**errorMessage** | **String** | Optional message providing additional information about the operation | [optional] | -|**currentPage** | **Integer** | Current page number of the results, if pagination is used | [optional] | -|**totalPages** | **Integer** | Total number of pages available, if pagination is used | [optional] | -|**matches** | [**List<V2FunctionMatch>**](V2FunctionMatch.md) | List of function matching results with best match information | [optional] | -|**numMatches** | **Integer** | Total number of function matches found | [optional] | -|**numDebugMatches** | **Integer** | Total number of debug function matches found | [optional] | -|**updatedAt** | **String** | Timestamp of the last time function matching with the same request parameters was performed | [optional] | - - - diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index dd24a5eb..c767d026 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -6,12 +6,6 @@ All URIs are relative to *https://api.reveng.ai* |------------- | ------------- | -------------| | [**addFunctionCallee**](FunctionsCoreApi.md#addFunctionCallee) | **POST** /v3/functions/{function_id}/callees | Add a callee to a function | | [**addUserStringToFunction**](FunctionsCoreApi.md#addUserStringToFunction) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. | -| [**aiUnstrip**](FunctionsCoreApi.md#aiUnstrip) | **POST** /v2/analyses/{analysis_id}/functions/ai-unstrip | Performs matching and auto-unstrip for an analysis and its functions | -| [**analysisFunctionMatching**](FunctionsCoreApi.md#analysisFunctionMatching) | **POST** /v2/analyses/{analysis_id}/functions/matches | Perform matching for the functions of an analysis | -| [**autoUnstrip**](FunctionsCoreApi.md#autoUnstrip) | **POST** /v2/analyses/{analysis_id}/functions/auto-unstrip | Performs matching and auto-unstrip for an analysis and its functions | -| [**batchFunctionMatching**](FunctionsCoreApi.md#batchFunctionMatching) | **POST** /v2/functions/matches | Perform function matching for an arbitrary batch of functions, binaries or collections | -| [**cancelAiUnstrip**](FunctionsCoreApi.md#cancelAiUnstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel | Cancels a running ai-unstrip | -| [**cancelAutoUnstrip**](FunctionsCoreApi.md#cancelAutoUnstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/unstrip/cancel | Cancels a running auto-unstrip | | [**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 | @@ -195,456 +189,6 @@ public class Example { | **422** | Unprocessable Entity | - | | **500** | Internal Server Error | - | - -# **aiUnstrip** -> AutoUnstripResponse aiUnstrip(analysisId, aiUnstripRequest) - -Performs matching and auto-unstrip for an analysis and its functions - -Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - AiUnstripRequest aiUnstripRequest = new AiUnstripRequest(); // AiUnstripRequest | - try { - AutoUnstripResponse result = apiInstance.aiUnstrip(analysisId, aiUnstripRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#aiUnstrip"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | -| **aiUnstripRequest** | [**AiUnstripRequest**](AiUnstripRequest.md)| | | - -### Return type - -[**AutoUnstripResponse**](AutoUnstripResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **analysisFunctionMatching** -> FunctionMatchingResponse analysisFunctionMatching(analysisId, analysisFunctionMatchingRequest) - -Perform matching for the functions of an analysis - -Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest = new AnalysisFunctionMatchingRequest(); // AnalysisFunctionMatchingRequest | - try { - FunctionMatchingResponse result = apiInstance.analysisFunctionMatching(analysisId, analysisFunctionMatchingRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#analysisFunctionMatching"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | -| **analysisFunctionMatchingRequest** | [**AnalysisFunctionMatchingRequest**](AnalysisFunctionMatchingRequest.md)| | | - -### Return type - -[**FunctionMatchingResponse**](FunctionMatchingResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **autoUnstrip** -> AutoUnstripResponse autoUnstrip(analysisId, autoUnstripRequest) - -Performs matching and auto-unstrip for an analysis and its functions - -Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - AutoUnstripRequest autoUnstripRequest = new AutoUnstripRequest(); // AutoUnstripRequest | - try { - AutoUnstripResponse result = apiInstance.autoUnstrip(analysisId, autoUnstripRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#autoUnstrip"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | -| **autoUnstripRequest** | [**AutoUnstripRequest**](AutoUnstripRequest.md)| | | - -### Return type - -[**AutoUnstripResponse**](AutoUnstripResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **batchFunctionMatching** -> FunctionMatchingResponse batchFunctionMatching(functionMatchingRequest) - -Perform function matching for an arbitrary batch of functions, binaries or collections - -Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - FunctionMatchingRequest functionMatchingRequest = new FunctionMatchingRequest(); // FunctionMatchingRequest | - try { - FunctionMatchingResponse result = apiInstance.batchFunctionMatching(functionMatchingRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#batchFunctionMatching"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **functionMatchingRequest** | [**FunctionMatchingRequest**](FunctionMatchingRequest.md)| | | - -### Return type - -[**FunctionMatchingResponse**](FunctionMatchingResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **cancelAiUnstrip** -> AutoUnstripResponse cancelAiUnstrip(analysisId) - -Cancels a running ai-unstrip - -Takes in the analysis ID and cancels a running ai-unstrip operation - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - AutoUnstripResponse result = apiInstance.cancelAiUnstrip(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#cancelAiUnstrip"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | - -### Return type - -[**AutoUnstripResponse**](AutoUnstripResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - - -# **cancelAutoUnstrip** -> AutoUnstripResponse cancelAutoUnstrip(analysisId) - -Cancels a running auto-unstrip - -Takes in the analysis ID and cancels a running auto-unstrip operation - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.FunctionsCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - FunctionsCoreApi apiInstance = new FunctionsCoreApi(defaultClient); - Integer analysisId = 56; // Integer | - try { - AutoUnstripResponse result = apiInstance.cancelAutoUnstrip(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FunctionsCoreApi#cancelAutoUnstrip"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | - -### Return type - -[**AutoUnstripResponse**](AutoUnstripResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Successful Response | - | -| **422** | Invalid request parameters | - | - # **getAnalysisStrings** > BaseResponseAnalysisStringsResponse getAnalysisStrings(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder) diff --git a/docs/GetAnalysisStringsStatusOutputBody.md b/docs/GetAnalysisStringsStatusOutputBody.md index 5bd4a582..8f509168 100644 --- a/docs/GetAnalysisStringsStatusOutputBody.md +++ b/docs/GetAnalysisStringsStatusOutputBody.md @@ -7,7 +7,20 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**status** | **String** | | | +|**status** | [**StatusEnum**](#StatusEnum) | String-extraction task status | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UNINITIALISED | "UNINITIALISED" | +| PENDING | "PENDING" | +| RUNNING | "RUNNING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/MatchedFunctionSuggestion.md b/docs/MatchedFunctionSuggestion.md deleted file mode 100644 index 2e3e87b9..00000000 --- a/docs/MatchedFunctionSuggestion.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# MatchedFunctionSuggestion - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | Unique identifier of the matched function | | -|**functionVaddr** | **Long** | Virtual address of the matched function | | -|**suggestedName** | **String** | Mangled name of the function group that contains the matched functions | [optional] | -|**suggestedDemangledName** | **String** | De-mangled name of the function group that contains the matched functions | | - - - diff --git a/docs/V2FunctionMatch.md b/docs/V2FunctionMatch.md deleted file mode 100644 index 17ee5dbb..00000000 --- a/docs/V2FunctionMatch.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# V2FunctionMatch - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | Unique identifier of the function | | -|**matchedFunctions** | [**List<V2MatchedFunction>**](V2MatchedFunction.md) | | | -|**confidences** | [**List<V2NameConfidence>**](V2NameConfidence.md) | | [optional] | - - - diff --git a/docs/V2MatchedFunction.md b/docs/V2MatchedFunction.md deleted file mode 100644 index a9beb746..00000000 --- a/docs/V2MatchedFunction.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# V2MatchedFunction - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**functionId** | **Long** | Unique identifier of the matched function | | -|**binaryId** | **Integer** | | | -|**functionName** | **String** | | | -|**functionVaddr** | **Long** | | | -|**mangledName** | **String** | | | -|**debug** | **Boolean** | | | -|**binaryName** | **String** | | | -|**sha256Hash** | **String** | | | -|**analysisId** | **Integer** | | | -|**similarity** | **BigDecimal** | | [optional] | -|**confidence** | **BigDecimal** | | [optional] | - - - diff --git a/docs/V2NameConfidence.md b/docs/V2NameConfidence.md deleted file mode 100644 index 9f02731f..00000000 --- a/docs/V2NameConfidence.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# V2NameConfidence - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**name** | **String** | The suggested function name | | -|**confidence** | **BigDecimal** | Confidence score as a percentage | | - - - diff --git a/pom.xml b/pom.xml index 922d6a76..bbd281f5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.114.2 + 3.116.5 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 b1ad7033..b9735323 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -3633,6 +3633,7 @@ public okhttp3.Call v3GetAnalysisAutoUnstripStatusAsync(@javax.annotation.Nonnul * @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 searchOperator How the search term matches string values. (optional, default to CONTAINS) * @param functionSearch Filter by function name (case-insensitive substring match). (optional) * @param orderBy Field to order results by. (optional, default to value) * @param sortOrder Sort direction. (optional, default to ASC) @@ -3650,7 +3651,7 @@ public okhttp3.Call v3GetAnalysisAutoUnstripStatusAsync(@javax.annotation.Nonnul 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3688,6 +3689,10 @@ public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long anal localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); } + if (searchOperator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_operator", searchOperator)); + } + if (functionSearch != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("function_search", functionSearch)); } @@ -3720,13 +3725,13 @@ public okhttp3.Call v3GetAnalysisStringsCall(@javax.annotation.Nonnull Long anal } @SuppressWarnings("rawtypes") - private okhttp3.Call v3GetAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + private okhttp3.Call v3GetAnalysisStringsValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { // verify the required parameter 'analysisId' is set if (analysisId == null) { throw new ApiException("Missing the required parameter 'analysisId' when calling v3GetAnalysisStrings(Async)"); } - return v3GetAnalysisStringsCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); + return v3GetAnalysisStringsCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, _callback); } @@ -3737,6 +3742,7 @@ private okhttp3.Call v3GetAnalysisStringsValidateBeforeCall(@javax.annotation.No * @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 searchOperator How the search term matches string values. (optional, default to CONTAINS) * @param functionSearch Filter by function name (case-insensitive substring match). (optional) * @param orderBy Field to order results by. (optional, default to value) * @param sortOrder Sort direction. (optional, default to ASC) @@ -3753,8 +3759,8 @@ private okhttp3.Call v3GetAnalysisStringsValidateBeforeCall(@javax.annotation.No 500 Internal Server Error - */ - public ListAnalysisStringsOutputBody v3GetAnalysisStrings(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { - ApiResponse localVarResp = v3GetAnalysisStringsWithHttpInfo(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder); + public ListAnalysisStringsOutputBody v3GetAnalysisStrings(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { + ApiResponse localVarResp = v3GetAnalysisStringsWithHttpInfo(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder); return localVarResp.getData(); } @@ -3765,6 +3771,7 @@ public ListAnalysisStringsOutputBody v3GetAnalysisStrings(@javax.annotation.Nonn * @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 searchOperator How the search term matches string values. (optional, default to CONTAINS) * @param functionSearch Filter by function name (case-insensitive substring match). (optional) * @param orderBy Field to order results by. (optional, default to value) * @param sortOrder Sort direction. (optional, default to ASC) @@ -3781,8 +3788,8 @@ public ListAnalysisStringsOutputBody v3GetAnalysisStrings(@javax.annotation.Nonn 500 Internal Server Error - */ - public ApiResponse v3GetAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, null); + public ApiResponse v3GetAnalysisStringsWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder) throws ApiException { + okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -3794,6 +3801,7 @@ public ApiResponse v3GetAnalysisStringsWithHttpIn * @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 searchOperator How the search term matches string values. (optional, default to CONTAINS) * @param functionSearch Filter by function name (case-insensitive substring match). (optional) * @param orderBy Field to order results by. (optional, default to value) * @param sortOrder Sort direction. (optional, default to ASC) @@ -3811,9 +3819,9 @@ public ApiResponse v3GetAnalysisStringsWithHttpIn 500 Internal Server Error - */ - public okhttp3.Call v3GetAnalysisStringsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { + public okhttp3.Call v3GetAnalysisStringsAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nullable Long page, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable String search, @javax.annotation.Nullable String searchOperator, @javax.annotation.Nullable String functionSearch, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String sortOrder, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, functionSearch, orderBy, sortOrder, _callback); + okhttp3.Call localVarCall = v3GetAnalysisStringsValidateBeforeCall(analysisId, page, pageSize, search, searchOperator, functionSearch, orderBy, sortOrder, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/ai/reveng/api/FunctionsCoreApi.java b/src/main/java/ai/reveng/api/FunctionsCoreApi.java index ab0be0ac..fa15ebe8 100644 --- a/src/main/java/ai/reveng/api/FunctionsCoreApi.java +++ b/src/main/java/ai/reveng/api/FunctionsCoreApi.java @@ -29,10 +29,6 @@ import ai.reveng.model.APIError; import ai.reveng.model.AddCalleeInputBody; import ai.reveng.model.AddUserStringToFunctionInputBody; -import ai.reveng.model.AiUnstripRequest; -import ai.reveng.model.AnalysisFunctionMatchingRequest; -import ai.reveng.model.AutoUnstripRequest; -import ai.reveng.model.AutoUnstripResponse; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseAnalysisStringsResponse; import ai.reveng.model.BaseResponseAnalysisStringsStatusResponse; @@ -48,8 +44,6 @@ 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.ImportedFunctionDetailOutputBody; @@ -413,876 +407,6 @@ public okhttp3.Call addUserStringToFunctionAsync(@javax.annotation.Nonnull Long localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for aiUnstrip - * @param analysisId (required) - * @param aiUnstripRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call aiUnstripCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AiUnstripRequest aiUnstripRequest, 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 = aiUnstripRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions/ai-unstrip" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @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 - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling aiUnstrip(Async)"); - } - - // verify the required parameter 'aiUnstripRequest' is set - if (aiUnstripRequest == null) { - throw new ApiException("Missing the required parameter 'aiUnstripRequest' when calling aiUnstrip(Async)"); - } - - return aiUnstripCall(analysisId, aiUnstripRequest, _callback); - - } - - /** - * Performs matching and auto-unstrip for an analysis and its functions - * Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system - * @param analysisId (required) - * @param aiUnstripRequest (required) - * @return AutoUnstripResponse - * @throws ApiException If fail to 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 AutoUnstripResponse aiUnstrip(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AiUnstripRequest aiUnstripRequest) throws ApiException { - ApiResponse localVarResp = aiUnstripWithHttpInfo(analysisId, aiUnstripRequest); - return localVarResp.getData(); - } - - /** - * Performs matching and auto-unstrip for an analysis and its functions - * Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system - * @param analysisId (required) - * @param aiUnstripRequest (required) - * @return ApiResponse<AutoUnstripResponse> - * @throws ApiException If fail to 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 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(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Performs matching and auto-unstrip for an analysis and its functions (asynchronously) - * Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system - * @param analysisId (required) - * @param aiUnstripRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call aiUnstripAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AiUnstripRequest aiUnstripRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = aiUnstripValidateBeforeCall(analysisId, aiUnstripRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for analysisFunctionMatching - * @param analysisId (required) - * @param analysisFunctionMatchingRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call analysisFunctionMatchingCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest, 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 = analysisFunctionMatchingRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions/matches" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @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 - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling analysisFunctionMatching(Async)"); - } - - // verify the required parameter 'analysisFunctionMatchingRequest' is set - if (analysisFunctionMatchingRequest == null) { - throw new ApiException("Missing the required parameter 'analysisFunctionMatchingRequest' when calling analysisFunctionMatching(Async)"); - } - - return analysisFunctionMatchingCall(analysisId, analysisFunctionMatchingRequest, _callback); - - } - - /** - * Perform matching for the functions of an analysis - * Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids - * @param analysisId (required) - * @param analysisFunctionMatchingRequest (required) - * @return FunctionMatchingResponse - * @throws ApiException If fail to 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 FunctionMatchingResponse analysisFunctionMatching(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest) throws ApiException { - ApiResponse localVarResp = analysisFunctionMatchingWithHttpInfo(analysisId, analysisFunctionMatchingRequest); - return localVarResp.getData(); - } - - /** - * Perform matching for the functions of an analysis - * Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids - * @param analysisId (required) - * @param analysisFunctionMatchingRequest (required) - * @return ApiResponse<FunctionMatchingResponse> - * @throws ApiException If fail to 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 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(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Perform matching for the functions of an analysis (asynchronously) - * Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids - * @param analysisId (required) - * @param analysisFunctionMatchingRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call analysisFunctionMatchingAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = analysisFunctionMatchingValidateBeforeCall(analysisId, analysisFunctionMatchingRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for autoUnstrip - * @param analysisId (required) - * @param autoUnstripRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call autoUnstripCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AutoUnstripRequest autoUnstripRequest, 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 = autoUnstripRequest; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions/auto-unstrip" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @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 - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling autoUnstrip(Async)"); - } - - // verify the required parameter 'autoUnstripRequest' is set - if (autoUnstripRequest == null) { - throw new ApiException("Missing the required parameter 'autoUnstripRequest' when calling autoUnstrip(Async)"); - } - - return autoUnstripCall(analysisId, autoUnstripRequest, _callback); - - } - - /** - * Performs matching and auto-unstrip for an analysis and its functions - * Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system - * @param analysisId (required) - * @param autoUnstripRequest (required) - * @return AutoUnstripResponse - * @throws ApiException If fail to 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 AutoUnstripResponse autoUnstrip(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AutoUnstripRequest autoUnstripRequest) throws ApiException { - ApiResponse localVarResp = autoUnstripWithHttpInfo(analysisId, autoUnstripRequest); - return localVarResp.getData(); - } - - /** - * Performs matching and auto-unstrip for an analysis and its functions - * Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system - * @param analysisId (required) - * @param autoUnstripRequest (required) - * @return ApiResponse<AutoUnstripResponse> - * @throws ApiException If fail to 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 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(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Performs matching and auto-unstrip for an analysis and its functions (asynchronously) - * Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system - * @param analysisId (required) - * @param autoUnstripRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call autoUnstripAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull AutoUnstripRequest autoUnstripRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = autoUnstripValidateBeforeCall(analysisId, autoUnstripRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for batchFunctionMatching - * @param functionMatchingRequest (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call batchFunctionMatchingCall(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest, 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 = functionMatchingRequest; - - // create path and map variables - String localVarPath = "/v2/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", "bearerAuth" }; - 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 - if (functionMatchingRequest == null) { - throw new ApiException("Missing the required parameter 'functionMatchingRequest' when calling batchFunctionMatching(Async)"); - } - - return batchFunctionMatchingCall(functionMatchingRequest, _callback); - - } - - /** - * Perform function matching for an arbitrary batch of functions, binaries or collections - * Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system - * @param functionMatchingRequest (required) - * @return FunctionMatchingResponse - * @throws ApiException If fail to 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 FunctionMatchingResponse batchFunctionMatching(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest) throws ApiException { - ApiResponse localVarResp = batchFunctionMatchingWithHttpInfo(functionMatchingRequest); - return localVarResp.getData(); - } - - /** - * Perform function matching for an arbitrary batch of functions, binaries or collections - * Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system - * @param functionMatchingRequest (required) - * @return ApiResponse<FunctionMatchingResponse> - * @throws ApiException If fail to 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 batchFunctionMatchingWithHttpInfo(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest) throws ApiException { - okhttp3.Call localVarCall = batchFunctionMatchingValidateBeforeCall(functionMatchingRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Perform function matching for an arbitrary batch of functions, binaries or collections (asynchronously) - * Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system - * @param functionMatchingRequest (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call batchFunctionMatchingAsync(@javax.annotation.Nonnull FunctionMatchingRequest functionMatchingRequest, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = batchFunctionMatchingValidateBeforeCall(functionMatchingRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for cancelAiUnstrip - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call cancelAiUnstripCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions/ai-unstrip/cancel" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call cancelAiUnstripValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling cancelAiUnstrip(Async)"); - } - - return cancelAiUnstripCall(analysisId, _callback); - - } - - /** - * Cancels a running ai-unstrip - * Takes in the analysis ID and cancels a running ai-unstrip operation - * @param analysisId (required) - * @return AutoUnstripResponse - * @throws ApiException If fail to 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 AutoUnstripResponse cancelAiUnstrip(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = cancelAiUnstripWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Cancels a running ai-unstrip - * Takes in the analysis ID and cancels a running ai-unstrip operation - * @param analysisId (required) - * @return ApiResponse<AutoUnstripResponse> - * @throws ApiException If fail to 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 cancelAiUnstripWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = cancelAiUnstripValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Cancels a running ai-unstrip (asynchronously) - * Takes in the analysis ID and cancels a running ai-unstrip operation - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call cancelAiUnstripAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = cancelAiUnstripValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for cancelAutoUnstrip - * @param analysisId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call cancelAutoUnstripCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions/unstrip/cancel" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call cancelAutoUnstripValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling cancelAutoUnstrip(Async)"); - } - - return cancelAutoUnstripCall(analysisId, _callback); - - } - - /** - * Cancels a running auto-unstrip - * Takes in the analysis ID and cancels a running auto-unstrip operation - * @param analysisId (required) - * @return AutoUnstripResponse - * @throws ApiException If fail to 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 AutoUnstripResponse cancelAutoUnstrip(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - ApiResponse localVarResp = cancelAutoUnstripWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Cancels a running auto-unstrip - * Takes in the analysis ID and cancels a running auto-unstrip operation - * @param analysisId (required) - * @return ApiResponse<AutoUnstripResponse> - * @throws ApiException If fail to 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 cancelAutoUnstripWithHttpInfo(@javax.annotation.Nonnull Integer analysisId) throws ApiException { - okhttp3.Call localVarCall = cancelAutoUnstripValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Cancels a running auto-unstrip (asynchronously) - * Takes in the analysis ID and cancels a running auto-unstrip operation - * @param analysisId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- * @deprecated - */ - @Deprecated - public okhttp3.Call cancelAutoUnstripAsync(@javax.annotation.Nonnull Integer analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = cancelAutoUnstripValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getAnalysisStrings * @param analysisId (required) diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 9691a750..25ea164e 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -148,7 +148,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/3.114.2/java"); + setUserAgent("OpenAPI-Generator/3.116.5/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 e7a9eb4b..f8c4b49f 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.114.2"; + public static final String VERSION = "3.116.5"; 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 19e060ab..e9091ab7 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -109,7 +109,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AddUserStringToFunctionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AdditionalDetailsStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AiUnstripRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisAccessInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBasicInfoOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisBulkAddTagsRequest.CustomTypeAdapterFactory()); @@ -122,7 +121,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisFunctionsList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AnalysisLogMessage.CustomTypeAdapterFactory()); @@ -151,8 +149,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AttemptFailedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AttemptStartedEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoRunAgents.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoUnstripRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoUnstripResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.AutoUnstripStatusOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BaseResponseAdditionalDetailsStatusResponse.CustomTypeAdapterFactory()); @@ -371,9 +367,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionLocalVariableResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMapping.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMatch.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMatchingFilters.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMatchingRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMatchingResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionNameHistory.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionParamResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionRename.CustomTypeAdapterFactory()); @@ -433,7 +426,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MessageBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MetaModel.CustomTypeAdapterFactory()); @@ -582,10 +574,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UserProfile.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2FunctionHeader.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2FunctionInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2FunctionMatch.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2FunctionType.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2MatchedFunction.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.V2NameConfidence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Vulnerabilities.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Vulnerability.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.WarningEvent.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/AiUnstripRequest.java b/src/main/java/ai/reveng/model/AiUnstripRequest.java deleted file mode 100644 index 1db12cfc..00000000 --- a/src/main/java/ai/reveng/model/AiUnstripRequest.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AiUnstripRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AiUnstripRequest { - public static final String SERIALIZED_NAME_APPLY = "apply"; - @SerializedName(SERIALIZED_NAME_APPLY) - @javax.annotation.Nullable - private Boolean apply = false; - - public AiUnstripRequest() { - } - - public AiUnstripRequest apply(@javax.annotation.Nullable Boolean apply) { - this.apply = apply; - return this; - } - - /** - * Whether to apply the suggested function names to the target functions, default is False - * @return apply - */ - @javax.annotation.Nullable - public Boolean getApply() { - return apply; - } - - public void setApply(@javax.annotation.Nullable Boolean apply) { - this.apply = apply; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AiUnstripRequest instance itself - */ - public AiUnstripRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AiUnstripRequest aiUnstripRequest = (AiUnstripRequest) o; - return Objects.equals(this.apply, aiUnstripRequest.apply)&& - Objects.equals(this.additionalProperties, aiUnstripRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(apply, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AiUnstripRequest {\n"); - sb.append(" apply: ").append(toIndentedString(apply)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("apply")); - - // 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 AiUnstripRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AiUnstripRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AiUnstripRequest is not found in the empty JSON string", AiUnstripRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AiUnstripRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AiUnstripRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AiUnstripRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AiUnstripRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AiUnstripRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AiUnstripRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AiUnstripRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of AiUnstripRequest - * @throws IOException if the JSON string is invalid with respect to AiUnstripRequest - */ - public static AiUnstripRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AiUnstripRequest.class); - } - - /** - * Convert an instance of AiUnstripRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java b/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java deleted file mode 100644 index 99053559..00000000 --- a/src/main/java/ai/reveng/model/AnalysisFunctionMatchingRequest.java +++ /dev/null @@ -1,501 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import ai.reveng.model.FunctionMatchingFilters; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; -import 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; - -/** - * AnalysisFunctionMatchingRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AnalysisFunctionMatchingRequest { - public static final String SERIALIZED_NAME_MIN_SIMILARITY = "min_similarity"; - @SerializedName(SERIALIZED_NAME_MIN_SIMILARITY) - @javax.annotation.Nullable - private BigDecimal minSimilarity = new BigDecimal("90"); - - public static final String SERIALIZED_NAME_FILTERS = "filters"; - @SerializedName(SERIALIZED_NAME_FILTERS) - @javax.annotation.Nullable - private FunctionMatchingFilters filters; - - public static final String SERIALIZED_NAME_RESULTS_PER_FUNCTION = "results_per_function"; - @SerializedName(SERIALIZED_NAME_RESULTS_PER_FUNCTION) - @javax.annotation.Nullable - private Integer resultsPerFunction = 1; - - public static final String SERIALIZED_NAME_PAGE = "page"; - @Deprecated - @SerializedName(SERIALIZED_NAME_PAGE) - @javax.annotation.Nullable - private Integer page = 1; - - public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; - @Deprecated - @SerializedName(SERIALIZED_NAME_PAGE_SIZE) - @javax.annotation.Nullable - private Integer pageSize = 0; - - public static final String SERIALIZED_NAME_STATUS_ONLY = "status_only"; - @Deprecated - @SerializedName(SERIALIZED_NAME_STATUS_ONLY) - @javax.annotation.Nullable - private Boolean statusOnly = false; - - public static final String SERIALIZED_NAME_NO_CACHE = "no_cache"; - @SerializedName(SERIALIZED_NAME_NO_CACHE) - @javax.annotation.Nullable - private Boolean noCache = false; - - public static final String SERIALIZED_NAME_USE_CANONICAL_NAMES = "use_canonical_names"; - @SerializedName(SERIALIZED_NAME_USE_CANONICAL_NAMES) - @javax.annotation.Nullable - private Boolean useCanonicalNames = false; - - public AnalysisFunctionMatchingRequest() { - } - - public AnalysisFunctionMatchingRequest minSimilarity(@javax.annotation.Nullable BigDecimal minSimilarity) { - this.minSimilarity = minSimilarity; - return this; - } - - /** - * Minimum similarity expected for a match as a percentage, default is 90 - * minimum: 0 - * maximum: 100 - * @return minSimilarity - */ - @javax.annotation.Nullable - public BigDecimal getMinSimilarity() { - return minSimilarity; - } - - public void setMinSimilarity(@javax.annotation.Nullable BigDecimal minSimilarity) { - this.minSimilarity = minSimilarity; - } - - - public AnalysisFunctionMatchingRequest filters(@javax.annotation.Nullable FunctionMatchingFilters filters) { - this.filters = filters; - return this; - } - - /** - * Used to limit the search to specific binaries, collections, and functions - * @return filters - */ - @javax.annotation.Nullable - public FunctionMatchingFilters getFilters() { - return filters; - } - - public void setFilters(@javax.annotation.Nullable FunctionMatchingFilters filters) { - this.filters = filters; - } - - - public AnalysisFunctionMatchingRequest resultsPerFunction(@javax.annotation.Nullable Integer resultsPerFunction) { - this.resultsPerFunction = resultsPerFunction; - return this; - } - - /** - * Maximum number of matches to return per function, default is 1, max is 30 - * minimum: 1 - * maximum: 30 - * @return resultsPerFunction - */ - @javax.annotation.Nullable - public Integer getResultsPerFunction() { - return resultsPerFunction; - } - - public void setResultsPerFunction(@javax.annotation.Nullable Integer resultsPerFunction) { - this.resultsPerFunction = resultsPerFunction; - } - - - @Deprecated - public AnalysisFunctionMatchingRequest page(@javax.annotation.Nullable Integer page) { - this.page = page; - return this; - } - - /** - * Page number for paginated results, default is 1 (first page) - * minimum: 1 - * @return page - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - @Deprecated - public void setPage(@javax.annotation.Nullable Integer page) { - this.page = page; - } - - - @Deprecated - public AnalysisFunctionMatchingRequest pageSize(@javax.annotation.Nullable Integer pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Number of functions to return per page, default is 0 (all functions), max is 1000 - * minimum: 0 - * maximum: 1000 - * @return pageSize - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Integer getPageSize() { - return pageSize; - } - - @Deprecated - public void setPageSize(@javax.annotation.Nullable Integer pageSize) { - this.pageSize = pageSize; - } - - - @Deprecated - public AnalysisFunctionMatchingRequest statusOnly(@javax.annotation.Nullable Boolean statusOnly) { - this.statusOnly = statusOnly; - return this; - } - - /** - * If set to true, only returns the status of the matching operation without the actual results - * @return statusOnly - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Boolean getStatusOnly() { - return statusOnly; - } - - @Deprecated - public void setStatusOnly(@javax.annotation.Nullable Boolean statusOnly) { - this.statusOnly = statusOnly; - } - - - public AnalysisFunctionMatchingRequest noCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - return this; - } - - /** - * If set to true, forces the system to bypass any cached results and perform a fresh computation - * @return noCache - */ - @javax.annotation.Nullable - public Boolean getNoCache() { - return noCache; - } - - public void setNoCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - } - - - public AnalysisFunctionMatchingRequest useCanonicalNames(@javax.annotation.Nullable Boolean useCanonicalNames) { - this.useCanonicalNames = useCanonicalNames; - return this; - } - - /** - * Whether to use canonical function names during function matching for confidence results, default is False - * @return useCanonicalNames - */ - @javax.annotation.Nullable - public Boolean getUseCanonicalNames() { - return useCanonicalNames; - } - - public void setUseCanonicalNames(@javax.annotation.Nullable Boolean useCanonicalNames) { - this.useCanonicalNames = useCanonicalNames; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AnalysisFunctionMatchingRequest instance itself - */ - public AnalysisFunctionMatchingRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AnalysisFunctionMatchingRequest analysisFunctionMatchingRequest = (AnalysisFunctionMatchingRequest) o; - return Objects.equals(this.minSimilarity, analysisFunctionMatchingRequest.minSimilarity) && - Objects.equals(this.filters, analysisFunctionMatchingRequest.filters) && - Objects.equals(this.resultsPerFunction, analysisFunctionMatchingRequest.resultsPerFunction) && - Objects.equals(this.page, analysisFunctionMatchingRequest.page) && - Objects.equals(this.pageSize, analysisFunctionMatchingRequest.pageSize) && - Objects.equals(this.statusOnly, analysisFunctionMatchingRequest.statusOnly) && - Objects.equals(this.noCache, analysisFunctionMatchingRequest.noCache) && - Objects.equals(this.useCanonicalNames, analysisFunctionMatchingRequest.useCanonicalNames)&& - Objects.equals(this.additionalProperties, analysisFunctionMatchingRequest.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(minSimilarity, filters, resultsPerFunction, page, pageSize, statusOnly, noCache, useCanonicalNames, 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 AnalysisFunctionMatchingRequest {\n"); - sb.append(" minSimilarity: ").append(toIndentedString(minSimilarity)).append("\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb.append(" resultsPerFunction: ").append(toIndentedString(resultsPerFunction)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); - sb.append(" statusOnly: ").append(toIndentedString(statusOnly)).append("\n"); - sb.append(" noCache: ").append(toIndentedString(noCache)).append("\n"); - sb.append(" useCanonicalNames: ").append(toIndentedString(useCanonicalNames)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("min_similarity", "filters", "results_per_function", "page", "page_size", "status_only", "no_cache", "use_canonical_names")); - - // 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 AnalysisFunctionMatchingRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AnalysisFunctionMatchingRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AnalysisFunctionMatchingRequest is not found in the empty JSON string", AnalysisFunctionMatchingRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `filters` - if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { - FunctionMatchingFilters.validateJsonElement(jsonObj.get("filters")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AnalysisFunctionMatchingRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AnalysisFunctionMatchingRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AnalysisFunctionMatchingRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AnalysisFunctionMatchingRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AnalysisFunctionMatchingRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AnalysisFunctionMatchingRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AnalysisFunctionMatchingRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnalysisFunctionMatchingRequest - * @throws IOException if the JSON string is invalid with respect to AnalysisFunctionMatchingRequest - */ - public static AnalysisFunctionMatchingRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AnalysisFunctionMatchingRequest.class); - } - - /** - * Convert an instance of AnalysisFunctionMatchingRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AutoUnstripRequest.java b/src/main/java/ai/reveng/model/AutoUnstripRequest.java deleted file mode 100644 index e324a7d2..00000000 --- a/src/main/java/ai/reveng/model/AutoUnstripRequest.java +++ /dev/null @@ -1,472 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * AutoUnstripRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AutoUnstripRequest { - public static final String SERIALIZED_NAME_MIN_SIMILARITY = "min_similarity"; - @Deprecated - @SerializedName(SERIALIZED_NAME_MIN_SIMILARITY) - @javax.annotation.Nullable - private BigDecimal minSimilarity = new BigDecimal("90"); - - public static final String SERIALIZED_NAME_APPLY = "apply"; - @Deprecated - @SerializedName(SERIALIZED_NAME_APPLY) - @javax.annotation.Nullable - private Boolean apply = false; - - public static final String SERIALIZED_NAME_CONFIDENCE_THRESHOLD = "confidence_threshold"; - @Deprecated - @SerializedName(SERIALIZED_NAME_CONFIDENCE_THRESHOLD) - @javax.annotation.Nullable - private BigDecimal confidenceThreshold = new BigDecimal("90"); - - public static final String SERIALIZED_NAME_MIN_GROUP_SIZE = "min_group_size"; - @Deprecated - @SerializedName(SERIALIZED_NAME_MIN_GROUP_SIZE) - @javax.annotation.Nullable - private Integer minGroupSize = 10; - - public static final String SERIALIZED_NAME_STATUS_ONLY = "status_only"; - @Deprecated - @SerializedName(SERIALIZED_NAME_STATUS_ONLY) - @javax.annotation.Nullable - private Boolean statusOnly = false; - - public static final String SERIALIZED_NAME_NO_CACHE = "no_cache"; - @Deprecated - @SerializedName(SERIALIZED_NAME_NO_CACHE) - @javax.annotation.Nullable - private Boolean noCache = false; - - public static final String SERIALIZED_NAME_USE_CANONICAL_NAMES = "use_canonical_names"; - @SerializedName(SERIALIZED_NAME_USE_CANONICAL_NAMES) - @javax.annotation.Nullable - private Boolean useCanonicalNames = false; - - public AutoUnstripRequest() { - } - - @Deprecated - public AutoUnstripRequest minSimilarity(@javax.annotation.Nullable BigDecimal minSimilarity) { - this.minSimilarity = minSimilarity; - return this; - } - - /** - * Minimum similarity expected for a match as a percentage, default is 90 - * minimum: 0 - * maximum: 100 - * @return minSimilarity - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public BigDecimal getMinSimilarity() { - return minSimilarity; - } - - @Deprecated - public void setMinSimilarity(@javax.annotation.Nullable BigDecimal minSimilarity) { - this.minSimilarity = minSimilarity; - } - - - @Deprecated - public AutoUnstripRequest apply(@javax.annotation.Nullable Boolean apply) { - this.apply = apply; - return this; - } - - /** - * Whether to apply the matched function names to the target binary, default is False - * @return apply - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Boolean getApply() { - return apply; - } - - @Deprecated - public void setApply(@javax.annotation.Nullable Boolean apply) { - this.apply = apply; - } - - - @Deprecated - public AutoUnstripRequest confidenceThreshold(@javax.annotation.Nullable BigDecimal confidenceThreshold) { - this.confidenceThreshold = confidenceThreshold; - return this; - } - - /** - * Confidence threshold for applying function names as a percentage, default is 90 - * minimum: 0 - * maximum: 100 - * @return confidenceThreshold - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public BigDecimal getConfidenceThreshold() { - return confidenceThreshold; - } - - @Deprecated - public void setConfidenceThreshold(@javax.annotation.Nullable BigDecimal confidenceThreshold) { - this.confidenceThreshold = confidenceThreshold; - } - - - @Deprecated - public AutoUnstripRequest minGroupSize(@javax.annotation.Nullable Integer minGroupSize) { - this.minGroupSize = minGroupSize; - return this; - } - - /** - * Minimum number of matching functions required to consider for a match, default is 10 - * minimum: 1 - * maximum: 20 - * @return minGroupSize - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Integer getMinGroupSize() { - return minGroupSize; - } - - @Deprecated - public void setMinGroupSize(@javax.annotation.Nullable Integer minGroupSize) { - this.minGroupSize = minGroupSize; - } - - - @Deprecated - public AutoUnstripRequest statusOnly(@javax.annotation.Nullable Boolean statusOnly) { - this.statusOnly = statusOnly; - return this; - } - - /** - * If set to true, only returns the status of the auto-unstrip operation without the actual results - * @return statusOnly - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Boolean getStatusOnly() { - return statusOnly; - } - - @Deprecated - public void setStatusOnly(@javax.annotation.Nullable Boolean statusOnly) { - this.statusOnly = statusOnly; - } - - - @Deprecated - public AutoUnstripRequest noCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - return this; - } - - /** - * If set to true, forces the system to bypass any cached results and perform a fresh computation - * @return noCache - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Boolean getNoCache() { - return noCache; - } - - @Deprecated - public void setNoCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - } - - - public AutoUnstripRequest useCanonicalNames(@javax.annotation.Nullable Boolean useCanonicalNames) { - this.useCanonicalNames = useCanonicalNames; - return this; - } - - /** - * Whether to use canonical function names during matching for auto-unstrip, default is False - * @return useCanonicalNames - */ - @javax.annotation.Nullable - public Boolean getUseCanonicalNames() { - return useCanonicalNames; - } - - public void setUseCanonicalNames(@javax.annotation.Nullable Boolean useCanonicalNames) { - this.useCanonicalNames = useCanonicalNames; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AutoUnstripRequest instance itself - */ - public AutoUnstripRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AutoUnstripRequest autoUnstripRequest = (AutoUnstripRequest) o; - return Objects.equals(this.minSimilarity, autoUnstripRequest.minSimilarity) && - Objects.equals(this.apply, autoUnstripRequest.apply) && - Objects.equals(this.confidenceThreshold, autoUnstripRequest.confidenceThreshold) && - Objects.equals(this.minGroupSize, autoUnstripRequest.minGroupSize) && - Objects.equals(this.statusOnly, autoUnstripRequest.statusOnly) && - Objects.equals(this.noCache, autoUnstripRequest.noCache) && - Objects.equals(this.useCanonicalNames, autoUnstripRequest.useCanonicalNames)&& - Objects.equals(this.additionalProperties, autoUnstripRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(minSimilarity, apply, confidenceThreshold, minGroupSize, statusOnly, noCache, useCanonicalNames, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AutoUnstripRequest {\n"); - sb.append(" minSimilarity: ").append(toIndentedString(minSimilarity)).append("\n"); - sb.append(" apply: ").append(toIndentedString(apply)).append("\n"); - sb.append(" confidenceThreshold: ").append(toIndentedString(confidenceThreshold)).append("\n"); - sb.append(" minGroupSize: ").append(toIndentedString(minGroupSize)).append("\n"); - sb.append(" statusOnly: ").append(toIndentedString(statusOnly)).append("\n"); - sb.append(" noCache: ").append(toIndentedString(noCache)).append("\n"); - sb.append(" useCanonicalNames: ").append(toIndentedString(useCanonicalNames)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("min_similarity", "apply", "confidence_threshold", "min_group_size", "status_only", "no_cache", "use_canonical_names")); - - // 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 AutoUnstripRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AutoUnstripRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AutoUnstripRequest is not found in the empty JSON string", AutoUnstripRequest.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AutoUnstripRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AutoUnstripRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AutoUnstripRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AutoUnstripRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AutoUnstripRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AutoUnstripRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AutoUnstripRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of AutoUnstripRequest - * @throws IOException if the JSON string is invalid with respect to AutoUnstripRequest - */ - public static AutoUnstripRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AutoUnstripRequest.class); - } - - /** - * Convert an instance of AutoUnstripRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/AutoUnstripResponse.java b/src/main/java/ai/reveng/model/AutoUnstripResponse.java deleted file mode 100644 index e0bab583..00000000 --- a/src/main/java/ai/reveng/model/AutoUnstripResponse.java +++ /dev/null @@ -1,457 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import ai.reveng.model.MatchedFunctionSuggestion; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import 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; - -/** - * AutoUnstripResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AutoUnstripResponse { - public static final String SERIALIZED_NAME_PROGRESS = "progress"; - @Deprecated - @SerializedName(SERIALIZED_NAME_PROGRESS) - @javax.annotation.Nullable - private Integer progress = 0; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_TOTAL_TIME = "total_time"; - @SerializedName(SERIALIZED_NAME_TOTAL_TIME) - @javax.annotation.Nullable - private Integer totalTime; - - public static final String SERIALIZED_NAME_MATCHES = "matches"; - @SerializedName(SERIALIZED_NAME_MATCHES) - @javax.annotation.Nullable - private List matches; - - public static final String SERIALIZED_NAME_APPLIED = "applied"; - @SerializedName(SERIALIZED_NAME_APPLIED) - @javax.annotation.Nullable - private Boolean applied; - - public static final String SERIALIZED_NAME_ERROR_MESSAGE = "error_message"; - @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) - @javax.annotation.Nullable - private String errorMessage; - - public AutoUnstripResponse() { - } - - @Deprecated - public AutoUnstripResponse progress(@javax.annotation.Nullable Integer progress) { - this.progress = progress; - return this; - } - - /** - * Progress of the auto-unstrip operation, represented as a percentage - * @return progress - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Integer getProgress() { - return progress; - } - - @Deprecated - public void setProgress(@javax.annotation.Nullable Integer progress) { - this.progress = progress; - } - - - public AutoUnstripResponse status(@javax.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Status of the function matching operation - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable String status) { - this.status = status; - } - - - public AutoUnstripResponse totalTime(@javax.annotation.Nullable Integer totalTime) { - this.totalTime = totalTime; - return this; - } - - /** - * Total time taken for the auto-unstrip operation in seconds - * @return totalTime - */ - @javax.annotation.Nullable - public Integer getTotalTime() { - return totalTime; - } - - public void setTotalTime(@javax.annotation.Nullable Integer totalTime) { - this.totalTime = totalTime; - } - - - public AutoUnstripResponse matches(@javax.annotation.Nullable List matches) { - this.matches = matches; - return this; - } - - public AutoUnstripResponse addMatchesItem(MatchedFunctionSuggestion matchesItem) { - if (this.matches == null) { - this.matches = new ArrayList<>(); - } - this.matches.add(matchesItem); - return this; - } - - /** - * Map of function IDs to their matching results with best match information - * @return matches - */ - @javax.annotation.Nullable - public List getMatches() { - return matches; - } - - public void setMatches(@javax.annotation.Nullable List matches) { - this.matches = matches; - } - - - public AutoUnstripResponse applied(@javax.annotation.Nullable Boolean applied) { - this.applied = applied; - return this; - } - - /** - * Indicates whether the matched function names were applied to the target binary - * @return applied - */ - @javax.annotation.Nullable - public Boolean getApplied() { - return applied; - } - - public void setApplied(@javax.annotation.Nullable Boolean applied) { - this.applied = applied; - } - - - public AutoUnstripResponse errorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; - return this; - } - - /** - * Error message if the operation failed - * @return errorMessage - */ - @javax.annotation.Nullable - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the AutoUnstripResponse instance itself - */ - public AutoUnstripResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AutoUnstripResponse autoUnstripResponse = (AutoUnstripResponse) o; - return Objects.equals(this.progress, autoUnstripResponse.progress) && - Objects.equals(this.status, autoUnstripResponse.status) && - Objects.equals(this.totalTime, autoUnstripResponse.totalTime) && - Objects.equals(this.matches, autoUnstripResponse.matches) && - Objects.equals(this.applied, autoUnstripResponse.applied) && - Objects.equals(this.errorMessage, autoUnstripResponse.errorMessage)&& - Objects.equals(this.additionalProperties, autoUnstripResponse.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(progress, status, totalTime, matches, applied, errorMessage, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AutoUnstripResponse {\n"); - sb.append(" progress: ").append(toIndentedString(progress)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" totalTime: ").append(toIndentedString(totalTime)).append("\n"); - sb.append(" matches: ").append(toIndentedString(matches)).append("\n"); - sb.append(" applied: ").append(toIndentedString(applied)).append("\n"); - sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("progress", "status", "total_time", "matches", "applied", "error_message")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AutoUnstripResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AutoUnstripResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AutoUnstripResponse is not found in the empty JSON string", AutoUnstripResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - 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++) { - MatchedFunctionSuggestion.validateJsonElement(jsonArraymatches.get(i)); - }; - } - } - if ((jsonObj.get("error_message") != null && !jsonObj.get("error_message").isJsonNull()) && !jsonObj.get("error_message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_message").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AutoUnstripResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AutoUnstripResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AutoUnstripResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AutoUnstripResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public AutoUnstripResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - AutoUnstripResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AutoUnstripResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of AutoUnstripResponse - * @throws IOException if the JSON string is invalid with respect to AutoUnstripResponse - */ - public static AutoUnstripResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AutoUnstripResponse.class); - } - - /** - * Convert an instance of AutoUnstripResponse 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 index c54aba42..da9507fc 100644 --- a/src/main/java/ai/reveng/model/CallEdge.java +++ b/src/main/java/ai/reveng/model/CallEdge.java @@ -79,6 +79,11 @@ public class CallEdge { @javax.annotation.Nonnull private Long callerVaddr; + public static final String SERIALIZED_NAME_IMPORTED_FUNCTION_ID = "imported_function_id"; + @SerializedName(SERIALIZED_NAME_IMPORTED_FUNCTION_ID) + @javax.annotation.Nullable + private Long importedFunctionId; + public static final String SERIALIZED_NAME_IS_EXTERNAL = "is_external"; @SerializedName(SERIALIZED_NAME_IS_EXTERNAL) @javax.annotation.Nonnull @@ -206,6 +211,25 @@ public void setCallerVaddr(@javax.annotation.Nonnull Long callerVaddr) { } + public CallEdge importedFunctionId(@javax.annotation.Nullable Long importedFunctionId) { + this.importedFunctionId = importedFunctionId; + return this; + } + + /** + * Imported function ID for an external callee, resolved via the thunk/stub address. + * @return importedFunctionId + */ + @javax.annotation.Nullable + public Long getImportedFunctionId() { + return importedFunctionId; + } + + public void setImportedFunctionId(@javax.annotation.Nullable Long importedFunctionId) { + this.importedFunctionId = importedFunctionId; + } + + public CallEdge isExternal(@javax.annotation.Nonnull Boolean isExternal) { this.isExternal = isExternal; return this; @@ -260,13 +284,14 @@ public boolean equals(Object o) { Objects.equals(this.callerFunctionId, callEdge.callerFunctionId) && Objects.equals(this.callerName, callEdge.callerName) && Objects.equals(this.callerVaddr, callEdge.callerVaddr) && + Objects.equals(this.importedFunctionId, callEdge.importedFunctionId) && 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); + return Objects.hash(calleeFunctionId, calleeName, calleeVaddr, callerFunctionId, callerName, callerVaddr, importedFunctionId, isExternal, thunkedVaddr); } @Override @@ -279,6 +304,7 @@ public String toString() { 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(" importedFunctionId: ").append(toIndentedString(importedFunctionId)).append("\n"); sb.append(" isExternal: ").append(toIndentedString(isExternal)).append("\n"); sb.append(" thunkedVaddr: ").append(toIndentedString(thunkedVaddr)).append("\n"); sb.append("}"); @@ -299,7 +325,7 @@ private String toIndentedString(Object o) { 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")); + openapiFields = new HashSet(Arrays.asList("callee_function_id", "callee_name", "callee_vaddr", "caller_function_id", "caller_name", "caller_vaddr", "imported_function_id", "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")); diff --git a/src/main/java/ai/reveng/model/DynamicExecutionStatusResponse.java b/src/main/java/ai/reveng/model/DynamicExecutionStatusResponse.java index 7678facd..868ae8f5 100644 --- a/src/main/java/ai/reveng/model/DynamicExecutionStatusResponse.java +++ b/src/main/java/ai/reveng/model/DynamicExecutionStatusResponse.java @@ -60,10 +60,70 @@ public class DynamicExecutionStatusResponse { @javax.annotation.Nonnull private AnalysisLogs logs; + /** + * Task 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 String status; + private StatusEnum status; public DynamicExecutionStatusResponse() { } @@ -106,21 +166,21 @@ public void setLogs(@javax.annotation.Nonnull AnalysisLogs logs) { } - public DynamicExecutionStatusResponse status(@javax.annotation.Nonnull String status) { + public DynamicExecutionStatusResponse status(@javax.annotation.Nonnull StatusEnum status) { this.status = status; return this; } /** - * Task status: UNINITIALISED, PENDING, RUNNING, COMPLETED, or FAILED + * Task status * @return status */ @javax.annotation.Nonnull - public String getStatus() { + public StatusEnum getStatus() { return status; } - public void setStatus(@javax.annotation.Nonnull String status) { + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { this.status = status; } @@ -212,6 +272,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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 { diff --git a/src/main/java/ai/reveng/model/FunctionMatchingFilters.java b/src/main/java/ai/reveng/model/FunctionMatchingFilters.java deleted file mode 100644 index 899bac71..00000000 --- a/src/main/java/ai/reveng/model/FunctionMatchingFilters.java +++ /dev/null @@ -1,501 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.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; - -/** - * FunctionMatchingFilters - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionMatchingFilters { - public static final String SERIALIZED_NAME_BINARY_IDS = "binary_ids"; - @SerializedName(SERIALIZED_NAME_BINARY_IDS) - @javax.annotation.Nullable - private List binaryIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_COLLECTION_IDS = "collection_ids"; - @SerializedName(SERIALIZED_NAME_COLLECTION_IDS) - @javax.annotation.Nullable - private List collectionIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_FUNCTION_IDS = "function_ids"; - @SerializedName(SERIALIZED_NAME_FUNCTION_IDS) - @javax.annotation.Nullable - private List functionIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_USER_IDS = "user_ids"; - @SerializedName(SERIALIZED_NAME_USER_IDS) - @javax.annotation.Nullable - private List userIds = new ArrayList<>(); - - /** - * Gets or Sets debugTypes - */ - @JsonAdapter(DebugTypesEnum.Adapter.class) - public enum DebugTypesEnum { - USER("USER"), - - SYSTEM("SYSTEM"), - - EXTERNAL("EXTERNAL"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - DebugTypesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static DebugTypesEnum fromValue(String value) { - for (DebugTypesEnum b : DebugTypesEnum.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 DebugTypesEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DebugTypesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return DebugTypesEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - DebugTypesEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_DEBUG_TYPES = "debug_types"; - @SerializedName(SERIALIZED_NAME_DEBUG_TYPES) - @javax.annotation.Nullable - private List debugTypes = new ArrayList<>(); - - public FunctionMatchingFilters() { - } - - public FunctionMatchingFilters binaryIds(@javax.annotation.Nullable List binaryIds) { - this.binaryIds = binaryIds; - return this; - } - - public FunctionMatchingFilters addBinaryIdsItem(Integer binaryIdsItem) { - if (this.binaryIds == null) { - this.binaryIds = new ArrayList<>(); - } - this.binaryIds.add(binaryIdsItem); - return this; - } - - /** - * ID's of binaries to limit the search to, if empty, search all scoped binaries - * @return binaryIds - */ - @javax.annotation.Nullable - public List getBinaryIds() { - return binaryIds; - } - - public void setBinaryIds(@javax.annotation.Nullable List binaryIds) { - this.binaryIds = binaryIds; - } - - - public FunctionMatchingFilters collectionIds(@javax.annotation.Nullable List collectionIds) { - this.collectionIds = collectionIds; - return this; - } - - public FunctionMatchingFilters addCollectionIdsItem(Integer collectionIdsItem) { - if (this.collectionIds == null) { - this.collectionIds = new ArrayList<>(); - } - this.collectionIds.add(collectionIdsItem); - return this; - } - - /** - * ID's of collections to limit the search to, if empty, search all scoped collections - * @return collectionIds - */ - @javax.annotation.Nullable - public List getCollectionIds() { - return collectionIds; - } - - public void setCollectionIds(@javax.annotation.Nullable List collectionIds) { - this.collectionIds = collectionIds; - } - - - public FunctionMatchingFilters functionIds(@javax.annotation.Nullable List functionIds) { - this.functionIds = functionIds; - return this; - } - - public FunctionMatchingFilters addFunctionIdsItem(Long functionIdsItem) { - if (this.functionIds == null) { - this.functionIds = new ArrayList<>(); - } - this.functionIds.add(functionIdsItem); - return this; - } - - /** - * ID's of functions to limit the search to, if empty, search all scoped functions - * @return functionIds - */ - @javax.annotation.Nullable - public List getFunctionIds() { - return functionIds; - } - - public void setFunctionIds(@javax.annotation.Nullable List functionIds) { - this.functionIds = functionIds; - } - - - public FunctionMatchingFilters userIds(@javax.annotation.Nullable List userIds) { - this.userIds = userIds; - return this; - } - - public FunctionMatchingFilters addUserIdsItem(Integer userIdsItem) { - if (this.userIds == null) { - this.userIds = new ArrayList<>(); - } - this.userIds.add(userIdsItem); - return this; - } - - /** - * ID's of users to limit the search to, if empty, search all scoped users - * @return userIds - */ - @javax.annotation.Nullable - public List getUserIds() { - return userIds; - } - - public void setUserIds(@javax.annotation.Nullable List userIds) { - this.userIds = userIds; - } - - - public FunctionMatchingFilters debugTypes(@javax.annotation.Nullable List debugTypes) { - this.debugTypes = debugTypes; - return this; - } - - public FunctionMatchingFilters addDebugTypesItem(DebugTypesEnum debugTypesItem) { - if (this.debugTypes == null) { - this.debugTypes = new ArrayList<>(); - } - this.debugTypes.add(debugTypesItem); - return this; - } - - /** - * Limit the search to specific debug types, if empty, search all scoped debug & non-debug functions - * @return debugTypes - */ - @javax.annotation.Nullable - public List getDebugTypes() { - return debugTypes; - } - - public void setDebugTypes(@javax.annotation.Nullable List debugTypes) { - this.debugTypes = debugTypes; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FunctionMatchingFilters instance itself - */ - public FunctionMatchingFilters putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FunctionMatchingFilters functionMatchingFilters = (FunctionMatchingFilters) o; - return Objects.equals(this.binaryIds, functionMatchingFilters.binaryIds) && - Objects.equals(this.collectionIds, functionMatchingFilters.collectionIds) && - Objects.equals(this.functionIds, functionMatchingFilters.functionIds) && - Objects.equals(this.userIds, functionMatchingFilters.userIds) && - Objects.equals(this.debugTypes, functionMatchingFilters.debugTypes)&& - Objects.equals(this.additionalProperties, functionMatchingFilters.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(binaryIds, collectionIds, functionIds, userIds, debugTypes, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionMatchingFilters {\n"); - sb.append(" binaryIds: ").append(toIndentedString(binaryIds)).append("\n"); - sb.append(" collectionIds: ").append(toIndentedString(collectionIds)).append("\n"); - sb.append(" functionIds: ").append(toIndentedString(functionIds)).append("\n"); - sb.append(" userIds: ").append(toIndentedString(userIds)).append("\n"); - sb.append(" debugTypes: ").append(toIndentedString(debugTypes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\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", "function_ids", "user_ids", "debug_types")); - - // 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 FunctionMatchingFilters - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionMatchingFilters.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionMatchingFilters is not found in the empty JSON string", FunctionMatchingFilters.openapiRequiredFields.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("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())); - } - // 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 (!FunctionMatchingFilters.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionMatchingFilters' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionMatchingFilters.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionMatchingFilters value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public FunctionMatchingFilters read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionMatchingFilters instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionMatchingFilters given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionMatchingFilters - * @throws IOException if the JSON string is invalid with respect to FunctionMatchingFilters - */ - public static FunctionMatchingFilters fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionMatchingFilters.class); - } - - /** - * Convert an instance of FunctionMatchingFilters to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionMatchingRequest.java b/src/main/java/ai/reveng/model/FunctionMatchingRequest.java deleted file mode 100644 index 31b10c77..00000000 --- a/src/main/java/ai/reveng/model/FunctionMatchingRequest.java +++ /dev/null @@ -1,576 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI 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.FunctionMatchingFilters; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import 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; - -/** - * FunctionMatchingRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionMatchingRequest { - public static final String SERIALIZED_NAME_MODEL_ID = "model_id"; - @SerializedName(SERIALIZED_NAME_MODEL_ID) - @javax.annotation.Nonnull - private Integer modelId; - - public static final String SERIALIZED_NAME_FUNCTION_IDS = "function_ids"; - @SerializedName(SERIALIZED_NAME_FUNCTION_IDS) - @javax.annotation.Nonnull - private List functionIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_MIN_SIMILARITY = "min_similarity"; - @SerializedName(SERIALIZED_NAME_MIN_SIMILARITY) - @javax.annotation.Nullable - private BigDecimal minSimilarity = new BigDecimal("90"); - - public static final String SERIALIZED_NAME_FILTERS = "filters"; - @SerializedName(SERIALIZED_NAME_FILTERS) - @javax.annotation.Nullable - private FunctionMatchingFilters filters; - - public static final String SERIALIZED_NAME_RESULTS_PER_FUNCTION = "results_per_function"; - @SerializedName(SERIALIZED_NAME_RESULTS_PER_FUNCTION) - @javax.annotation.Nullable - private Integer resultsPerFunction = 1; - - public static final String SERIALIZED_NAME_PAGE = "page"; - @Deprecated - @SerializedName(SERIALIZED_NAME_PAGE) - @javax.annotation.Nullable - private Integer page = 1; - - public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; - @Deprecated - @SerializedName(SERIALIZED_NAME_PAGE_SIZE) - @javax.annotation.Nullable - private Integer pageSize = 0; - - public static final String SERIALIZED_NAME_STATUS_ONLY = "status_only"; - @Deprecated - @SerializedName(SERIALIZED_NAME_STATUS_ONLY) - @javax.annotation.Nullable - private Boolean statusOnly = false; - - public static final String SERIALIZED_NAME_NO_CACHE = "no_cache"; - @SerializedName(SERIALIZED_NAME_NO_CACHE) - @javax.annotation.Nullable - private Boolean noCache = false; - - public static final String SERIALIZED_NAME_USE_CANONICAL_NAMES = "use_canonical_names"; - @SerializedName(SERIALIZED_NAME_USE_CANONICAL_NAMES) - @javax.annotation.Nullable - private Boolean useCanonicalNames = false; - - public FunctionMatchingRequest() { - } - - public FunctionMatchingRequest modelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - return this; - } - - /** - * ID of the model used for function matching, used to determine the embedding model - * @return modelId - */ - @javax.annotation.Nonnull - public Integer getModelId() { - return modelId; - } - - public void setModelId(@javax.annotation.Nonnull Integer modelId) { - this.modelId = modelId; - } - - - public FunctionMatchingRequest functionIds(@javax.annotation.Nonnull List functionIds) { - this.functionIds = functionIds; - return this; - } - - public FunctionMatchingRequest addFunctionIdsItem(Long functionIdsItem) { - if (this.functionIds == null) { - this.functionIds = new ArrayList<>(); - } - this.functionIds.add(functionIdsItem); - return this; - } - - /** - * ID's of functions to find matches for, must be at least one function ID - * @return functionIds - */ - @javax.annotation.Nonnull - public List getFunctionIds() { - return functionIds; - } - - public void setFunctionIds(@javax.annotation.Nonnull List functionIds) { - this.functionIds = functionIds; - } - - - public FunctionMatchingRequest minSimilarity(@javax.annotation.Nullable BigDecimal minSimilarity) { - this.minSimilarity = minSimilarity; - return this; - } - - /** - * Minimum similarity expected for a match as a percentage, default is 90 - * minimum: 0 - * maximum: 100 - * @return minSimilarity - */ - @javax.annotation.Nullable - public BigDecimal getMinSimilarity() { - return minSimilarity; - } - - public void setMinSimilarity(@javax.annotation.Nullable BigDecimal minSimilarity) { - this.minSimilarity = minSimilarity; - } - - - public FunctionMatchingRequest filters(@javax.annotation.Nullable FunctionMatchingFilters filters) { - this.filters = filters; - return this; - } - - /** - * Used to limit the search to specific binaries, collections, and functions - * @return filters - */ - @javax.annotation.Nullable - public FunctionMatchingFilters getFilters() { - return filters; - } - - public void setFilters(@javax.annotation.Nullable FunctionMatchingFilters filters) { - this.filters = filters; - } - - - public FunctionMatchingRequest resultsPerFunction(@javax.annotation.Nullable Integer resultsPerFunction) { - this.resultsPerFunction = resultsPerFunction; - return this; - } - - /** - * Maximum number of matches to return per function, default is 1, max is 50 - * minimum: 1 - * maximum: 50 - * @return resultsPerFunction - */ - @javax.annotation.Nullable - public Integer getResultsPerFunction() { - return resultsPerFunction; - } - - public void setResultsPerFunction(@javax.annotation.Nullable Integer resultsPerFunction) { - this.resultsPerFunction = resultsPerFunction; - } - - - @Deprecated - public FunctionMatchingRequest page(@javax.annotation.Nullable Integer page) { - this.page = page; - return this; - } - - /** - * Page number for paginated results, default is 1 (first page) - * minimum: 1 - * @return page - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Integer getPage() { - return page; - } - - @Deprecated - public void setPage(@javax.annotation.Nullable Integer page) { - this.page = page; - } - - - @Deprecated - public FunctionMatchingRequest pageSize(@javax.annotation.Nullable Integer pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Number of functions to return per page, default is 0 (all functions), max is 1000 - * minimum: 0 - * maximum: 1000 - * @return pageSize - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Integer getPageSize() { - return pageSize; - } - - @Deprecated - public void setPageSize(@javax.annotation.Nullable Integer pageSize) { - this.pageSize = pageSize; - } - - - @Deprecated - public FunctionMatchingRequest statusOnly(@javax.annotation.Nullable Boolean statusOnly) { - this.statusOnly = statusOnly; - return this; - } - - /** - * If set to true, only returns the status of the matching operation without the actual results - * @return statusOnly - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - public Boolean getStatusOnly() { - return statusOnly; - } - - @Deprecated - public void setStatusOnly(@javax.annotation.Nullable Boolean statusOnly) { - this.statusOnly = statusOnly; - } - - - public FunctionMatchingRequest noCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - return this; - } - - /** - * If set to true, forces the system to bypass any cached results and perform a fresh computation - * @return noCache - */ - @javax.annotation.Nullable - public Boolean getNoCache() { - return noCache; - } - - public void setNoCache(@javax.annotation.Nullable Boolean noCache) { - this.noCache = noCache; - } - - - public FunctionMatchingRequest useCanonicalNames(@javax.annotation.Nullable Boolean useCanonicalNames) { - this.useCanonicalNames = useCanonicalNames; - return this; - } - - /** - * Whether to use canonical function names during function matching for confidence results, default is False - * @return useCanonicalNames - */ - @javax.annotation.Nullable - public Boolean getUseCanonicalNames() { - return useCanonicalNames; - } - - public void setUseCanonicalNames(@javax.annotation.Nullable Boolean useCanonicalNames) { - this.useCanonicalNames = useCanonicalNames; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FunctionMatchingRequest instance itself - */ - public FunctionMatchingRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FunctionMatchingRequest functionMatchingRequest = (FunctionMatchingRequest) o; - return Objects.equals(this.modelId, functionMatchingRequest.modelId) && - Objects.equals(this.functionIds, functionMatchingRequest.functionIds) && - Objects.equals(this.minSimilarity, functionMatchingRequest.minSimilarity) && - Objects.equals(this.filters, functionMatchingRequest.filters) && - Objects.equals(this.resultsPerFunction, functionMatchingRequest.resultsPerFunction) && - Objects.equals(this.page, functionMatchingRequest.page) && - Objects.equals(this.pageSize, functionMatchingRequest.pageSize) && - Objects.equals(this.statusOnly, functionMatchingRequest.statusOnly) && - Objects.equals(this.noCache, functionMatchingRequest.noCache) && - Objects.equals(this.useCanonicalNames, functionMatchingRequest.useCanonicalNames)&& - Objects.equals(this.additionalProperties, functionMatchingRequest.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(modelId, functionIds, minSimilarity, filters, resultsPerFunction, page, pageSize, statusOnly, noCache, useCanonicalNames, 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 FunctionMatchingRequest {\n"); - sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); - sb.append(" functionIds: ").append(toIndentedString(functionIds)).append("\n"); - sb.append(" minSimilarity: ").append(toIndentedString(minSimilarity)).append("\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb.append(" resultsPerFunction: ").append(toIndentedString(resultsPerFunction)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); - sb.append(" statusOnly: ").append(toIndentedString(statusOnly)).append("\n"); - sb.append(" noCache: ").append(toIndentedString(noCache)).append("\n"); - sb.append(" useCanonicalNames: ").append(toIndentedString(useCanonicalNames)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("model_id", "function_ids", "min_similarity", "filters", "results_per_function", "page", "page_size", "status_only", "no_cache", "use_canonical_names")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("model_id", "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 FunctionMatchingRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionMatchingRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionMatchingRequest is not found in the empty JSON string", FunctionMatchingRequest.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionMatchingRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("function_ids") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("function_ids").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `function_ids` to be an array in the JSON string but got `%s`", jsonObj.get("function_ids").toString())); - } - // validate the optional field `filters` - if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { - FunctionMatchingFilters.validateJsonElement(jsonObj.get("filters")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionMatchingRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionMatchingRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionMatchingRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionMatchingRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public FunctionMatchingRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionMatchingRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionMatchingRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionMatchingRequest - * @throws IOException if the JSON string is invalid with respect to FunctionMatchingRequest - */ - public static FunctionMatchingRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionMatchingRequest.class); - } - - /** - * Convert an instance of FunctionMatchingRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/FunctionMatchingResponse.java b/src/main/java/ai/reveng/model/FunctionMatchingResponse.java deleted file mode 100644 index 2cf5616c..00000000 --- a/src/main/java/ai/reveng/model/FunctionMatchingResponse.java +++ /dev/null @@ -1,559 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import ai.reveng.model.V2FunctionMatch; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import 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; - -/** - * FunctionMatchingResponse - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionMatchingResponse { - public static final String SERIALIZED_NAME_PROGRESS = "progress"; - @SerializedName(SERIALIZED_NAME_PROGRESS) - @javax.annotation.Nullable - private Integer progress = 0; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_TOTAL_TIME = "total_time"; - @SerializedName(SERIALIZED_NAME_TOTAL_TIME) - @javax.annotation.Nullable - private Integer totalTime; - - 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_CURRENT_PAGE = "current_page"; - @SerializedName(SERIALIZED_NAME_CURRENT_PAGE) - @javax.annotation.Nullable - private Integer currentPage; - - public static final String SERIALIZED_NAME_TOTAL_PAGES = "total_pages"; - @SerializedName(SERIALIZED_NAME_TOTAL_PAGES) - @javax.annotation.Nullable - private Integer totalPages; - - public static final String SERIALIZED_NAME_MATCHES = "matches"; - @SerializedName(SERIALIZED_NAME_MATCHES) - @javax.annotation.Nullable - private List matches; - - public static final String SERIALIZED_NAME_NUM_MATCHES = "num_matches"; - @SerializedName(SERIALIZED_NAME_NUM_MATCHES) - @javax.annotation.Nullable - private Integer numMatches; - - public static final String SERIALIZED_NAME_NUM_DEBUG_MATCHES = "num_debug_matches"; - @SerializedName(SERIALIZED_NAME_NUM_DEBUG_MATCHES) - @javax.annotation.Nullable - private Integer numDebugMatches; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - @javax.annotation.Nullable - private String updatedAt; - - public FunctionMatchingResponse() { - } - - public FunctionMatchingResponse progress(@javax.annotation.Nullable Integer progress) { - this.progress = progress; - return this; - } - - /** - * Progress of the matching operation, represented as a percentage - * @return progress - */ - @javax.annotation.Nullable - public Integer getProgress() { - return progress; - } - - public void setProgress(@javax.annotation.Nullable Integer progress) { - this.progress = progress; - } - - - public FunctionMatchingResponse status(@javax.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Status of the function matching operation - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nullable String status) { - this.status = status; - } - - - public FunctionMatchingResponse totalTime(@javax.annotation.Nullable Integer totalTime) { - this.totalTime = totalTime; - return this; - } - - /** - * Total time taken for the matching operation in seconds - * @return totalTime - */ - @javax.annotation.Nullable - public Integer getTotalTime() { - return totalTime; - } - - public void setTotalTime(@javax.annotation.Nullable Integer totalTime) { - this.totalTime = totalTime; - } - - - public FunctionMatchingResponse errorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; - return this; - } - - /** - * Optional message providing additional information about the operation - * @return errorMessage - */ - @javax.annotation.Nullable - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(@javax.annotation.Nullable String errorMessage) { - this.errorMessage = errorMessage; - } - - - public FunctionMatchingResponse currentPage(@javax.annotation.Nullable Integer currentPage) { - this.currentPage = currentPage; - return this; - } - - /** - * Current page number of the results, if pagination is used - * @return currentPage - */ - @javax.annotation.Nullable - public Integer getCurrentPage() { - return currentPage; - } - - public void setCurrentPage(@javax.annotation.Nullable Integer currentPage) { - this.currentPage = currentPage; - } - - - public FunctionMatchingResponse totalPages(@javax.annotation.Nullable Integer totalPages) { - this.totalPages = totalPages; - return this; - } - - /** - * Total number of pages available, if pagination is used - * @return totalPages - */ - @javax.annotation.Nullable - public Integer getTotalPages() { - return totalPages; - } - - public void setTotalPages(@javax.annotation.Nullable Integer totalPages) { - this.totalPages = totalPages; - } - - - public FunctionMatchingResponse matches(@javax.annotation.Nullable List matches) { - this.matches = matches; - return this; - } - - public FunctionMatchingResponse addMatchesItem(V2FunctionMatch matchesItem) { - if (this.matches == null) { - this.matches = new ArrayList<>(); - } - this.matches.add(matchesItem); - return this; - } - - /** - * List of function matching results with best match information - * @return matches - */ - @javax.annotation.Nullable - public List getMatches() { - return matches; - } - - public void setMatches(@javax.annotation.Nullable List matches) { - this.matches = matches; - } - - - public FunctionMatchingResponse numMatches(@javax.annotation.Nullable Integer numMatches) { - this.numMatches = numMatches; - return this; - } - - /** - * Total number of function matches found - * @return numMatches - */ - @javax.annotation.Nullable - public Integer getNumMatches() { - return numMatches; - } - - public void setNumMatches(@javax.annotation.Nullable Integer numMatches) { - this.numMatches = numMatches; - } - - - public FunctionMatchingResponse numDebugMatches(@javax.annotation.Nullable Integer numDebugMatches) { - this.numDebugMatches = numDebugMatches; - return this; - } - - /** - * Total number of debug function matches found - * @return numDebugMatches - */ - @javax.annotation.Nullable - public Integer getNumDebugMatches() { - return numDebugMatches; - } - - public void setNumDebugMatches(@javax.annotation.Nullable Integer numDebugMatches) { - this.numDebugMatches = numDebugMatches; - } - - - public FunctionMatchingResponse updatedAt(@javax.annotation.Nullable String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Timestamp of the last time function matching with the same request parameters was performed - * @return updatedAt - */ - @javax.annotation.Nullable - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(@javax.annotation.Nullable String updatedAt) { - this.updatedAt = updatedAt; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the FunctionMatchingResponse instance itself - */ - public FunctionMatchingResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FunctionMatchingResponse functionMatchingResponse = (FunctionMatchingResponse) o; - return Objects.equals(this.progress, functionMatchingResponse.progress) && - Objects.equals(this.status, functionMatchingResponse.status) && - Objects.equals(this.totalTime, functionMatchingResponse.totalTime) && - Objects.equals(this.errorMessage, functionMatchingResponse.errorMessage) && - Objects.equals(this.currentPage, functionMatchingResponse.currentPage) && - Objects.equals(this.totalPages, functionMatchingResponse.totalPages) && - Objects.equals(this.matches, functionMatchingResponse.matches) && - Objects.equals(this.numMatches, functionMatchingResponse.numMatches) && - Objects.equals(this.numDebugMatches, functionMatchingResponse.numDebugMatches) && - Objects.equals(this.updatedAt, functionMatchingResponse.updatedAt)&& - Objects.equals(this.additionalProperties, functionMatchingResponse.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(progress, status, totalTime, errorMessage, currentPage, totalPages, matches, numMatches, numDebugMatches, updatedAt, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionMatchingResponse {\n"); - sb.append(" progress: ").append(toIndentedString(progress)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" totalTime: ").append(toIndentedString(totalTime)).append("\n"); - sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); - sb.append(" currentPage: ").append(toIndentedString(currentPage)).append("\n"); - sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); - sb.append(" matches: ").append(toIndentedString(matches)).append("\n"); - sb.append(" numMatches: ").append(toIndentedString(numMatches)).append("\n"); - sb.append(" numDebugMatches: ").append(toIndentedString(numDebugMatches)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("progress", "status", "total_time", "error_message", "current_page", "total_pages", "matches", "num_matches", "num_debug_matches", "updated_at")); - - // 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 FunctionMatchingResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FunctionMatchingResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionMatchingResponse is not found in the empty JSON string", FunctionMatchingResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - 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("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++) { - V2FunctionMatch.validateJsonElement(jsonArraymatches.get(i)); - }; - } - } - if ((jsonObj.get("updated_at") != null && !jsonObj.get("updated_at").isJsonNull()) && !jsonObj.get("updated_at").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionMatchingResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionMatchingResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionMatchingResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionMatchingResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public FunctionMatchingResponse read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - FunctionMatchingResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionMatchingResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionMatchingResponse - * @throws IOException if the JSON string is invalid with respect to FunctionMatchingResponse - */ - public static FunctionMatchingResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionMatchingResponse.class); - } - - /** - * Convert an instance of FunctionMatchingResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/GetAnalysisStringsStatusOutputBody.java b/src/main/java/ai/reveng/model/GetAnalysisStringsStatusOutputBody.java index 36db3310..824d1ae7 100644 --- a/src/main/java/ai/reveng/model/GetAnalysisStringsStatusOutputBody.java +++ b/src/main/java/ai/reveng/model/GetAnalysisStringsStatusOutputBody.java @@ -49,29 +49,89 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class GetAnalysisStringsStatusOutputBody { + /** + * String-extraction task 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 String status; + private StatusEnum status; public GetAnalysisStringsStatusOutputBody() { } - public GetAnalysisStringsStatusOutputBody status(@javax.annotation.Nonnull String status) { + public GetAnalysisStringsStatusOutputBody status(@javax.annotation.Nonnull StatusEnum status) { this.status = status; return this; } /** - * Get status + * String-extraction task status * @return status */ @javax.annotation.Nonnull - public String getStatus() { + public StatusEnum getStatus() { return status; } - public void setStatus(@javax.annotation.Nonnull String status) { + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { this.status = status; } @@ -154,6 +214,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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 { diff --git a/src/main/java/ai/reveng/model/MatchedFunctionSuggestion.java b/src/main/java/ai/reveng/model/MatchedFunctionSuggestion.java deleted file mode 100644 index 719c9547..00000000 --- a/src/main/java/ai/reveng/model/MatchedFunctionSuggestion.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * MatchedFunctionSuggestion - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MatchedFunctionSuggestion { - 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_VADDR = "function_vaddr"; - @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) - @javax.annotation.Nonnull - private Long functionVaddr; - - public static final String SERIALIZED_NAME_SUGGESTED_NAME = "suggested_name"; - @SerializedName(SERIALIZED_NAME_SUGGESTED_NAME) - @javax.annotation.Nullable - private String suggestedName; - - public static final String SERIALIZED_NAME_SUGGESTED_DEMANGLED_NAME = "suggested_demangled_name"; - @SerializedName(SERIALIZED_NAME_SUGGESTED_DEMANGLED_NAME) - @javax.annotation.Nonnull - private String suggestedDemangledName; - - public MatchedFunctionSuggestion() { - } - - public MatchedFunctionSuggestion functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Unique identifier of the matched function - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public MatchedFunctionSuggestion functionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - return this; - } - - /** - * Virtual address of the matched function - * @return functionVaddr - */ - @javax.annotation.Nonnull - public Long getFunctionVaddr() { - return functionVaddr; - } - - public void setFunctionVaddr(@javax.annotation.Nonnull Long functionVaddr) { - this.functionVaddr = functionVaddr; - } - - - public MatchedFunctionSuggestion suggestedName(@javax.annotation.Nullable String suggestedName) { - this.suggestedName = suggestedName; - return this; - } - - /** - * Mangled name of the function group that contains the matched functions - * @return suggestedName - */ - @javax.annotation.Nullable - public String getSuggestedName() { - return suggestedName; - } - - public void setSuggestedName(@javax.annotation.Nullable String suggestedName) { - this.suggestedName = suggestedName; - } - - - public MatchedFunctionSuggestion suggestedDemangledName(@javax.annotation.Nonnull String suggestedDemangledName) { - this.suggestedDemangledName = suggestedDemangledName; - return this; - } - - /** - * De-mangled name of the function group that contains the matched functions - * @return suggestedDemangledName - */ - @javax.annotation.Nonnull - public String getSuggestedDemangledName() { - return suggestedDemangledName; - } - - public void setSuggestedDemangledName(@javax.annotation.Nonnull String suggestedDemangledName) { - this.suggestedDemangledName = suggestedDemangledName; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the MatchedFunctionSuggestion instance itself - */ - public MatchedFunctionSuggestion putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MatchedFunctionSuggestion matchedFunctionSuggestion = (MatchedFunctionSuggestion) o; - return Objects.equals(this.functionId, matchedFunctionSuggestion.functionId) && - Objects.equals(this.functionVaddr, matchedFunctionSuggestion.functionVaddr) && - Objects.equals(this.suggestedName, matchedFunctionSuggestion.suggestedName) && - Objects.equals(this.suggestedDemangledName, matchedFunctionSuggestion.suggestedDemangledName)&& - Objects.equals(this.additionalProperties, matchedFunctionSuggestion.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, functionVaddr, suggestedName, suggestedDemangledName, 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 MatchedFunctionSuggestion {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); - sb.append(" suggestedName: ").append(toIndentedString(suggestedName)).append("\n"); - sb.append(" suggestedDemangledName: ").append(toIndentedString(suggestedDemangledName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "function_vaddr", "suggested_name", "suggested_demangled_name")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "function_vaddr", "suggested_demangled_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 MatchedFunctionSuggestion - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!MatchedFunctionSuggestion.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in MatchedFunctionSuggestion is not found in the empty JSON string", MatchedFunctionSuggestion.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : MatchedFunctionSuggestion.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("suggested_name") != null && !jsonObj.get("suggested_name").isJsonNull()) && !jsonObj.get("suggested_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `suggested_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("suggested_name").toString())); - } - if (!jsonObj.get("suggested_demangled_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `suggested_demangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("suggested_demangled_name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MatchedFunctionSuggestion.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MatchedFunctionSuggestion' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(MatchedFunctionSuggestion.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, MatchedFunctionSuggestion value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public MatchedFunctionSuggestion read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - MatchedFunctionSuggestion instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of MatchedFunctionSuggestion given an JSON string - * - * @param jsonString JSON string - * @return An instance of MatchedFunctionSuggestion - * @throws IOException if the JSON string is invalid with respect to MatchedFunctionSuggestion - */ - public static MatchedFunctionSuggestion fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, MatchedFunctionSuggestion.class); - } - - /** - * Convert an instance of MatchedFunctionSuggestion to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/V2FunctionMatch.java b/src/main/java/ai/reveng/model/V2FunctionMatch.java deleted file mode 100644 index ec1974d8..00000000 --- a/src/main/java/ai/reveng/model/V2FunctionMatch.java +++ /dev/null @@ -1,394 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI 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.V2MatchedFunction; -import ai.reveng.model.V2NameConfidence; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import 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; - -/** - * V2FunctionMatch - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class V2FunctionMatch { - public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - @javax.annotation.Nonnull - private Long functionId; - - public static final String SERIALIZED_NAME_MATCHED_FUNCTIONS = "matched_functions"; - @SerializedName(SERIALIZED_NAME_MATCHED_FUNCTIONS) - @javax.annotation.Nonnull - private List matchedFunctions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_CONFIDENCES = "confidences"; - @SerializedName(SERIALIZED_NAME_CONFIDENCES) - @javax.annotation.Nullable - private List confidences; - - public V2FunctionMatch() { - } - - public V2FunctionMatch functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Unique identifier of the function - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public V2FunctionMatch matchedFunctions(@javax.annotation.Nonnull List matchedFunctions) { - this.matchedFunctions = matchedFunctions; - return this; - } - - public V2FunctionMatch addMatchedFunctionsItem(V2MatchedFunction matchedFunctionsItem) { - if (this.matchedFunctions == null) { - this.matchedFunctions = new ArrayList<>(); - } - this.matchedFunctions.add(matchedFunctionsItem); - return this; - } - - /** - * Get matchedFunctions - * @return matchedFunctions - */ - @javax.annotation.Nonnull - public List getMatchedFunctions() { - return matchedFunctions; - } - - public void setMatchedFunctions(@javax.annotation.Nonnull List matchedFunctions) { - this.matchedFunctions = matchedFunctions; - } - - - public V2FunctionMatch confidences(@javax.annotation.Nullable List confidences) { - this.confidences = confidences; - return this; - } - - public V2FunctionMatch addConfidencesItem(V2NameConfidence confidencesItem) { - if (this.confidences == null) { - this.confidences = new ArrayList<>(); - } - this.confidences.add(confidencesItem); - return this; - } - - /** - * Get confidences - * @return confidences - */ - @javax.annotation.Nullable - public List getConfidences() { - return confidences; - } - - public void setConfidences(@javax.annotation.Nullable List confidences) { - this.confidences = confidences; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the V2FunctionMatch instance itself - */ - public V2FunctionMatch putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V2FunctionMatch v2FunctionMatch = (V2FunctionMatch) o; - return Objects.equals(this.functionId, v2FunctionMatch.functionId) && - Objects.equals(this.matchedFunctions, v2FunctionMatch.matchedFunctions) && - Objects.equals(this.confidences, v2FunctionMatch.confidences)&& - Objects.equals(this.additionalProperties, v2FunctionMatch.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, matchedFunctions, confidences, 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 V2FunctionMatch {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" matchedFunctions: ").append(toIndentedString(matchedFunctions)).append("\n"); - sb.append(" confidences: ").append(toIndentedString(confidences)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "matched_functions", "confidences")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "matched_functions")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to V2FunctionMatch - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!V2FunctionMatch.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in V2FunctionMatch is not found in the empty JSON string", V2FunctionMatch.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V2FunctionMatch.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("matched_functions") != null) { - if (!jsonObj.get("matched_functions").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `matched_functions` to be an array in the JSON string but got `%s`", jsonObj.get("matched_functions").toString())); - } - JsonArray jsonArraymatchedFunctions = jsonObj.getAsJsonArray("matched_functions"); - // validate the required field `matched_functions` (array) - for (int i = 0; i < jsonArraymatchedFunctions.size(); i++) { - V2MatchedFunction.validateJsonElement(jsonArraymatchedFunctions.get(i)); - } - } - if (jsonObj.get("confidences") != null && !jsonObj.get("confidences").isJsonNull()) { - JsonArray jsonArrayconfidences = jsonObj.getAsJsonArray("confidences"); - if (jsonArrayconfidences != null) { - // ensure the json data is an array - if (!jsonObj.get("confidences").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `confidences` to be an array in the JSON string but got `%s`", jsonObj.get("confidences").toString())); - } - - // validate the optional field `confidences` (array) - for (int i = 0; i < jsonArrayconfidences.size(); i++) { - V2NameConfidence.validateJsonElement(jsonArrayconfidences.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V2FunctionMatch.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V2FunctionMatch' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V2FunctionMatch.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V2FunctionMatch value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public V2FunctionMatch read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - V2FunctionMatch instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V2FunctionMatch given an JSON string - * - * @param jsonString JSON string - * @return An instance of V2FunctionMatch - * @throws IOException if the JSON string is invalid with respect to V2FunctionMatch - */ - public static V2FunctionMatch fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V2FunctionMatch.class); - } - - /** - * Convert an instance of V2FunctionMatch to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/V2MatchedFunction.java b/src/main/java/ai/reveng/model/V2MatchedFunction.java deleted file mode 100644 index 5ae42ca4..00000000 --- a/src/main/java/ai/reveng/model/V2MatchedFunction.java +++ /dev/null @@ -1,571 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; -import 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; - -/** - * V2MatchedFunction - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class V2MatchedFunction { - 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_BINARY_ID = "binary_id"; - @SerializedName(SERIALIZED_NAME_BINARY_ID) - @javax.annotation.Nonnull - private Integer binaryId; - - public static final String SERIALIZED_NAME_FUNCTION_NAME = "function_name"; - @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) - @javax.annotation.Nonnull - private String functionName; - - public static final String SERIALIZED_NAME_FUNCTION_VADDR = "function_vaddr"; - @SerializedName(SERIALIZED_NAME_FUNCTION_VADDR) - @javax.annotation.Nonnull - private Long functionVaddr; - - public static final String SERIALIZED_NAME_MANGLED_NAME = "mangled_name"; - @SerializedName(SERIALIZED_NAME_MANGLED_NAME) - @javax.annotation.Nonnull - private String mangledName; - - public static final String SERIALIZED_NAME_DEBUG = "debug"; - @SerializedName(SERIALIZED_NAME_DEBUG) - @javax.annotation.Nonnull - private Boolean debug; - - public static final String SERIALIZED_NAME_BINARY_NAME = "binary_name"; - @SerializedName(SERIALIZED_NAME_BINARY_NAME) - @javax.annotation.Nonnull - private String binaryName; - - public static final String SERIALIZED_NAME_SHA256_HASH = "sha_256_hash"; - @SerializedName(SERIALIZED_NAME_SHA256_HASH) - @javax.annotation.Nonnull - private String sha256Hash; - - public static final String SERIALIZED_NAME_ANALYSIS_ID = "analysis_id"; - @SerializedName(SERIALIZED_NAME_ANALYSIS_ID) - @javax.annotation.Nonnull - private Integer analysisId; - - public static final String SERIALIZED_NAME_SIMILARITY = "similarity"; - @SerializedName(SERIALIZED_NAME_SIMILARITY) - @javax.annotation.Nullable - private BigDecimal similarity; - - public static final String SERIALIZED_NAME_CONFIDENCE = "confidence"; - @SerializedName(SERIALIZED_NAME_CONFIDENCE) - @javax.annotation.Nullable - private BigDecimal confidence; - - public V2MatchedFunction() { - } - - public V2MatchedFunction functionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - return this; - } - - /** - * Unique identifier of the matched function - * @return functionId - */ - @javax.annotation.Nonnull - public Long getFunctionId() { - return functionId; - } - - public void setFunctionId(@javax.annotation.Nonnull Long functionId) { - this.functionId = functionId; - } - - - public V2MatchedFunction binaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - return this; - } - - /** - * Get binaryId - * @return binaryId - */ - @javax.annotation.Nonnull - public Integer getBinaryId() { - return binaryId; - } - - public void setBinaryId(@javax.annotation.Nonnull Integer binaryId) { - this.binaryId = binaryId; - } - - - public V2MatchedFunction 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 V2MatchedFunction 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 V2MatchedFunction mangledName(@javax.annotation.Nonnull String mangledName) { - this.mangledName = mangledName; - return this; - } - - /** - * Get mangledName - * @return mangledName - */ - @javax.annotation.Nonnull - public String getMangledName() { - return mangledName; - } - - public void setMangledName(@javax.annotation.Nonnull String mangledName) { - this.mangledName = mangledName; - } - - - public V2MatchedFunction 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 V2MatchedFunction binaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * Get binaryName - * @return binaryName - */ - @javax.annotation.Nonnull - public String getBinaryName() { - return binaryName; - } - - public void setBinaryName(@javax.annotation.Nonnull String binaryName) { - this.binaryName = binaryName; - } - - - public V2MatchedFunction sha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - return this; - } - - /** - * Get sha256Hash - * @return sha256Hash - */ - @javax.annotation.Nonnull - public String getSha256Hash() { - return sha256Hash; - } - - public void setSha256Hash(@javax.annotation.Nonnull String sha256Hash) { - this.sha256Hash = sha256Hash; - } - - - public V2MatchedFunction analysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - return this; - } - - /** - * Get analysisId - * @return analysisId - */ - @javax.annotation.Nonnull - public Integer getAnalysisId() { - return analysisId; - } - - public void setAnalysisId(@javax.annotation.Nonnull Integer analysisId) { - this.analysisId = analysisId; - } - - - public V2MatchedFunction similarity(@javax.annotation.Nullable BigDecimal similarity) { - this.similarity = similarity; - return this; - } - - /** - * Get similarity - * @return similarity - */ - @javax.annotation.Nullable - public BigDecimal getSimilarity() { - return similarity; - } - - public void setSimilarity(@javax.annotation.Nullable BigDecimal similarity) { - this.similarity = similarity; - } - - - public V2MatchedFunction confidence(@javax.annotation.Nullable BigDecimal confidence) { - this.confidence = confidence; - return this; - } - - /** - * Get confidence - * @return confidence - */ - @javax.annotation.Nullable - public BigDecimal getConfidence() { - return confidence; - } - - public void setConfidence(@javax.annotation.Nullable BigDecimal confidence) { - this.confidence = confidence; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the V2MatchedFunction instance itself - */ - public V2MatchedFunction putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V2MatchedFunction v2MatchedFunction = (V2MatchedFunction) o; - return Objects.equals(this.functionId, v2MatchedFunction.functionId) && - Objects.equals(this.binaryId, v2MatchedFunction.binaryId) && - Objects.equals(this.functionName, v2MatchedFunction.functionName) && - Objects.equals(this.functionVaddr, v2MatchedFunction.functionVaddr) && - Objects.equals(this.mangledName, v2MatchedFunction.mangledName) && - Objects.equals(this.debug, v2MatchedFunction.debug) && - Objects.equals(this.binaryName, v2MatchedFunction.binaryName) && - Objects.equals(this.sha256Hash, v2MatchedFunction.sha256Hash) && - Objects.equals(this.analysisId, v2MatchedFunction.analysisId) && - Objects.equals(this.similarity, v2MatchedFunction.similarity) && - Objects.equals(this.confidence, v2MatchedFunction.confidence)&& - Objects.equals(this.additionalProperties, v2MatchedFunction.additionalProperties); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, binaryId, functionName, functionVaddr, mangledName, debug, binaryName, sha256Hash, analysisId, similarity, confidence, 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 V2MatchedFunction {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" binaryId: ").append(toIndentedString(binaryId)).append("\n"); - sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); - sb.append(" functionVaddr: ").append(toIndentedString(functionVaddr)).append("\n"); - sb.append(" mangledName: ").append(toIndentedString(mangledName)).append("\n"); - sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); - sb.append(" binaryName: ").append(toIndentedString(binaryName)).append("\n"); - sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n"); - sb.append(" analysisId: ").append(toIndentedString(analysisId)).append("\n"); - sb.append(" similarity: ").append(toIndentedString(similarity)).append("\n"); - sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("function_id", "binary_id", "function_name", "function_vaddr", "mangled_name", "debug", "binary_name", "sha_256_hash", "analysis_id", "similarity", "confidence")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id", "binary_id", "function_name", "function_vaddr", "mangled_name", "debug", "binary_name", "sha_256_hash", "analysis_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 V2MatchedFunction - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!V2MatchedFunction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in V2MatchedFunction is not found in the empty JSON string", V2MatchedFunction.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V2MatchedFunction.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").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("binary_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `binary_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binary_name").toString())); - } - if (!jsonObj.get("sha_256_hash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sha_256_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha_256_hash").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V2MatchedFunction.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V2MatchedFunction' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V2MatchedFunction.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V2MatchedFunction value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public V2MatchedFunction read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - V2MatchedFunction instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V2MatchedFunction given an JSON string - * - * @param jsonString JSON string - * @return An instance of V2MatchedFunction - * @throws IOException if the JSON string is invalid with respect to V2MatchedFunction - */ - public static V2MatchedFunction fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V2MatchedFunction.class); - } - - /** - * Convert an instance of V2MatchedFunction to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/ai/reveng/model/V2NameConfidence.java b/src/main/java/ai/reveng/model/V2NameConfidence.java deleted file mode 100644 index bc70a26f..00000000 --- a/src/main/java/ai/reveng/model/V2NameConfidence.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * RevEng.AI API - * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package ai.reveng.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import ai.reveng.invoker.JSON; - -/** - * V2NameConfidence - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class V2NameConfidence { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nonnull - private String name; - - public static final String SERIALIZED_NAME_CONFIDENCE = "confidence"; - @SerializedName(SERIALIZED_NAME_CONFIDENCE) - @javax.annotation.Nonnull - private BigDecimal confidence; - - public V2NameConfidence() { - } - - public V2NameConfidence name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The suggested function name - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - - public V2NameConfidence confidence(@javax.annotation.Nonnull BigDecimal confidence) { - this.confidence = confidence; - return this; - } - - /** - * Confidence score as a percentage - * minimum: 0 - * maximum: 100 - * @return confidence - */ - @javax.annotation.Nonnull - public BigDecimal getConfidence() { - return confidence; - } - - public void setConfidence(@javax.annotation.Nonnull BigDecimal confidence) { - this.confidence = confidence; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the V2NameConfidence instance itself - */ - public V2NameConfidence putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - V2NameConfidence v2NameConfidence = (V2NameConfidence) o; - return Objects.equals(this.name, v2NameConfidence.name) && - Objects.equals(this.confidence, v2NameConfidence.confidence)&& - Objects.equals(this.additionalProperties, v2NameConfidence.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(name, confidence, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class V2NameConfidence {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - return o == null ? "null" : o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "confidence")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "confidence")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to V2NameConfidence - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!V2NameConfidence.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in V2NameConfidence is not found in the empty JSON string", V2NameConfidence.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : V2NameConfidence.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!V2NameConfidence.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'V2NameConfidence' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(V2NameConfidence.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, V2NameConfidence value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public V2NameConfidence read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - V2NameConfidence instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of V2NameConfidence given an JSON string - * - * @param jsonString JSON string - * @return An instance of V2NameConfidence - * @throws IOException if the JSON string is invalid with respect to V2NameConfidence - */ - public static V2NameConfidence fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, V2NameConfidence.class); - } - - /** - * Convert an instance of V2NameConfidence to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} -