From f52ad8b93a639458ad57d4c4fa5ad7cb84fa765d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 12 Jun 2026 08:29:33 +0000 Subject: [PATCH] Update SDK to version v3.91.1 - Generated from OpenAPI spec version v3.91.1 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 13 +- build.gradle | 4 +- build.sbt | 2 +- docs/AnalysesCoreApi.md | 74 -- docs/CollectionListItemBody.md | 23 + docs/CollectionsApi.md | 311 ++++++-- docs/GetCollectionOutputBody.md | 26 + docs/ListCollectionsOutputBody.md | 16 + docs/QueuePositionResponse.md | 13 - pom.xml | 2 +- .../java/ai/reveng/api/AnalysesCoreApi.java | 144 ---- .../java/ai/reveng/api/CollectionsApi.java | 632 ++++++++++++---- .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 4 +- .../reveng/model/CollectionListItemBody.java | 583 +++++++++++++++ .../reveng/model/GetCollectionOutputBody.java | 678 ++++++++++++++++++ ...se.java => ListCollectionsOutputBody.java} | 179 +++-- 19 files changed, 2212 insertions(+), 498 deletions(-) create mode 100644 docs/CollectionListItemBody.md create mode 100644 docs/GetCollectionOutputBody.md create mode 100644 docs/ListCollectionsOutputBody.md delete mode 100644 docs/QueuePositionResponse.md create mode 100644 src/main/java/ai/reveng/model/CollectionListItemBody.java create mode 100644 src/main/java/ai/reveng/model/GetCollectionOutputBody.java rename src/main/java/ai/reveng/model/{QueuePositionResponse.java => ListCollectionsOutputBody.java} (58%) diff --git a/.sdk-version b/.sdk-version index d66c631d..a12e6bfb 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.91.0 +v3.91.1 diff --git a/README.md b/README.md index 47a03f54..a62405aa 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.91.0 + 3.91.1 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.91.0" + implementation "ai.reveng:sdk:3.91.1" } ``` @@ -100,7 +100,6 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**getAnalysisFunctionMap**](docs/AnalysesCoreApi.md#getAnalysisFunctionMap) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map *AnalysesCoreApi* | [**getAnalysisLogs**](docs/AnalysesCoreApi.md#getAnalysisLogs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis *AnalysesCoreApi* | [**getAnalysisParams**](docs/AnalysesCoreApi.md#getAnalysisParams) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information -*AnalysesCoreApi* | [**getAnalysisQueuePosition**](docs/AnalysesCoreApi.md#getAnalysisQueuePosition) | **GET** /v2/analyses/{analysis_id}/queue-position | Get the queue position of an analysis *AnalysesCoreApi* | [**getAnalysisStatus**](docs/AnalysesCoreApi.md#getAnalysisStatus) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis *AnalysesCoreApi* | [**insertAnalysisLog**](docs/AnalysesCoreApi.md#insertAnalysisLog) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis *AnalysesCoreApi* | [**listAnalyses**](docs/AnalysesCoreApi.md#listAnalyses) | **GET** /v2/analyses/list | Gets the most recent analyses @@ -133,13 +132,15 @@ Class | Method | HTTP request | Description *BinariesApi* | [**getBinaryRelatedStatus**](docs/BinariesApi.md#getBinaryRelatedStatus) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary *BinariesApi* | [**getRelatedBinaries**](docs/BinariesApi.md#getRelatedBinaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. *CollectionsApi* | [**createCollection**](docs/CollectionsApi.md#createCollection) | **POST** /v2/collections | Creates new collection information -*CollectionsApi* | [**createCollection_0**](docs/CollectionsApi.md#createCollection_0) | **POST** /v3/collections | Create a collection. *CollectionsApi* | [**deleteCollection**](docs/CollectionsApi.md#deleteCollection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection *CollectionsApi* | [**getCollection**](docs/CollectionsApi.md#getCollection) | **GET** /v2/collections/{collection_id} | Returns a collection *CollectionsApi* | [**listCollections**](docs/CollectionsApi.md#listCollections) | **GET** /v2/collections | Gets basic collections information *CollectionsApi* | [**updateCollection**](docs/CollectionsApi.md#updateCollection) | **PATCH** /v2/collections/{collection_id} | Updates a collection *CollectionsApi* | [**updateCollectionBinaries**](docs/CollectionsApi.md#updateCollectionBinaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries *CollectionsApi* | [**updateCollectionTags**](docs/CollectionsApi.md#updateCollectionTags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags +*CollectionsApi* | [**v3CreateCollection**](docs/CollectionsApi.md#v3CreateCollection) | **POST** /v3/collections | Create a collection. +*CollectionsApi* | [**v3GetCollection**](docs/CollectionsApi.md#v3GetCollection) | **GET** /v3/collections/{collection_id} | Get a collection. +*CollectionsApi* | [**v3ListCollections**](docs/CollectionsApi.md#v3ListCollections) | **GET** /v3/collections | List collections. *ConfigApi* | [**getConfig**](docs/ConfigApi.md#getConfig) | **GET** /v2/config | Get Config *ConversationsApi* | [**cancelRun**](docs/ConversationsApi.md#cancelRun) | **POST** /v2/conversations/{id}/cancel | Cancel an active run *ConversationsApi* | [**confirmTool**](docs/ConversationsApi.md#confirmTool) | **POST** /v2/conversations/{id}/confirm | Approve or reject a pending tool confirmation @@ -363,6 +364,7 @@ Class | Method | HTTP request | Description - [CollectionBinaryResponse](docs/CollectionBinaryResponse.md) - [CollectionCreateRequest](docs/CollectionCreateRequest.md) - [CollectionListItem](docs/CollectionListItem.md) + - [CollectionListItemBody](docs/CollectionListItemBody.md) - [CollectionResponse](docs/CollectionResponse.md) - [CollectionResponseBinariesInner](docs/CollectionResponseBinariesInner.md) - [CollectionScope](docs/CollectionScope.md) @@ -492,6 +494,7 @@ Class | Method | HTTP request | Description - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) - [GetAiDecompilationTask](docs/GetAiDecompilationTask.md) - [GetAnalysisStringsStatusOutputBody](docs/GetAnalysisStringsStatusOutputBody.md) + - [GetCollectionOutputBody](docs/GetCollectionOutputBody.md) - [GetProductsOutputBody](docs/GetProductsOutputBody.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) - [GetSubscriptionOutputBody](docs/GetSubscriptionOutputBody.md) @@ -509,6 +512,7 @@ Class | Method | HTTP request | Description - [InverseValue](docs/InverseValue.md) - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) - [ListCollectionResults](docs/ListCollectionResults.md) + - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) - [Logs](docs/Logs.md) - [MITRETechnique](docs/MITRETechnique.md) @@ -543,7 +547,6 @@ Class | Method | HTTP request | Description - [ProgressMessage](docs/ProgressMessage.md) - [ProseEvent](docs/ProseEvent.md) - [PutAnalysisStringsRequest](docs/PutAnalysisStringsRequest.md) - - [QueuePositionResponse](docs/QueuePositionResponse.md) - [QueuedWorkflowTaskResponse](docs/QueuedWorkflowTaskResponse.md) - [ReAnalysisForm](docs/ReAnalysisForm.md) - [Recent](docs/Recent.md) diff --git a/build.gradle b/build.gradle index 6a3bd6b9..711af77e 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.91.0' +version = '3.91.1' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.91.0") + coordinates("ai.reveng", "sdk", "3.91.1") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index 3cea3536..020c051b 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.91.0", + version := "3.91.1", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 230a7f4f..d785c6c6 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -13,7 +13,6 @@ All URIs are relative to *https://api.reveng.ai* | [**getAnalysisFunctionMap**](AnalysesCoreApi.md#getAnalysisFunctionMap) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map | | [**getAnalysisLogs**](AnalysesCoreApi.md#getAnalysisLogs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis | | [**getAnalysisParams**](AnalysesCoreApi.md#getAnalysisParams) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information | -| [**getAnalysisQueuePosition**](AnalysesCoreApi.md#getAnalysisQueuePosition) | **GET** /v2/analyses/{analysis_id}/queue-position | Get the queue position of an analysis | | [**getAnalysisStatus**](AnalysesCoreApi.md#getAnalysisStatus) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis | | [**insertAnalysisLog**](AnalysesCoreApi.md#insertAnalysisLog) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis | | [**listAnalyses**](AnalysesCoreApi.md#listAnalyses) | **GET** /v2/analyses/list | Gets the most recent analyses | @@ -676,79 +675,6 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **getAnalysisQueuePosition** -> QueuePositionResponse getAnalysisQueuePosition(analysisId) - -Get the queue position of an analysis - -Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.AnalysesCoreApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - AnalysesCoreApi apiInstance = new AnalysesCoreApi(defaultClient); - Long analysisId = 56L; // Long | Analysis ID - try { - QueuePositionResponse result = apiInstance.getAnalysisQueuePosition(analysisId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnalysesCoreApi#getAnalysisQueuePosition"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **analysisId** | **Long**| Analysis ID | | - -### Return type - -[**QueuePositionResponse**](QueuePositionResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **403** | Forbidden | - | -| **404** | Not Found | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - # **getAnalysisStatus** > BaseResponseStatus getAnalysisStatus(analysisId) diff --git a/docs/CollectionListItemBody.md b/docs/CollectionListItemBody.md new file mode 100644 index 00000000..954aa63a --- /dev/null +++ b/docs/CollectionListItemBody.md @@ -0,0 +1,23 @@ + + +# CollectionListItemBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**collectionId** | **Long** | | | +|**collectionName** | **String** | | | +|**collectionOwner** | **String** | | | +|**collectionScope** | **String** | | | +|**collectionSize** | **Long** | | | +|**collectionTags** | **List<String>** | | | +|**creation** | **OffsetDateTime** | | | +|**description** | **String** | | | +|**modelName** | **String** | | | +|**officialCollection** | **Boolean** | | | +|**teamId** | **Long** | | | + + + diff --git a/docs/CollectionsApi.md b/docs/CollectionsApi.md index 2ec48d93..adeb77d7 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -5,13 +5,15 @@ All URIs are relative to *https://api.reveng.ai* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createCollection**](CollectionsApi.md#createCollection) | **POST** /v2/collections | Creates new collection information | -| [**createCollection_0**](CollectionsApi.md#createCollection_0) | **POST** /v3/collections | Create a collection. | | [**deleteCollection**](CollectionsApi.md#deleteCollection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection | | [**getCollection**](CollectionsApi.md#getCollection) | **GET** /v2/collections/{collection_id} | Returns a collection | | [**listCollections**](CollectionsApi.md#listCollections) | **GET** /v2/collections | Gets basic collections information | | [**updateCollection**](CollectionsApi.md#updateCollection) | **PATCH** /v2/collections/{collection_id} | Updates a collection | | [**updateCollectionBinaries**](CollectionsApi.md#updateCollectionBinaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries | | [**updateCollectionTags**](CollectionsApi.md#updateCollectionTags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags | +| [**v3CreateCollection**](CollectionsApi.md#v3CreateCollection) | **POST** /v3/collections | Create a collection. | +| [**v3GetCollection**](CollectionsApi.md#v3GetCollection) | **GET** /v3/collections/{collection_id} | Get a collection. | +| [**v3ListCollections**](CollectionsApi.md#v3ListCollections) | **GET** /v3/collections | List collections. | @@ -84,78 +86,6 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | - -# **createCollection_0** -> CreateCollectionOutputBody createCollection_0(createCollectionInputBody) - -Create a collection. - -Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - -### Example -```java -// Import classes: -import ai.reveng.invoker.ApiClient; -import ai.reveng.invoker.ApiException; -import ai.reveng.invoker.Configuration; -import ai.reveng.invoker.auth.*; -import ai.reveng.invoker.models.*; -import ai.reveng.api.CollectionsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.reveng.ai"); - - // Configure API key authorization: APIKey - ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); - APIKey.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //APIKey.setApiKeyPrefix("Token"); - - CollectionsApi apiInstance = new CollectionsApi(defaultClient); - CreateCollectionInputBody createCollectionInputBody = new CreateCollectionInputBody(); // CreateCollectionInputBody | - try { - CreateCollectionOutputBody result = apiInstance.createCollection_0(createCollectionInputBody); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CollectionsApi#createCollection_0"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **createCollectionInputBody** | [**CreateCollectionInputBody**](CreateCollectionInputBody.md)| | | - -### Return type - -[**CreateCollectionOutputBody**](CreateCollectionOutputBody.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Created | - | -| **404** | Not Found | - | -| **422** | Unprocessable Entity | - | -| **500** | Internal Server Error | - | - # **deleteCollection** > BaseResponseBool deleteCollection(collectionId) @@ -602,3 +532,238 @@ public class Example { | **200** | Successful Response | - | | **422** | Invalid request parameters | - | + +# **v3CreateCollection** +> CreateCollectionOutputBody v3CreateCollection(createCollectionInputBody) + +Create a collection. + +Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.CollectionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + CollectionsApi apiInstance = new CollectionsApi(defaultClient); + CreateCollectionInputBody createCollectionInputBody = new CreateCollectionInputBody(); // CreateCollectionInputBody | + try { + CreateCollectionOutputBody result = apiInstance.v3CreateCollection(createCollectionInputBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CollectionsApi#v3CreateCollection"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **createCollectionInputBody** | [**CreateCollectionInputBody**](CreateCollectionInputBody.md)| | | + +### Return type + +[**CreateCollectionOutputBody**](CreateCollectionOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3GetCollection** +> GetCollectionOutputBody v3GetCollection(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr) + +Get a collection. + +Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.CollectionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + CollectionsApi apiInstance = new CollectionsApi(defaultClient); + Long collectionId = 56L; // Long | + Boolean includeTags = true; // Boolean | + Boolean includeBinaries = true; // Boolean | + Long pageSize = 10L; // Long | + Long pageNumber = 1L; // Long | + String binarySearchStr = "binarySearchStr_example"; // String | + try { + GetCollectionOutputBody result = apiInstance.v3GetCollection(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CollectionsApi#v3GetCollection"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **collectionId** | **Long**| | | +| **includeTags** | **Boolean**| | [optional] | +| **includeBinaries** | **Boolean**| | [optional] | +| **pageSize** | **Long**| | [optional] [default to 10] | +| **pageNumber** | **Long**| | [optional] [default to 1] | +| **binarySearchStr** | **String**| | [optional] | + +### Return type + +[**GetCollectionOutputBody**](GetCollectionOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Not Found | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + + +# **v3ListCollections** +> ListCollectionsOutputBody v3ListCollections(searchTerm, filters, limit, offset, orderBy, order) + +List collections. + +Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example +```java +// Import classes: +import ai.reveng.invoker.ApiClient; +import ai.reveng.invoker.ApiException; +import ai.reveng.invoker.Configuration; +import ai.reveng.invoker.auth.*; +import ai.reveng.invoker.models.*; +import ai.reveng.api.CollectionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.reveng.ai"); + + // Configure API key authorization: APIKey + ApiKeyAuth APIKey = (ApiKeyAuth) defaultClient.getAuthentication("APIKey"); + APIKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKey.setApiKeyPrefix("Token"); + + CollectionsApi apiInstance = new CollectionsApi(defaultClient); + String searchTerm = "searchTerm_example"; // String | + List filters = Arrays.asList(); // List | + Long limit = 20L; // Long | + Long offset = 0L; // Long | + String orderBy = "created"; // String | + String order = "ASC"; // String | + try { + ListCollectionsOutputBody result = apiInstance.v3ListCollections(searchTerm, filters, limit, offset, orderBy, order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CollectionsApi#v3ListCollections"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **searchTerm** | **String**| | [optional] | +| **filters** | [**List<String>**](String.md)| | [optional] [enum: official_only, user_only, team_only, public_only, hide_empty] | +| **limit** | **Long**| | [optional] [default to 20] | +| **offset** | **Long**| | [optional] [default to 0] | +| **orderBy** | **String**| | [optional] [default to collection] [enum: created, collection, model, collection_size, updated] | +| **order** | **String**| | [optional] [default to ASC] [enum: ASC, DESC] | + +### Return type + +[**ListCollectionsOutputBody**](ListCollectionsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **422** | Unprocessable Entity | - | +| **500** | Internal Server Error | - | + diff --git a/docs/GetCollectionOutputBody.md b/docs/GetCollectionOutputBody.md new file mode 100644 index 00000000..fca6b9db --- /dev/null +++ b/docs/GetCollectionOutputBody.md @@ -0,0 +1,26 @@ + + +# GetCollectionOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binaries** | **List<Binary>** | | [optional] | +|**collectionId** | **Long** | | | +|**collectionName** | **String** | | | +|**collectionScope** | **String** | | | +|**createdAt** | **OffsetDateTime** | | | +|**description** | **String** | | | +|**hasNextPage** | **Boolean** | | [optional] | +|**modelId** | **Long** | | | +|**pageNumber** | **Long** | | [optional] | +|**pageSize** | **Long** | | [optional] | +|**tags** | **List<String>** | | [optional] | +|**teamId** | **Long** | | | +|**updatedAt** | **OffsetDateTime** | | | +|**userId** | **Long** | | | + + + diff --git a/docs/ListCollectionsOutputBody.md b/docs/ListCollectionsOutputBody.md new file mode 100644 index 00000000..edbad9ba --- /dev/null +++ b/docs/ListCollectionsOutputBody.md @@ -0,0 +1,16 @@ + + +# ListCollectionsOutputBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasNextPage** | **Boolean** | | | +|**pageNumber** | **Long** | | | +|**pageSize** | **Long** | | | +|**results** | **List<CollectionListItemBody>** | | | + + + diff --git a/docs/QueuePositionResponse.md b/docs/QueuePositionResponse.md deleted file mode 100644 index d7643c66..00000000 --- a/docs/QueuePositionResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# QueuePositionResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**queuePosition** | **Long** | Number of Processing analyses ahead of this one in the queue. 0 if this analysis is not Processing or has no analyses ahead of it. | | - - - diff --git a/pom.xml b/pom.xml index 9f9cefd5..65dfb621 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.91.0 + 3.91.1 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/api/AnalysesCoreApi.java b/src/main/java/ai/reveng/api/AnalysesCoreApi.java index af806b25..58423194 100644 --- a/src/main/java/ai/reveng/api/AnalysesCoreApi.java +++ b/src/main/java/ai/reveng/api/AnalysesCoreApi.java @@ -54,7 +54,6 @@ import ai.reveng.model.ModelName; import ai.reveng.model.Order; import ai.reveng.model.PutAnalysisStringsRequest; -import ai.reveng.model.QueuePositionResponse; import ai.reveng.model.ReAnalysisForm; import ai.reveng.model.StatusInput; import ai.reveng.model.UploadFileType; @@ -1370,149 +1369,6 @@ public okhttp3.Call getAnalysisParamsAsync(@javax.annotation.Nonnull Integer ana localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for getAnalysisQueuePosition - * @param analysisId Analysis ID (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getAnalysisQueuePositionCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v2/analyses/{analysis_id}/queue-position" - .replace("{" + "analysis_id" + "}", localVarApiClient.escapeString(analysisId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAnalysisQueuePositionValidateBeforeCall(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'analysisId' is set - if (analysisId == null) { - throw new ApiException("Missing the required parameter 'analysisId' when calling getAnalysisQueuePosition(Async)"); - } - - return getAnalysisQueuePositionCall(analysisId, _callback); - - } - - /** - * Get the queue position of an analysis - * Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @return QueuePositionResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public QueuePositionResponse getAnalysisQueuePosition(@javax.annotation.Nonnull Long analysisId) throws ApiException { - ApiResponse localVarResp = getAnalysisQueuePositionWithHttpInfo(analysisId); - return localVarResp.getData(); - } - - /** - * Get the queue position of an analysis - * Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @return ApiResponse<QueuePositionResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse getAnalysisQueuePositionWithHttpInfo(@javax.annotation.Nonnull Long analysisId) throws ApiException { - okhttp3.Call localVarCall = getAnalysisQueuePositionValidateBeforeCall(analysisId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the queue position of an analysis (asynchronously) - * Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - * @param analysisId Analysis ID (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - - -
Response Details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call getAnalysisQueuePositionAsync(@javax.annotation.Nonnull Long analysisId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAnalysisQueuePositionValidateBeforeCall(analysisId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getAnalysisStatus * @param analysisId (required) diff --git a/src/main/java/ai/reveng/api/CollectionsApi.java b/src/main/java/ai/reveng/api/CollectionsApi.java index affcb531..70367204 100644 --- a/src/main/java/ai/reveng/api/CollectionsApi.java +++ b/src/main/java/ai/reveng/api/CollectionsApi.java @@ -41,6 +41,8 @@ import ai.reveng.model.CreateCollectionInputBody; import ai.reveng.model.CreateCollectionOutputBody; import ai.reveng.model.Filters; +import ai.reveng.model.GetCollectionOutputBody; +import ai.reveng.model.ListCollectionsOutputBody; import ai.reveng.model.Order; import java.lang.reflect.Type; @@ -217,145 +219,6 @@ public okhttp3.Call createCollectionAsync(@javax.annotation.Nonnull CollectionCr localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for createCollection_0 - * @param createCollectionInputBody (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call createCollection_0Call(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, 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 = createCollectionInputBody; - - // create path and map variables - String localVarPath = "/v3/collections"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "APIKey" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createCollection_0ValidateBeforeCall(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createCollectionInputBody' is set - if (createCollectionInputBody == null) { - throw new ApiException("Missing the required parameter 'createCollectionInputBody' when calling createCollection_0(Async)"); - } - - return createCollection_0Call(createCollectionInputBody, _callback); - - } - - /** - * Create a collection. - * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - * @param createCollectionInputBody (required) - * @return CreateCollectionOutputBody - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public CreateCollectionOutputBody createCollection_0(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody) throws ApiException { - ApiResponse localVarResp = createCollection_0WithHttpInfo(createCollectionInputBody); - return localVarResp.getData(); - } - - /** - * Create a collection. - * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - * @param createCollectionInputBody (required) - * @return ApiResponse<CreateCollectionOutputBody> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public ApiResponse createCollection_0WithHttpInfo(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody) throws ApiException { - okhttp3.Call localVarCall = createCollection_0ValidateBeforeCall(createCollectionInputBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create a collection. (asynchronously) - * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - * @param createCollectionInputBody (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - - -
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
- */ - public okhttp3.Call createCollection_0Async(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createCollection_0ValidateBeforeCall(createCollectionInputBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for deleteCollection * @param collectionId (required) @@ -1250,4 +1113,495 @@ public okhttp3.Call updateCollectionTagsAsync(@javax.annotation.Nonnull Integer localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for v3CreateCollection + * @param createCollectionInputBody (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3CreateCollectionCall(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, 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 = createCollectionInputBody; + + // create path and map variables + String localVarPath = "/v3/collections"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3CreateCollectionValidateBeforeCall(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createCollectionInputBody' is set + if (createCollectionInputBody == null) { + throw new ApiException("Missing the required parameter 'createCollectionInputBody' when calling v3CreateCollection(Async)"); + } + + return v3CreateCollectionCall(createCollectionInputBody, _callback); + + } + + /** + * Create a collection. + * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createCollectionInputBody (required) + * @return CreateCollectionOutputBody + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public CreateCollectionOutputBody v3CreateCollection(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody) throws ApiException { + ApiResponse localVarResp = v3CreateCollectionWithHttpInfo(createCollectionInputBody); + return localVarResp.getData(); + } + + /** + * Create a collection. + * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createCollectionInputBody (required) + * @return ApiResponse<CreateCollectionOutputBody> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3CreateCollectionWithHttpInfo(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody) throws ApiException { + okhttp3.Call localVarCall = v3CreateCollectionValidateBeforeCall(createCollectionInputBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a collection. (asynchronously) + * Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param createCollectionInputBody (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3CreateCollectionAsync(@javax.annotation.Nonnull CreateCollectionInputBody createCollectionInputBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3CreateCollectionValidateBeforeCall(createCollectionInputBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3GetCollection + * @param collectionId (required) + * @param includeTags (optional) + * @param includeBinaries (optional) + * @param pageSize (optional, default to 10) + * @param pageNumber (optional, default to 1) + * @param binarySearchStr (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetCollectionCall(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable Long pageNumber, @javax.annotation.Nullable String binarySearchStr, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/collections/{collection_id}" + .replace("{" + "collection_id" + "}", localVarApiClient.escapeString(collectionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (includeTags != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_tags", includeTags)); + } + + if (includeBinaries != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_binaries", includeBinaries)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); + } + + if (pageNumber != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_number", pageNumber)); + } + + if (binarySearchStr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("binary_search_str", binarySearchStr)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3GetCollectionValidateBeforeCall(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable Long pageNumber, @javax.annotation.Nullable String binarySearchStr, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'collectionId' is set + if (collectionId == null) { + throw new ApiException("Missing the required parameter 'collectionId' when calling v3GetCollection(Async)"); + } + + return v3GetCollectionCall(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr, _callback); + + } + + /** + * Get a collection. + * Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param collectionId (required) + * @param includeTags (optional) + * @param includeBinaries (optional) + * @param pageSize (optional, default to 10) + * @param pageNumber (optional, default to 1) + * @param binarySearchStr (optional) + * @return GetCollectionOutputBody + * @throws ApiException If fail 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 -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public GetCollectionOutputBody v3GetCollection(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable Long pageNumber, @javax.annotation.Nullable String binarySearchStr) throws ApiException { + ApiResponse localVarResp = v3GetCollectionWithHttpInfo(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr); + return localVarResp.getData(); + } + + /** + * Get a collection. + * Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param collectionId (required) + * @param includeTags (optional) + * @param includeBinaries (optional) + * @param pageSize (optional, default to 10) + * @param pageNumber (optional, default to 1) + * @param binarySearchStr (optional) + * @return ApiResponse<GetCollectionOutputBody> + * @throws ApiException If fail 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 -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3GetCollectionWithHttpInfo(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable Long pageNumber, @javax.annotation.Nullable String binarySearchStr) throws ApiException { + okhttp3.Call localVarCall = v3GetCollectionValidateBeforeCall(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a collection. (asynchronously) + * Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + * @param collectionId (required) + * @param includeTags (optional) + * @param includeBinaries (optional) + * @param pageSize (optional, default to 10) + * @param pageNumber (optional, default to 1) + * @param binarySearchStr (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
404 Not Found -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3GetCollectionAsync(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable Boolean includeTags, @javax.annotation.Nullable Boolean includeBinaries, @javax.annotation.Nullable Long pageSize, @javax.annotation.Nullable Long pageNumber, @javax.annotation.Nullable String binarySearchStr, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3GetCollectionValidateBeforeCall(collectionId, includeTags, includeBinaries, pageSize, pageNumber, binarySearchStr, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for v3ListCollections + * @param searchTerm (optional) + * @param filters (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @param orderBy (optional, default to collection) + * @param order (optional, default to ASC) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListCollectionsCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v3/collections"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (searchTerm != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search_term", searchTerm)); + } + + if (filters != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "filters", filters)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (orderBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); + } + + if (order != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call v3ListCollectionsValidateBeforeCall(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, final ApiCallback _callback) throws ApiException { + return v3ListCollectionsCall(searchTerm, filters, limit, offset, orderBy, order, _callback); + + } + + /** + * List collections. + * Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param searchTerm (optional) + * @param filters (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @param orderBy (optional, default to collection) + * @param order (optional, default to ASC) + * @return ListCollectionsOutputBody + * @throws ApiException If fail 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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ListCollectionsOutputBody v3ListCollections(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order) throws ApiException { + ApiResponse localVarResp = v3ListCollectionsWithHttpInfo(searchTerm, filters, limit, offset, orderBy, order); + return localVarResp.getData(); + } + + /** + * List collections. + * Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param searchTerm (optional) + * @param filters (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @param orderBy (optional, default to collection) + * @param order (optional, default to ASC) + * @return ApiResponse<ListCollectionsOutputBody> + * @throws ApiException If fail 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 -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse v3ListCollectionsWithHttpInfo(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order) throws ApiException { + okhttp3.Call localVarCall = v3ListCollectionsValidateBeforeCall(searchTerm, filters, limit, offset, orderBy, order, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List collections. (asynchronously) + * Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + * @param searchTerm (optional) + * @param filters (optional) + * @param limit (optional, default to 20) + * @param offset (optional, default to 0) + * @param orderBy (optional, default to collection) + * @param order (optional, default to ASC) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call v3ListCollectionsAsync(@javax.annotation.Nullable String searchTerm, @javax.annotation.Nullable List filters, @javax.annotation.Nullable Long limit, @javax.annotation.Nullable Long offset, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = v3ListCollectionsValidateBeforeCall(searchTerm, filters, limit, offset, orderBy, order, _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 4d98f61c..1ac67565 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.91.0/java"); + setUserAgent("OpenAPI-Generator/3.91.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 7131e446..3a8d8568 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.91.0"; + public static final String VERSION = "3.91.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 8d68bf12..699307f3 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -235,6 +235,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionBinaryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionCreateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionListItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionListItemBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionResponseBinariesInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.CollectionSearchResponse.CustomTypeAdapterFactory()); @@ -358,6 +359,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAiDecompilationRatingResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAiDecompilationTask.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetAnalysisStringsStatusOutputBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetCollectionOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetProductsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetPublicUserResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.GetSubscriptionOutputBody.CustomTypeAdapterFactory()); @@ -374,6 +376,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.InverseValue.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListAnalysisStringsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionResults.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListCollectionsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ListFunctionStringsOutputBody.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Logs.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.MITRETechnique.CustomTypeAdapterFactory()); @@ -405,7 +408,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProgressMessage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ProseEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.PutAnalysisStringsRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.QueuePositionResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.QueuedWorkflowTaskResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.ReAnalysisForm.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.Recent.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/CollectionListItemBody.java b/src/main/java/ai/reveng/model/CollectionListItemBody.java new file mode 100644 index 00000000..3526c69a --- /dev/null +++ b/src/main/java/ai/reveng/model/CollectionListItemBody.java @@ -0,0 +1,583 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * CollectionListItemBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CollectionListItemBody { + public static final String SERIALIZED_NAME_COLLECTION_ID = "collection_id"; + @SerializedName(SERIALIZED_NAME_COLLECTION_ID) + @javax.annotation.Nonnull + private Long collectionId; + + public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; + @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) + @javax.annotation.Nonnull + private String collectionName; + + public static final String SERIALIZED_NAME_COLLECTION_OWNER = "collection_owner"; + @SerializedName(SERIALIZED_NAME_COLLECTION_OWNER) + @javax.annotation.Nonnull + private String collectionOwner; + + public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; + @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) + @javax.annotation.Nonnull + private String collectionScope; + + public static final String SERIALIZED_NAME_COLLECTION_SIZE = "collection_size"; + @SerializedName(SERIALIZED_NAME_COLLECTION_SIZE) + @javax.annotation.Nonnull + private Long collectionSize; + + public static final String SERIALIZED_NAME_COLLECTION_TAGS = "collection_tags"; + @SerializedName(SERIALIZED_NAME_COLLECTION_TAGS) + @javax.annotation.Nullable + private List collectionTags; + + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + @javax.annotation.Nonnull + private OffsetDateTime creation; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_MODEL_NAME = "model_name"; + @SerializedName(SERIALIZED_NAME_MODEL_NAME) + @javax.annotation.Nonnull + private String modelName; + + public static final String SERIALIZED_NAME_OFFICIAL_COLLECTION = "official_collection"; + @SerializedName(SERIALIZED_NAME_OFFICIAL_COLLECTION) + @javax.annotation.Nonnull + private Boolean officialCollection; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public CollectionListItemBody() { + } + + public CollectionListItemBody collectionId(@javax.annotation.Nonnull Long collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + * Get collectionId + * @return collectionId + */ + @javax.annotation.Nonnull + public Long getCollectionId() { + return collectionId; + } + + public void setCollectionId(@javax.annotation.Nonnull Long collectionId) { + this.collectionId = collectionId; + } + + + public CollectionListItemBody collectionName(@javax.annotation.Nonnull String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Get collectionName + * @return collectionName + */ + @javax.annotation.Nonnull + public String getCollectionName() { + return collectionName; + } + + public void setCollectionName(@javax.annotation.Nonnull String collectionName) { + this.collectionName = collectionName; + } + + + public CollectionListItemBody collectionOwner(@javax.annotation.Nonnull String collectionOwner) { + this.collectionOwner = collectionOwner; + return this; + } + + /** + * Get collectionOwner + * @return collectionOwner + */ + @javax.annotation.Nonnull + public String getCollectionOwner() { + return collectionOwner; + } + + public void setCollectionOwner(@javax.annotation.Nonnull String collectionOwner) { + this.collectionOwner = collectionOwner; + } + + + public CollectionListItemBody collectionScope(@javax.annotation.Nonnull String collectionScope) { + this.collectionScope = collectionScope; + return this; + } + + /** + * Get collectionScope + * @return collectionScope + */ + @javax.annotation.Nonnull + public String getCollectionScope() { + return collectionScope; + } + + public void setCollectionScope(@javax.annotation.Nonnull String collectionScope) { + this.collectionScope = collectionScope; + } + + + public CollectionListItemBody collectionSize(@javax.annotation.Nonnull Long collectionSize) { + this.collectionSize = collectionSize; + return this; + } + + /** + * Get collectionSize + * @return collectionSize + */ + @javax.annotation.Nonnull + public Long getCollectionSize() { + return collectionSize; + } + + public void setCollectionSize(@javax.annotation.Nonnull Long collectionSize) { + this.collectionSize = collectionSize; + } + + + public CollectionListItemBody collectionTags(@javax.annotation.Nullable List collectionTags) { + this.collectionTags = collectionTags; + return this; + } + + public CollectionListItemBody addCollectionTagsItem(String collectionTagsItem) { + if (this.collectionTags == null) { + this.collectionTags = new ArrayList<>(); + } + this.collectionTags.add(collectionTagsItem); + return this; + } + + /** + * Get collectionTags + * @return collectionTags + */ + @javax.annotation.Nullable + public List getCollectionTags() { + return collectionTags; + } + + public void setCollectionTags(@javax.annotation.Nullable List collectionTags) { + this.collectionTags = collectionTags; + } + + + public CollectionListItemBody creation(@javax.annotation.Nonnull OffsetDateTime creation) { + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreation() { + return creation; + } + + public void setCreation(@javax.annotation.Nonnull OffsetDateTime creation) { + this.creation = creation; + } + + + public CollectionListItemBody description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public CollectionListItemBody modelName(@javax.annotation.Nonnull String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get modelName + * @return modelName + */ + @javax.annotation.Nonnull + public String getModelName() { + return modelName; + } + + public void setModelName(@javax.annotation.Nonnull String modelName) { + this.modelName = modelName; + } + + + public CollectionListItemBody officialCollection(@javax.annotation.Nonnull Boolean officialCollection) { + this.officialCollection = officialCollection; + return this; + } + + /** + * Get officialCollection + * @return officialCollection + */ + @javax.annotation.Nonnull + public Boolean getOfficialCollection() { + return officialCollection; + } + + public void setOfficialCollection(@javax.annotation.Nonnull Boolean officialCollection) { + this.officialCollection = officialCollection; + } + + + public CollectionListItemBody teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Get teamId + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CollectionListItemBody instance itself + */ + public CollectionListItemBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CollectionListItemBody collectionListItemBody = (CollectionListItemBody) o; + return Objects.equals(this.collectionId, collectionListItemBody.collectionId) && + Objects.equals(this.collectionName, collectionListItemBody.collectionName) && + Objects.equals(this.collectionOwner, collectionListItemBody.collectionOwner) && + Objects.equals(this.collectionScope, collectionListItemBody.collectionScope) && + Objects.equals(this.collectionSize, collectionListItemBody.collectionSize) && + Objects.equals(this.collectionTags, collectionListItemBody.collectionTags) && + Objects.equals(this.creation, collectionListItemBody.creation) && + Objects.equals(this.description, collectionListItemBody.description) && + Objects.equals(this.modelName, collectionListItemBody.modelName) && + Objects.equals(this.officialCollection, collectionListItemBody.officialCollection) && + Objects.equals(this.teamId, collectionListItemBody.teamId)&& + Objects.equals(this.additionalProperties, collectionListItemBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(collectionId, collectionName, collectionOwner, collectionScope, collectionSize, collectionTags, creation, description, modelName, officialCollection, teamId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CollectionListItemBody {\n"); + sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); + sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); + sb.append(" collectionOwner: ").append(toIndentedString(collectionOwner)).append("\n"); + sb.append(" collectionScope: ").append(toIndentedString(collectionScope)).append("\n"); + sb.append(" collectionSize: ").append(toIndentedString(collectionSize)).append("\n"); + sb.append(" collectionTags: ").append(toIndentedString(collectionTags)).append("\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n"); + sb.append(" officialCollection: ").append(toIndentedString(officialCollection)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("collection_id", "collection_name", "collection_owner", "collection_scope", "collection_size", "collection_tags", "creation", "description", "model_name", "official_collection", "team_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("collection_id", "collection_name", "collection_owner", "collection_scope", "collection_size", "collection_tags", "creation", "description", "model_name", "official_collection", "team_id")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CollectionListItemBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CollectionListItemBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CollectionListItemBody is not found in the empty JSON string", CollectionListItemBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CollectionListItemBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("collection_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); + } + if (!jsonObj.get("collection_owner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_owner").toString())); + } + if (!jsonObj.get("collection_scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_scope").toString())); + } + // ensure the required json array is present + if (jsonObj.get("collection_tags") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("collection_tags").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_tags` to be an array in the JSON string but got `%s`", jsonObj.get("collection_tags").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("model_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `model_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CollectionListItemBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CollectionListItemBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CollectionListItemBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CollectionListItemBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CollectionListItemBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CollectionListItemBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CollectionListItemBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CollectionListItemBody + * @throws IOException if the JSON string is invalid with respect to CollectionListItemBody + */ + public static CollectionListItemBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CollectionListItemBody.class); + } + + /** + * Convert an instance of CollectionListItemBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/GetCollectionOutputBody.java b/src/main/java/ai/reveng/model/GetCollectionOutputBody.java new file mode 100644 index 00000000..75f086fb --- /dev/null +++ b/src/main/java/ai/reveng/model/GetCollectionOutputBody.java @@ -0,0 +1,678 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import java.util.Locale; +import ai.reveng.model.Binary; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import ai.reveng.invoker.JSON; + +/** + * GetCollectionOutputBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetCollectionOutputBody { + public static final String SERIALIZED_NAME_BINARIES = "binaries"; + @SerializedName(SERIALIZED_NAME_BINARIES) + @javax.annotation.Nullable + private List binaries; + + public static final String SERIALIZED_NAME_COLLECTION_ID = "collection_id"; + @SerializedName(SERIALIZED_NAME_COLLECTION_ID) + @javax.annotation.Nonnull + private Long collectionId; + + public static final String SERIALIZED_NAME_COLLECTION_NAME = "collection_name"; + @SerializedName(SERIALIZED_NAME_COLLECTION_NAME) + @javax.annotation.Nonnull + private String collectionName; + + public static final String SERIALIZED_NAME_COLLECTION_SCOPE = "collection_scope"; + @SerializedName(SERIALIZED_NAME_COLLECTION_SCOPE) + @javax.annotation.Nonnull + private String collectionScope; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_HAS_NEXT_PAGE = "has_next_page"; + @SerializedName(SERIALIZED_NAME_HAS_NEXT_PAGE) + @javax.annotation.Nullable + private Boolean hasNextPage; + + public static final String SERIALIZED_NAME_MODEL_ID = "model_id"; + @SerializedName(SERIALIZED_NAME_MODEL_ID) + @javax.annotation.Nonnull + private Long modelId; + + public static final String SERIALIZED_NAME_PAGE_NUMBER = "page_number"; + @SerializedName(SERIALIZED_NAME_PAGE_NUMBER) + @javax.annotation.Nullable + private Long pageNumber; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + @javax.annotation.Nullable + private Long pageSize; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + @javax.annotation.Nullable + private List tags; + + public static final String SERIALIZED_NAME_TEAM_ID = "team_id"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nonnull + private Long teamId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private Long userId; + + public GetCollectionOutputBody() { + } + + public GetCollectionOutputBody binaries(@javax.annotation.Nullable List binaries) { + this.binaries = binaries; + return this; + } + + public GetCollectionOutputBody addBinariesItem(Binary binariesItem) { + if (this.binaries == null) { + this.binaries = new ArrayList<>(); + } + this.binaries.add(binariesItem); + return this; + } + + /** + * Get binaries + * @return binaries + */ + @javax.annotation.Nullable + public List getBinaries() { + return binaries; + } + + public void setBinaries(@javax.annotation.Nullable List binaries) { + this.binaries = binaries; + } + + + public GetCollectionOutputBody collectionId(@javax.annotation.Nonnull Long collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + * Get collectionId + * @return collectionId + */ + @javax.annotation.Nonnull + public Long getCollectionId() { + return collectionId; + } + + public void setCollectionId(@javax.annotation.Nonnull Long collectionId) { + this.collectionId = collectionId; + } + + + public GetCollectionOutputBody collectionName(@javax.annotation.Nonnull String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Get collectionName + * @return collectionName + */ + @javax.annotation.Nonnull + public String getCollectionName() { + return collectionName; + } + + public void setCollectionName(@javax.annotation.Nonnull String collectionName) { + this.collectionName = collectionName; + } + + + public GetCollectionOutputBody collectionScope(@javax.annotation.Nonnull String collectionScope) { + this.collectionScope = collectionScope; + return this; + } + + /** + * Get collectionScope + * @return collectionScope + */ + @javax.annotation.Nonnull + public String getCollectionScope() { + return collectionScope; + } + + public void setCollectionScope(@javax.annotation.Nonnull String collectionScope) { + this.collectionScope = collectionScope; + } + + + public GetCollectionOutputBody createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetCollectionOutputBody description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public GetCollectionOutputBody hasNextPage(@javax.annotation.Nullable Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + return this; + } + + /** + * Get hasNextPage + * @return hasNextPage + */ + @javax.annotation.Nullable + public Boolean getHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(@javax.annotation.Nullable Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + + public GetCollectionOutputBody modelId(@javax.annotation.Nonnull Long modelId) { + this.modelId = modelId; + return this; + } + + /** + * Get modelId + * @return modelId + */ + @javax.annotation.Nonnull + public Long getModelId() { + return modelId; + } + + public void setModelId(@javax.annotation.Nonnull Long modelId) { + this.modelId = modelId; + } + + + public GetCollectionOutputBody pageNumber(@javax.annotation.Nullable Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Get pageNumber + * @return pageNumber + */ + @javax.annotation.Nullable + public Long getPageNumber() { + return pageNumber; + } + + public void setPageNumber(@javax.annotation.Nullable Long pageNumber) { + this.pageNumber = pageNumber; + } + + + public GetCollectionOutputBody pageSize(@javax.annotation.Nullable Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + */ + @javax.annotation.Nullable + public Long getPageSize() { + return pageSize; + } + + public void setPageSize(@javax.annotation.Nullable Long pageSize) { + this.pageSize = pageSize; + } + + + public GetCollectionOutputBody tags(@javax.annotation.Nullable List tags) { + this.tags = tags; + return this; + } + + public GetCollectionOutputBody addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @javax.annotation.Nullable + public List getTags() { + return tags; + } + + public void setTags(@javax.annotation.Nullable List tags) { + this.tags = tags; + } + + + public GetCollectionOutputBody teamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + return this; + } + + /** + * Get teamId + * @return teamId + */ + @javax.annotation.Nonnull + public Long getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nonnull Long teamId) { + this.teamId = teamId; + } + + + public GetCollectionOutputBody updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public GetCollectionOutputBody userId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + return this; + } + + /** + * Get userId + * @return userId + */ + @javax.annotation.Nonnull + public Long getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull Long userId) { + this.userId = userId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetCollectionOutputBody instance itself + */ + public GetCollectionOutputBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCollectionOutputBody getCollectionOutputBody = (GetCollectionOutputBody) o; + return Objects.equals(this.binaries, getCollectionOutputBody.binaries) && + Objects.equals(this.collectionId, getCollectionOutputBody.collectionId) && + Objects.equals(this.collectionName, getCollectionOutputBody.collectionName) && + Objects.equals(this.collectionScope, getCollectionOutputBody.collectionScope) && + Objects.equals(this.createdAt, getCollectionOutputBody.createdAt) && + Objects.equals(this.description, getCollectionOutputBody.description) && + Objects.equals(this.hasNextPage, getCollectionOutputBody.hasNextPage) && + Objects.equals(this.modelId, getCollectionOutputBody.modelId) && + Objects.equals(this.pageNumber, getCollectionOutputBody.pageNumber) && + Objects.equals(this.pageSize, getCollectionOutputBody.pageSize) && + Objects.equals(this.tags, getCollectionOutputBody.tags) && + Objects.equals(this.teamId, getCollectionOutputBody.teamId) && + Objects.equals(this.updatedAt, getCollectionOutputBody.updatedAt) && + Objects.equals(this.userId, getCollectionOutputBody.userId)&& + Objects.equals(this.additionalProperties, getCollectionOutputBody.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(binaries, collectionId, collectionName, collectionScope, createdAt, description, hasNextPage, modelId, pageNumber, pageSize, tags, teamId, updatedAt, userId, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCollectionOutputBody {\n"); + sb.append(" binaries: ").append(toIndentedString(binaries)).append("\n"); + sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); + sb.append(" collectionName: ").append(toIndentedString(collectionName)).append("\n"); + sb.append(" collectionScope: ").append(toIndentedString(collectionScope)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" pageNumber: ").append(toIndentedString(pageNumber)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("binaries", "collection_id", "collection_name", "collection_scope", "created_at", "description", "has_next_page", "model_id", "page_number", "page_size", "tags", "team_id", "updated_at", "user_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("collection_id", "collection_name", "collection_scope", "created_at", "description", "model_id", "team_id", "updated_at", "user_id")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetCollectionOutputBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetCollectionOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in GetCollectionOutputBody is not found in the empty JSON string", GetCollectionOutputBody.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetCollectionOutputBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("binaries") != null && !jsonObj.get("binaries").isJsonNull() && !jsonObj.get("binaries").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `binaries` to be an array in the JSON string but got `%s`", jsonObj.get("binaries").toString())); + } + if (!jsonObj.get("collection_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_name").toString())); + } + if (!jsonObj.get("collection_scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `collection_scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection_scope").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetCollectionOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetCollectionOutputBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetCollectionOutputBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetCollectionOutputBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetCollectionOutputBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetCollectionOutputBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetCollectionOutputBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetCollectionOutputBody + * @throws IOException if the JSON string is invalid with respect to GetCollectionOutputBody + */ + public static GetCollectionOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetCollectionOutputBody.class); + } + + /** + * Convert an instance of GetCollectionOutputBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/QueuePositionResponse.java b/src/main/java/ai/reveng/model/ListCollectionsOutputBody.java similarity index 58% rename from src/main/java/ai/reveng/model/QueuePositionResponse.java rename to src/main/java/ai/reveng/model/ListCollectionsOutputBody.java index c8850779..98ff1c93 100644 --- a/src/main/java/ai/reveng/model/QueuePositionResponse.java +++ b/src/main/java/ai/reveng/model/ListCollectionsOutputBody.java @@ -14,13 +14,16 @@ import java.util.Objects; import java.util.Locale; +import ai.reveng.model.CollectionListItemBody; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import 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; @@ -47,34 +50,114 @@ import ai.reveng.invoker.JSON; /** - * QueuePositionResponse + * ListCollectionsOutputBody */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class QueuePositionResponse { - public static final String SERIALIZED_NAME_QUEUE_POSITION = "queue_position"; - @SerializedName(SERIALIZED_NAME_QUEUE_POSITION) +public class ListCollectionsOutputBody { + public static final String SERIALIZED_NAME_HAS_NEXT_PAGE = "has_next_page"; + @SerializedName(SERIALIZED_NAME_HAS_NEXT_PAGE) + @javax.annotation.Nonnull + private Boolean hasNextPage; + + public static final String SERIALIZED_NAME_PAGE_NUMBER = "page_number"; + @SerializedName(SERIALIZED_NAME_PAGE_NUMBER) + @javax.annotation.Nonnull + private Long pageNumber; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + @javax.annotation.Nonnull + private Long pageSize; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + @javax.annotation.Nullable + private List results; + + public ListCollectionsOutputBody() { + } + + public ListCollectionsOutputBody hasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + return this; + } + + /** + * Get hasNextPage + * @return hasNextPage + */ @javax.annotation.Nonnull - private Long queuePosition; + public Boolean getHasNextPage() { + return hasNextPage; + } - public QueuePositionResponse() { + public void setHasNextPage(@javax.annotation.Nonnull Boolean hasNextPage) { + this.hasNextPage = hasNextPage; } - public QueuePositionResponse queuePosition(@javax.annotation.Nonnull Long queuePosition) { - this.queuePosition = queuePosition; + + public ListCollectionsOutputBody pageNumber(@javax.annotation.Nonnull Long pageNumber) { + this.pageNumber = pageNumber; return this; } /** - * Number of Processing analyses ahead of this one in the queue. 0 if this analysis is not Processing or has no analyses ahead of it. - * @return queuePosition + * Get pageNumber + * @return pageNumber */ @javax.annotation.Nonnull - public Long getQueuePosition() { - return queuePosition; + public Long getPageNumber() { + return pageNumber; } - public void setQueuePosition(@javax.annotation.Nonnull Long queuePosition) { - this.queuePosition = queuePosition; + public void setPageNumber(@javax.annotation.Nonnull Long pageNumber) { + this.pageNumber = pageNumber; + } + + + public ListCollectionsOutputBody pageSize(@javax.annotation.Nonnull Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + */ + @javax.annotation.Nonnull + public Long getPageSize() { + return pageSize; + } + + public void setPageSize(@javax.annotation.Nonnull Long pageSize) { + this.pageSize = pageSize; + } + + + public ListCollectionsOutputBody results(@javax.annotation.Nullable List results) { + this.results = results; + return this; + } + + public ListCollectionsOutputBody addResultsItem(CollectionListItemBody resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * @return results + */ + @javax.annotation.Nullable + public List getResults() { + return results; + } + + public void setResults(@javax.annotation.Nullable List results) { + this.results = results; } /** @@ -90,9 +173,9 @@ public void setQueuePosition(@javax.annotation.Nonnull Long queuePosition) { * * @param key name of the property * @param value value of the property - * @return the QueuePositionResponse instance itself + * @return the ListCollectionsOutputBody instance itself */ - public QueuePositionResponse putAdditionalProperty(String key, Object value) { + public ListCollectionsOutputBody putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -131,21 +214,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - QueuePositionResponse queuePositionResponse = (QueuePositionResponse) o; - return Objects.equals(this.queuePosition, queuePositionResponse.queuePosition)&& - Objects.equals(this.additionalProperties, queuePositionResponse.additionalProperties); + ListCollectionsOutputBody listCollectionsOutputBody = (ListCollectionsOutputBody) o; + return Objects.equals(this.hasNextPage, listCollectionsOutputBody.hasNextPage) && + Objects.equals(this.pageNumber, listCollectionsOutputBody.pageNumber) && + Objects.equals(this.pageSize, listCollectionsOutputBody.pageSize) && + Objects.equals(this.results, listCollectionsOutputBody.results)&& + Objects.equals(this.additionalProperties, listCollectionsOutputBody.additionalProperties); } @Override public int hashCode() { - return Objects.hash(queuePosition, additionalProperties); + return Objects.hash(hasNextPage, pageNumber, pageSize, results, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class QueuePositionResponse {\n"); - sb.append(" queuePosition: ").append(toIndentedString(queuePosition)).append("\n"); + sb.append("class ListCollectionsOutputBody {\n"); + sb.append(" hasNextPage: ").append(toIndentedString(hasNextPage)).append("\n"); + sb.append(" pageNumber: ").append(toIndentedString(pageNumber)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -168,48 +257,54 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("queue_position")); + openapiFields = new HashSet(Arrays.asList("has_next_page", "page_number", "page_size", "results")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("queue_position")); + openapiRequiredFields = new HashSet(Arrays.asList("has_next_page", "page_number", "page_size", "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 QueuePositionResponse + * @throws IOException if the JSON Element is invalid with respect to ListCollectionsOutputBody */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!QueuePositionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in QueuePositionResponse is not found in the empty JSON string", QueuePositionResponse.openapiRequiredFields.toString())); + if (!ListCollectionsOutputBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ListCollectionsOutputBody is not found in the empty JSON string", ListCollectionsOutputBody.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : QueuePositionResponse.openapiRequiredFields) { + for (String requiredField : ListCollectionsOutputBody.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("results") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueuePositionResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'QueuePositionResponse' and its subtypes + if (!ListCollectionsOutputBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListCollectionsOutputBody' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(QueuePositionResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListCollectionsOutputBody.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, QueuePositionResponse value) throws IOException { + public void write(JsonWriter out, ListCollectionsOutputBody value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -237,12 +332,12 @@ else if (entry.getValue() instanceof Character) } @Override - public QueuePositionResponse read(JsonReader in) throws IOException { + public ListCollectionsOutputBody read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - QueuePositionResponse instance = thisAdapter.fromJsonTree(jsonObj); + ListCollectionsOutputBody instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -269,18 +364,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of QueuePositionResponse given an JSON string + * Create an instance of ListCollectionsOutputBody given an JSON string * * @param jsonString JSON string - * @return An instance of QueuePositionResponse - * @throws IOException if the JSON string is invalid with respect to QueuePositionResponse + * @return An instance of ListCollectionsOutputBody + * @throws IOException if the JSON string is invalid with respect to ListCollectionsOutputBody */ - public static QueuePositionResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, QueuePositionResponse.class); + public static ListCollectionsOutputBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListCollectionsOutputBody.class); } /** - * Convert an instance of QueuePositionResponse to an JSON string + * Convert an instance of ListCollectionsOutputBody to an JSON string * * @return JSON string */