From 74a696e59db139cb8903ce951e9f9938f6fdc026 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 Jun 2026 09:00:40 +0000 Subject: [PATCH] Update SDK to version v3.95.1 - Generated from OpenAPI spec version v3.95.1 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 18 +- build.gradle | 4 +- build.sbt | 2 +- docs/BatchUpdateDataTypesInputBody.md | 13 + docs/BatchUpdateDataTypesItem.md | 15 + docs/BatchUpdateDataTypesOutputBody.md | 13 + docs/BatchUpdateDataTypesResult.md | 28 ++ docs/FunctionDataTypes.md | 2 +- docs/FunctionDataTypesListItem.md | 2 +- .../{FunctionInfoInput.md => FunctionInfo.md} | 4 +- docs/FunctionInfoOutput.md | 14 - .../{FunctionTypeInput.md => FunctionType.md} | 2 +- docs/FunctionsDataTypesApi.md | 136 ++++--- docs/UpdateDataTypesInputBody.md | 14 + docs/UpdateDataTypesOutputBody.md | 15 + docs/UpdateFunctionDataTypes.md | 14 - pom.xml | 2 +- .../ai/reveng/api/FunctionsDataTypesApi.java | 312 +++++++------- .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 12 +- .../model/BatchUpdateDataTypesInputBody.java | 226 ++++++++++ .../model/BatchUpdateDataTypesItem.java | 259 ++++++++++++ .../model/BatchUpdateDataTypesOutputBody.java | 226 ++++++++++ .../model/BatchUpdateDataTypesResult.java | 385 ++++++++++++++++++ .../ai/reveng/model/FunctionDataTypes.java | 12 +- .../model/FunctionDataTypesListItem.java | 12 +- ...nctionInfoInput.java => FunctionInfo.java} | 72 ++-- ...nctionTypeInput.java => FunctionType.java} | 86 ++-- ...pes.java => UpdateDataTypesInputBody.java} | 114 +++--- ...ut.java => UpdateDataTypesOutputBody.java} | 168 ++++---- 32 files changed, 1679 insertions(+), 509 deletions(-) create mode 100644 docs/BatchUpdateDataTypesInputBody.md create mode 100644 docs/BatchUpdateDataTypesItem.md create mode 100644 docs/BatchUpdateDataTypesOutputBody.md create mode 100644 docs/BatchUpdateDataTypesResult.md rename docs/{FunctionInfoInput.md => FunctionInfo.md} (64%) delete mode 100644 docs/FunctionInfoOutput.md rename docs/{FunctionTypeInput.md => FunctionType.md} (97%) create mode 100644 docs/UpdateDataTypesInputBody.md create mode 100644 docs/UpdateDataTypesOutputBody.md delete mode 100644 docs/UpdateFunctionDataTypes.md create mode 100644 src/main/java/ai/reveng/model/BatchUpdateDataTypesInputBody.java create mode 100644 src/main/java/ai/reveng/model/BatchUpdateDataTypesItem.java create mode 100644 src/main/java/ai/reveng/model/BatchUpdateDataTypesOutputBody.java create mode 100644 src/main/java/ai/reveng/model/BatchUpdateDataTypesResult.java rename src/main/java/ai/reveng/model/{FunctionInfoInput.java => FunctionInfo.java} (83%) rename src/main/java/ai/reveng/model/{FunctionTypeInput.java => FunctionType.java} (83%) rename src/main/java/ai/reveng/model/{UpdateFunctionDataTypes.java => UpdateDataTypesInputBody.java} (75%) rename src/main/java/ai/reveng/model/{FunctionInfoOutput.java => UpdateDataTypesOutputBody.java} (63%) diff --git a/.sdk-version b/.sdk-version index f6a594d5..e5bccb11 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.94.1 +v3.95.1 diff --git a/README.md b/README.md index 0a2e980c..98ff3185 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.94.1 + 3.95.1 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.94.1" + implementation "ai.reveng:sdk:3.95.1" } ``` @@ -193,12 +193,12 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**getFunctionDetails**](docs/FunctionsCoreApi.md#getFunctionDetails) | **GET** /v2/functions/{function_id} | Get function details *FunctionsCoreApi* | [**getFunctionStrings**](docs/FunctionsCoreApi.md#getFunctionStrings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function *FunctionsCoreApi* | [**getFunctionStrings_0**](docs/FunctionsCoreApi.md#getFunctionStrings_0) | **GET** /v3/functions/{function_id}/strings | List strings for a function. +*FunctionsDataTypesApi* | [**batchUpdateFunctionDataTypes**](docs/FunctionsDataTypesApi.md#batchUpdateFunctionDataTypes) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types *FunctionsDataTypesApi* | [**generateFunctionDataTypesForAnalysis**](docs/FunctionsDataTypesApi.md#generateFunctionDataTypesForAnalysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types *FunctionsDataTypesApi* | [**generateFunctionDataTypesForFunctions**](docs/FunctionsDataTypesApi.md#generateFunctionDataTypesForFunctions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions *FunctionsDataTypesApi* | [**getFunctionDataTypes**](docs/FunctionsDataTypesApi.md#getFunctionDataTypes) | **GET** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types *FunctionsDataTypesApi* | [**listFunctionDataTypesForAnalysis**](docs/FunctionsDataTypesApi.md#listFunctionDataTypesForAnalysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types *FunctionsDataTypesApi* | [**listFunctionDataTypesForFunctions**](docs/FunctionsDataTypesApi.md#listFunctionDataTypesForFunctions) | **GET** /v2/functions/data_types | List Function Data Types -*FunctionsDataTypesApi* | [**updateFunctionDataTypes**](docs/FunctionsDataTypesApi.md#updateFunctionDataTypes) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update Function Data Types *FunctionsRenamingHistoryApi* | [**batchRenameFunction**](docs/FunctionsRenamingHistoryApi.md#batchRenameFunction) | **POST** /v2/functions/rename/batch | Batch Rename Functions *FunctionsRenamingHistoryApi* | [**batchRenameFunctions**](docs/FunctionsRenamingHistoryApi.md#batchRenameFunctions) | **POST** /v3/functions/rename | Batch rename functions *FunctionsRenamingHistoryApi* | [**getFunctionHistory**](docs/FunctionsRenamingHistoryApi.md#getFunctionHistory) | **GET** /v3/functions/{function_id}/history | Get function name history @@ -339,6 +339,10 @@ Class | Method | HTTP request | Description - [BatchRenameInputBody](docs/BatchRenameInputBody.md) - [BatchRenameItem](docs/BatchRenameItem.md) - [BatchRenameOutputBody](docs/BatchRenameOutputBody.md) + - [BatchUpdateDataTypesInputBody](docs/BatchUpdateDataTypesInputBody.md) + - [BatchUpdateDataTypesItem](docs/BatchUpdateDataTypesItem.md) + - [BatchUpdateDataTypesOutputBody](docs/BatchUpdateDataTypesOutputBody.md) + - [BatchUpdateDataTypesResult](docs/BatchUpdateDataTypesResult.md) - [BinariesRelatedStatusResponse](docs/BinariesRelatedStatusResponse.md) - [BinariesTaskStatus](docs/BinariesTaskStatus.md) - [Binary](docs/Binary.md) @@ -458,8 +462,7 @@ Class | Method | HTTP request | Description - [FunctionDataTypesParams](docs/FunctionDataTypesParams.md) - [FunctionDataTypesStatus](docs/FunctionDataTypesStatus.md) - [FunctionHeader](docs/FunctionHeader.md) - - [FunctionInfoInput](docs/FunctionInfoInput.md) - - [FunctionInfoOutput](docs/FunctionInfoOutput.md) + - [FunctionInfo](docs/FunctionInfo.md) - [FunctionListItem](docs/FunctionListItem.md) - [FunctionLocalVariableResponse](docs/FunctionLocalVariableResponse.md) - [FunctionMapping](docs/FunctionMapping.md) @@ -477,7 +480,7 @@ Class | Method | HTTP request | Description - [FunctionString](docs/FunctionString.md) - [FunctionStringItem](docs/FunctionStringItem.md) - [FunctionStringsResponse](docs/FunctionStringsResponse.md) - - [FunctionTypeInput](docs/FunctionTypeInput.md) + - [FunctionType](docs/FunctionType.md) - [FunctionsDetailResponse](docs/FunctionsDetailResponse.md) - [FunctionsListRename](docs/FunctionsListRename.md) - [GenerateFunctionDataTypes](docs/GenerateFunctionDataTypes.md) @@ -621,7 +624,8 @@ Class | Method | HTTP request | Description - [TriggerDynamicExecutionInputBody](docs/TriggerDynamicExecutionInputBody.md) - [Ttp](docs/Ttp.md) - [TypeDefinition](docs/TypeDefinition.md) - - [UpdateFunctionDataTypes](docs/UpdateFunctionDataTypes.md) + - [UpdateDataTypesInputBody](docs/UpdateDataTypesInputBody.md) + - [UpdateDataTypesOutputBody](docs/UpdateDataTypesOutputBody.md) - [UploadFileType](docs/UploadFileType.md) - [UploadResponse](docs/UploadResponse.md) - [UpsertAiDecomplationRatingRequest](docs/UpsertAiDecomplationRatingRequest.md) diff --git a/build.gradle b/build.gradle index b1f035b3..16f42177 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.94.1' +version = '3.95.1' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.94.1") + coordinates("ai.reveng", "sdk", "3.95.1") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 8cdd7e19..b8bbafa4 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.94.1", + version := "3.95.1", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/BatchUpdateDataTypesInputBody.md b/docs/BatchUpdateDataTypesInputBody.md new file mode 100644 index 00000000..54bdacfc --- /dev/null +++ b/docs/BatchUpdateDataTypesInputBody.md @@ -0,0 +1,13 @@ + + +# BatchUpdateDataTypesInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**functions** | [**List<BatchUpdateDataTypesItem>**](BatchUpdateDataTypesItem.md) | List of functions to update. All function IDs must belong to the analysis in the URL. | | + + + diff --git a/docs/BatchUpdateDataTypesItem.md b/docs/BatchUpdateDataTypesItem.md new file mode 100644 index 00000000..c252fbc8 --- /dev/null +++ b/docs/BatchUpdateDataTypesItem.md @@ -0,0 +1,15 @@ + + +# BatchUpdateDataTypesItem + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dataTypes** | **Object** | | | +|**dataTypesVersion** | **Long** | Current stored version. Pass 0 on the first write. | | +|**functionId** | **Long** | Function ID | | + + + diff --git a/docs/BatchUpdateDataTypesOutputBody.md b/docs/BatchUpdateDataTypesOutputBody.md new file mode 100644 index 00000000..433856a7 --- /dev/null +++ b/docs/BatchUpdateDataTypesOutputBody.md @@ -0,0 +1,13 @@ + + +# BatchUpdateDataTypesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**results** | [**List<BatchUpdateDataTypesResult>**](BatchUpdateDataTypesResult.md) | Per-function outcomes in the same order as the input | | + + + diff --git a/docs/BatchUpdateDataTypesResult.md b/docs/BatchUpdateDataTypesResult.md new file mode 100644 index 00000000..4f0c46d2 --- /dev/null +++ b/docs/BatchUpdateDataTypesResult.md @@ -0,0 +1,28 @@ + + +# BatchUpdateDataTypesResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dataTypes** | **Object** | | [optional] | +|**dataTypesVersion** | **Long** | Version after update (present when status is 'updated') | [optional] | +|**error** | **String** | Error message (present when status is 'error') | [optional] | +|**functionId** | **Long** | Function ID | | +|**status** | [**StatusEnum**](#StatusEnum) | Outcome for this function | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| UPDATED | "updated" | +| VERSION_CONFLICT | "version_conflict" | +| ERROR | "error" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/FunctionDataTypes.md b/docs/FunctionDataTypes.md index a169f6ca..4aec6668 100644 --- a/docs/FunctionDataTypes.md +++ b/docs/FunctionDataTypes.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**completed** | **Boolean** | Whether the service has completed data types generation | | |**status** | **String** | The current status of the data types service | | -|**dataTypes** | [**FunctionInfoOutput**](FunctionInfoOutput.md) | Function data types information if available | [optional] | +|**dataTypes** | [**FunctionInfo**](FunctionInfo.md) | Function data types information if available | [optional] | |**dataTypesVersion** | **Integer** | If the data types information has been updated by the user, this field will be populated | [optional] | diff --git a/docs/FunctionDataTypesListItem.md b/docs/FunctionDataTypesListItem.md index 83ac4e1d..e10a4fc0 100644 --- a/docs/FunctionDataTypesListItem.md +++ b/docs/FunctionDataTypesListItem.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**completed** | **Boolean** | Whether the service has completed data types generation | | |**status** | **String** | The current status of the data types service | | -|**dataTypes** | [**FunctionInfoOutput**](FunctionInfoOutput.md) | Function data types information if available | [optional] | +|**dataTypes** | [**FunctionInfo**](FunctionInfo.md) | Function data types information if available | [optional] | |**dataTypesVersion** | **Integer** | If the data types information has been updated by the user, this field will be populated | [optional] | |**functionId** | **Long** | Function id | | diff --git a/docs/FunctionInfoInput.md b/docs/FunctionInfo.md similarity index 64% rename from docs/FunctionInfoInput.md rename to docs/FunctionInfo.md index ba6215f4..5e744900 100644 --- a/docs/FunctionInfoInput.md +++ b/docs/FunctionInfo.md @@ -1,13 +1,13 @@ -# FunctionInfoInput +# FunctionInfo ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**funcTypes** | [**FunctionTypeInput**](FunctionTypeInput.md) | Function type information | [optional] | +|**funcTypes** | [**FunctionType**](FunctionType.md) | Function type information | [optional] | |**funcDeps** | [**List<FuncDepsInner>**](FuncDepsInner.md) | List of function dependencies | | diff --git a/docs/FunctionInfoOutput.md b/docs/FunctionInfoOutput.md deleted file mode 100644 index 9fc46c97..00000000 --- a/docs/FunctionInfoOutput.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# FunctionInfoOutput - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**funcTypes** | [**FunctionTypeInput**](FunctionTypeInput.md) | Function type information | [optional] | -|**funcDeps** | [**List<FuncDepsInner>**](FuncDepsInner.md) | List of function dependencies | | - - - diff --git a/docs/FunctionTypeInput.md b/docs/FunctionType.md similarity index 97% rename from docs/FunctionTypeInput.md rename to docs/FunctionType.md index b0772025..d92b3b56 100644 --- a/docs/FunctionTypeInput.md +++ b/docs/FunctionType.md @@ -1,6 +1,6 @@ -# FunctionTypeInput +# FunctionType ## Properties diff --git a/docs/FunctionsDataTypesApi.md b/docs/FunctionsDataTypesApi.md index b6e2d8d3..31114667 100644 --- a/docs/FunctionsDataTypesApi.md +++ b/docs/FunctionsDataTypesApi.md @@ -4,21 +4,21 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**batchUpdateFunctionDataTypes**](FunctionsDataTypesApi.md#batchUpdateFunctionDataTypes) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types | | [**generateFunctionDataTypesForAnalysis**](FunctionsDataTypesApi.md#generateFunctionDataTypesForAnalysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types | | [**generateFunctionDataTypesForFunctions**](FunctionsDataTypesApi.md#generateFunctionDataTypesForFunctions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions | | [**getFunctionDataTypes**](FunctionsDataTypesApi.md#getFunctionDataTypes) | **GET** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types | | [**listFunctionDataTypesForAnalysis**](FunctionsDataTypesApi.md#listFunctionDataTypesForAnalysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types | | [**listFunctionDataTypesForFunctions**](FunctionsDataTypesApi.md#listFunctionDataTypesForFunctions) | **GET** /v2/functions/data_types | List Function Data Types | -| [**updateFunctionDataTypes**](FunctionsDataTypesApi.md#updateFunctionDataTypes) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update Function Data Types | - -# **generateFunctionDataTypesForAnalysis** -> BaseResponseGenerateFunctionDataTypes generateFunctionDataTypesForAnalysis(analysisId, functionDataTypesParams) + +# **batchUpdateFunctionDataTypes** +> BatchUpdateDataTypesOutputBody batchUpdateFunctionDataTypes(analysisId, batchUpdateDataTypesInputBody) -Generate Function Data Types +Batch update function data types -Submits a request to generate the function data types +Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example ```java @@ -42,13 +42,13 @@ public class Example { //APIKey.setApiKeyPrefix("Token"); FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); - Integer analysisId = 56; // Integer | - FunctionDataTypesParams functionDataTypesParams = new FunctionDataTypesParams(); // FunctionDataTypesParams | + Long analysisId = 56L; // Long | Analysis ID + BatchUpdateDataTypesInputBody batchUpdateDataTypesInputBody = new BatchUpdateDataTypesInputBody(); // BatchUpdateDataTypesInputBody | try { - BaseResponseGenerateFunctionDataTypes result = apiInstance.generateFunctionDataTypesForAnalysis(analysisId, functionDataTypesParams); + BatchUpdateDataTypesOutputBody result = apiInstance.batchUpdateFunctionDataTypes(analysisId, batchUpdateDataTypesInputBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#generateFunctionDataTypesForAnalysis"); + System.err.println("Exception when calling FunctionsDataTypesApi#batchUpdateFunctionDataTypes"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -62,12 +62,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | -| **functionDataTypesParams** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | | +| **analysisId** | **Long**| Analysis ID | | +| **batchUpdateDataTypesInputBody** | [**BatchUpdateDataTypesInputBody**](BatchUpdateDataTypesInputBody.md)| | | ### Return type -[**BaseResponseGenerateFunctionDataTypes**](BaseResponseGenerateFunctionDataTypes.md) +[**BatchUpdateDataTypesOutputBody**](BatchUpdateDataTypesOutputBody.md) ### Authorization @@ -81,14 +81,18 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **201** | Successful Response | - | -| **422** | Invalid request parameters | - | +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | - -# **generateFunctionDataTypesForFunctions** -> BaseResponseGenerationStatusList generateFunctionDataTypesForFunctions(functionDataTypesParams) + +# **generateFunctionDataTypesForAnalysis** +> BaseResponseGenerateFunctionDataTypes generateFunctionDataTypesForAnalysis(analysisId, functionDataTypesParams) -Generate Function Data Types for an arbitrary list of functions +Generate Function Data Types Submits a request to generate the function data types @@ -114,12 +118,13 @@ public class Example { //APIKey.setApiKeyPrefix("Token"); FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); + Integer analysisId = 56; // Integer | FunctionDataTypesParams functionDataTypesParams = new FunctionDataTypesParams(); // FunctionDataTypesParams | try { - BaseResponseGenerationStatusList result = apiInstance.generateFunctionDataTypesForFunctions(functionDataTypesParams); + BaseResponseGenerateFunctionDataTypes result = apiInstance.generateFunctionDataTypesForAnalysis(analysisId, functionDataTypesParams); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#generateFunctionDataTypesForFunctions"); + System.err.println("Exception when calling FunctionsDataTypesApi#generateFunctionDataTypesForAnalysis"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -133,11 +138,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **analysisId** | **Integer**| | | | **functionDataTypesParams** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | | ### Return type -[**BaseResponseGenerationStatusList**](BaseResponseGenerationStatusList.md) +[**BaseResponseGenerateFunctionDataTypes**](BaseResponseGenerateFunctionDataTypes.md) ### Authorization @@ -154,13 +160,13 @@ public class Example { | **201** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **getFunctionDataTypes** -> BaseResponseFunctionDataTypes getFunctionDataTypes(analysisId, functionId) + +# **generateFunctionDataTypesForFunctions** +> BaseResponseGenerationStatusList generateFunctionDataTypesForFunctions(functionDataTypesParams) -Get Function Data Types +Generate Function Data Types for an arbitrary list of functions -Polling endpoint which returns the current status of function generation and once completed the data type information +Submits a request to generate the function data types ### Example ```java @@ -184,13 +190,12 @@ public class Example { //APIKey.setApiKeyPrefix("Token"); FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); - Integer analysisId = 56; // Integer | - Integer functionId = 56; // Integer | + FunctionDataTypesParams functionDataTypesParams = new FunctionDataTypesParams(); // FunctionDataTypesParams | try { - BaseResponseFunctionDataTypes result = apiInstance.getFunctionDataTypes(analysisId, functionId); + BaseResponseGenerationStatusList result = apiInstance.generateFunctionDataTypesForFunctions(functionDataTypesParams); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#getFunctionDataTypes"); + System.err.println("Exception when calling FunctionsDataTypesApi#generateFunctionDataTypesForFunctions"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -204,12 +209,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | -| **functionId** | **Integer**| | | +| **functionDataTypesParams** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | | ### Return type -[**BaseResponseFunctionDataTypes**](BaseResponseFunctionDataTypes.md) +[**BaseResponseGenerationStatusList**](BaseResponseGenerationStatusList.md) ### Authorization @@ -217,22 +221,22 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Successful Response | - | +| **201** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **listFunctionDataTypesForAnalysis** -> BaseResponseFunctionDataTypesList listFunctionDataTypesForAnalysis(analysisId, functionIds) + +# **getFunctionDataTypes** +> BaseResponseFunctionDataTypes getFunctionDataTypes(analysisId, functionId) -List Function Data Types +Get Function Data Types -Returns data types for multiple functions with optional function ID filtering +Polling endpoint which returns the current status of function generation and once completed the data type information ### Example ```java @@ -257,12 +261,12 @@ public class Example { FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); Integer analysisId = 56; // Integer | - List functionIds = Arrays.asList(); // List | + Integer functionId = 56; // Integer | try { - BaseResponseFunctionDataTypesList result = apiInstance.listFunctionDataTypesForAnalysis(analysisId, functionIds); + BaseResponseFunctionDataTypes result = apiInstance.getFunctionDataTypes(analysisId, functionId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#listFunctionDataTypesForAnalysis"); + System.err.println("Exception when calling FunctionsDataTypesApi#getFunctionDataTypes"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -277,11 +281,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **analysisId** | **Integer**| | | -| **functionIds** | [**List<Integer>**](Integer.md)| | [optional] | +| **functionId** | **Integer**| | | ### Return type -[**BaseResponseFunctionDataTypesList**](BaseResponseFunctionDataTypesList.md) +[**BaseResponseFunctionDataTypes**](BaseResponseFunctionDataTypes.md) ### Authorization @@ -298,13 +302,13 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **listFunctionDataTypesForFunctions** -> BaseResponseFunctionDataTypesList listFunctionDataTypesForFunctions(functionIds) + +# **listFunctionDataTypesForAnalysis** +> BaseResponseFunctionDataTypesList listFunctionDataTypesForAnalysis(analysisId, functionIds) List Function Data Types -Returns data types for multiple function IDs +Returns data types for multiple functions with optional function ID filtering ### Example ```java @@ -328,12 +332,13 @@ public class Example { //APIKey.setApiKeyPrefix("Token"); FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); + Integer analysisId = 56; // Integer | List functionIds = Arrays.asList(); // List | try { - BaseResponseFunctionDataTypesList result = apiInstance.listFunctionDataTypesForFunctions(functionIds); + BaseResponseFunctionDataTypesList result = apiInstance.listFunctionDataTypesForAnalysis(analysisId, functionIds); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#listFunctionDataTypesForFunctions"); + System.err.println("Exception when calling FunctionsDataTypesApi#listFunctionDataTypesForAnalysis"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -347,6 +352,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **analysisId** | **Integer**| | | | **functionIds** | [**List<Integer>**](Integer.md)| | [optional] | ### Return type @@ -368,13 +374,13 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **updateFunctionDataTypes** -> BaseResponseFunctionDataTypes updateFunctionDataTypes(analysisId, functionId, updateFunctionDataTypes) + +# **listFunctionDataTypesForFunctions** +> BaseResponseFunctionDataTypesList listFunctionDataTypesForFunctions(functionIds) -Update Function Data Types +List Function Data Types -Updates the function data types for a given function +Returns data types for multiple function IDs ### Example ```java @@ -398,14 +404,12 @@ public class Example { //APIKey.setApiKeyPrefix("Token"); FunctionsDataTypesApi apiInstance = new FunctionsDataTypesApi(defaultClient); - Integer analysisId = 56; // Integer | - Integer functionId = 56; // Integer | - UpdateFunctionDataTypes updateFunctionDataTypes = new UpdateFunctionDataTypes(); // UpdateFunctionDataTypes | + List functionIds = Arrays.asList(); // List | try { - BaseResponseFunctionDataTypes result = apiInstance.updateFunctionDataTypes(analysisId, functionId, updateFunctionDataTypes); + BaseResponseFunctionDataTypesList result = apiInstance.listFunctionDataTypesForFunctions(functionIds); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FunctionsDataTypesApi#updateFunctionDataTypes"); + System.err.println("Exception when calling FunctionsDataTypesApi#listFunctionDataTypesForFunctions"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -419,13 +423,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **analysisId** | **Integer**| | | -| **functionId** | **Integer**| | | -| **updateFunctionDataTypes** | [**UpdateFunctionDataTypes**](UpdateFunctionDataTypes.md)| | | +| **functionIds** | [**List<Integer>**](Integer.md)| | [optional] | ### Return type -[**BaseResponseFunctionDataTypes**](BaseResponseFunctionDataTypes.md) +[**BaseResponseFunctionDataTypesList**](BaseResponseFunctionDataTypesList.md) ### Authorization @@ -433,7 +435,7 @@ public class Example { ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details diff --git a/docs/UpdateDataTypesInputBody.md b/docs/UpdateDataTypesInputBody.md new file mode 100644 index 00000000..65210fc3 --- /dev/null +++ b/docs/UpdateDataTypesInputBody.md @@ -0,0 +1,14 @@ + + +# UpdateDataTypesInputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dataTypes** | **Object** | | | +|**dataTypesVersion** | **Long** | Current version of the function data types. The update is rejected if the stored version has moved on. Pass 0 on the first write. | | + + + diff --git a/docs/UpdateDataTypesOutputBody.md b/docs/UpdateDataTypesOutputBody.md new file mode 100644 index 00000000..8f460951 --- /dev/null +++ b/docs/UpdateDataTypesOutputBody.md @@ -0,0 +1,15 @@ + + +# UpdateDataTypesOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dataTypes** | **Object** | | | +|**dataTypesVersion** | **Long** | Version of the stored function data types after the update | | +|**functionId** | **Long** | Function ID | | + + + diff --git a/docs/UpdateFunctionDataTypes.md b/docs/UpdateFunctionDataTypes.md deleted file mode 100644 index 72976676..00000000 --- a/docs/UpdateFunctionDataTypes.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# UpdateFunctionDataTypes - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**dataTypesVersion** | **Integer** | Version of the function data types, used to check this update is not overwriting a newer one | | -|**dataTypes** | [**FunctionInfoInput**](FunctionInfoInput.md) | Function data types information to update | | - - - diff --git a/pom.xml b/pom.xml index 6c95633a..d1cc553d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.94.1 + 3.95.1 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java b/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java index a2cbdc39..3229b1e4 100644 --- a/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java +++ b/src/main/java/ai/reveng/api/FunctionsDataTypesApi.java @@ -26,13 +26,15 @@ import java.io.IOException; +import ai.reveng.model.APIError; import ai.reveng.model.BaseResponse; import ai.reveng.model.BaseResponseFunctionDataTypes; import ai.reveng.model.BaseResponseFunctionDataTypesList; import ai.reveng.model.BaseResponseGenerateFunctionDataTypes; import ai.reveng.model.BaseResponseGenerationStatusList; +import ai.reveng.model.BatchUpdateDataTypesInputBody; +import ai.reveng.model.BatchUpdateDataTypesOutputBody; import ai.reveng.model.FunctionDataTypesParams; -import ai.reveng.model.UpdateFunctionDataTypes; import java.lang.reflect.Type; import java.util.ArrayList; @@ -77,6 +79,163 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for batchUpdateFunctionDataTypes + * @param analysisId Analysis ID (required) + * @param batchUpdateDataTypesInputBody (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call batchUpdateFunctionDataTypesCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull BatchUpdateDataTypesInputBody batchUpdateDataTypesInputBody, 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 = batchUpdateDataTypesInputBody; + + // create path and map variables + String localVarPath = "/v3/analyses/{analysis_id}/functions/data-types" + .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call batchUpdateFunctionDataTypesValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull BatchUpdateDataTypesInputBody batchUpdateDataTypesInputBody, 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 batchUpdateFunctionDataTypes(Async)"); + } + + // verify the required parameter 'batchUpdateDataTypesInputBody' is set + if (batchUpdateDataTypesInputBody == null) { + throw new ApiException("Missing the required parameter 'batchUpdateDataTypesInputBody' when calling batchUpdateFunctionDataTypes(Async)"); + } + + return batchUpdateFunctionDataTypesCall(analysisId, batchUpdateDataTypesInputBody, _callback); + + } + + /** + * Batch update function data types + * Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param batchUpdateDataTypesInputBody (required) + * @return BatchUpdateDataTypesOutputBody + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public BatchUpdateDataTypesOutputBody batchUpdateFunctionDataTypes(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull BatchUpdateDataTypesInputBody batchUpdateDataTypesInputBody) throws ApiException { + ApiResponse localVarResp = batchUpdateFunctionDataTypesWithHttpInfo(analysisId, batchUpdateDataTypesInputBody); + return localVarResp.getData(); + } + + /** + * Batch update function data types + * Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param batchUpdateDataTypesInputBody (required) + * @return ApiResponse<BatchUpdateDataTypesOutputBody> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse batchUpdateFunctionDataTypesWithHttpInfo(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull BatchUpdateDataTypesInputBody batchUpdateDataTypesInputBody) throws ApiException { + okhttp3.Call localVarCall = batchUpdateFunctionDataTypesValidateBeforeCall(analysisId, batchUpdateDataTypesInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Batch update function data types (asynchronously) + * Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + * @param analysisId Analysis ID (required) + * @param batchUpdateDataTypesInputBody (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call batchUpdateFunctionDataTypesAsync(@javax.annotation.Nonnull Long analysisId, @javax.annotation.Nonnull BatchUpdateDataTypesInputBody batchUpdateDataTypesInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = batchUpdateFunctionDataTypesValidateBeforeCall(analysisId, batchUpdateDataTypesInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for generateFunctionDataTypesForAnalysis * @param analysisId (required) @@ -758,155 +917,4 @@ public okhttp3.Call listFunctionDataTypesForFunctionsAsync(@javax.annotation.Nul localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for updateFunctionDataTypes - * @param analysisId (required) - * @param functionId (required) - * @param updateFunctionDataTypes (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call updateFunctionDataTypesCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull UpdateFunctionDataTypes updateFunctionDataTypes, 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 = updateFunctionDataTypes; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/functions/{function_id}/data_types" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())) - .replace("{" + "function_id" + "}", localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateFunctionDataTypesValidateBeforeCall(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull UpdateFunctionDataTypes updateFunctionDataTypes, 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 updateFunctionDataTypes(Async)"); - } - - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling updateFunctionDataTypes(Async)"); - } - - // verify the required parameter 'updateFunctionDataTypes' is set - if (updateFunctionDataTypes == null) { - throw new ApiException("Missing the required parameter 'updateFunctionDataTypes' when calling updateFunctionDataTypes(Async)"); - } - - return updateFunctionDataTypesCall(analysisId, functionId, updateFunctionDataTypes, _callback); - - } - - /** - * Update Function Data Types - * Updates the function data types for a given function - * @param analysisId (required) - * @param functionId (required) - * @param updateFunctionDataTypes (required) - * @return BaseResponseFunctionDataTypes - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public BaseResponseFunctionDataTypes updateFunctionDataTypes(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull UpdateFunctionDataTypes updateFunctionDataTypes) throws ApiException { - ApiResponse localVarResp = updateFunctionDataTypesWithHttpInfo(analysisId, functionId, updateFunctionDataTypes); - return localVarResp.getData(); - } - - /** - * Update Function Data Types - * Updates the function data types for a given function - * @param analysisId (required) - * @param functionId (required) - * @param updateFunctionDataTypes (required) - * @return ApiResponse<BaseResponseFunctionDataTypes> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public ApiResponse updateFunctionDataTypesWithHttpInfo(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull UpdateFunctionDataTypes updateFunctionDataTypes) throws ApiException { - okhttp3.Call localVarCall = updateFunctionDataTypesValidateBeforeCall(analysisId, functionId, updateFunctionDataTypes, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Function Data Types (asynchronously) - * Updates the function data types for a given function - * @param analysisId (required) - * @param functionId (required) - * @param updateFunctionDataTypes (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Response Details
Status Code Description Response Headers
200 Successful Response -
422 Invalid request parameters -
- */ - public okhttp3.Call updateFunctionDataTypesAsync(@javax.annotation.Nonnull Integer analysisId, @javax.annotation.Nonnull Integer functionId, @javax.annotation.Nonnull UpdateFunctionDataTypes updateFunctionDataTypes, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateFunctionDataTypesValidateBeforeCall(analysisId, functionId, updateFunctionDataTypes, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } } diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index f6cc8c65..2d140242 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -146,7 +146,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/3.94.1/java"); + setUserAgent("OpenAPI-Generator/3.95.1/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 36fe73e4..5e86c455 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.94.1"; + public static final String VERSION = "3.95.1"; 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 c9c130f8..47def183 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -214,6 +214,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchRenameInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchRenameItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchRenameOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchUpdateDataTypesInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchUpdateDataTypesItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchUpdateDataTypesOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BatchUpdateDataTypesResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinariesRelatedStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Binary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.BinaryAdditionalDetailsDataResponse.CustomTypeAdapterFactory()); @@ -327,8 +331,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDataTypesParams.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionDataTypesStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionHeader.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionInfoInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionInfoOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionListItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionLocalVariableResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionMapping.CustomTypeAdapterFactory()); @@ -345,7 +348,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionString.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionStringItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionStringsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionTypeInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionsDetailResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.FunctionsListRename.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GenerateFunctionDataTypes.CustomTypeAdapterFactory()); @@ -480,7 +483,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TriggerDynamicExecutionInputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Ttp.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.TypeDefinition.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateFunctionDataTypes.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateDataTypesInputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpdateDataTypesOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UploadResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpsertAiDecomplationRatingRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.UpsertOverridesData.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/BatchUpdateDataTypesInputBody.java b/src/main/java/ai/reveng/model/BatchUpdateDataTypesInputBody.java new file mode 100644 index 00000000..e49f1f26 --- /dev/null +++ b/src/main/java/ai/reveng/model/BatchUpdateDataTypesInputBody.java @@ -0,0 +1,226 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.BatchUpdateDataTypesItem; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * BatchUpdateDataTypesInputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BatchUpdateDataTypesInputBody { + public static final String SERIALIZED_NAME_FUNCTIONS = "functions"; + @SerializedName(SERIALIZED_NAME_FUNCTIONS) + @javax.annotation.Nullable + private List functions; + + public BatchUpdateDataTypesInputBody() { + } + + public BatchUpdateDataTypesInputBody functions(@javax.annotation.Nullable List functions) { + this.functions = functions; + return this; + } + + public BatchUpdateDataTypesInputBody addFunctionsItem(BatchUpdateDataTypesItem functionsItem) { + if (this.functions == null) { + this.functions = new ArrayList<>(); + } + this.functions.add(functionsItem); + return this; + } + + /** + * List of functions to update. All function IDs must belong to the analysis in the URL. + * @return functions + */ + @javax.annotation.Nullable + public List getFunctions() { + return functions; + } + + public void setFunctions(@javax.annotation.Nullable List functions) { + this.functions = functions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchUpdateDataTypesInputBody batchUpdateDataTypesInputBody = (BatchUpdateDataTypesInputBody) o; + return Objects.equals(this.functions, batchUpdateDataTypesInputBody.functions); + } + + @Override + public int hashCode() { + return Objects.hash(functions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchUpdateDataTypesInputBody {\n"); + sb.append(" functions: ").append(toIndentedString(functions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("functions")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("functions")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BatchUpdateDataTypesInputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchUpdateDataTypesInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BatchUpdateDataTypesInputBody is not found in the empty JSON string", BatchUpdateDataTypesInputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BatchUpdateDataTypesInputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `BatchUpdateDataTypesInputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchUpdateDataTypesInputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("functions") != null && !jsonObj.get("functions").isJsonNull()) { + if (!jsonObj.get("functions").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `functions` to be an array in the JSON string but got `%s`", jsonObj.get("functions").toString())); + } + JsonArray jsonArrayfunctions = jsonObj.getAsJsonArray("functions"); + // validate the required field `functions` (array) + for (int i = 0; i < jsonArrayfunctions.size(); i++) { + BatchUpdateDataTypesItem.validateJsonElement(jsonArrayfunctions.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchUpdateDataTypesInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchUpdateDataTypesInputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchUpdateDataTypesInputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchUpdateDataTypesInputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchUpdateDataTypesInputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchUpdateDataTypesInputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchUpdateDataTypesInputBody + * @throws IOException if the JSON string is invalid with respect to BatchUpdateDataTypesInputBody + */ + public static BatchUpdateDataTypesInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchUpdateDataTypesInputBody.class); + } + + /** + * Convert an instance of BatchUpdateDataTypesInputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BatchUpdateDataTypesItem.java b/src/main/java/ai/reveng/model/BatchUpdateDataTypesItem.java new file mode 100644 index 00000000..9a40e827 --- /dev/null +++ b/src/main/java/ai/reveng/model/BatchUpdateDataTypesItem.java @@ -0,0 +1,259 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * BatchUpdateDataTypesItem + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BatchUpdateDataTypesItem { + public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; + @SerializedName(SERIALIZED_NAME_DATA_TYPES) + @javax.annotation.Nullable + private Object dataTypes = null; + + public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; + @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) + @javax.annotation.Nonnull + private Long dataTypesVersion; + + public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + @javax.annotation.Nonnull + private Long functionId; + + public BatchUpdateDataTypesItem() { + } + + public BatchUpdateDataTypesItem dataTypes(@javax.annotation.Nullable Object dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Get dataTypes + * @return dataTypes + */ + @javax.annotation.Nullable + public Object getDataTypes() { + return dataTypes; + } + + public void setDataTypes(@javax.annotation.Nullable Object dataTypes) { + this.dataTypes = dataTypes; + } + + + public BatchUpdateDataTypesItem dataTypesVersion(@javax.annotation.Nonnull Long dataTypesVersion) { + this.dataTypesVersion = dataTypesVersion; + return this; + } + + /** + * Current stored version. Pass 0 on the first write. + * minimum: 0 + * @return dataTypesVersion + */ + @javax.annotation.Nonnull + public Long getDataTypesVersion() { + return dataTypesVersion; + } + + public void setDataTypesVersion(@javax.annotation.Nonnull Long dataTypesVersion) { + this.dataTypesVersion = dataTypesVersion; + } + + + public BatchUpdateDataTypesItem functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Function ID + * minimum: 1 + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchUpdateDataTypesItem batchUpdateDataTypesItem = (BatchUpdateDataTypesItem) o; + return Objects.equals(this.dataTypes, batchUpdateDataTypesItem.dataTypes) && + Objects.equals(this.dataTypesVersion, batchUpdateDataTypesItem.dataTypesVersion) && + Objects.equals(this.functionId, batchUpdateDataTypesItem.functionId); + } + + @Override + public int hashCode() { + return Objects.hash(dataTypes, dataTypesVersion, functionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchUpdateDataTypesItem {\n"); + sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); + sb.append(" dataTypesVersion: ").append(toIndentedString(dataTypesVersion)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data_types", "data_types_version", "function_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data_types", "data_types_version", "function_id")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BatchUpdateDataTypesItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchUpdateDataTypesItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BatchUpdateDataTypesItem is not found in the empty JSON string", BatchUpdateDataTypesItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BatchUpdateDataTypesItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `BatchUpdateDataTypesItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchUpdateDataTypesItem.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchUpdateDataTypesItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchUpdateDataTypesItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchUpdateDataTypesItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchUpdateDataTypesItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchUpdateDataTypesItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchUpdateDataTypesItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchUpdateDataTypesItem + * @throws IOException if the JSON string is invalid with respect to BatchUpdateDataTypesItem + */ + public static BatchUpdateDataTypesItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchUpdateDataTypesItem.class); + } + + /** + * Convert an instance of BatchUpdateDataTypesItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BatchUpdateDataTypesOutputBody.java b/src/main/java/ai/reveng/model/BatchUpdateDataTypesOutputBody.java new file mode 100644 index 00000000..45db416b --- /dev/null +++ b/src/main/java/ai/reveng/model/BatchUpdateDataTypesOutputBody.java @@ -0,0 +1,226 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.BatchUpdateDataTypesResult; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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; + +/** + * BatchUpdateDataTypesOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BatchUpdateDataTypesOutputBody { + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nullable + private List results; + + public BatchUpdateDataTypesOutputBody() { + } + + public BatchUpdateDataTypesOutputBody results(@javax.annotation.Nullable List results) { + this.results = results; + return this; + } + + public BatchUpdateDataTypesOutputBody addResultsItem(BatchUpdateDataTypesResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Per-function outcomes in the same order as the input + * @return results + */ + @javax.annotation.Nullable + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nullable List results) { + this.results = results; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchUpdateDataTypesOutputBody batchUpdateDataTypesOutputBody = (BatchUpdateDataTypesOutputBody) o; + return Objects.equals(this.results, batchUpdateDataTypesOutputBody.results); + } + + @Override + public int hashCode() { + return Objects.hash(results); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchUpdateDataTypesOutputBody {\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("results")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("results")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BatchUpdateDataTypesOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchUpdateDataTypesOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BatchUpdateDataTypesOutputBody is not found in the empty JSON string", BatchUpdateDataTypesOutputBody.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BatchUpdateDataTypesOutputBody.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `BatchUpdateDataTypesOutputBody` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchUpdateDataTypesOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + BatchUpdateDataTypesResult.validateJsonElement(jsonArrayresults.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchUpdateDataTypesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchUpdateDataTypesOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchUpdateDataTypesOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchUpdateDataTypesOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchUpdateDataTypesOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchUpdateDataTypesOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchUpdateDataTypesOutputBody + * @throws IOException if the JSON string is invalid with respect to BatchUpdateDataTypesOutputBody + */ + public static BatchUpdateDataTypesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchUpdateDataTypesOutputBody.class); + } + + /** + * Convert an instance of BatchUpdateDataTypesOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/BatchUpdateDataTypesResult.java b/src/main/java/ai/reveng/model/BatchUpdateDataTypesResult.java new file mode 100644 index 00000000..66bafadd --- /dev/null +++ b/src/main/java/ai/reveng/model/BatchUpdateDataTypesResult.java @@ -0,0 +1,385 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI 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; + +/** + * BatchUpdateDataTypesResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BatchUpdateDataTypesResult { + public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; + @SerializedName(SERIALIZED_NAME_DATA_TYPES) + @javax.annotation.Nullable + private Object dataTypes = null; + + public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; + @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) + @javax.annotation.Nullable + private Long dataTypesVersion; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nullable + private String error; + + public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + @javax.annotation.Nonnull + private Long functionId; + + /** + * Outcome for this function + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UPDATED("updated"), + + VERSION_CONFLICT("version_conflict"), + + ERROR("error"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public BatchUpdateDataTypesResult() { + } + + public BatchUpdateDataTypesResult dataTypes(@javax.annotation.Nullable Object dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Get dataTypes + * @return dataTypes + */ + @javax.annotation.Nullable + public Object getDataTypes() { + return dataTypes; + } + + public void setDataTypes(@javax.annotation.Nullable Object dataTypes) { + this.dataTypes = dataTypes; + } + + + public BatchUpdateDataTypesResult dataTypesVersion(@javax.annotation.Nullable Long dataTypesVersion) { + this.dataTypesVersion = dataTypesVersion; + return this; + } + + /** + * Version after update (present when status is 'updated') + * @return dataTypesVersion + */ + @javax.annotation.Nullable + public Long getDataTypesVersion() { + return dataTypesVersion; + } + + public void setDataTypesVersion(@javax.annotation.Nullable Long dataTypesVersion) { + this.dataTypesVersion = dataTypesVersion; + } + + + public BatchUpdateDataTypesResult error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Error message (present when status is 'error') + * @return error + */ + @javax.annotation.Nullable + public String getError() { + return error; + } + + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + + public BatchUpdateDataTypesResult functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + return this; + } + + /** + * Function ID + * @return functionId + */ + @javax.annotation.Nonnull + public Long getFunctionId() { + return functionId; + } + + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; + } + + + public BatchUpdateDataTypesResult status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Outcome for this function + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchUpdateDataTypesResult batchUpdateDataTypesResult = (BatchUpdateDataTypesResult) o; + return Objects.equals(this.dataTypes, batchUpdateDataTypesResult.dataTypes) && + Objects.equals(this.dataTypesVersion, batchUpdateDataTypesResult.dataTypesVersion) && + Objects.equals(this.error, batchUpdateDataTypesResult.error) && + Objects.equals(this.functionId, batchUpdateDataTypesResult.functionId) && + Objects.equals(this.status, batchUpdateDataTypesResult.status); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(dataTypes, dataTypesVersion, error, functionId, status); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchUpdateDataTypesResult {\n"); + sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); + sb.append(" dataTypesVersion: ").append(toIndentedString(dataTypesVersion)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data_types", "data_types_version", "error", "function_id", "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("function_id", "status")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BatchUpdateDataTypesResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchUpdateDataTypesResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in BatchUpdateDataTypesResult is not found in the empty JSON string", BatchUpdateDataTypesResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BatchUpdateDataTypesResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `BatchUpdateDataTypesResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchUpdateDataTypesResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchUpdateDataTypesResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchUpdateDataTypesResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchUpdateDataTypesResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchUpdateDataTypesResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchUpdateDataTypesResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchUpdateDataTypesResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchUpdateDataTypesResult + * @throws IOException if the JSON string is invalid with respect to BatchUpdateDataTypesResult + */ + public static BatchUpdateDataTypesResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchUpdateDataTypesResult.class); + } + + /** + * Convert an instance of BatchUpdateDataTypesResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/FunctionDataTypes.java b/src/main/java/ai/reveng/model/FunctionDataTypes.java index f348aefb..4151daeb 100644 --- a/src/main/java/ai/reveng/model/FunctionDataTypes.java +++ b/src/main/java/ai/reveng/model/FunctionDataTypes.java @@ -13,7 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.FunctionInfoOutput; +import ai.reveng.model.FunctionInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -64,7 +64,7 @@ public class FunctionDataTypes { public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; @SerializedName(SERIALIZED_NAME_DATA_TYPES) @javax.annotation.Nullable - private FunctionInfoOutput dataTypes; + private FunctionInfo dataTypes; public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) @@ -112,7 +112,7 @@ public void setStatus(@javax.annotation.Nonnull String status) { } - public FunctionDataTypes dataTypes(@javax.annotation.Nullable FunctionInfoOutput dataTypes) { + public FunctionDataTypes dataTypes(@javax.annotation.Nullable FunctionInfo dataTypes) { this.dataTypes = dataTypes; return this; } @@ -122,11 +122,11 @@ public FunctionDataTypes dataTypes(@javax.annotation.Nullable FunctionInfoOutput * @return dataTypes */ @javax.annotation.Nullable - public FunctionInfoOutput getDataTypes() { + public FunctionInfo getDataTypes() { return dataTypes; } - public void setDataTypes(@javax.annotation.Nullable FunctionInfoOutput dataTypes) { + public void setDataTypes(@javax.annotation.Nullable FunctionInfo dataTypes) { this.dataTypes = dataTypes; } @@ -285,7 +285,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `data_types` if (jsonObj.get("data_types") != null && !jsonObj.get("data_types").isJsonNull()) { - FunctionInfoOutput.validateJsonElement(jsonObj.get("data_types")); + FunctionInfo.validateJsonElement(jsonObj.get("data_types")); } } diff --git a/src/main/java/ai/reveng/model/FunctionDataTypesListItem.java b/src/main/java/ai/reveng/model/FunctionDataTypesListItem.java index 39a491d9..f9db9668 100644 --- a/src/main/java/ai/reveng/model/FunctionDataTypesListItem.java +++ b/src/main/java/ai/reveng/model/FunctionDataTypesListItem.java @@ -13,7 +13,7 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.FunctionInfoOutput; +import ai.reveng.model.FunctionInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -64,7 +64,7 @@ public class FunctionDataTypesListItem { public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; @SerializedName(SERIALIZED_NAME_DATA_TYPES) @javax.annotation.Nullable - private FunctionInfoOutput dataTypes; + private FunctionInfo dataTypes; public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) @@ -117,7 +117,7 @@ public void setStatus(@javax.annotation.Nonnull String status) { } - public FunctionDataTypesListItem dataTypes(@javax.annotation.Nullable FunctionInfoOutput dataTypes) { + public FunctionDataTypesListItem dataTypes(@javax.annotation.Nullable FunctionInfo dataTypes) { this.dataTypes = dataTypes; return this; } @@ -127,11 +127,11 @@ public FunctionDataTypesListItem dataTypes(@javax.annotation.Nullable FunctionIn * @return dataTypes */ @javax.annotation.Nullable - public FunctionInfoOutput getDataTypes() { + public FunctionInfo getDataTypes() { return dataTypes; } - public void setDataTypes(@javax.annotation.Nullable FunctionInfoOutput dataTypes) { + public void setDataTypes(@javax.annotation.Nullable FunctionInfo dataTypes) { this.dataTypes = dataTypes; } @@ -311,7 +311,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `data_types` if (jsonObj.get("data_types") != null && !jsonObj.get("data_types").isJsonNull()) { - FunctionInfoOutput.validateJsonElement(jsonObj.get("data_types")); + FunctionInfo.validateJsonElement(jsonObj.get("data_types")); } } diff --git a/src/main/java/ai/reveng/model/FunctionInfoInput.java b/src/main/java/ai/reveng/model/FunctionInfo.java similarity index 83% rename from src/main/java/ai/reveng/model/FunctionInfoInput.java rename to src/main/java/ai/reveng/model/FunctionInfo.java index 736c53e7..0453e340 100644 --- a/src/main/java/ai/reveng/model/FunctionInfoInput.java +++ b/src/main/java/ai/reveng/model/FunctionInfo.java @@ -14,7 +14,7 @@ import java.util.Objects; import ai.reveng.model.FuncDepsInner; -import ai.reveng.model.FunctionTypeInput; +import ai.reveng.model.FunctionType; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -50,24 +50,24 @@ import ai.reveng.invoker.JSON; /** - * FunctionInfoInput + * FunctionInfo */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionInfoInput { +public class FunctionInfo { public static final String SERIALIZED_NAME_FUNC_TYPES = "func_types"; @SerializedName(SERIALIZED_NAME_FUNC_TYPES) @javax.annotation.Nullable - private FunctionTypeInput funcTypes; + private FunctionType funcTypes; public static final String SERIALIZED_NAME_FUNC_DEPS = "func_deps"; @SerializedName(SERIALIZED_NAME_FUNC_DEPS) @javax.annotation.Nonnull private List funcDeps = new ArrayList<>(); - public FunctionInfoInput() { + public FunctionInfo() { } - public FunctionInfoInput funcTypes(@javax.annotation.Nullable FunctionTypeInput funcTypes) { + public FunctionInfo funcTypes(@javax.annotation.Nullable FunctionType funcTypes) { this.funcTypes = funcTypes; return this; } @@ -77,21 +77,21 @@ public FunctionInfoInput funcTypes(@javax.annotation.Nullable FunctionTypeInput * @return funcTypes */ @javax.annotation.Nullable - public FunctionTypeInput getFuncTypes() { + public FunctionType getFuncTypes() { return funcTypes; } - public void setFuncTypes(@javax.annotation.Nullable FunctionTypeInput funcTypes) { + public void setFuncTypes(@javax.annotation.Nullable FunctionType funcTypes) { this.funcTypes = funcTypes; } - public FunctionInfoInput funcDeps(@javax.annotation.Nonnull List funcDeps) { + public FunctionInfo funcDeps(@javax.annotation.Nonnull List funcDeps) { this.funcDeps = funcDeps; return this; } - public FunctionInfoInput addFuncDepsItem(FuncDepsInner funcDepsItem) { + public FunctionInfo addFuncDepsItem(FuncDepsInner funcDepsItem) { if (this.funcDeps == null) { this.funcDeps = new ArrayList<>(); } @@ -125,9 +125,9 @@ public void setFuncDeps(@javax.annotation.Nonnull List funcDeps) * * @param key name of the property * @param value value of the property - * @return the FunctionInfoInput instance itself + * @return the FunctionInfo instance itself */ - public FunctionInfoInput putAdditionalProperty(String key, Object value) { + public FunctionInfo putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -166,10 +166,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - FunctionInfoInput functionInfoInput = (FunctionInfoInput) o; - return Objects.equals(this.funcTypes, functionInfoInput.funcTypes) && - Objects.equals(this.funcDeps, functionInfoInput.funcDeps)&& - Objects.equals(this.additionalProperties, functionInfoInput.additionalProperties); + FunctionInfo functionInfo = (FunctionInfo) o; + return Objects.equals(this.funcTypes, functionInfo.funcTypes) && + Objects.equals(this.funcDeps, functionInfo.funcDeps)&& + Objects.equals(this.additionalProperties, functionInfo.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -191,7 +191,7 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class FunctionInfoInput {\n"); + sb.append("class FunctionInfo {\n"); sb.append(" funcTypes: ").append(toIndentedString(funcTypes)).append("\n"); sb.append(" funcDeps: ").append(toIndentedString(funcDeps)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -223,17 +223,17 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionInfoInput + * @throws IOException if the JSON Element is invalid with respect to FunctionInfo */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!FunctionInfoInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionInfoInput is not found in the empty JSON string", FunctionInfoInput.openapiRequiredFields.toString())); + if (!FunctionInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionInfo is not found in the empty JSON string", FunctionInfo.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionInfoInput.openapiRequiredFields) { + for (String requiredField : FunctionInfo.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())); } @@ -241,7 +241,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `func_types` if (jsonObj.get("func_types") != null && !jsonObj.get("func_types").isJsonNull()) { - FunctionTypeInput.validateJsonElement(jsonObj.get("func_types")); + FunctionType.validateJsonElement(jsonObj.get("func_types")); } if (jsonObj.get("func_deps") != null) { if (!jsonObj.get("func_deps").isJsonArray()) { @@ -259,16 +259,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionInfoInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionInfoInput' and its subtypes + if (!FunctionInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionInfo' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionInfoInput.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionInfo.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, FunctionInfoInput value) throws IOException { + public void write(JsonWriter out, FunctionInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -296,12 +296,12 @@ else if (entry.getValue() instanceof Character) } @Override - public FunctionInfoInput read(JsonReader in) throws IOException { + public FunctionInfo read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - FunctionInfoInput instance = thisAdapter.fromJsonTree(jsonObj); + FunctionInfo instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -328,18 +328,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of FunctionInfoInput given an JSON string + * Create an instance of FunctionInfo given an JSON string * * @param jsonString JSON string - * @return An instance of FunctionInfoInput - * @throws IOException if the JSON string is invalid with respect to FunctionInfoInput + * @return An instance of FunctionInfo + * @throws IOException if the JSON string is invalid with respect to FunctionInfo */ - public static FunctionInfoInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionInfoInput.class); + public static FunctionInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionInfo.class); } /** - * Convert an instance of FunctionInfoInput to an JSON string + * Convert an instance of FunctionInfo to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/FunctionTypeInput.java b/src/main/java/ai/reveng/model/FunctionType.java similarity index 83% rename from src/main/java/ai/reveng/model/FunctionTypeInput.java rename to src/main/java/ai/reveng/model/FunctionType.java index d32ed24b..2241523d 100644 --- a/src/main/java/ai/reveng/model/FunctionTypeInput.java +++ b/src/main/java/ai/reveng/model/FunctionType.java @@ -50,10 +50,10 @@ import ai.reveng.invoker.JSON; /** - * FunctionTypeInput + * FunctionType */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionTypeInput { +public class FunctionType { public static final String SERIALIZED_NAME_LAST_CHANGE = "last_change"; @SerializedName(SERIALIZED_NAME_LAST_CHANGE) @javax.annotation.Nullable @@ -94,10 +94,10 @@ public class FunctionTypeInput { @javax.annotation.Nullable private String artifactType = "Function"; - public FunctionTypeInput() { + public FunctionType() { } - public FunctionTypeInput lastChange(@javax.annotation.Nullable String lastChange) { + public FunctionType lastChange(@javax.annotation.Nullable String lastChange) { this.lastChange = lastChange; return this; } @@ -116,7 +116,7 @@ public void setLastChange(@javax.annotation.Nullable String lastChange) { } - public FunctionTypeInput addr(@javax.annotation.Nonnull Integer addr) { + public FunctionType addr(@javax.annotation.Nonnull Integer addr) { this.addr = addr; return this; } @@ -135,7 +135,7 @@ public void setAddr(@javax.annotation.Nonnull Integer addr) { } - public FunctionTypeInput size(@javax.annotation.Nonnull Integer size) { + public FunctionType size(@javax.annotation.Nonnull Integer size) { this.size = size; return this; } @@ -154,7 +154,7 @@ public void setSize(@javax.annotation.Nonnull Integer size) { } - public FunctionTypeInput header(@javax.annotation.Nonnull FunctionHeader header) { + public FunctionType header(@javax.annotation.Nonnull FunctionHeader header) { this.header = header; return this; } @@ -173,12 +173,12 @@ public void setHeader(@javax.annotation.Nonnull FunctionHeader header) { } - public FunctionTypeInput stackVars(@javax.annotation.Nullable Map stackVars) { + public FunctionType stackVars(@javax.annotation.Nullable Map stackVars) { this.stackVars = stackVars; return this; } - public FunctionTypeInput putStackVarsItem(String key, StackVariable stackVarsItem) { + public FunctionType putStackVarsItem(String key, StackVariable stackVarsItem) { if (this.stackVars == null) { this.stackVars = new HashMap<>(); } @@ -200,7 +200,7 @@ public void setStackVars(@javax.annotation.Nullable Map s } - public FunctionTypeInput name(@javax.annotation.Nonnull String name) { + public FunctionType name(@javax.annotation.Nonnull String name) { this.name = name; return this; } @@ -219,7 +219,7 @@ public void setName(@javax.annotation.Nonnull String name) { } - public FunctionTypeInput type(@javax.annotation.Nonnull String type) { + public FunctionType type(@javax.annotation.Nonnull String type) { this.type = type; return this; } @@ -238,7 +238,7 @@ public void setType(@javax.annotation.Nonnull String type) { } - public FunctionTypeInput artifactType(@javax.annotation.Nullable String artifactType) { + public FunctionType artifactType(@javax.annotation.Nullable String artifactType) { this.artifactType = artifactType; return this; } @@ -269,9 +269,9 @@ public void setArtifactType(@javax.annotation.Nullable String artifactType) { * * @param key name of the property * @param value value of the property - * @return the FunctionTypeInput instance itself + * @return the FunctionType instance itself */ - public FunctionTypeInput putAdditionalProperty(String key, Object value) { + public FunctionType putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -310,16 +310,16 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - FunctionTypeInput functionTypeInput = (FunctionTypeInput) o; - return Objects.equals(this.lastChange, functionTypeInput.lastChange) && - Objects.equals(this.addr, functionTypeInput.addr) && - Objects.equals(this.size, functionTypeInput.size) && - Objects.equals(this.header, functionTypeInput.header) && - Objects.equals(this.stackVars, functionTypeInput.stackVars) && - Objects.equals(this.name, functionTypeInput.name) && - Objects.equals(this.type, functionTypeInput.type) && - Objects.equals(this.artifactType, functionTypeInput.artifactType)&& - Objects.equals(this.additionalProperties, functionTypeInput.additionalProperties); + FunctionType functionType = (FunctionType) o; + return Objects.equals(this.lastChange, functionType.lastChange) && + Objects.equals(this.addr, functionType.addr) && + Objects.equals(this.size, functionType.size) && + Objects.equals(this.header, functionType.header) && + Objects.equals(this.stackVars, functionType.stackVars) && + Objects.equals(this.name, functionType.name) && + Objects.equals(this.type, functionType.type) && + Objects.equals(this.artifactType, functionType.artifactType)&& + Objects.equals(this.additionalProperties, functionType.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -341,7 +341,7 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class FunctionTypeInput {\n"); + sb.append("class FunctionType {\n"); sb.append(" lastChange: ").append(toIndentedString(lastChange)).append("\n"); sb.append(" addr: ").append(toIndentedString(addr)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); @@ -379,17 +379,17 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionTypeInput + * @throws IOException if the JSON Element is invalid with respect to FunctionType */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!FunctionTypeInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionTypeInput is not found in the empty JSON string", FunctionTypeInput.openapiRequiredFields.toString())); + if (!FunctionType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionType is not found in the empty JSON string", FunctionType.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionTypeInput.openapiRequiredFields) { + for (String requiredField : FunctionType.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())); } @@ -415,16 +415,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionTypeInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionTypeInput' and its subtypes + if (!FunctionType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionType' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionTypeInput.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FunctionType.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, FunctionTypeInput value) throws IOException { + public void write(JsonWriter out, FunctionType value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -452,12 +452,12 @@ else if (entry.getValue() instanceof Character) } @Override - public FunctionTypeInput read(JsonReader in) throws IOException { + public FunctionType read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - FunctionTypeInput instance = thisAdapter.fromJsonTree(jsonObj); + FunctionType instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -484,18 +484,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of FunctionTypeInput given an JSON string + * Create an instance of FunctionType given an JSON string * * @param jsonString JSON string - * @return An instance of FunctionTypeInput - * @throws IOException if the JSON string is invalid with respect to FunctionTypeInput + * @return An instance of FunctionType + * @throws IOException if the JSON string is invalid with respect to FunctionType */ - public static FunctionTypeInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionTypeInput.class); + public static FunctionType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionType.class); } /** - * Convert an instance of FunctionTypeInput to an JSON string + * Convert an instance of FunctionType to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/UpdateFunctionDataTypes.java b/src/main/java/ai/reveng/model/UpdateDataTypesInputBody.java similarity index 75% rename from src/main/java/ai/reveng/model/UpdateFunctionDataTypes.java rename to src/main/java/ai/reveng/model/UpdateDataTypesInputBody.java index df8d80ca..b7d50b7c 100644 --- a/src/main/java/ai/reveng/model/UpdateFunctionDataTypes.java +++ b/src/main/java/ai/reveng/model/UpdateDataTypesInputBody.java @@ -13,7 +13,6 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.FunctionInfoInput; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -46,58 +45,59 @@ import ai.reveng.invoker.JSON; /** - * UpdateFunctionDataTypes + * UpdateDataTypesInputBody */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class UpdateFunctionDataTypes { - public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; - @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) - @javax.annotation.Nonnull - private Integer dataTypesVersion; - +public class UpdateDataTypesInputBody { public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; @SerializedName(SERIALIZED_NAME_DATA_TYPES) + @javax.annotation.Nullable + private Object dataTypes = null; + + public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; + @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) @javax.annotation.Nonnull - private FunctionInfoInput dataTypes; + private Long dataTypesVersion; - public UpdateFunctionDataTypes() { + public UpdateDataTypesInputBody() { } - public UpdateFunctionDataTypes dataTypesVersion(@javax.annotation.Nonnull Integer dataTypesVersion) { - this.dataTypesVersion = dataTypesVersion; + public UpdateDataTypesInputBody dataTypes(@javax.annotation.Nullable Object dataTypes) { + this.dataTypes = dataTypes; return this; } /** - * Version of the function data types, used to check this update is not overwriting a newer one - * @return dataTypesVersion + * Get dataTypes + * @return dataTypes */ - @javax.annotation.Nonnull - public Integer getDataTypesVersion() { - return dataTypesVersion; + @javax.annotation.Nullable + public Object getDataTypes() { + return dataTypes; } - public void setDataTypesVersion(@javax.annotation.Nonnull Integer dataTypesVersion) { - this.dataTypesVersion = dataTypesVersion; + public void setDataTypes(@javax.annotation.Nullable Object dataTypes) { + this.dataTypes = dataTypes; } - public UpdateFunctionDataTypes dataTypes(@javax.annotation.Nonnull FunctionInfoInput dataTypes) { - this.dataTypes = dataTypes; + public UpdateDataTypesInputBody dataTypesVersion(@javax.annotation.Nonnull Long dataTypesVersion) { + this.dataTypesVersion = dataTypesVersion; return this; } /** - * Function data types information to update - * @return dataTypes + * Current version of the function data types. The update is rejected if the stored version has moved on. Pass 0 on the first write. + * minimum: 0 + * @return dataTypesVersion */ @javax.annotation.Nonnull - public FunctionInfoInput getDataTypes() { - return dataTypes; + public Long getDataTypesVersion() { + return dataTypesVersion; } - public void setDataTypes(@javax.annotation.Nonnull FunctionInfoInput dataTypes) { - this.dataTypes = dataTypes; + public void setDataTypesVersion(@javax.annotation.Nonnull Long dataTypesVersion) { + this.dataTypesVersion = dataTypesVersion; } /** @@ -113,9 +113,9 @@ public void setDataTypes(@javax.annotation.Nonnull FunctionInfoInput dataTypes) * * @param key name of the property * @param value value of the property - * @return the UpdateFunctionDataTypes instance itself + * @return the UpdateDataTypesInputBody instance itself */ - public UpdateFunctionDataTypes putAdditionalProperty(String key, Object value) { + public UpdateDataTypesInputBody putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -154,23 +154,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - UpdateFunctionDataTypes updateFunctionDataTypes = (UpdateFunctionDataTypes) o; - return Objects.equals(this.dataTypesVersion, updateFunctionDataTypes.dataTypesVersion) && - Objects.equals(this.dataTypes, updateFunctionDataTypes.dataTypes)&& - Objects.equals(this.additionalProperties, updateFunctionDataTypes.additionalProperties); + UpdateDataTypesInputBody updateDataTypesInputBody = (UpdateDataTypesInputBody) o; + return Objects.equals(this.dataTypes, updateDataTypesInputBody.dataTypes) && + Objects.equals(this.dataTypesVersion, updateDataTypesInputBody.dataTypesVersion)&& + Objects.equals(this.additionalProperties, updateDataTypesInputBody.additionalProperties); } @Override public int hashCode() { - return Objects.hash(dataTypesVersion, dataTypes, additionalProperties); + return Objects.hash(dataTypes, dataTypesVersion, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class UpdateFunctionDataTypes {\n"); - sb.append(" dataTypesVersion: ").append(toIndentedString(dataTypesVersion)).append("\n"); + sb.append("class UpdateDataTypesInputBody {\n"); sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); + sb.append(" dataTypesVersion: ").append(toIndentedString(dataTypesVersion)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -190,50 +190,48 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("data_types_version", "data_types")); + openapiFields = new HashSet(Arrays.asList("data_types", "data_types_version")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("data_types_version", "data_types")); + openapiRequiredFields = new HashSet(Arrays.asList("data_types", "data_types_version")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateFunctionDataTypes + * @throws IOException if the JSON Element is invalid with respect to UpdateDataTypesInputBody */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!UpdateFunctionDataTypes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateFunctionDataTypes is not found in the empty JSON string", UpdateFunctionDataTypes.openapiRequiredFields.toString())); + if (!UpdateDataTypesInputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateDataTypesInputBody is not found in the empty JSON string", UpdateDataTypesInputBody.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateFunctionDataTypes.openapiRequiredFields) { + for (String requiredField : UpdateDataTypesInputBody.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `data_types` - FunctionInfoInput.validateJsonElement(jsonObj.get("data_types")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateFunctionDataTypes.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateFunctionDataTypes' and its subtypes + if (!UpdateDataTypesInputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateDataTypesInputBody' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UpdateFunctionDataTypes.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateDataTypesInputBody.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, UpdateFunctionDataTypes value) throws IOException { + public void write(JsonWriter out, UpdateDataTypesInputBody value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -261,12 +259,12 @@ else if (entry.getValue() instanceof Character) } @Override - public UpdateFunctionDataTypes read(JsonReader in) throws IOException { + public UpdateDataTypesInputBody read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - UpdateFunctionDataTypes instance = thisAdapter.fromJsonTree(jsonObj); + UpdateDataTypesInputBody instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -293,18 +291,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of UpdateFunctionDataTypes given an JSON string + * Create an instance of UpdateDataTypesInputBody given an JSON string * * @param jsonString JSON string - * @return An instance of UpdateFunctionDataTypes - * @throws IOException if the JSON string is invalid with respect to UpdateFunctionDataTypes + * @return An instance of UpdateDataTypesInputBody + * @throws IOException if the JSON string is invalid with respect to UpdateDataTypesInputBody */ - public static UpdateFunctionDataTypes fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateFunctionDataTypes.class); + public static UpdateDataTypesInputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateDataTypesInputBody.class); } /** - * Convert an instance of UpdateFunctionDataTypes to an JSON string + * Convert an instance of UpdateDataTypesInputBody to an JSON string * * @return JSON string */ diff --git a/src/main/java/ai/reveng/model/FunctionInfoOutput.java b/src/main/java/ai/reveng/model/UpdateDataTypesOutputBody.java similarity index 63% rename from src/main/java/ai/reveng/model/FunctionInfoOutput.java rename to src/main/java/ai/reveng/model/UpdateDataTypesOutputBody.java index e1cf9d0f..71fc62c0 100644 --- a/src/main/java/ai/reveng/model/FunctionInfoOutput.java +++ b/src/main/java/ai/reveng/model/UpdateDataTypesOutputBody.java @@ -13,18 +13,13 @@ package ai.reveng.model; import java.util.Objects; -import ai.reveng.model.FuncDepsInner; -import ai.reveng.model.FunctionTypeInput; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -50,66 +45,82 @@ import ai.reveng.invoker.JSON; /** - * FunctionInfoOutput + * UpdateDataTypesOutputBody */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FunctionInfoOutput { - public static final String SERIALIZED_NAME_FUNC_TYPES = "func_types"; - @SerializedName(SERIALIZED_NAME_FUNC_TYPES) +public class UpdateDataTypesOutputBody { + public static final String SERIALIZED_NAME_DATA_TYPES = "data_types"; + @SerializedName(SERIALIZED_NAME_DATA_TYPES) @javax.annotation.Nullable - private FunctionTypeInput funcTypes; + private Object dataTypes = null; + + public static final String SERIALIZED_NAME_DATA_TYPES_VERSION = "data_types_version"; + @SerializedName(SERIALIZED_NAME_DATA_TYPES_VERSION) + @javax.annotation.Nonnull + private Long dataTypesVersion; - public static final String SERIALIZED_NAME_FUNC_DEPS = "func_deps"; - @SerializedName(SERIALIZED_NAME_FUNC_DEPS) + public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) @javax.annotation.Nonnull - private List funcDeps = new ArrayList<>(); + private Long functionId; - public FunctionInfoOutput() { + public UpdateDataTypesOutputBody() { } - public FunctionInfoOutput funcTypes(@javax.annotation.Nullable FunctionTypeInput funcTypes) { - this.funcTypes = funcTypes; + public UpdateDataTypesOutputBody dataTypes(@javax.annotation.Nullable Object dataTypes) { + this.dataTypes = dataTypes; return this; } /** - * Function type information - * @return funcTypes + * Get dataTypes + * @return dataTypes */ @javax.annotation.Nullable - public FunctionTypeInput getFuncTypes() { - return funcTypes; + public Object getDataTypes() { + return dataTypes; } - public void setFuncTypes(@javax.annotation.Nullable FunctionTypeInput funcTypes) { - this.funcTypes = funcTypes; + public void setDataTypes(@javax.annotation.Nullable Object dataTypes) { + this.dataTypes = dataTypes; } - public FunctionInfoOutput funcDeps(@javax.annotation.Nonnull List funcDeps) { - this.funcDeps = funcDeps; + public UpdateDataTypesOutputBody dataTypesVersion(@javax.annotation.Nonnull Long dataTypesVersion) { + this.dataTypesVersion = dataTypesVersion; return this; } - public FunctionInfoOutput addFuncDepsItem(FuncDepsInner funcDepsItem) { - if (this.funcDeps == null) { - this.funcDeps = new ArrayList<>(); - } - this.funcDeps.add(funcDepsItem); + /** + * Version of the stored function data types after the update + * @return dataTypesVersion + */ + @javax.annotation.Nonnull + public Long getDataTypesVersion() { + return dataTypesVersion; + } + + public void setDataTypesVersion(@javax.annotation.Nonnull Long dataTypesVersion) { + this.dataTypesVersion = dataTypesVersion; + } + + + public UpdateDataTypesOutputBody functionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; return this; } /** - * List of function dependencies - * @return funcDeps + * Function ID + * @return functionId */ @javax.annotation.Nonnull - public List getFuncDeps() { - return funcDeps; + public Long getFunctionId() { + return functionId; } - public void setFuncDeps(@javax.annotation.Nonnull List funcDeps) { - this.funcDeps = funcDeps; + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { + this.functionId = functionId; } /** @@ -125,9 +136,9 @@ public void setFuncDeps(@javax.annotation.Nonnull List funcDeps) * * @param key name of the property * @param value value of the property - * @return the FunctionInfoOutput instance itself + * @return the UpdateDataTypesOutputBody instance itself */ - public FunctionInfoOutput putAdditionalProperty(String key, Object value) { + public UpdateDataTypesOutputBody putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -166,34 +177,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - FunctionInfoOutput functionInfoOutput = (FunctionInfoOutput) o; - return Objects.equals(this.funcTypes, functionInfoOutput.funcTypes) && - Objects.equals(this.funcDeps, functionInfoOutput.funcDeps)&& - Objects.equals(this.additionalProperties, functionInfoOutput.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())); + UpdateDataTypesOutputBody updateDataTypesOutputBody = (UpdateDataTypesOutputBody) o; + return Objects.equals(this.dataTypes, updateDataTypesOutputBody.dataTypes) && + Objects.equals(this.dataTypesVersion, updateDataTypesOutputBody.dataTypesVersion) && + Objects.equals(this.functionId, updateDataTypesOutputBody.functionId)&& + Objects.equals(this.additionalProperties, updateDataTypesOutputBody.additionalProperties); } @Override public int hashCode() { - return Objects.hash(funcTypes, funcDeps, additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(dataTypes, dataTypesVersion, functionId, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class FunctionInfoOutput {\n"); - sb.append(" funcTypes: ").append(toIndentedString(funcTypes)).append("\n"); - sb.append(" funcDeps: ").append(toIndentedString(funcDeps)).append("\n"); + sb.append("class UpdateDataTypesOutputBody {\n"); + sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); + sb.append(" dataTypesVersion: ").append(toIndentedString(dataTypesVersion)).append("\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -213,62 +215,48 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("func_types", "func_deps")); + openapiFields = new HashSet(Arrays.asList("data_types", "data_types_version", "function_id")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("func_deps")); + openapiRequiredFields = new HashSet(Arrays.asList("data_types", "data_types_version", "function_id")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FunctionInfoOutput + * @throws IOException if the JSON Element is invalid with respect to UpdateDataTypesOutputBody */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!FunctionInfoOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FunctionInfoOutput is not found in the empty JSON string", FunctionInfoOutput.openapiRequiredFields.toString())); + if (!UpdateDataTypesOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateDataTypesOutputBody is not found in the empty JSON string", UpdateDataTypesOutputBody.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionInfoOutput.openapiRequiredFields) { + for (String requiredField : UpdateDataTypesOutputBody.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `func_types` - if (jsonObj.get("func_types") != null && !jsonObj.get("func_types").isJsonNull()) { - FunctionTypeInput.validateJsonElement(jsonObj.get("func_types")); - } - if (jsonObj.get("func_deps") != null) { - if (!jsonObj.get("func_deps").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `func_deps` to be an array in the JSON string but got `%s`", jsonObj.get("func_deps").toString())); - } - JsonArray jsonArrayfuncDeps = jsonObj.getAsJsonArray("func_deps"); - // validate the required field `func_deps` (array) - for (int i = 0; i < jsonArrayfuncDeps.size(); i++) { - FuncDepsInner.validateJsonElement(jsonArrayfuncDeps.get(i)); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionInfoOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionInfoOutput' and its subtypes + if (!UpdateDataTypesOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateDataTypesOutputBody' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionInfoOutput.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateDataTypesOutputBody.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, FunctionInfoOutput value) throws IOException { + public void write(JsonWriter out, UpdateDataTypesOutputBody value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -296,12 +284,12 @@ else if (entry.getValue() instanceof Character) } @Override - public FunctionInfoOutput read(JsonReader in) throws IOException { + public UpdateDataTypesOutputBody read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - FunctionInfoOutput instance = thisAdapter.fromJsonTree(jsonObj); + UpdateDataTypesOutputBody instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -328,18 +316,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of FunctionInfoOutput given an JSON string + * Create an instance of UpdateDataTypesOutputBody given an JSON string * * @param jsonString JSON string - * @return An instance of FunctionInfoOutput - * @throws IOException if the JSON string is invalid with respect to FunctionInfoOutput + * @return An instance of UpdateDataTypesOutputBody + * @throws IOException if the JSON string is invalid with respect to UpdateDataTypesOutputBody */ - public static FunctionInfoOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionInfoOutput.class); + public static UpdateDataTypesOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateDataTypesOutputBody.class); } /** - * Convert an instance of FunctionInfoOutput to an JSON string + * Convert an instance of UpdateDataTypesOutputBody to an JSON string * * @return JSON string */