diff --git a/codegen/apis b/codegen/apis index 63e97dc..df8c283 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit 63e97dcd8a46cfb0687e23eab1f02300824f6e9d +Subproject commit df8c2831eb79b6ded5848583f773b3adedfc1155 diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index 27375dd..8082973 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -74,6 +74,27 @@ generate_client() { find "${destination}/${module_name}" -name "*.java" | while IFS= read -r file; do sed -i '' "s/org\.openapitools\.client/org\.openapitools\.${module_name}\.client/g" "$file" done + + # Add NDJSON block to ApiClient.java in the db_data module + if [ "$module_name" == "db_data" ]; then + echo "Adding NDJSON handler block to ApiClient.java" + + # Use sed to insert the NDJSON block into ApiClient.java + sed -i '' '/return RequestBody.create((File) obj, MediaType.parse(contentType));/a \ + } else if ("application/x-ndjson".equals(contentType)) { \ + // Handle NDJSON (Newline Delimited JSON) \ + if (obj instanceof Iterable) { \ + StringBuilder ndjsonContent = new StringBuilder(); \ + for (Object item : (Iterable) obj) { \ + String json = JSON.serialize(item); \ + ndjsonContent.append(json).append("\\n"); \ + } \ + return RequestBody.create(ndjsonContent.toString(), MediaType.parse(contentType)); \ + } else { \ + throw new ApiException("NDJSON content requires a collection of objects."); \ + } \ + ' src/main/java/org/openapitools/db_data/client/ApiClient.java + fi } update_apis_repo diff --git a/src/main/java/io/pinecone/clients/Pinecone.java b/src/main/java/io/pinecone/clients/Pinecone.java index 077db05..7fcaf3c 100644 --- a/src/main/java/io/pinecone/clients/Pinecone.java +++ b/src/main/java/io/pinecone/clients/Pinecone.java @@ -874,6 +874,98 @@ public void deleteIndex(String indexName) throws PineconeException { } } + /** + * Create a backup of an index + * @param indexName Name of the index to backup (required) + * @param description A description of the backup. (required) + * @return BackupModel + */ + public BackupModel createBackup(String indexName, String description) throws ApiException { + return manageIndexesApi.createBackup(indexName, new CreateBackupRequest().description(description)); + } + + /** + * Overload to list all backups for an index with default limit = 10 and pagination token = null. + * @param indexName Name of the backed up index (required) + * limit which is the number of results to return per page is set to 10 by default. + * paginationToken which is the token to use to retrieve the next page of results is set to null. + * @return BackupList + */ + public BackupList listIndexBackup(String indexName) throws ApiException { + return manageIndexesApi.listIndexBackups(indexName, 10, null); + } + + /** + * List all backups for an index. + * @param indexName Name of the backed up index (required) + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (optional) + * @return BackupList + */ + public BackupList listIndexBackups(String indexName, Integer limit, String paginationToken) throws ApiException { + return manageIndexesApi.listIndexBackups(indexName, limit, paginationToken); + } + + /** + * List backups for all indexes in a project + * List all backups for a project. + * @return BackupList + */ + public BackupList listProjectBackups() throws ApiException { + return manageIndexesApi.listProjectBackups(); + } + + /** + * Describe a backup + * Get a description of a backup. + * @param backupId The ID of the backup to describe. (required) + * @return BackupModel + */ + public BackupModel describeBackup(String backupId) throws ApiException { + return manageIndexesApi.describeBackup(backupId); + } + + /** + * Delete a backup + * @param backupId The ID of the backup to delete. (required) + */ + public void deleteBackup(String backupId) throws ApiException { + manageIndexesApi.deleteBackup(backupId); + } + + /** + * Create an index from a backup + * @param backupId The ID of the backup to create an index from. (required) + * @param name The name of the index. Resource name must be 1-45 characters long, start and end with an + * alphanumeric character, and consist only of lower case alphanumeric characters. (required) + * @param tags Custom user tags added to an index. (optional) + * @param deletionProtection Whether deletion protection is enabled for the index. If enabled, the index + * cannot be deleted. Defaults to disabled if not provided. + */ + public void createIndexFromBackup(String backupId, String name, Map tags, DeletionProtection deletionProtection) throws ApiException { + CreateIndexFromBackupRequest createIndexFromBackupRequest = new CreateIndexFromBackupRequest() + .name(name) + .tags(tags); + + if(deletionProtection != null) { + createIndexFromBackupRequest.deletionProtection(deletionProtection); + } + manageIndexesApi.createIndexFromBackup(backupId, createIndexFromBackupRequest); + } + + /** + * Overload to create an index from a backup with name and backupId. + * @param backupId The ID of the backup to create an index from. (required) + * @param name The name of the index. Resource name must be 1-45 characters long, start and end with an + * alphanumeric character, and consist only of lower case alphanumeric characters. (required) + * cannot be deleted. Defaults to disabled if not provided. + */ + public void createIndexFromBackup(String backupId, String name) throws ApiException { + CreateIndexFromBackupRequest createIndexFromBackupRequest = new CreateIndexFromBackupRequest() + .name(name); + manageIndexesApi.createIndexFromBackup(backupId, createIndexFromBackupRequest); + } + /** * Creates a new collection from a source index. *

diff --git a/src/main/java/org/openapitools/db_control/client/ApiCallback.java b/src/main/java/org/openapitools/db_control/client/ApiCallback.java index 1fbcdb2..f0157ee 100644 --- a/src/main/java/org/openapitools/db_control/client/ApiCallback.java +++ b/src/main/java/org/openapitools/db_control/client/ApiCallback.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_control/client/ApiClient.java b/src/main/java/org/openapitools/db_control/client/ApiClient.java index 39477a5..5ada77e 100644 --- a/src/main/java/org/openapitools/db_control/client/ApiClient.java +++ b/src/main/java/org/openapitools/db_control/client/ApiClient.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -140,7 +140,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2025-01/java"); + setUserAgent("OpenAPI-Generator/2025-04/java"); authentications = new HashMap(); } diff --git a/src/main/java/org/openapitools/db_control/client/ApiException.java b/src/main/java/org/openapitools/db_control/client/ApiException.java index 6b2aecb..c66282d 100644 --- a/src/main/java/org/openapitools/db_control/client/ApiException.java +++ b/src/main/java/org/openapitools/db_control/client/ApiException.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/org/openapitools/db_control/client/ApiResponse.java b/src/main/java/org/openapitools/db_control/client/ApiResponse.java index 9dada28..9e1f0f9 100644 --- a/src/main/java/org/openapitools/db_control/client/ApiResponse.java +++ b/src/main/java/org/openapitools/db_control/client/ApiResponse.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_control/client/Configuration.java b/src/main/java/org/openapitools/db_control/client/Configuration.java index 02eeb11..976cbfa 100644 --- a/src/main/java/org/openapitools/db_control/client/Configuration.java +++ b/src/main/java/org/openapitools/db_control/client/Configuration.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,9 +13,9 @@ package org.openapitools.db_control.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class Configuration { - public static final String VERSION = "2025-01"; + public static final String VERSION = "2025-04"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/org/openapitools/db_control/client/GzipRequestInterceptor.java b/src/main/java/org/openapitools/db_control/client/GzipRequestInterceptor.java index 568c6f9..5a2b990 100644 --- a/src/main/java/org/openapitools/db_control/client/GzipRequestInterceptor.java +++ b/src/main/java/org/openapitools/db_control/client/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_control/client/JSON.java b/src/main/java/org/openapitools/db_control/client/JSON.java index 4daeab8..8e4fc18 100644 --- a/src/main/java/org/openapitools/db_control/client/JSON.java +++ b/src/main/java/org/openapitools/db_control/client/JSON.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,15 +93,20 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.BackupList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.BackupModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ByocSpec.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CollectionList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CollectionModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestEmbed.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestSpec.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestSpecPod.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateBackupRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateCollectionRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateIndexForModelRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateIndexForModelRequestEmbed.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateIndexFromBackupRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateIndexRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ErrorResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ErrorResponseError.CustomTypeAdapterFactory()); @@ -111,8 +116,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexModelStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexSpec.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ModelIndexEmbed.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.PaginationResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.PodSpec.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.PodSpecMetadataConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.RestoreJobList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.RestoreJobModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ServerlessSpec.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/src/main/java/org/openapitools/db_control/client/Pair.java b/src/main/java/org/openapitools/db_control/client/Pair.java index 86fca96..b369f60 100644 --- a/src/main/java/org/openapitools/db_control/client/Pair.java +++ b/src/main/java/org/openapitools/db_control/client/Pair.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package org.openapitools.db_control.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/org/openapitools/db_control/client/ProgressRequestBody.java b/src/main/java/org/openapitools/db_control/client/ProgressRequestBody.java index 07002b2..f297ddb 100644 --- a/src/main/java/org/openapitools/db_control/client/ProgressRequestBody.java +++ b/src/main/java/org/openapitools/db_control/client/ProgressRequestBody.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_control/client/ProgressResponseBody.java b/src/main/java/org/openapitools/db_control/client/ProgressResponseBody.java index 9e2cb8a..b8b1ff1 100644 --- a/src/main/java/org/openapitools/db_control/client/ProgressResponseBody.java +++ b/src/main/java/org/openapitools/db_control/client/ProgressResponseBody.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_control/client/StringUtil.java b/src/main/java/org/openapitools/db_control/client/StringUtil.java index 2d129fa..bc1b4ba 100644 --- a/src/main/java/org/openapitools/db_control/client/StringUtil.java +++ b/src/main/java/org/openapitools/db_control/client/StringUtil.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/org/openapitools/db_control/client/api/ManageIndexesApi.java b/src/main/java/org/openapitools/db_control/client/api/ManageIndexesApi.java index 75f7b88..20d0af9 100644 --- a/src/main/java/org/openapitools/db_control/client/api/ManageIndexesApi.java +++ b/src/main/java/org/openapitools/db_control/client/api/ManageIndexesApi.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,15 +27,21 @@ import java.io.IOException; +import org.openapitools.db_control.client.model.BackupList; +import org.openapitools.db_control.client.model.BackupModel; import org.openapitools.db_control.client.model.CollectionList; import org.openapitools.db_control.client.model.CollectionModel; import org.openapitools.db_control.client.model.ConfigureIndexRequest; +import org.openapitools.db_control.client.model.CreateBackupRequest; import org.openapitools.db_control.client.model.CreateCollectionRequest; import org.openapitools.db_control.client.model.CreateIndexForModelRequest; +import org.openapitools.db_control.client.model.CreateIndexFromBackupRequest; import org.openapitools.db_control.client.model.CreateIndexRequest; import org.openapitools.db_control.client.model.ErrorResponse; import org.openapitools.db_control.client.model.IndexList; import org.openapitools.db_control.client.model.IndexModel; +import org.openapitools.db_control.client.model.RestoreJobList; +import org.openapitools.db_control.client.model.RestoreJobModel; import java.lang.reflect.Type; import java.util.ArrayList; @@ -164,7 +170,7 @@ private okhttp3.Call configureIndexValidateBeforeCall(String indexName, Configur /** * Configure an index - * This operation configures an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). + * Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). * @param indexName The name of the index to configure. (required) * @param configureIndexRequest The desired pod size and replica configuration for the index. (required) * @return IndexModel @@ -189,7 +195,7 @@ public IndexModel configureIndex(String indexName, ConfigureIndexRequest configu /** * Configure an index - * This operation configures an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). + * Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). * @param indexName The name of the index to configure. (required) * @param configureIndexRequest The desired pod size and replica configuration for the index. (required) * @return ApiResponse<IndexModel> @@ -215,7 +221,7 @@ public ApiResponse configureIndexWithHttpInfo(String indexName, Conf /** * Configure an index (asynchronously) - * This operation configures an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). + * Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). * @param indexName The name of the index to configure. (required) * @param configureIndexRequest The desired pod size and replica configuration for the index. (required) * @param _callback The callback to be executed when the API call finishes @@ -241,6 +247,163 @@ public okhttp3.Call configureIndexAsync(String indexName, ConfigureIndexRequest localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for createBackup + * @param indexName Name of the index to backup (required) + * @param createBackupRequest The desired configuration for the backup. (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 + + + + + + + + + +
Status Code Description Response Headers
201 The backup has been successfully created. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
402 Payment required. Organization is on a paid plan and is delinquent on payment. -
403 You've exceed your backup quota. -
422 Unprocessable entity. The request body could not be deserialized. -
500 Internal server error. -
+ */ + public okhttp3.Call createBackupCall(String indexName, CreateBackupRequest createBackupRequest, 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 = createBackupRequest; + + // create path and map variables + String localVarPath = "/indexes/{index_name}/backups" + .replace("{" + "index_name" + "}", localVarApiClient.escapeString(indexName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBackupValidateBeforeCall(String indexName, CreateBackupRequest createBackupRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException("Missing the required parameter 'indexName' when calling createBackup(Async)"); + } + + // verify the required parameter 'createBackupRequest' is set + if (createBackupRequest == null) { + throw new ApiException("Missing the required parameter 'createBackupRequest' when calling createBackup(Async)"); + } + + return createBackupCall(indexName, createBackupRequest, _callback); + + } + + /** + * Create a backup of an index + * Create a backup of an index. + * @param indexName Name of the index to backup (required) + * @param createBackupRequest The desired configuration for the backup. (required) + * @return BackupModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 The backup has been successfully created. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
402 Payment required. Organization is on a paid plan and is delinquent on payment. -
403 You've exceed your backup quota. -
422 Unprocessable entity. The request body could not be deserialized. -
500 Internal server error. -
+ */ + public BackupModel createBackup(String indexName, CreateBackupRequest createBackupRequest) throws ApiException { + ApiResponse localVarResp = createBackupWithHttpInfo(indexName, createBackupRequest); + return localVarResp.getData(); + } + + /** + * Create a backup of an index + * Create a backup of an index. + * @param indexName Name of the index to backup (required) + * @param createBackupRequest The desired configuration for the backup. (required) + * @return ApiResponse<BackupModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
201 The backup has been successfully created. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
402 Payment required. Organization is on a paid plan and is delinquent on payment. -
403 You've exceed your backup quota. -
422 Unprocessable entity. The request body could not be deserialized. -
500 Internal server error. -
+ */ + public ApiResponse createBackupWithHttpInfo(String indexName, CreateBackupRequest createBackupRequest) throws ApiException { + okhttp3.Call localVarCall = createBackupValidateBeforeCall(indexName, createBackupRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a backup of an index (asynchronously) + * Create a backup of an index. + * @param indexName Name of the index to backup (required) + * @param createBackupRequest The desired configuration for the backup. (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 + + + + + + + + + +
Status Code Description Response Headers
201 The backup has been successfully created. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
402 Payment required. Organization is on a paid plan and is delinquent on payment. -
403 You've exceed your backup quota. -
422 Unprocessable entity. The request body could not be deserialized. -
500 Internal server error. -
+ */ + public okhttp3.Call createBackupAsync(String indexName, CreateBackupRequest createBackupRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createBackupValidateBeforeCall(indexName, createBackupRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for createCollection * @param createCollectionRequest The desired configuration for the collection. (required) @@ -318,7 +481,7 @@ private okhttp3.Call createCollectionValidateBeforeCall(CreateCollectionRequest /** * Create a collection - * This operation creates a Pinecone collection. Serverless indexes do not support collections. + * Create a Pinecone collection. Serverless indexes do not support collections. * @param createCollectionRequest The desired configuration for the collection. (required) * @return CollectionModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -342,7 +505,7 @@ public CollectionModel createCollection(CreateCollectionRequest createCollection /** * Create a collection - * This operation creates a Pinecone collection. Serverless indexes do not support collections. + * Create a Pinecone collection. Serverless indexes do not support collections. * @param createCollectionRequest The desired configuration for the collection. (required) * @return ApiResponse<CollectionModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -367,7 +530,7 @@ public ApiResponse createCollectionWithHttpInfo(CreateCollectio /** * Create a collection (asynchronously) - * This operation creates a Pinecone collection. Serverless indexes do not support collections. + * Create a Pinecone collection. Serverless indexes do not support collections. * @param createCollectionRequest The desired configuration for the collection. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -470,7 +633,7 @@ private okhttp3.Call createIndexValidateBeforeCall(CreateIndexRequest createInde /** * Create an index - * This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). + * Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). * @param createIndexRequest The desired configuration for the index. (required) * @return IndexModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -495,7 +658,7 @@ public IndexModel createIndex(CreateIndexRequest createIndexRequest) throws ApiE /** * Create an index - * This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). + * Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). * @param createIndexRequest The desired configuration for the index. (required) * @return ApiResponse<IndexModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -521,7 +684,7 @@ public ApiResponse createIndexWithHttpInfo(CreateIndexRequest create /** * Create an index (asynchronously) - * This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). + * Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). * @param createIndexRequest The desired configuration for the index. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -622,8 +785,8 @@ private okhttp3.Call createIndexForModelValidateBeforeCall(CreateIndexForModelRe } /** - * Create an index for an embedding model - * This operation creates a serverless integrated inference index for a specific embedding model. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) for available models and model details. + * Create an index with integrated embedding + * Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). * @param createIndexForModelRequest The desired configuration for the index and associated embedding model. (required) * @return IndexModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -645,8 +808,8 @@ public IndexModel createIndexForModel(CreateIndexForModelRequest createIndexForM } /** - * Create an index for an embedding model - * This operation creates a serverless integrated inference index for a specific embedding model. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) for available models and model details. + * Create an index with integrated embedding + * Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). * @param createIndexForModelRequest The desired configuration for the index and associated embedding model. (required) * @return ApiResponse<IndexModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -669,8 +832,8 @@ public ApiResponse createIndexForModelWithHttpInfo(CreateIndexForMod } /** - * Create an index for an embedding model (asynchronously) - * This operation creates a serverless integrated inference index for a specific embedding model. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) for available models and model details. + * Create an index with integrated embedding (asynchronously) + * Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). * @param createIndexForModelRequest The desired configuration for the index and associated embedding model. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -695,21 +858,27 @@ public okhttp3.Call createIndexForModelAsync(CreateIndexForModelRequest createIn return localVarCall; } /** - * Build call for deleteCollection - * @param collectionName The name of the collection. (required) + * Build call for createIndexFromBackup + * @param backupId The ID of the backup to create an index from. (required) + * @param createIndexFromBackupRequest The desired configuration for the index created from a backup. (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 - + + - + + + + +
Status Code Description Response Headers
202 The collection has been successfully deleted. -
202 The request to create the index has been accepted. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
402 Payment required. Organization is on a paid plan and is delinquent on payment. -
403 You've exceed your pod quota. -
404 Backup not found. -
409 Index of given name already exists. -
422 Unprocessable entity. The request body could not be deserialized. -
500 Internal server error. -
*/ - public okhttp3.Call deleteCollectionCall(String collectionName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createIndexFromBackupCall(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -723,11 +892,11 @@ public okhttp3.Call deleteCollectionCall(String collectionName, final ApiCallbac basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = createIndexFromBackupRequest; // create path and map variables - String localVarPath = "/collections/{collection_name}" - .replace("{" + "collection_name" + "}", localVarApiClient.escapeString(collectionName.toString())); + String localVarPath = "/backups/{backup_id}/create-index" + .replace("{" + "backup_id" + "}", localVarApiClient.escapeString(backupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -744,6 +913,7 @@ public okhttp3.Call deleteCollectionCall(String collectionName, final ApiCallbac } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -751,98 +921,120 @@ public okhttp3.Call deleteCollectionCall(String collectionName, final ApiCallbac } String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteCollectionValidateBeforeCall(String collectionName, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'collectionName' is set - if (collectionName == null) { - throw new ApiException("Missing the required parameter 'collectionName' when calling deleteCollection(Async)"); + private okhttp3.Call createIndexFromBackupValidateBeforeCall(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'backupId' is set + if (backupId == null) { + throw new ApiException("Missing the required parameter 'backupId' when calling createIndexFromBackup(Async)"); } - return deleteCollectionCall(collectionName, _callback); + // verify the required parameter 'createIndexFromBackupRequest' is set + if (createIndexFromBackupRequest == null) { + throw new ApiException("Missing the required parameter 'createIndexFromBackupRequest' when calling createIndexFromBackup(Async)"); + } + + return createIndexFromBackupCall(backupId, createIndexFromBackupRequest, _callback); } /** - * Delete a collection - * This operation deletes an existing collection. Serverless indexes do not support collections. - * @param collectionName The name of the collection. (required) + * Create an index from a backup + * Create an index from a backup. + * @param backupId The ID of the backup to create an index from. (required) + * @param createIndexFromBackupRequest The desired configuration for the index created from a backup. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + + - + + + + +
Status Code Description Response Headers
202 The collection has been successfully deleted. -
202 The request to create the index has been accepted. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
402 Payment required. Organization is on a paid plan and is delinquent on payment. -
403 You've exceed your pod quota. -
404 Backup not found. -
409 Index of given name already exists. -
422 Unprocessable entity. The request body could not be deserialized. -
500 Internal server error. -
*/ - public void deleteCollection(String collectionName) throws ApiException { - deleteCollectionWithHttpInfo(collectionName); + public void createIndexFromBackup(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest) throws ApiException { + createIndexFromBackupWithHttpInfo(backupId, createIndexFromBackupRequest); } /** - * Delete a collection - * This operation deletes an existing collection. Serverless indexes do not support collections. - * @param collectionName The name of the collection. (required) + * Create an index from a backup + * Create an index from a backup. + * @param backupId The ID of the backup to create an index from. (required) + * @param createIndexFromBackupRequest The desired configuration for the index created from a backup. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + + - + + + + +
Status Code Description Response Headers
202 The collection has been successfully deleted. -
202 The request to create the index has been accepted. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
402 Payment required. Organization is on a paid plan and is delinquent on payment. -
403 You've exceed your pod quota. -
404 Backup not found. -
409 Index of given name already exists. -
422 Unprocessable entity. The request body could not be deserialized. -
500 Internal server error. -
*/ - public ApiResponse deleteCollectionWithHttpInfo(String collectionName) throws ApiException { - okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionName, null); + public ApiResponse createIndexFromBackupWithHttpInfo(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest) throws ApiException { + okhttp3.Call localVarCall = createIndexFromBackupValidateBeforeCall(backupId, createIndexFromBackupRequest, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a collection (asynchronously) - * This operation deletes an existing collection. Serverless indexes do not support collections. - * @param collectionName The name of the collection. (required) + * Create an index from a backup (asynchronously) + * Create an index from a backup. + * @param backupId The ID of the backup to create an index from. (required) + * @param createIndexFromBackupRequest The desired configuration for the index created from a backup. (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 - + + - + + + + +
Status Code Description Response Headers
202 The collection has been successfully deleted. -
202 The request to create the index has been accepted. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
402 Payment required. Organization is on a paid plan and is delinquent on payment. -
403 You've exceed your pod quota. -
404 Backup not found. -
409 Index of given name already exists. -
422 Unprocessable entity. The request body could not be deserialized. -
500 Internal server error. -
*/ - public okhttp3.Call deleteCollectionAsync(String collectionName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createIndexFromBackupAsync(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionName, _callback); + okhttp3.Call localVarCall = createIndexFromBackupValidateBeforeCall(backupId, createIndexFromBackupRequest, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteIndex - * @param indexName The name of the index to delete. (required) + * Build call for deleteBackup + * @param backupId The ID of the backup to delete. (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 - + - - - + +
Status Code Description Response Headers
202 The request to delete the index has been accepted. -
202 The request to delete the backup has been accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden. Deletion protection enabled. -
404 Index not found. -
412 There is a pending collection created from this index. -
404 Backup not found. -
412 There is a pending restore job created from this backup. -
500 Internal server error. -
*/ - public okhttp3.Call deleteIndexCall(String indexName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteBackupCall(String backupId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -859,8 +1051,8 @@ public okhttp3.Call deleteIndexCall(String indexName, final ApiCallback _callbac Object localVarPostBody = null; // create path and map variables - String localVarPath = "/indexes/{index_name}" - .replace("{" + "index_name" + "}", localVarApiClient.escapeString(indexName.toString())); + String localVarPath = "/backups/{backup_id}" + .replace("{" + "backup_id" + "}", localVarApiClient.escapeString(backupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -888,98 +1080,95 @@ public okhttp3.Call deleteIndexCall(String indexName, final ApiCallback _callbac } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteIndexValidateBeforeCall(String indexName, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'indexName' is set - if (indexName == null) { - throw new ApiException("Missing the required parameter 'indexName' when calling deleteIndex(Async)"); + private okhttp3.Call deleteBackupValidateBeforeCall(String backupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'backupId' is set + if (backupId == null) { + throw new ApiException("Missing the required parameter 'backupId' when calling deleteBackup(Async)"); } - return deleteIndexCall(indexName, _callback); + return deleteBackupCall(backupId, _callback); } /** - * Delete an index - * This operation deletes an existing index. - * @param indexName The name of the index to delete. (required) + * Delete a backup + * Delete a backup. + * @param backupId The ID of the backup to delete. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + - - - + +
Status Code Description Response Headers
202 The request to delete the index has been accepted. -
202 The request to delete the backup has been accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden. Deletion protection enabled. -
404 Index not found. -
412 There is a pending collection created from this index. -
404 Backup not found. -
412 There is a pending restore job created from this backup. -
500 Internal server error. -
*/ - public void deleteIndex(String indexName) throws ApiException { - deleteIndexWithHttpInfo(indexName); + public void deleteBackup(String backupId) throws ApiException { + deleteBackupWithHttpInfo(backupId); } /** - * Delete an index - * This operation deletes an existing index. - * @param indexName The name of the index to delete. (required) + * Delete a backup + * Delete a backup. + * @param backupId The ID of the backup to delete. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + - - - + +
Status Code Description Response Headers
202 The request to delete the index has been accepted. -
202 The request to delete the backup has been accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden. Deletion protection enabled. -
404 Index not found. -
412 There is a pending collection created from this index. -
404 Backup not found. -
412 There is a pending restore job created from this backup. -
500 Internal server error. -
*/ - public ApiResponse deleteIndexWithHttpInfo(String indexName) throws ApiException { - okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(indexName, null); + public ApiResponse deleteBackupWithHttpInfo(String backupId) throws ApiException { + okhttp3.Call localVarCall = deleteBackupValidateBeforeCall(backupId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete an index (asynchronously) - * This operation deletes an existing index. - * @param indexName The name of the index to delete. (required) + * Delete a backup (asynchronously) + * Delete a backup. + * @param backupId The ID of the backup to delete. (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 - + - - - + +
Status Code Description Response Headers
202 The request to delete the index has been accepted. -
202 The request to delete the backup has been accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden. Deletion protection enabled. -
404 Index not found. -
412 There is a pending collection created from this index. -
404 Backup not found. -
412 There is a pending restore job created from this backup. -
500 Internal server error. -
*/ - public okhttp3.Call deleteIndexAsync(String indexName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteBackupAsync(String backupId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(indexName, _callback); + okhttp3.Call localVarCall = deleteBackupValidateBeforeCall(backupId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for describeCollection - * @param collectionName The name of the collection to be described. (required) + * Build call for deleteCollection + * @param collectionName The name of the collection. (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 - +
Status Code Description Response Headers
200 Configuration information and status of the collection. -
202 The collection has been successfully deleted. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
500 Internal server error. -
*/ - public okhttp3.Call describeCollectionCall(String collectionName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteCollectionCall(String collectionName, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1021,100 +1210,898 @@ public okhttp3.Call describeCollectionCall(String collectionName, final ApiCallb } String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call describeCollectionValidateBeforeCall(String collectionName, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteCollectionValidateBeforeCall(String collectionName, final ApiCallback _callback) throws ApiException { // verify the required parameter 'collectionName' is set if (collectionName == null) { - throw new ApiException("Missing the required parameter 'collectionName' when calling describeCollection(Async)"); + throw new ApiException("Missing the required parameter 'collectionName' when calling deleteCollection(Async)"); } - return describeCollectionCall(collectionName, _callback); + return deleteCollectionCall(collectionName, _callback); } /** - * Describe a collection - * This operation gets a description of a collection. Serverless indexes do not support collections. - * @param collectionName The name of the collection to be described. (required) - * @return CollectionModel + * Delete a collection + * Delete an existing collection. Serverless indexes do not support collections. + * @param collectionName The name of the collection. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 Configuration information and status of the collection. -
202 The collection has been successfully deleted. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
500 Internal server error. -
*/ - public CollectionModel describeCollection(String collectionName) throws ApiException { - ApiResponse localVarResp = describeCollectionWithHttpInfo(collectionName); - return localVarResp.getData(); + public void deleteCollection(String collectionName) throws ApiException { + deleteCollectionWithHttpInfo(collectionName); } /** - * Describe a collection - * This operation gets a description of a collection. Serverless indexes do not support collections. - * @param collectionName The name of the collection to be described. (required) - * @return ApiResponse<CollectionModel> + * Delete a collection + * Delete an existing collection. Serverless indexes do not support collections. + * @param collectionName The name of the collection. (required) + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 Configuration information and status of the collection. -
202 The collection has been successfully deleted. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
500 Internal server error. -
*/ - public ApiResponse describeCollectionWithHttpInfo(String collectionName) throws ApiException { - okhttp3.Call localVarCall = describeCollectionValidateBeforeCall(collectionName, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse deleteCollectionWithHttpInfo(String collectionName) throws ApiException { + okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionName, null); + return localVarApiClient.execute(localVarCall); } /** - * Describe a collection (asynchronously) - * This operation gets a description of a collection. Serverless indexes do not support collections. - * @param collectionName The name of the collection to be described. (required) + * Delete a collection (asynchronously) + * Delete an existing collection. Serverless indexes do not support collections. + * @param collectionName The name of the collection. (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 + + + + + + +
Status Code Description Response Headers
202 The collection has been successfully deleted. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
500 Internal server error. -
+ */ + public okhttp3.Call deleteCollectionAsync(String collectionName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionName, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteIndex + * @param indexName The name of the index to delete. (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 + + + + + + + + +
Status Code Description Response Headers
202 The request to delete the index has been accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden. Deletion protection enabled. -
404 Index not found. -
412 There is a pending collection created from this index. -
500 Internal server error. -
+ */ + public okhttp3.Call deleteIndexCall(String indexName, 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 = "/indexes/{index_name}" + .replace("{" + "index_name" + "}", localVarApiClient.escapeString(indexName.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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteIndexValidateBeforeCall(String indexName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException("Missing the required parameter 'indexName' when calling deleteIndex(Async)"); + } + + return deleteIndexCall(indexName, _callback); + + } + + /** + * Delete an index + * Delete an existing index. + * @param indexName The name of the index to delete. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 The request to delete the index has been accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden. Deletion protection enabled. -
404 Index not found. -
412 There is a pending collection created from this index. -
500 Internal server error. -
+ */ + public void deleteIndex(String indexName) throws ApiException { + deleteIndexWithHttpInfo(indexName); + } + + /** + * Delete an index + * Delete an existing index. + * @param indexName The name of the index to delete. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 The request to delete the index has been accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden. Deletion protection enabled. -
404 Index not found. -
412 There is a pending collection created from this index. -
500 Internal server error. -
+ */ + public ApiResponse deleteIndexWithHttpInfo(String indexName) throws ApiException { + okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(indexName, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete an index (asynchronously) + * Delete an existing index. + * @param indexName The name of the index to delete. (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 + + + + + + + + +
Status Code Description Response Headers
202 The request to delete the index has been accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden. Deletion protection enabled. -
404 Index not found. -
412 There is a pending collection created from this index. -
500 Internal server error. -
+ */ + public okhttp3.Call deleteIndexAsync(String indexName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(indexName, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for describeBackup + * @param backupId The ID of the backup to describe. (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 + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the backup. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Backup not found. -
500 Internal server error. -
+ */ + public okhttp3.Call describeBackupCall(String backupId, 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 = "/backups/{backup_id}" + .replace("{" + "backup_id" + "}", localVarApiClient.escapeString(backupId.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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call describeBackupValidateBeforeCall(String backupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'backupId' is set + if (backupId == null) { + throw new ApiException("Missing the required parameter 'backupId' when calling describeBackup(Async)"); + } + + return describeBackupCall(backupId, _callback); + + } + + /** + * Describe a backup + * Get a description of a backup. + * @param backupId The ID of the backup to describe. (required) + * @return BackupModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the backup. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Backup not found. -
500 Internal server error. -
+ */ + public BackupModel describeBackup(String backupId) throws ApiException { + ApiResponse localVarResp = describeBackupWithHttpInfo(backupId); + return localVarResp.getData(); + } + + /** + * Describe a backup + * Get a description of a backup. + * @param backupId The ID of the backup to describe. (required) + * @return ApiResponse<BackupModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the backup. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Backup not found. -
500 Internal server error. -
+ */ + public ApiResponse describeBackupWithHttpInfo(String backupId) throws ApiException { + okhttp3.Call localVarCall = describeBackupValidateBeforeCall(backupId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Describe a backup (asynchronously) + * Get a description of a backup. + * @param backupId The ID of the backup to describe. (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 + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the backup. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Backup not found. -
500 Internal server error. -
+ */ + public okhttp3.Call describeBackupAsync(String backupId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = describeBackupValidateBeforeCall(backupId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for describeCollection + * @param collectionName The name of the collection to be described. (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 - + + +
Status Code Description Response Headers
200 Configuration information and status of the collection. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
404 Collection not found. -
500 Internal server error. -
+ */ + public okhttp3.Call describeCollectionCall(String collectionName, 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 = "/collections/{collection_name}" + .replace("{" + "collection_name" + "}", localVarApiClient.escapeString(collectionName.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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call describeCollectionValidateBeforeCall(String collectionName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'collectionName' is set + if (collectionName == null) { + throw new ApiException("Missing the required parameter 'collectionName' when calling describeCollection(Async)"); + } + + return describeCollectionCall(collectionName, _callback); + + } + + /** + * Describe a collection + * Get a description of a collection. Serverless indexes do not support collections. + * @param collectionName The name of the collection to be described. (required) + * @return CollectionModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Configuration information and status of the collection. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
500 Internal server error. -
+ */ + public CollectionModel describeCollection(String collectionName) throws ApiException { + ApiResponse localVarResp = describeCollectionWithHttpInfo(collectionName); + return localVarResp.getData(); + } + + /** + * Describe a collection + * Get a description of a collection. Serverless indexes do not support collections. + * @param collectionName The name of the collection to be described. (required) + * @return ApiResponse<CollectionModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Configuration information and status of the collection. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
500 Internal server error. -
+ */ + public ApiResponse describeCollectionWithHttpInfo(String collectionName) throws ApiException { + okhttp3.Call localVarCall = describeCollectionValidateBeforeCall(collectionName, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Describe a collection (asynchronously) + * Get a description of a collection. Serverless indexes do not support collections. + * @param collectionName The name of the collection to be described. (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 + + + + + + +
Status Code Description Response Headers
200 Configuration information and status of the collection. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Collection not found. -
500 Internal server error. -
+ */ + public okhttp3.Call describeCollectionAsync(String collectionName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = describeCollectionValidateBeforeCall(collectionName, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for describeIndex + * @param indexName The name of the index to be described. (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 + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the index. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Index not found. -
500 Internal server error. -
+ */ + public okhttp3.Call describeIndexCall(String indexName, 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 = "/indexes/{index_name}" + .replace("{" + "index_name" + "}", localVarApiClient.escapeString(indexName.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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call describeIndexValidateBeforeCall(String indexName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'indexName' is set + if (indexName == null) { + throw new ApiException("Missing the required parameter 'indexName' when calling describeIndex(Async)"); + } + + return describeIndexCall(indexName, _callback); + + } + + /** + * Describe an index + * Get a description of an index. + * @param indexName The name of the index to be described. (required) + * @return IndexModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the index. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Index not found. -
500 Internal server error. -
+ */ + public IndexModel describeIndex(String indexName) throws ApiException { + ApiResponse localVarResp = describeIndexWithHttpInfo(indexName); + return localVarResp.getData(); + } + + /** + * Describe an index + * Get a description of an index. + * @param indexName The name of the index to be described. (required) + * @return ApiResponse<IndexModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the index. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Index not found. -
500 Internal server error. -
+ */ + public ApiResponse describeIndexWithHttpInfo(String indexName) throws ApiException { + okhttp3.Call localVarCall = describeIndexValidateBeforeCall(indexName, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Describe an index (asynchronously) + * Get a description of an index. + * @param indexName The name of the index to be described. (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 + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the index. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Index not found. -
500 Internal server error. -
+ */ + public okhttp3.Call describeIndexAsync(String indexName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = describeIndexValidateBeforeCall(indexName, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for describeRestoreJob + * @param jobId The ID of the restore job to describe. (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 + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the restore job. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Restore job not found. -
500 Internal server error. -
+ */ + public okhttp3.Call describeRestoreJobCall(String jobId, 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 = "/restore-jobs/{job_id}" + .replace("{" + "job_id" + "}", localVarApiClient.escapeString(jobId.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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call describeRestoreJobValidateBeforeCall(String jobId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jobId' is set + if (jobId == null) { + throw new ApiException("Missing the required parameter 'jobId' when calling describeRestoreJob(Async)"); + } + + return describeRestoreJobCall(jobId, _callback); + + } + + /** + * Describe a restore job + * Get a description of a restore job. + * @param jobId The ID of the restore job to describe. (required) + * @return RestoreJobModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the restore job. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Restore job not found. -
500 Internal server error. -
+ */ + public RestoreJobModel describeRestoreJob(String jobId) throws ApiException { + ApiResponse localVarResp = describeRestoreJobWithHttpInfo(jobId); + return localVarResp.getData(); + } + + /** + * Describe a restore job + * Get a description of a restore job. + * @param jobId The ID of the restore job to describe. (required) + * @return ApiResponse<RestoreJobModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the restore job. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Restore job not found. -
500 Internal server error. -
+ */ + public ApiResponse describeRestoreJobWithHttpInfo(String jobId) throws ApiException { + okhttp3.Call localVarCall = describeRestoreJobValidateBeforeCall(jobId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Describe a restore job (asynchronously) + * Get a description of a restore job. + * @param jobId The ID of the restore job to describe. (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 + + + + + + +
Status Code Description Response Headers
200 Configuration information and deployment status of the restore job. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Restore job not found. -
500 Internal server error. -
+ */ + public okhttp3.Call describeRestoreJobAsync(String jobId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = describeRestoreJobValidateBeforeCall(jobId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listCollections + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 List all the collections in your current project. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
+ */ + public okhttp3.Call listCollectionsCall(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 = "/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 = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCollectionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return listCollectionsCall(_callback); + + } + + /** + * List collections + * List all collections in a project. Serverless indexes do not support collections. + * @return CollectionList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 List all the collections in your current project. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public okhttp3.Call describeCollectionAsync(String collectionName, final ApiCallback _callback) throws ApiException { + public CollectionList listCollections() throws ApiException { + ApiResponse localVarResp = listCollectionsWithHttpInfo(); + return localVarResp.getData(); + } - okhttp3.Call localVarCall = describeCollectionValidateBeforeCall(collectionName, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + /** + * List collections + * List all collections in a project. Serverless indexes do not support collections. + * @return ApiResponse<CollectionList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 List all the collections in your current project. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
+ */ + public ApiResponse listCollectionsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List collections (asynchronously) + * List all collections in a project. Serverless indexes do not support collections. + * @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 + + + + + +
Status Code Description Response Headers
200 List all the collections in your current project. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
+ */ + public okhttp3.Call listCollectionsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for describeIndex - * @param indexName The name of the index to be described. (required) + * Build call for listIndexBackups + * @param indexName Name of the backed up index (required) + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (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 - +
Status Code Description Response Headers
200 Configuration information and deployment status of the index. -
200 This operation returns a list of all the backups that you have previously created, and which are associated with the given index. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Index not found. -
500 Internal server error. -
*/ - public okhttp3.Call describeIndexCall(String indexName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listIndexBackupsCall(String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1131,7 +2118,7 @@ public okhttp3.Call describeIndexCall(String indexName, final ApiCallback _callb Object localVarPostBody = null; // create path and map variables - String localVarPath = "/indexes/{index_name}" + String localVarPath = "/indexes/{index_name}/backups" .replace("{" + "index_name" + "}", localVarApiClient.escapeString(indexName.toString())); List localVarQueryParams = new ArrayList(); @@ -1140,6 +2127,14 @@ public okhttp3.Call describeIndexCall(String indexName, final ApiCallback _callb Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (paginationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("paginationToken", paginationToken)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1160,94 +2155,100 @@ public okhttp3.Call describeIndexCall(String indexName, final ApiCallback _callb } @SuppressWarnings("rawtypes") - private okhttp3.Call describeIndexValidateBeforeCall(String indexName, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listIndexBackupsValidateBeforeCall(String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { // verify the required parameter 'indexName' is set if (indexName == null) { - throw new ApiException("Missing the required parameter 'indexName' when calling describeIndex(Async)"); + throw new ApiException("Missing the required parameter 'indexName' when calling listIndexBackups(Async)"); } - return describeIndexCall(indexName, _callback); + return listIndexBackupsCall(indexName, limit, paginationToken, _callback); } /** - * Describe an index - * Get a description of an index. - * @param indexName The name of the index to be described. (required) - * @return IndexModel + * List backups for an index + * List all backups for an index. + * @param indexName Name of the backed up index (required) + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (optional) + * @return BackupList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 Configuration information and deployment status of the index. -
200 This operation returns a list of all the backups that you have previously created, and which are associated with the given index. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Index not found. -
500 Internal server error. -
*/ - public IndexModel describeIndex(String indexName) throws ApiException { - ApiResponse localVarResp = describeIndexWithHttpInfo(indexName); + public BackupList listIndexBackups(String indexName, Integer limit, String paginationToken) throws ApiException { + ApiResponse localVarResp = listIndexBackupsWithHttpInfo(indexName, limit, paginationToken); return localVarResp.getData(); } /** - * Describe an index - * Get a description of an index. - * @param indexName The name of the index to be described. (required) - * @return ApiResponse<IndexModel> + * List backups for an index + * List all backups for an index. + * @param indexName Name of the backed up index (required) + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (optional) + * @return ApiResponse<BackupList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 Configuration information and deployment status of the index. -
200 This operation returns a list of all the backups that you have previously created, and which are associated with the given index. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Index not found. -
500 Internal server error. -
*/ - public ApiResponse describeIndexWithHttpInfo(String indexName) throws ApiException { - okhttp3.Call localVarCall = describeIndexValidateBeforeCall(indexName, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listIndexBackupsWithHttpInfo(String indexName, Integer limit, String paginationToken) throws ApiException { + okhttp3.Call localVarCall = listIndexBackupsValidateBeforeCall(indexName, limit, paginationToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Describe an index (asynchronously) - * Get a description of an index. - * @param indexName The name of the index to be described. (required) + * List backups for an index (asynchronously) + * List all backups for an index. + * @param indexName Name of the backed up index (required) + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (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 - +
Status Code Description Response Headers
200 Configuration information and deployment status of the index. -
200 This operation returns a list of all the backups that you have previously created, and which are associated with the given index. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Index not found. -
500 Internal server error. -
*/ - public okhttp3.Call describeIndexAsync(String indexName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listIndexBackupsAsync(String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = describeIndexValidateBeforeCall(indexName, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = listIndexBackupsValidateBeforeCall(indexName, limit, paginationToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listCollections + * Build call for listIndexes * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - +
Status Code Description Response Headers
200 This operation returns a list of all the collections in your current project. -
200 This operation returns a list of all the indexes that you have previously created, and which are associated with the given project -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public okhttp3.Call listCollectionsCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listIndexesCall(final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1264,7 +2265,7 @@ public okhttp3.Call listCollectionsCall(final ApiCallback _callback) throws ApiE Object localVarPostBody = null; // create path and map variables - String localVarPath = "/collections"; + String localVarPath = "/indexes"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1292,83 +2293,206 @@ public okhttp3.Call listCollectionsCall(final ApiCallback _callback) throws ApiE } @SuppressWarnings("rawtypes") - private okhttp3.Call listCollectionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return listCollectionsCall(_callback); + private okhttp3.Call listIndexesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return listIndexesCall(_callback); } /** - * List collections - * This operation returns a list of all collections in a project. Serverless indexes do not support collections. - * @return CollectionList + * List indexes + * List all indexes in a project. + * @return IndexList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 This operation returns a list of all the collections in your current project. -
200 This operation returns a list of all the indexes that you have previously created, and which are associated with the given project -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public CollectionList listCollections() throws ApiException { - ApiResponse localVarResp = listCollectionsWithHttpInfo(); + public IndexList listIndexes() throws ApiException { + ApiResponse localVarResp = listIndexesWithHttpInfo(); return localVarResp.getData(); } /** - * List collections - * This operation returns a list of all collections in a project. Serverless indexes do not support collections. - * @return ApiResponse<CollectionList> + * List indexes + * List all indexes in a project. + * @return ApiResponse<IndexList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 This operation returns a list of all the collections in your current project. -
200 This operation returns a list of all the indexes that you have previously created, and which are associated with the given project -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public ApiResponse listCollectionsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listIndexesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listIndexesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List collections (asynchronously) - * This operation returns a list of all collections in a project. Serverless indexes do not support collections. + * List indexes (asynchronously) + * List all indexes in a project. + * @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 + + + + + +
Status Code Description Response Headers
200 This operation returns a list of all the indexes that you have previously created, and which are associated with the given project -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
+ */ + public okhttp3.Call listIndexesAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listIndexesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listProjectBackups + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 This operation returns a list of all the backups for the given index that you have previously created. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
+ */ + public okhttp3.Call listProjectBackupsCall(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 = "/backups"; + + 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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listProjectBackupsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return listProjectBackupsCall(_callback); + + } + + /** + * List backups for all indexes in a project + * List all backups for a project. + * @return BackupList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 This operation returns a list of all the backups for the given index that you have previously created. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
+ */ + public BackupList listProjectBackups() throws ApiException { + ApiResponse localVarResp = listProjectBackupsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List backups for all indexes in a project + * List all backups for a project. + * @return ApiResponse<BackupList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 This operation returns a list of all the backups for the given index that you have previously created. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
+ */ + public ApiResponse listProjectBackupsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listProjectBackupsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List backups for all indexes in a project (asynchronously) + * List all backups for a project. * @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 - +
Status Code Description Response Headers
200 This operation returns a list of all the collections in your current project. -
200 This operation returns a list of all the backups for the given index that you have previously created. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public okhttp3.Call listCollectionsAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listProjectBackupsAsync(final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = listProjectBackupsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listIndexes + * Build call for listRestoreJobs + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (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 - +
Status Code Description Response Headers
200 This operation returns a list of all the indexes that you have previously created, and which are associated with the given project -
200 This operation returns a list of all the restore jobs that you have previously created. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public okhttp3.Call listIndexesCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listRestoreJobsCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1385,7 +2509,7 @@ public okhttp3.Call listIndexesCall(final ApiCallback _callback) throws ApiExcep Object localVarPostBody = null; // create path and map variables - String localVarPath = "/indexes"; + String localVarPath = "/restore-jobs"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1393,6 +2517,14 @@ public okhttp3.Call listIndexesCall(final ApiCallback _callback) throws ApiExcep Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (paginationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("paginationToken", paginationToken)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1413,66 +2545,72 @@ public okhttp3.Call listIndexesCall(final ApiCallback _callback) throws ApiExcep } @SuppressWarnings("rawtypes") - private okhttp3.Call listIndexesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return listIndexesCall(_callback); + private okhttp3.Call listRestoreJobsValidateBeforeCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + return listRestoreJobsCall(limit, paginationToken, _callback); } /** - * List indexes - * This operation returns a list of all indexes in a project. - * @return IndexList + * List restore jobs + * List all restore jobs for a project. + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (optional) + * @return RestoreJobList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 This operation returns a list of all the indexes that you have previously created, and which are associated with the given project -
200 This operation returns a list of all the restore jobs that you have previously created. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public IndexList listIndexes() throws ApiException { - ApiResponse localVarResp = listIndexesWithHttpInfo(); + public RestoreJobList listRestoreJobs(Integer limit, String paginationToken) throws ApiException { + ApiResponse localVarResp = listRestoreJobsWithHttpInfo(limit, paginationToken); return localVarResp.getData(); } /** - * List indexes - * This operation returns a list of all indexes in a project. - * @return ApiResponse<IndexList> + * List restore jobs + * List all restore jobs for a project. + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (optional) + * @return ApiResponse<RestoreJobList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 This operation returns a list of all the indexes that you have previously created, and which are associated with the given project -
200 This operation returns a list of all the restore jobs that you have previously created. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public ApiResponse listIndexesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listIndexesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listRestoreJobsWithHttpInfo(Integer limit, String paginationToken) throws ApiException { + okhttp3.Call localVarCall = listRestoreJobsValidateBeforeCall(limit, paginationToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List indexes (asynchronously) - * This operation returns a list of all indexes in a project. + * List restore jobs (asynchronously) + * List all restore jobs for a project. + * @param limit The number of results to return per page. (optional, default to 10) + * @param paginationToken The token to use to retrieve the next page of results. (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 - +
Status Code Description Response Headers
200 This operation returns a list of all the indexes that you have previously created, and which are associated with the given project -
200 This operation returns a list of all the restore jobs that you have previously created. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
*/ - public okhttp3.Call listIndexesAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listRestoreJobsAsync(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listIndexesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = listRestoreJobsValidateBeforeCall(limit, paginationToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/org/openapitools/db_control/client/auth/ApiKeyAuth.java b/src/main/java/org/openapitools/db_control/client/auth/ApiKeyAuth.java index 05644cf..93a032a 100644 --- a/src/main/java/org/openapitools/db_control/client/auth/ApiKeyAuth.java +++ b/src/main/java/org/openapitools/db_control/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/org/openapitools/db_control/client/auth/Authentication.java b/src/main/java/org/openapitools/db_control/client/auth/Authentication.java index 3816148..948f1dd 100644 --- a/src/main/java/org/openapitools/db_control/client/auth/Authentication.java +++ b/src/main/java/org/openapitools/db_control/client/auth/Authentication.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_control/client/auth/HttpBasicAuth.java b/src/main/java/org/openapitools/db_control/client/auth/HttpBasicAuth.java index 26ad363..0edd7e4 100644 --- a/src/main/java/org/openapitools/db_control/client/auth/HttpBasicAuth.java +++ b/src/main/java/org/openapitools/db_control/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_control/client/auth/HttpBearerAuth.java b/src/main/java/org/openapitools/db_control/client/auth/HttpBearerAuth.java index 9a3fbef..14fc738 100644 --- a/src/main/java/org/openapitools/db_control/client/auth/HttpBearerAuth.java +++ b/src/main/java/org/openapitools/db_control/client/auth/HttpBearerAuth.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/org/openapitools/db_control/client/model/AbstractOpenApiSchema.java b/src/main/java/org/openapitools/db_control/client/model/AbstractOpenApiSchema.java index 854b1fd..b55dc20 100644 --- a/src/main/java/org/openapitools/db_control/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/org/openapitools/db_control/client/model/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,7 +23,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/org/openapitools/db_control/client/model/BackupList.java b/src/main/java/org/openapitools/db_control/client/model/BackupList.java new file mode 100644 index 0000000..4719a9a --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/BackupList.java @@ -0,0 +1,339 @@ +/* + * Pinecone Control Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_control.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.db_control.client.model.BackupModel; +import org.openapitools.db_control.client.model.PaginationResponse; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_control.client.JSON; + +/** + * The list of backups that exist in the project. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") +public class BackupList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data; + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private PaginationResponse pagination; + + public BackupList() { + } + + public BackupList data(List data) { + + this.data = data; + return this; + } + + public BackupList addDataItem(BackupModel dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + + public BackupList pagination(PaginationResponse pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nullable + public PaginationResponse getPagination() { + return pagination; + } + + + public void setPagination(PaginationResponse pagination) { + this.pagination = pagination; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BackupList instance itself + */ + public BackupList 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; + } + BackupList backupList = (BackupList) o; + return Objects.equals(this.data, backupList.data) && + Objects.equals(this.pagination, backupList.pagination)&& + Objects.equals(this.additionalProperties, backupList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, pagination, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BackupList {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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(); + openapiFields.add("data"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BackupList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BackupList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BackupList is not found in the empty JSON string", BackupList.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + BackupModel.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + PaginationResponse.validateJsonElement(jsonObj.get("pagination")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BackupList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BackupList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BackupList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BackupList 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BackupList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BackupList 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("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 BackupList given an JSON string + * + * @param jsonString JSON string + * @return An instance of BackupList + * @throws IOException if the JSON string is invalid with respect to BackupList + */ + public static BackupList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BackupList.class); + } + + /** + * Convert an instance of BackupList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/model/BackupModel.java b/src/main/java/org/openapitools/db_control/client/model/BackupModel.java new file mode 100644 index 0000000..cf3aa47 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/BackupModel.java @@ -0,0 +1,777 @@ +/* + * Pinecone Control Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_control.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_control.client.JSON; + +/** + * The BackupModel describes the configuration and status of a Pinecone backup. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") +public class BackupModel { + public static final String SERIALIZED_NAME_BACKUP_ID = "backup_id"; + @SerializedName(SERIALIZED_NAME_BACKUP_ID) + private String backupId; + + public static final String SERIALIZED_NAME_SOURCE_INDEX_NAME = "source_index_name"; + @SerializedName(SERIALIZED_NAME_SOURCE_INDEX_NAME) + private String sourceIndexName; + + public static final String SERIALIZED_NAME_SOURCE_INDEX_ID = "source_index_id"; + @SerializedName(SERIALIZED_NAME_SOURCE_INDEX_ID) + private String sourceIndexId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CLOUD = "cloud"; + @SerializedName(SERIALIZED_NAME_CLOUD) + private String cloud; + + public static final String SERIALIZED_NAME_REGION = "region"; + @SerializedName(SERIALIZED_NAME_REGION) + private String region; + + public static final String SERIALIZED_NAME_DIMENSION = "dimension"; + @SerializedName(SERIALIZED_NAME_DIMENSION) + private Integer dimension; + + /** + * The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If the 'vector_type' is 'sparse', the metric must be 'dotproduct'. If the `vector_type` is `dense`, the metric defaults to 'cosine'. + */ + @JsonAdapter(MetricEnum.Adapter.class) + public enum MetricEnum { + COSINE("cosine"), + + EUCLIDEAN("euclidean"), + + DOTPRODUCT("dotproduct"); + + private String value; + + MetricEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static MetricEnum fromValue(String value) { + for (MetricEnum b : MetricEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MetricEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MetricEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MetricEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_METRIC = "metric"; + @SerializedName(SERIALIZED_NAME_METRIC) + private MetricEnum metric; + + public static final String SERIALIZED_NAME_RECORD_COUNT = "record_count"; + @SerializedName(SERIALIZED_NAME_RECORD_COUNT) + private Integer recordCount; + + public static final String SERIALIZED_NAME_NAMESPACE_COUNT = "namespace_count"; + @SerializedName(SERIALIZED_NAME_NAMESPACE_COUNT) + private Integer namespaceCount; + + public static final String SERIALIZED_NAME_SIZE_BYTES = "size_bytes"; + @SerializedName(SERIALIZED_NAME_SIZE_BYTES) + private Integer sizeBytes; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private Map tags = new HashMap<>(); + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public BackupModel() { + } + + public BackupModel backupId(String backupId) { + + this.backupId = backupId; + return this; + } + + /** + * Unique identifier for the backup. + * @return backupId + **/ + @javax.annotation.Nonnull + public String getBackupId() { + return backupId; + } + + + public void setBackupId(String backupId) { + this.backupId = backupId; + } + + + public BackupModel sourceIndexName(String sourceIndexName) { + + this.sourceIndexName = sourceIndexName; + return this; + } + + /** + * Name of the index from which the backup was taken. + * @return sourceIndexName + **/ + @javax.annotation.Nonnull + public String getSourceIndexName() { + return sourceIndexName; + } + + + public void setSourceIndexName(String sourceIndexName) { + this.sourceIndexName = sourceIndexName; + } + + + public BackupModel sourceIndexId(String sourceIndexId) { + + this.sourceIndexId = sourceIndexId; + return this; + } + + /** + * ID of the index. + * @return sourceIndexId + **/ + @javax.annotation.Nonnull + public String getSourceIndexId() { + return sourceIndexId; + } + + + public void setSourceIndexId(String sourceIndexId) { + this.sourceIndexId = sourceIndexId; + } + + + public BackupModel name(String name) { + + this.name = name; + return this; + } + + /** + * Optional user-defined name for the backup. + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public BackupModel description(String description) { + + this.description = description; + return this; + } + + /** + * Optional description providing context for the backup. + * @return description + **/ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public BackupModel status(String status) { + + this.status = status; + return this; + } + + /** + * Current status of the backup (e.g., Initializing, Ready, Failed). + * @return status + **/ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public BackupModel cloud(String cloud) { + + this.cloud = cloud; + return this; + } + + /** + * Cloud provider where the backup is stored. + * @return cloud + **/ + @javax.annotation.Nonnull + public String getCloud() { + return cloud; + } + + + public void setCloud(String cloud) { + this.cloud = cloud; + } + + + public BackupModel region(String region) { + + this.region = region; + return this; + } + + /** + * Cloud region where the backup is stored. + * @return region + **/ + @javax.annotation.Nonnull + public String getRegion() { + return region; + } + + + public void setRegion(String region) { + this.region = region; + } + + + public BackupModel dimension(Integer dimension) { + + this.dimension = dimension; + return this; + } + + /** + * The dimensions of the vectors to be inserted in the index. + * minimum: 1 + * maximum: 20000 + * @return dimension + **/ + @javax.annotation.Nullable + public Integer getDimension() { + return dimension; + } + + + public void setDimension(Integer dimension) { + this.dimension = dimension; + } + + + public BackupModel metric(MetricEnum metric) { + + this.metric = metric; + return this; + } + + /** + * The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If the 'vector_type' is 'sparse', the metric must be 'dotproduct'. If the `vector_type` is `dense`, the metric defaults to 'cosine'. + * @return metric + **/ + @javax.annotation.Nullable + public MetricEnum getMetric() { + return metric; + } + + + public void setMetric(MetricEnum metric) { + this.metric = metric; + } + + + public BackupModel recordCount(Integer recordCount) { + + this.recordCount = recordCount; + return this; + } + + /** + * Total number of records in the backup. + * @return recordCount + **/ + @javax.annotation.Nullable + public Integer getRecordCount() { + return recordCount; + } + + + public void setRecordCount(Integer recordCount) { + this.recordCount = recordCount; + } + + + public BackupModel namespaceCount(Integer namespaceCount) { + + this.namespaceCount = namespaceCount; + return this; + } + + /** + * Number of namespaces in the backup. + * @return namespaceCount + **/ + @javax.annotation.Nullable + public Integer getNamespaceCount() { + return namespaceCount; + } + + + public void setNamespaceCount(Integer namespaceCount) { + this.namespaceCount = namespaceCount; + } + + + public BackupModel sizeBytes(Integer sizeBytes) { + + this.sizeBytes = sizeBytes; + return this; + } + + /** + * Size of the backup in bytes. + * @return sizeBytes + **/ + @javax.annotation.Nullable + public Integer getSizeBytes() { + return sizeBytes; + } + + + public void setSizeBytes(Integer sizeBytes) { + this.sizeBytes = sizeBytes; + } + + + public BackupModel tags(Map tags) { + + this.tags = tags; + return this; + } + + public BackupModel putTagsItem(String key, String tagsItem) { + if (this.tags == null) { + this.tags = new HashMap<>(); + } + this.tags.put(key, tagsItem); + return this; + } + + /** + * Custom user tags added to an index. Keys must be 80 characters or less. Values must be 120 characters or less. Keys must be alphanumeric, '_', or '-'. Values must be alphanumeric, ';', '@', '_', '-', '.', '+', or ' '. To unset a key, set the value to be an empty string. + * @return tags + **/ + @javax.annotation.Nullable + public Map getTags() { + return tags; + } + + + public void setTags(Map tags) { + this.tags = tags; + } + + + public BackupModel createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the backup was created. + * @return createdAt + **/ + @javax.annotation.Nullable + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BackupModel instance itself + */ + public BackupModel 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; + } + BackupModel backupModel = (BackupModel) o; + return Objects.equals(this.backupId, backupModel.backupId) && + Objects.equals(this.sourceIndexName, backupModel.sourceIndexName) && + Objects.equals(this.sourceIndexId, backupModel.sourceIndexId) && + Objects.equals(this.name, backupModel.name) && + Objects.equals(this.description, backupModel.description) && + Objects.equals(this.status, backupModel.status) && + Objects.equals(this.cloud, backupModel.cloud) && + Objects.equals(this.region, backupModel.region) && + Objects.equals(this.dimension, backupModel.dimension) && + Objects.equals(this.metric, backupModel.metric) && + Objects.equals(this.recordCount, backupModel.recordCount) && + Objects.equals(this.namespaceCount, backupModel.namespaceCount) && + Objects.equals(this.sizeBytes, backupModel.sizeBytes) && + Objects.equals(this.tags, backupModel.tags) && + Objects.equals(this.createdAt, backupModel.createdAt)&& + Objects.equals(this.additionalProperties, backupModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(backupId, sourceIndexName, sourceIndexId, name, description, status, cloud, region, dimension, metric, recordCount, namespaceCount, sizeBytes, tags, createdAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BackupModel {\n"); + sb.append(" backupId: ").append(toIndentedString(backupId)).append("\n"); + sb.append(" sourceIndexName: ").append(toIndentedString(sourceIndexName)).append("\n"); + sb.append(" sourceIndexId: ").append(toIndentedString(sourceIndexId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" dimension: ").append(toIndentedString(dimension)).append("\n"); + sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); + sb.append(" recordCount: ").append(toIndentedString(recordCount)).append("\n"); + sb.append(" namespaceCount: ").append(toIndentedString(namespaceCount)).append("\n"); + sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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(); + openapiFields.add("backup_id"); + openapiFields.add("source_index_name"); + openapiFields.add("source_index_id"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("status"); + openapiFields.add("cloud"); + openapiFields.add("region"); + openapiFields.add("dimension"); + openapiFields.add("metric"); + openapiFields.add("record_count"); + openapiFields.add("namespace_count"); + openapiFields.add("size_bytes"); + openapiFields.add("tags"); + openapiFields.add("created_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("backup_id"); + openapiRequiredFields.add("source_index_name"); + openapiRequiredFields.add("source_index_id"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("cloud"); + openapiRequiredFields.add("region"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BackupModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BackupModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BackupModel is not found in the empty JSON string", BackupModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BackupModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("backup_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backup_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backup_id").toString())); + } + if (!jsonObj.get("source_index_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source_index_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_index_name").toString())); + } + if (!jsonObj.get("source_index_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source_index_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_index_id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if (!jsonObj.get("cloud").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cloud` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cloud").toString())); + } + if (!jsonObj.get("region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region").toString())); + } + if ((jsonObj.get("metric") != null && !jsonObj.get("metric").isJsonNull()) && !jsonObj.get("metric").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metric` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metric").toString())); + } + if ((jsonObj.get("created_at") != null && !jsonObj.get("created_at").isJsonNull()) && !jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BackupModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BackupModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BackupModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BackupModel 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BackupModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BackupModel 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("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 BackupModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of BackupModel + * @throws IOException if the JSON string is invalid with respect to BackupModel + */ + public static BackupModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BackupModel.class); + } + + /** + * Convert an instance of BackupModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/model/ByocSpec.java b/src/main/java/org/openapitools/db_control/client/model/ByocSpec.java new file mode 100644 index 0000000..147805c --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ByocSpec.java @@ -0,0 +1,292 @@ +/* + * Pinecone Control Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_control.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_control.client.JSON; + +/** + * Configuration needed to deploy an index in a BYOC environment. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") +public class ByocSpec { + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private String environment; + + public ByocSpec() { + } + + public ByocSpec environment(String environment) { + + this.environment = environment; + return this; + } + + /** + * The environment where the index is hosted. + * @return environment + **/ + @javax.annotation.Nonnull + public String getEnvironment() { + return environment; + } + + + public void setEnvironment(String environment) { + this.environment = environment; + } + + /** + * 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 ByocSpec instance itself + */ + public ByocSpec 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; + } + ByocSpec byocSpec = (ByocSpec) o; + return Objects.equals(this.environment, byocSpec.environment)&& + Objects.equals(this.additionalProperties, byocSpec.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(environment, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ByocSpec {\n"); + sb.append(" environment: ").append(toIndentedString(environment)).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(); + openapiFields.add("environment"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("environment"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ByocSpec + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ByocSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ByocSpec is not found in the empty JSON string", ByocSpec.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ByocSpec.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("environment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ByocSpec.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ByocSpec' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ByocSpec.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ByocSpec 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ByocSpec read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ByocSpec 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("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 ByocSpec given an JSON string + * + * @param jsonString JSON string + * @return An instance of ByocSpec + * @throws IOException if the JSON string is invalid with respect to ByocSpec + */ + public static ByocSpec fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ByocSpec.class); + } + + /** + * Convert an instance of ByocSpec to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/model/CollectionList.java b/src/main/java/org/openapitools/db_control/client/model/CollectionList.java index 0b8e206..68f477b 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CollectionList.java +++ b/src/main/java/org/openapitools/db_control/client/model/CollectionList.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * The list of collections that exist in the project. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class CollectionList { public static final String SERIALIZED_NAME_COLLECTIONS = "collections"; @SerializedName(SERIALIZED_NAME_COLLECTIONS) diff --git a/src/main/java/org/openapitools/db_control/client/model/CollectionModel.java b/src/main/java/org/openapitools/db_control/client/model/CollectionModel.java index d70cf62..6dda080 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CollectionModel.java +++ b/src/main/java/org/openapitools/db_control/client/model/CollectionModel.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The CollectionModel describes the configuration and status of a Pinecone collection. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class CollectionModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequest.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequest.java index 7c99289..e71fc70 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequest.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -54,7 +54,7 @@ /** * Configuration used to scale an index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ConfigureIndexRequest { public static final String SERIALIZED_NAME_SPEC = "spec"; @SerializedName(SERIALIZED_NAME_SPEC) diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestEmbed.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestEmbed.java index e7c8641..04c5ff0 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestEmbed.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestEmbed.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Configure the integrated inference embedding settings for this index. You can convert an existing index to an integrated index by specifying the embedding model and field_map. The index vector type and dimension must match the model vector type and dimension, and the index similarity metric must be supported by the model. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) for available models and model details. You can later change the embedding configuration to update the field map, read parameters, or write parameters. Once set, the model cannot be changed. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ConfigureIndexRequestEmbed { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java index 8e6cc68..e2d4c61 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * ConfigureIndexRequestSpec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ConfigureIndexRequestSpec { public static final String SERIALIZED_NAME_POD = "pod"; @SerializedName(SERIALIZED_NAME_POD) diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java index c4f054a..9aec23d 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * ConfigureIndexRequestSpecPod */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ConfigureIndexRequestSpecPod { public static final String SERIALIZED_NAME_REPLICAS = "replicas"; @SerializedName(SERIALIZED_NAME_REPLICAS) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.java new file mode 100644 index 0000000..0bd500b --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.java @@ -0,0 +1,315 @@ +/* + * Pinecone Control Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_control.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_control.client.JSON; + +/** + * The configuration needed to create a backup of an index. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") +public class CreateBackupRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public CreateBackupRequest() { + } + + public CreateBackupRequest name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateBackupRequest description(String description) { + + this.description = description; + return this; + } + + /** + * A description of the backup. + * @return description + **/ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + /** + * 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 CreateBackupRequest instance itself + */ + public CreateBackupRequest 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; + } + CreateBackupRequest createBackupRequest = (CreateBackupRequest) o; + return Objects.equals(this.name, createBackupRequest.name) && + Objects.equals(this.description, createBackupRequest.description)&& + Objects.equals(this.additionalProperties, createBackupRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackupRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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(); + openapiFields.add("name"); + openapiFields.add("description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateBackupRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateBackupRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateBackupRequest is not found in the empty JSON string", CreateBackupRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateBackupRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateBackupRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateBackupRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateBackupRequest 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateBackupRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateBackupRequest 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("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 CreateBackupRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateBackupRequest + * @throws IOException if the JSON string is invalid with respect to CreateBackupRequest + */ + public static CreateBackupRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateBackupRequest.class); + } + + /** + * Convert an instance of CreateBackupRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateCollectionRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateCollectionRequest.java index df9c320..b9ed633 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateCollectionRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateCollectionRequest.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The configuration needed to create a Pinecone collection. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class CreateCollectionRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequest.java index f8a0ef5..0f13fb0 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequest.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * The desired configuration for the index and associated embedding model. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class CreateIndexForModelRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequestEmbed.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequestEmbed.java index 5e13b2a..f7b34a1 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequestEmbed.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequestEmbed.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Specify the integrated inference embedding configuration for the index. Once set the model cannot be changed, but you can later update the embedding configuration for an integrated inference index including field map, read parameters, or write parameters. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) for available models and model details. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class CreateIndexForModelRequestEmbed { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) @@ -112,6 +112,10 @@ public MetricEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_FIELD_MAP) private Object fieldMap; + public static final String SERIALIZED_NAME_DIMENSION = "dimension"; + @SerializedName(SERIALIZED_NAME_DIMENSION) + private Integer dimension; + public static final String SERIALIZED_NAME_READ_PARAMETERS = "read_parameters"; @SerializedName(SERIALIZED_NAME_READ_PARAMETERS) private Object readParameters; @@ -186,6 +190,27 @@ public void setFieldMap(Object fieldMap) { } + public CreateIndexForModelRequestEmbed dimension(Integer dimension) { + + this.dimension = dimension; + return this; + } + + /** + * The dimension of embedding vectors produced for the index. + * @return dimension + **/ + @javax.annotation.Nullable + public Integer getDimension() { + return dimension; + } + + + public void setDimension(Integer dimension) { + this.dimension = dimension; + } + + public CreateIndexForModelRequestEmbed readParameters(Object readParameters) { this.readParameters = readParameters; @@ -285,6 +310,7 @@ public boolean equals(Object o) { return Objects.equals(this.model, createIndexForModelRequestEmbed.model) && Objects.equals(this.metric, createIndexForModelRequestEmbed.metric) && Objects.equals(this.fieldMap, createIndexForModelRequestEmbed.fieldMap) && + Objects.equals(this.dimension, createIndexForModelRequestEmbed.dimension) && Objects.equals(this.readParameters, createIndexForModelRequestEmbed.readParameters) && Objects.equals(this.writeParameters, createIndexForModelRequestEmbed.writeParameters)&& Objects.equals(this.additionalProperties, createIndexForModelRequestEmbed.additionalProperties); @@ -292,7 +318,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(model, metric, fieldMap, readParameters, writeParameters, additionalProperties); + return Objects.hash(model, metric, fieldMap, dimension, readParameters, writeParameters, additionalProperties); } @Override @@ -302,6 +328,7 @@ public String toString() { sb.append(" model: ").append(toIndentedString(model)).append("\n"); sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); sb.append(" fieldMap: ").append(toIndentedString(fieldMap)).append("\n"); + sb.append(" dimension: ").append(toIndentedString(dimension)).append("\n"); sb.append(" readParameters: ").append(toIndentedString(readParameters)).append("\n"); sb.append(" writeParameters: ").append(toIndentedString(writeParameters)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -330,6 +357,7 @@ private String toIndentedString(Object o) { openapiFields.add("model"); openapiFields.add("metric"); openapiFields.add("field_map"); + openapiFields.add("dimension"); openapiFields.add("read_parameters"); openapiFields.add("write_parameters"); diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.java new file mode 100644 index 0000000..738fb22 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.java @@ -0,0 +1,359 @@ +/* + * Pinecone Control Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_control.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.db_control.client.model.DeletionProtection; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_control.client.JSON; + +/** + * The configuration needed to create a Pinecone index from a backup. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") +public class CreateIndexFromBackupRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private Map tags = new HashMap<>(); + + public static final String SERIALIZED_NAME_DELETION_PROTECTION = "deletion_protection"; + @SerializedName(SERIALIZED_NAME_DELETION_PROTECTION) + private DeletionProtection deletionProtection = DeletionProtection.DISABLED; + + public CreateIndexFromBackupRequest() { + } + + public CreateIndexFromBackupRequest name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateIndexFromBackupRequest tags(Map tags) { + + this.tags = tags; + return this; + } + + public CreateIndexFromBackupRequest putTagsItem(String key, String tagsItem) { + if (this.tags == null) { + this.tags = new HashMap<>(); + } + this.tags.put(key, tagsItem); + return this; + } + + /** + * Custom user tags added to an index. Keys must be 80 characters or less. Values must be 120 characters or less. Keys must be alphanumeric, '_', or '-'. Values must be alphanumeric, ';', '@', '_', '-', '.', '+', or ' '. To unset a key, set the value to be an empty string. + * @return tags + **/ + @javax.annotation.Nullable + public Map getTags() { + return tags; + } + + + public void setTags(Map tags) { + this.tags = tags; + } + + + public CreateIndexFromBackupRequest deletionProtection(DeletionProtection deletionProtection) { + + this.deletionProtection = deletionProtection; + return this; + } + + /** + * Get deletionProtection + * @return deletionProtection + **/ + @javax.annotation.Nullable + public DeletionProtection getDeletionProtection() { + return deletionProtection; + } + + + public void setDeletionProtection(DeletionProtection deletionProtection) { + this.deletionProtection = deletionProtection; + } + + /** + * 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 CreateIndexFromBackupRequest instance itself + */ + public CreateIndexFromBackupRequest 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; + } + CreateIndexFromBackupRequest createIndexFromBackupRequest = (CreateIndexFromBackupRequest) o; + return Objects.equals(this.name, createIndexFromBackupRequest.name) && + Objects.equals(this.tags, createIndexFromBackupRequest.tags) && + Objects.equals(this.deletionProtection, createIndexFromBackupRequest.deletionProtection)&& + Objects.equals(this.additionalProperties, createIndexFromBackupRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, tags, deletionProtection, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateIndexFromBackupRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" deletionProtection: ").append(toIndentedString(deletionProtection)).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(); + openapiFields.add("name"); + openapiFields.add("tags"); + openapiFields.add("deletion_protection"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateIndexFromBackupRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateIndexFromBackupRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateIndexFromBackupRequest is not found in the empty JSON string", CreateIndexFromBackupRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateIndexFromBackupRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateIndexFromBackupRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateIndexFromBackupRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateIndexFromBackupRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateIndexFromBackupRequest 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateIndexFromBackupRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateIndexFromBackupRequest 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("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 CreateIndexFromBackupRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateIndexFromBackupRequest + * @throws IOException if the JSON string is invalid with respect to CreateIndexFromBackupRequest + */ + public static CreateIndexFromBackupRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateIndexFromBackupRequest.class); + } + + /** + * Convert an instance of CreateIndexFromBackupRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexRequest.java index 64e209d..264cbaa 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexRequest.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * The configuration needed to create a Pinecone index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class CreateIndexRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/DeletionProtection.java b/src/main/java/org/openapitools/db_control/client/model/DeletionProtection.java index 5432246..ed5149d 100644 --- a/src/main/java/org/openapitools/db_control/client/model/DeletionProtection.java +++ b/src/main/java/org/openapitools/db_control/client/model/DeletionProtection.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_control/client/model/ErrorResponse.java b/src/main/java/org/openapitools/db_control/client/model/ErrorResponse.java index 8a59502..545339a 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ErrorResponse.java +++ b/src/main/java/org/openapitools/db_control/client/model/ErrorResponse.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * The response shape used for all error responses. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ErrorResponse { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/org/openapitools/db_control/client/model/ErrorResponseError.java b/src/main/java/org/openapitools/db_control/client/model/ErrorResponseError.java index 8ee6f30..2b752ab 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ErrorResponseError.java +++ b/src/main/java/org/openapitools/db_control/client/model/ErrorResponseError.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Detailed information about the error that occurred. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ErrorResponseError { /** * Gets or Sets code diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexList.java b/src/main/java/org/openapitools/db_control/client/model/IndexList.java index 89e27c1..8cf7a63 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexList.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexList.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * The list of indexes that exist in the project. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class IndexList { public static final String SERIALIZED_NAME_INDEXES = "indexes"; @SerializedName(SERIALIZED_NAME_INDEXES) diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexModel.java b/src/main/java/org/openapitools/db_control/client/model/IndexModel.java index 2850b44..7b86720 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexModel.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModel.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -55,7 +55,7 @@ /** * The IndexModel describes the configuration and status of a Pinecone index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class IndexModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java b/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java index df87eb3..8a22919 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; +import org.openapitools.db_control.client.model.ByocSpec; import org.openapitools.db_control.client.model.PodSpec; import org.openapitools.db_control.client.model.ServerlessSpec; @@ -51,8 +52,12 @@ /** * IndexModelSpec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class IndexModelSpec { + public static final String SERIALIZED_NAME_BYOC = "byoc"; + @SerializedName(SERIALIZED_NAME_BYOC) + private ByocSpec byoc; + public static final String SERIALIZED_NAME_POD = "pod"; @SerializedName(SERIALIZED_NAME_POD) private PodSpec pod; @@ -64,6 +69,27 @@ public class IndexModelSpec { public IndexModelSpec() { } + public IndexModelSpec byoc(ByocSpec byoc) { + + this.byoc = byoc; + return this; + } + + /** + * Get byoc + * @return byoc + **/ + @javax.annotation.Nullable + public ByocSpec getByoc() { + return byoc; + } + + + public void setByoc(ByocSpec byoc) { + this.byoc = byoc; + } + + public IndexModelSpec pod(PodSpec pod) { this.pod = pod; @@ -160,20 +186,22 @@ public boolean equals(Object o) { return false; } IndexModelSpec indexModelSpec = (IndexModelSpec) o; - return Objects.equals(this.pod, indexModelSpec.pod) && + return Objects.equals(this.byoc, indexModelSpec.byoc) && + Objects.equals(this.pod, indexModelSpec.pod) && Objects.equals(this.serverless, indexModelSpec.serverless)&& Objects.equals(this.additionalProperties, indexModelSpec.additionalProperties); } @Override public int hashCode() { - return Objects.hash(pod, serverless, additionalProperties); + return Objects.hash(byoc, pod, serverless, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IndexModelSpec {\n"); + sb.append(" byoc: ").append(toIndentedString(byoc)).append("\n"); sb.append(" pod: ").append(toIndentedString(pod)).append("\n"); sb.append(" serverless: ").append(toIndentedString(serverless)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -199,6 +227,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("byoc"); openapiFields.add("pod"); openapiFields.add("serverless"); @@ -219,6 +248,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `byoc` + if (jsonObj.get("byoc") != null && !jsonObj.get("byoc").isJsonNull()) { + ByocSpec.validateJsonElement(jsonObj.get("byoc")); + } // validate the optional field `pod` if (jsonObj.get("pod") != null && !jsonObj.get("pod").isJsonNull()) { PodSpec.validateJsonElement(jsonObj.get("pod")); diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexModelStatus.java b/src/main/java/org/openapitools/db_control/client/model/IndexModelStatus.java index e8e9719..722432f 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexModelStatus.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModelStatus.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * IndexModelStatus */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class IndexModelStatus { public static final String SERIALIZED_NAME_READY = "ready"; @SerializedName(SERIALIZED_NAME_READY) @@ -74,7 +74,9 @@ public enum StateEnum { TERMINATING("Terminating"), - READY("Ready"); + READY("Ready"), + + DISABLED("Disabled"); private String value; diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexSpec.java b/src/main/java/org/openapitools/db_control/client/model/IndexSpec.java index ac1ef9c..86f2893 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexSpec.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; +import org.openapitools.db_control.client.model.ByocSpec; import org.openapitools.db_control.client.model.PodSpec; import org.openapitools.db_control.client.model.ServerlessSpec; @@ -49,9 +50,9 @@ import org.openapitools.db_control.client.JSON; /** - * The spec object defines how the index should be deployed. For serverless indexes, you define only the [cloud and region](http://docs.pinecone.io/guides/indexes/understanding-indexes#cloud-regions) where the index should be hosted. For pod-based indexes, you define the [environment](http://docs.pinecone.io/guides/indexes/pods/understanding-pod-based-indexes#pod-environments) where the index should be hosted, the [pod type and size](http://docs.pinecone.io/guides/indexes/pods/understanding-pod-based-indexes#pod-types) to use, and other index characteristics. + * The spec object defines how the index should be deployed. For serverless indexes, you set only the [cloud and region](http://docs.pinecone.io/guides/indexes/understanding-indexes#cloud-regions) where the index should be hosted. For pod-based indexes, you set the [environment](http://docs.pinecone.io/guides/indexes/pods/understanding-pod-based-indexes#pod-environments) where the index should be hosted, the [pod type and size](http://docs.pinecone.io/guides/indexes/pods/understanding-pod-based-indexes#pod-types) to use, and other index characteristics. For [BYOC indexes](http://docs.pinecone.io/guides/operations/bring-your-own-cloud), you set the environment name provided to you during onboarding. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class IndexSpec { public static final String SERIALIZED_NAME_SERVERLESS = "serverless"; @SerializedName(SERIALIZED_NAME_SERVERLESS) @@ -61,6 +62,10 @@ public class IndexSpec { @SerializedName(SERIALIZED_NAME_POD) private PodSpec pod; + public static final String SERIALIZED_NAME_BYOC = "byoc"; + @SerializedName(SERIALIZED_NAME_BYOC) + private ByocSpec byoc; + public IndexSpec() { } @@ -106,6 +111,27 @@ public void setPod(PodSpec pod) { } + public IndexSpec byoc(ByocSpec byoc) { + + this.byoc = byoc; + return this; + } + + /** + * Get byoc + * @return byoc + **/ + @javax.annotation.Nullable + public ByocSpec getByoc() { + return byoc; + } + + + public void setByoc(ByocSpec byoc) { + this.byoc = byoc; + } + + @Override public boolean equals(Object o) { @@ -117,12 +143,13 @@ public boolean equals(Object o) { } IndexSpec indexSpec = (IndexSpec) o; return Objects.equals(this.serverless, indexSpec.serverless) && - Objects.equals(this.pod, indexSpec.pod); + Objects.equals(this.pod, indexSpec.pod) && + Objects.equals(this.byoc, indexSpec.byoc); } @Override public int hashCode() { - return Objects.hash(serverless, pod); + return Objects.hash(serverless, pod, byoc); } @Override @@ -131,6 +158,7 @@ public String toString() { sb.append("class IndexSpec {\n"); sb.append(" serverless: ").append(toIndentedString(serverless)).append("\n"); sb.append(" pod: ").append(toIndentedString(pod)).append("\n"); + sb.append(" byoc: ").append(toIndentedString(byoc)).append("\n"); sb.append("}"); return sb.toString(); } @@ -187,6 +215,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("pod") != null && !jsonObj.get("pod").isJsonNull()) { PodSpec.validateJsonElement(jsonObj.get("pod")); } + // validate the optional field `byoc` + if (jsonObj.get("byoc") != null && !jsonObj.get("byoc").isJsonNull()) { + ByocSpec.validateJsonElement(jsonObj.get("byoc")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java b/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java index d358f31..80e7cb2 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java +++ b/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The embedding model and document fields mapped to embedding inputs. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ModelIndexEmbed { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.java b/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.java new file mode 100644 index 0000000..a7d9c0b --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.java @@ -0,0 +1,292 @@ +/* + * Pinecone Control Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_control.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_control.client.JSON; + +/** + * The pagination object that is returned with paginated responses. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") +public class PaginationResponse { + public static final String SERIALIZED_NAME_NEXT = "next"; + @SerializedName(SERIALIZED_NAME_NEXT) + private String next; + + public PaginationResponse() { + } + + public PaginationResponse next(String next) { + + this.next = next; + return this; + } + + /** + * The token to use to retrieve the next page of results. + * @return next + **/ + @javax.annotation.Nonnull + public String getNext() { + return next; + } + + + public void setNext(String next) { + this.next = next; + } + + /** + * 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 PaginationResponse instance itself + */ + public PaginationResponse 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; + } + PaginationResponse paginationResponse = (PaginationResponse) o; + return Objects.equals(this.next, paginationResponse.next)&& + Objects.equals(this.additionalProperties, paginationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(next, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaginationResponse {\n"); + sb.append(" next: ").append(toIndentedString(next)).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(); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("next"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PaginationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PaginationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PaginationResponse is not found in the empty JSON string", PaginationResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PaginationResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaginationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaginationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaginationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaginationResponse 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PaginationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PaginationResponse 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("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 PaginationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaginationResponse + * @throws IOException if the JSON string is invalid with respect to PaginationResponse + */ + public static PaginationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaginationResponse.class); + } + + /** + * Convert an instance of PaginationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/model/PodSpec.java b/src/main/java/org/openapitools/db_control/client/model/PodSpec.java index c9a7f56..ebaa3ad 100644 --- a/src/main/java/org/openapitools/db_control/client/model/PodSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/PodSpec.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * Configuration needed to deploy a pod-based index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class PodSpec { public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT) diff --git a/src/main/java/org/openapitools/db_control/client/model/PodSpecMetadataConfig.java b/src/main/java/org/openapitools/db_control/client/model/PodSpecMetadataConfig.java index 4455b09..8bcb17c 100644 --- a/src/main/java/org/openapitools/db_control/client/model/PodSpecMetadataConfig.java +++ b/src/main/java/org/openapitools/db_control/client/model/PodSpecMetadataConfig.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. These configurations are only valid for use with pod-based indexes. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class PodSpecMetadataConfig { public static final String SERIALIZED_NAME_INDEXED = "indexed"; @SerializedName(SERIALIZED_NAME_INDEXED) diff --git a/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java b/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java new file mode 100644 index 0000000..688c1f1 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java @@ -0,0 +1,343 @@ +/* + * Pinecone Control Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_control.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.db_control.client.model.PaginationResponse; +import org.openapitools.db_control.client.model.RestoreJobModel; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_control.client.JSON; + +/** + * The list of restore jobs that exist in the project. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") +public class RestoreJobList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private PaginationResponse pagination; + + public RestoreJobList() { + } + + public RestoreJobList data(List data) { + + this.data = data; + return this; + } + + public RestoreJobList addDataItem(RestoreJobModel dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + + public RestoreJobList pagination(PaginationResponse pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nullable + public PaginationResponse getPagination() { + return pagination; + } + + + public void setPagination(PaginationResponse pagination) { + this.pagination = pagination; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RestoreJobList instance itself + */ + public RestoreJobList 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; + } + RestoreJobList restoreJobList = (RestoreJobList) o; + return Objects.equals(this.data, restoreJobList.data) && + Objects.equals(this.pagination, restoreJobList.pagination)&& + Objects.equals(this.additionalProperties, restoreJobList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, pagination, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreJobList {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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(); + openapiFields.add("data"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RestoreJobList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RestoreJobList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RestoreJobList is not found in the empty JSON string", RestoreJobList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RestoreJobList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + RestoreJobModel.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + PaginationResponse.validateJsonElement(jsonObj.get("pagination")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestoreJobList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreJobList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RestoreJobList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RestoreJobList 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RestoreJobList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RestoreJobList 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("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 RestoreJobList given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreJobList + * @throws IOException if the JSON string is invalid with respect to RestoreJobList + */ + public static RestoreJobList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreJobList.class); + } + + /** + * Convert an instance of RestoreJobList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.java b/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.java new file mode 100644 index 0000000..9228af9 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.java @@ -0,0 +1,508 @@ +/* + * Pinecone Control Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_control.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_control.client.JSON; + +/** + * The RestoreJobModel describes the status of a restore job. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") +public class RestoreJobModel { + public static final String SERIALIZED_NAME_RESTORE_JOB_ID = "restore_job_id"; + @SerializedName(SERIALIZED_NAME_RESTORE_JOB_ID) + private String restoreJobId; + + public static final String SERIALIZED_NAME_BACKUP_ID = "backup_id"; + @SerializedName(SERIALIZED_NAME_BACKUP_ID) + private String backupId; + + public static final String SERIALIZED_NAME_TARGET_INDEX_NAME = "target_index_name"; + @SerializedName(SERIALIZED_NAME_TARGET_INDEX_NAME) + private String targetIndexName; + + public static final String SERIALIZED_NAME_TARGET_INDEX_ID = "target_index_id"; + @SerializedName(SERIALIZED_NAME_TARGET_INDEX_ID) + private String targetIndexId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_COMPLETED_AT = "completed_at"; + @SerializedName(SERIALIZED_NAME_COMPLETED_AT) + private OffsetDateTime completedAt; + + public static final String SERIALIZED_NAME_PERCENT_COMPLETE = "percent_complete"; + @SerializedName(SERIALIZED_NAME_PERCENT_COMPLETE) + private Float percentComplete; + + public RestoreJobModel() { + } + + public RestoreJobModel restoreJobId(String restoreJobId) { + + this.restoreJobId = restoreJobId; + return this; + } + + /** + * Unique identifier for the restore job + * @return restoreJobId + **/ + @javax.annotation.Nonnull + public String getRestoreJobId() { + return restoreJobId; + } + + + public void setRestoreJobId(String restoreJobId) { + this.restoreJobId = restoreJobId; + } + + + public RestoreJobModel backupId(String backupId) { + + this.backupId = backupId; + return this; + } + + /** + * Backup used for the restore + * @return backupId + **/ + @javax.annotation.Nonnull + public String getBackupId() { + return backupId; + } + + + public void setBackupId(String backupId) { + this.backupId = backupId; + } + + + public RestoreJobModel targetIndexName(String targetIndexName) { + + this.targetIndexName = targetIndexName; + return this; + } + + /** + * Name of the index into which data is being restored + * @return targetIndexName + **/ + @javax.annotation.Nonnull + public String getTargetIndexName() { + return targetIndexName; + } + + + public void setTargetIndexName(String targetIndexName) { + this.targetIndexName = targetIndexName; + } + + + public RestoreJobModel targetIndexId(String targetIndexId) { + + this.targetIndexId = targetIndexId; + return this; + } + + /** + * ID of the index + * @return targetIndexId + **/ + @javax.annotation.Nonnull + public String getTargetIndexId() { + return targetIndexId; + } + + + public void setTargetIndexId(String targetIndexId) { + this.targetIndexId = targetIndexId; + } + + + public RestoreJobModel status(String status) { + + this.status = status; + return this; + } + + /** + * Status of the restore job + * @return status + **/ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public RestoreJobModel createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the restore job started + * @return createdAt + **/ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public RestoreJobModel completedAt(OffsetDateTime completedAt) { + + this.completedAt = completedAt; + return this; + } + + /** + * Timestamp when the restore job finished + * @return completedAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + + public void setCompletedAt(OffsetDateTime completedAt) { + this.completedAt = completedAt; + } + + + public RestoreJobModel percentComplete(Float percentComplete) { + + this.percentComplete = percentComplete; + return this; + } + + /** + * The progress made by the restore job out of 100 + * minimum: 0.0 + * maximum: 100.0 + * @return percentComplete + **/ + @javax.annotation.Nullable + public Float getPercentComplete() { + return percentComplete; + } + + + public void setPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + } + + /** + * 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 RestoreJobModel instance itself + */ + public RestoreJobModel 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; + } + RestoreJobModel restoreJobModel = (RestoreJobModel) o; + return Objects.equals(this.restoreJobId, restoreJobModel.restoreJobId) && + Objects.equals(this.backupId, restoreJobModel.backupId) && + Objects.equals(this.targetIndexName, restoreJobModel.targetIndexName) && + Objects.equals(this.targetIndexId, restoreJobModel.targetIndexId) && + Objects.equals(this.status, restoreJobModel.status) && + Objects.equals(this.createdAt, restoreJobModel.createdAt) && + Objects.equals(this.completedAt, restoreJobModel.completedAt) && + Objects.equals(this.percentComplete, restoreJobModel.percentComplete)&& + Objects.equals(this.additionalProperties, restoreJobModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(restoreJobId, backupId, targetIndexName, targetIndexId, status, createdAt, completedAt, percentComplete, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreJobModel {\n"); + sb.append(" restoreJobId: ").append(toIndentedString(restoreJobId)).append("\n"); + sb.append(" backupId: ").append(toIndentedString(backupId)).append("\n"); + sb.append(" targetIndexName: ").append(toIndentedString(targetIndexName)).append("\n"); + sb.append(" targetIndexId: ").append(toIndentedString(targetIndexId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n"); + sb.append(" percentComplete: ").append(toIndentedString(percentComplete)).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(); + openapiFields.add("restore_job_id"); + openapiFields.add("backup_id"); + openapiFields.add("target_index_name"); + openapiFields.add("target_index_id"); + openapiFields.add("status"); + openapiFields.add("created_at"); + openapiFields.add("completed_at"); + openapiFields.add("percent_complete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("restore_job_id"); + openapiRequiredFields.add("backup_id"); + openapiRequiredFields.add("target_index_name"); + openapiRequiredFields.add("target_index_id"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("created_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RestoreJobModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RestoreJobModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RestoreJobModel is not found in the empty JSON string", RestoreJobModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RestoreJobModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("restore_job_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `restore_job_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("restore_job_id").toString())); + } + if (!jsonObj.get("backup_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backup_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backup_id").toString())); + } + if (!jsonObj.get("target_index_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `target_index_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("target_index_name").toString())); + } + if (!jsonObj.get("target_index_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `target_index_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("target_index_id").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestoreJobModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreJobModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RestoreJobModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RestoreJobModel 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RestoreJobModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RestoreJobModel 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("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 RestoreJobModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreJobModel + * @throws IOException if the JSON string is invalid with respect to RestoreJobModel + */ + public static RestoreJobModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreJobModel.class); + } + + /** + * Convert an instance of RestoreJobModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/model/ServerlessSpec.java b/src/main/java/org/openapitools/db_control/client/model/ServerlessSpec.java index efb01c0..a2458fb 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ServerlessSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/ServerlessSpec.java @@ -2,7 +2,7 @@ * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Configuration needed to deploy a serverless index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:44.938992Z[Etc/UTC]") public class ServerlessSpec { /** * The public cloud where you would like your index hosted. diff --git a/src/main/java/org/openapitools/db_data/client/ApiCallback.java b/src/main/java/org/openapitools/db_data/client/ApiCallback.java index 9cc0047..05886e4 100644 --- a/src/main/java/org/openapitools/db_data/client/ApiCallback.java +++ b/src/main/java/org/openapitools/db_data/client/ApiCallback.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_data/client/ApiClient.java b/src/main/java/org/openapitools/db_data/client/ApiClient.java index b4f5b45..5da027d 100644 --- a/src/main/java/org/openapitools/db_data/client/ApiClient.java +++ b/src/main/java/org/openapitools/db_data/client/ApiClient.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -147,7 +147,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2025-01/java"); + setUserAgent("OpenAPI-Generator/2025-04/java"); authentications = new HashMap(); } @@ -929,11 +929,9 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } else if (obj instanceof File) { // File body parameter support. return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if ("text/plain".equals(contentType) && obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); } else if ("application/x-ndjson".equals(contentType)) { // Handle NDJSON (Newline Delimited JSON) - if (obj instanceof Iterable) { // If obj is a collection of objects + if (obj instanceof Iterable) { StringBuilder ndjsonContent = new StringBuilder(); for (Object item : (Iterable) obj) { String json = JSON.serialize(item); @@ -943,6 +941,8 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } else { throw new ApiException("NDJSON content requires a collection of objects."); } + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else if (isJsonMime(contentType)) { String content; if (obj != null) { diff --git a/src/main/java/org/openapitools/db_data/client/ApiException.java b/src/main/java/org/openapitools/db_data/client/ApiException.java index ab6e38e..4e37e41 100644 --- a/src/main/java/org/openapitools/db_data/client/ApiException.java +++ b/src/main/java/org/openapitools/db_data/client/ApiException.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/org/openapitools/db_data/client/ApiResponse.java b/src/main/java/org/openapitools/db_data/client/ApiResponse.java index 818729b..c1afedb 100644 --- a/src/main/java/org/openapitools/db_data/client/ApiResponse.java +++ b/src/main/java/org/openapitools/db_data/client/ApiResponse.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_data/client/Configuration.java b/src/main/java/org/openapitools/db_data/client/Configuration.java index 03afa1d..1780a17 100644 --- a/src/main/java/org/openapitools/db_data/client/Configuration.java +++ b/src/main/java/org/openapitools/db_data/client/Configuration.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,9 +13,9 @@ package org.openapitools.db_data.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class Configuration { - public static final String VERSION = "2025-01"; + public static final String VERSION = "2025-04"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/org/openapitools/db_data/client/GzipRequestInterceptor.java b/src/main/java/org/openapitools/db_data/client/GzipRequestInterceptor.java index 1cdc68b..e6e440f 100644 --- a/src/main/java/org/openapitools/db_data/client/GzipRequestInterceptor.java +++ b/src/main/java/org/openapitools/db_data/client/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_data/client/JSON.java b/src/main/java/org/openapitools/db_data/client/JSON.java index 3adbead..87ed659 100644 --- a/src/main/java/org/openapitools/db_data/client/JSON.java +++ b/src/main/java/org/openapitools/db_data/client/JSON.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -102,7 +102,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.IndexDescription.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.ListImportsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.ListItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.ListNamespacesResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.ListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.NamespaceDescription.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.NamespaceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.Pagination.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.ProtobufAny.CustomTypeAdapterFactory()); diff --git a/src/main/java/org/openapitools/db_data/client/Pair.java b/src/main/java/org/openapitools/db_data/client/Pair.java index 902e03f..15b284d 100644 --- a/src/main/java/org/openapitools/db_data/client/Pair.java +++ b/src/main/java/org/openapitools/db_data/client/Pair.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package org.openapitools.db_data.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/org/openapitools/db_data/client/ProgressRequestBody.java b/src/main/java/org/openapitools/db_data/client/ProgressRequestBody.java index 6c29bbd..3123582 100644 --- a/src/main/java/org/openapitools/db_data/client/ProgressRequestBody.java +++ b/src/main/java/org/openapitools/db_data/client/ProgressRequestBody.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_data/client/ProgressResponseBody.java b/src/main/java/org/openapitools/db_data/client/ProgressResponseBody.java index 23010a8..968e13e 100644 --- a/src/main/java/org/openapitools/db_data/client/ProgressResponseBody.java +++ b/src/main/java/org/openapitools/db_data/client/ProgressResponseBody.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_data/client/StringUtil.java b/src/main/java/org/openapitools/db_data/client/StringUtil.java index 2073f56..cf0bc8d 100644 --- a/src/main/java/org/openapitools/db_data/client/StringUtil.java +++ b/src/main/java/org/openapitools/db_data/client/StringUtil.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/org/openapitools/db_data/client/api/BulkOperationsApi.java b/src/main/java/org/openapitools/db_data/client/api/BulkOperationsApi.java index da713ea..29bf6ee 100644 --- a/src/main/java/org/openapitools/db_data/client/api/BulkOperationsApi.java +++ b/src/main/java/org/openapitools/db_data/client/api/BulkOperationsApi.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -422,7 +422,7 @@ private okhttp3.Call listBulkImportsValidateBeforeCall(Integer limit, String pag /** * List imports - * List all recent and ongoing import operations. By default, this returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). + * List all recent and ongoing import operations. By default, `list_imports` returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). * @param limit Max number of operations to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @return ListImportsResponse @@ -443,7 +443,7 @@ public ListImportsResponse listBulkImports(Integer limit, String paginationToken /** * List imports - * List all recent and ongoing import operations. By default, this returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). + * List all recent and ongoing import operations. By default, `list_imports` returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). * @param limit Max number of operations to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @return ApiResponse<ListImportsResponse> @@ -465,7 +465,7 @@ public ApiResponse listBulkImportsWithHttpInfo(Integer limi /** * List imports (asynchronously) - * List all recent and ongoing import operations. By default, this returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). + * List all recent and ongoing import operations. By default, `list_imports` returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). * @param limit Max number of operations to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @param _callback The callback to be executed when the API call finishes diff --git a/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java b/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java new file mode 100644 index 0000000..1d72f43 --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java @@ -0,0 +1,484 @@ +/* + * Pinecone Data Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_data.client.api; + +import org.openapitools.db_data.client.ApiCallback; +import org.openapitools.db_data.client.ApiClient; +import org.openapitools.db_data.client.ApiException; +import org.openapitools.db_data.client.ApiResponse; +import org.openapitools.db_data.client.Configuration; +import org.openapitools.db_data.client.Pair; +import org.openapitools.db_data.client.ProgressRequestBody; +import org.openapitools.db_data.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.db_data.client.model.ListNamespacesResponse; +import org.openapitools.db_data.client.model.NamespaceDescription; +import org.openapitools.db_data.client.model.RpcStatus; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class NamespaceOperationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public NamespaceOperationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public NamespaceOperationsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteNamespace + * @param namespace The namespace to delete (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 + + + + + + +
Status Code Description Response Headers
200 A successful response -
400 Bad request. The request body included invalid request parameters. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public okhttp3.Call deleteNamespaceCall(String namespace, 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 = "/namespaces/{namespace}" + .replace("{" + "namespace" + "}", localVarApiClient.escapeString(namespace.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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteNamespaceValidateBeforeCall(String namespace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling deleteNamespace(Async)"); + } + + return deleteNamespaceCall(namespace, _callback); + + } + + /** + * Delete a namespace + * Delete a namespace from an index. + * @param namespace The namespace to delete (required) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A successful response -
400 Bad request. The request body included invalid request parameters. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public Object deleteNamespace(String namespace) throws ApiException { + ApiResponse localVarResp = deleteNamespaceWithHttpInfo(namespace); + return localVarResp.getData(); + } + + /** + * Delete a namespace + * Delete a namespace from an index. + * @param namespace The namespace to delete (required) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A successful response -
400 Bad request. The request body included invalid request parameters. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public ApiResponse deleteNamespaceWithHttpInfo(String namespace) throws ApiException { + okhttp3.Call localVarCall = deleteNamespaceValidateBeforeCall(namespace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete a namespace (asynchronously) + * Delete a namespace from an index. + * @param namespace The namespace to delete (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 + + + + + + +
Status Code Description Response Headers
200 A successful response -
400 Bad request. The request body included invalid request parameters. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public okhttp3.Call deleteNamespaceAsync(String namespace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteNamespaceValidateBeforeCall(namespace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for describeNamespace + * @param namespace The namespace to describe (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 + + + + + + +
Status Code Description Response Headers
200 A description of a namespace. -
400 Bad request. The request body included invalid request parameters. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public okhttp3.Call describeNamespaceCall(String namespace, 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 = "/namespaces/{namespace}" + .replace("{" + "namespace" + "}", localVarApiClient.escapeString(namespace.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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call describeNamespaceValidateBeforeCall(String namespace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling describeNamespace(Async)"); + } + + return describeNamespaceCall(namespace, _callback); + + } + + /** + * Describe a namespace + * Describe a namespace within an index, showing the vector count within the namespace. + * @param namespace The namespace to describe (required) + * @return NamespaceDescription + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A description of a namespace. -
400 Bad request. The request body included invalid request parameters. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public NamespaceDescription describeNamespace(String namespace) throws ApiException { + ApiResponse localVarResp = describeNamespaceWithHttpInfo(namespace); + return localVarResp.getData(); + } + + /** + * Describe a namespace + * Describe a namespace within an index, showing the vector count within the namespace. + * @param namespace The namespace to describe (required) + * @return ApiResponse<NamespaceDescription> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A description of a namespace. -
400 Bad request. The request body included invalid request parameters. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public ApiResponse describeNamespaceWithHttpInfo(String namespace) throws ApiException { + okhttp3.Call localVarCall = describeNamespaceValidateBeforeCall(namespace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Describe a namespace (asynchronously) + * Describe a namespace within an index, showing the vector count within the namespace. + * @param namespace The namespace to describe (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 + + + + + + +
Status Code Description Response Headers
200 A description of a namespace. -
400 Bad request. The request body included invalid request parameters. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public okhttp3.Call describeNamespaceAsync(String namespace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = describeNamespaceValidateBeforeCall(namespace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listNamespaces + * @param limit Max number namespaces to return per page. (optional) + * @param paginationToken Pagination token to continue a previous listing operation. (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 + + + + + +
Status Code Description Response Headers
200 A successful response -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public okhttp3.Call listNamespacesCall(Integer limit, String paginationToken, 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 = "/namespaces"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (paginationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("paginationToken", paginationToken)); + } + + 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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listNamespacesValidateBeforeCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + return listNamespacesCall(limit, paginationToken, _callback); + + } + + /** + * Get list of all namespaces + * Get a list of all namespaces within an index. + * @param limit Max number namespaces to return per page. (optional) + * @param paginationToken Pagination token to continue a previous listing operation. (optional) + * @return ListNamespacesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 A successful response -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public ListNamespacesResponse listNamespaces(Integer limit, String paginationToken) throws ApiException { + ApiResponse localVarResp = listNamespacesWithHttpInfo(limit, paginationToken); + return localVarResp.getData(); + } + + /** + * Get list of all namespaces + * Get a list of all namespaces within an index. + * @param limit Max number namespaces to return per page. (optional) + * @param paginationToken Pagination token to continue a previous listing operation. (optional) + * @return ApiResponse<ListNamespacesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 A successful response -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public ApiResponse listNamespacesWithHttpInfo(Integer limit, String paginationToken) throws ApiException { + okhttp3.Call localVarCall = listNamespacesValidateBeforeCall(limit, paginationToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get list of all namespaces (asynchronously) + * Get a list of all namespaces within an index. + * @param limit Max number namespaces to return per page. (optional) + * @param paginationToken Pagination token to continue a previous listing operation. (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 + + + + + +
Status Code Description Response Headers
200 A successful response -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public okhttp3.Call listNamespacesAsync(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listNamespacesValidateBeforeCall(limit, paginationToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/db_data/client/api/VectorOperationsApi.java b/src/main/java/org/openapitools/db_data/client/api/VectorOperationsApi.java index 0f64974..85a9d21 100644 --- a/src/main/java/org/openapitools/db_data/client/api/VectorOperationsApi.java +++ b/src/main/java/org/openapitools/db_data/client/api/VectorOperationsApi.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -158,7 +158,7 @@ private okhttp3.Call deleteVectorsValidateBeforeCall(DeleteRequest deleteRequest /** * Delete vectors - * Delete vectors, by id, from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). + * Delete vectors by id from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). * @param deleteRequest (required) * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -178,7 +178,7 @@ public Object deleteVectors(DeleteRequest deleteRequest) throws ApiException { /** * Delete vectors - * Delete vectors, by id, from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). + * Delete vectors by id from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). * @param deleteRequest (required) * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -199,7 +199,7 @@ public ApiResponse deleteVectorsWithHttpInfo(DeleteRequest deleteRequest /** * Delete vectors (asynchronously) - * Delete vectors, by id, from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). + * Delete vectors by id from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). * @param deleteRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -436,7 +436,7 @@ private okhttp3.Call fetchVectorsValidateBeforeCall(List ids, String nam /** * Fetch vectors - * Look up and return vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). + * Look up and return vectors by ID from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). * @param ids The vector IDs to fetch. Does not accept values containing spaces. (required) * @param namespace (optional) * @return FetchResponse @@ -457,7 +457,7 @@ public FetchResponse fetchVectors(List ids, String namespace) throws Api /** * Fetch vectors - * Look up and return vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). + * Look up and return vectors by ID from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). * @param ids The vector IDs to fetch. Does not accept values containing spaces. (required) * @param namespace (optional) * @return ApiResponse<FetchResponse> @@ -479,7 +479,7 @@ public ApiResponse fetchVectorsWithHttpInfo(List ids, Str /** * Fetch vectors (asynchronously) - * Look up and return vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). + * Look up and return vectors by ID from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). * @param ids The vector IDs to fetch. Does not accept values containing spaces. (required) * @param namespace (optional) * @param _callback The callback to be executed when the API call finishes @@ -587,7 +587,7 @@ private okhttp3.Call listVectorsValidateBeforeCall(String prefix, Long limit, St /** * List vector IDs - * List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. This returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. + * List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. Returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. * @param prefix The vector IDs to fetch. Does not accept values containing spaces. (optional) * @param limit Max number of IDs to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) @@ -610,7 +610,7 @@ public ListResponse listVectors(String prefix, Long limit, String paginationToke /** * List vector IDs - * List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. This returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. + * List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. Returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. * @param prefix The vector IDs to fetch. Does not accept values containing spaces. (optional) * @param limit Max number of IDs to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) @@ -634,7 +634,7 @@ public ApiResponse listVectorsWithHttpInfo(String prefix, Long lim /** * List vector IDs (asynchronously) - * List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. This returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. + * List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. Returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. * @param prefix The vector IDs to fetch. Does not accept values containing spaces. (optional) * @param limit Max number of IDs to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) @@ -730,8 +730,8 @@ private okhttp3.Call queryVectorsValidateBeforeCall(QueryRequest queryRequest, f } /** - * Query vectors - * Search a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). + * Search with a vector + * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). * @param queryRequest (required) * @return QueryResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -750,8 +750,8 @@ public QueryResponse queryVectors(QueryRequest queryRequest) throws ApiException } /** - * Query vectors - * Search a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). + * Search with a vector + * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). * @param queryRequest (required) * @return ApiResponse<QueryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -771,8 +771,8 @@ public ApiResponse queryVectorsWithHttpInfo(QueryRequest queryReq } /** - * Query vectors (asynchronously) - * Search a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). + * Search with a vector (asynchronously) + * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). * @param queryRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -872,8 +872,8 @@ private okhttp3.Call searchRecordsNamespaceValidateBeforeCall(String namespace, } /** - * Search a namespace - * This operation converts a query to a vector embedding and then searches a namespace using the embedding. It returns the most similar records in the namespace, along with their similarity scores. + * Search with text + * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @return SearchRecordsResponse @@ -893,8 +893,8 @@ public SearchRecordsResponse searchRecordsNamespace(String namespace, SearchReco } /** - * Search a namespace - * This operation converts a query to a vector embedding and then searches a namespace using the embedding. It returns the most similar records in the namespace, along with their similarity scores. + * Search with text + * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @return ApiResponse<SearchRecordsResponse> @@ -915,8 +915,8 @@ public ApiResponse searchRecordsNamespaceWithHttpInfo(Str } /** - * Search a namespace (asynchronously) - * This operation converts a query to a vector embedding and then searches a namespace using the embedding. It returns the most similar records in the namespace, along with their similarity scores. + * Search with text (asynchronously) + * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @param _callback The callback to be executed when the API call finishes @@ -1152,8 +1152,8 @@ private okhttp3.Call upsertRecordsNamespaceValidateBeforeCall(String namespace, } /** - * Upsert records into a namespace - * This operation converts input data to vector embeddings and then upserts the embeddings into a namespace. + * Upsert text + * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-text). * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1171,8 +1171,8 @@ public void upsertRecordsNamespace(String namespace, List upsertRe } /** - * Upsert records into a namespace - * This operation converts input data to vector embeddings and then upserts the embeddings into a namespace. + * Upsert text + * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-text). * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @return ApiResponse<Void> @@ -1192,8 +1192,8 @@ public ApiResponse upsertRecordsNamespaceWithHttpInfo(String namespace, Li } /** - * Upsert records into a namespace (asynchronously) - * This operation converts input data to vector embeddings and then upserts the embeddings into a namespace. + * Upsert text (asynchronously) + * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-text). * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @param _callback The callback to be executed when the API call finishes @@ -1287,7 +1287,7 @@ private okhttp3.Call upsertVectorsValidateBeforeCall(UpsertRequest upsertRequest /** * Upsert vectors - * Write vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-vectors). * @param upsertRequest (required) * @return UpsertResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1307,7 +1307,7 @@ public UpsertResponse upsertVectors(UpsertRequest upsertRequest) throws ApiExcep /** * Upsert vectors - * Write vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-vectors). * @param upsertRequest (required) * @return ApiResponse<UpsertResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1328,7 +1328,7 @@ public ApiResponse upsertVectorsWithHttpInfo(UpsertRequest upser /** * Upsert vectors (asynchronously) - * Write vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-vectors). * @param upsertRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call diff --git a/src/main/java/org/openapitools/db_data/client/auth/ApiKeyAuth.java b/src/main/java/org/openapitools/db_data/client/auth/ApiKeyAuth.java index 2060fe5..6e909d8 100644 --- a/src/main/java/org/openapitools/db_data/client/auth/ApiKeyAuth.java +++ b/src/main/java/org/openapitools/db_data/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/org/openapitools/db_data/client/auth/Authentication.java b/src/main/java/org/openapitools/db_data/client/auth/Authentication.java index 501d69e..5de0e4a 100644 --- a/src/main/java/org/openapitools/db_data/client/auth/Authentication.java +++ b/src/main/java/org/openapitools/db_data/client/auth/Authentication.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_data/client/auth/HttpBasicAuth.java b/src/main/java/org/openapitools/db_data/client/auth/HttpBasicAuth.java index ef761ef..c167dfc 100644 --- a/src/main/java/org/openapitools/db_data/client/auth/HttpBasicAuth.java +++ b/src/main/java/org/openapitools/db_data/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_data/client/auth/HttpBearerAuth.java b/src/main/java/org/openapitools/db_data/client/auth/HttpBearerAuth.java index 7878e42..8405183 100644 --- a/src/main/java/org/openapitools/db_data/client/auth/HttpBearerAuth.java +++ b/src/main/java/org/openapitools/db_data/client/auth/HttpBearerAuth.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/org/openapitools/db_data/client/model/AbstractOpenApiSchema.java b/src/main/java/org/openapitools/db_data/client/model/AbstractOpenApiSchema.java index 16a34e3..a62bc2e 100644 --- a/src/main/java/org/openapitools/db_data/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/org/openapitools/db_data/client/model/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,7 +23,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java b/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java index 87b9de7..47ce4a9 100644 --- a/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * The request for the `delete` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class DeleteRequest { public static final String SERIALIZED_NAME_IDS = "ids"; @SerializedName(SERIALIZED_NAME_IDS) diff --git a/src/main/java/org/openapitools/db_data/client/model/DescribeIndexStatsRequest.java b/src/main/java/org/openapitools/db_data/client/model/DescribeIndexStatsRequest.java index 0a92259..de8dbcd 100644 --- a/src/main/java/org/openapitools/db_data/client/model/DescribeIndexStatsRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/DescribeIndexStatsRequest.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The request for the `describe_index_stats` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class DescribeIndexStatsRequest { public static final String SERIALIZED_NAME_FILTER = "filter"; @SerializedName(SERIALIZED_NAME_FILTER) diff --git a/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java b/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java index d4fabf5..2c4627b 100644 --- a/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * The response for the `fetch` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class FetchResponse { public static final String SERIALIZED_NAME_VECTORS = "vectors"; @SerializedName(SERIALIZED_NAME_VECTORS) diff --git a/src/main/java/org/openapitools/db_data/client/model/Hit.java b/src/main/java/org/openapitools/db_data/client/model/Hit.java index b818784..e072520 100644 --- a/src/main/java/org/openapitools/db_data/client/model/Hit.java +++ b/src/main/java/org/openapitools/db_data/client/model/Hit.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * A record whose vector values are similar to the provided search query. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class Hit { public static final String SERIALIZED_NAME_ID = "_id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/ImportErrorMode.java b/src/main/java/org/openapitools/db_data/client/model/ImportErrorMode.java index 88dc084..52820b5 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ImportErrorMode.java +++ b/src/main/java/org/openapitools/db_data/client/model/ImportErrorMode.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Indicates how to respond to errors during the import process. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ImportErrorMode { /** * Indicates how to respond to errors during the import process. diff --git a/src/main/java/org/openapitools/db_data/client/model/ImportModel.java b/src/main/java/org/openapitools/db_data/client/model/ImportModel.java index 5a9e41a..fcc511f 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ImportModel.java +++ b/src/main/java/org/openapitools/db_data/client/model/ImportModel.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * The model for an import operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ImportModel { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/IndexDescription.java b/src/main/java/org/openapitools/db_data/client/model/IndexDescription.java index e167229..4699591 100644 --- a/src/main/java/org/openapitools/db_data/client/model/IndexDescription.java +++ b/src/main/java/org/openapitools/db_data/client/model/IndexDescription.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * The response for the `describe_index_stats` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class IndexDescription { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) diff --git a/src/main/java/org/openapitools/db_data/client/model/ListImportsResponse.java b/src/main/java/org/openapitools/db_data/client/model/ListImportsResponse.java index 93b6871..7232536 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ListImportsResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/ListImportsResponse.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * The response for the `list_imports` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ListImportsResponse { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/org/openapitools/db_data/client/model/ListItem.java b/src/main/java/org/openapitools/db_data/client/model/ListItem.java index b770d95..bfda6dd 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ListItem.java +++ b/src/main/java/org/openapitools/db_data/client/model/ListItem.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * ListItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ListItem { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.java b/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.java new file mode 100644 index 0000000..2c6e175 --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.java @@ -0,0 +1,339 @@ +/* + * Pinecone Data Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_data.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.db_data.client.model.NamespaceDescription; +import org.openapitools.db_data.client.model.Pagination; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_data.client.JSON; + +/** + * ListNamespacesResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") +public class ListNamespacesResponse { + public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; + @SerializedName(SERIALIZED_NAME_NAMESPACES) + private List namespaces; + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListNamespacesResponse() { + } + + public ListNamespacesResponse namespaces(List namespaces) { + + this.namespaces = namespaces; + return this; + } + + public ListNamespacesResponse addNamespacesItem(NamespaceDescription namespacesItem) { + if (this.namespaces == null) { + this.namespaces = new ArrayList<>(); + } + this.namespaces.add(namespacesItem); + return this; + } + + /** + * The list of namespaces belonging to this index. + * @return namespaces + **/ + @javax.annotation.Nullable + public List getNamespaces() { + return namespaces; + } + + + public void setNamespaces(List namespaces) { + this.namespaces = namespaces; + } + + + public ListNamespacesResponse pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nullable + public Pagination getPagination() { + return pagination; + } + + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ListNamespacesResponse instance itself + */ + public ListNamespacesResponse 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; + } + ListNamespacesResponse listNamespacesResponse = (ListNamespacesResponse) o; + return Objects.equals(this.namespaces, listNamespacesResponse.namespaces) && + Objects.equals(this.pagination, listNamespacesResponse.pagination)&& + Objects.equals(this.additionalProperties, listNamespacesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(namespaces, pagination, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListNamespacesResponse {\n"); + sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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(); + openapiFields.add("namespaces"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListNamespacesResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListNamespacesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListNamespacesResponse is not found in the empty JSON string", ListNamespacesResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonNull()) { + JsonArray jsonArraynamespaces = jsonObj.getAsJsonArray("namespaces"); + if (jsonArraynamespaces != null) { + // ensure the json data is an array + if (!jsonObj.get("namespaces").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `namespaces` to be an array in the JSON string but got `%s`", jsonObj.get("namespaces").toString())); + } + + // validate the optional field `namespaces` (array) + for (int i = 0; i < jsonArraynamespaces.size(); i++) { + NamespaceDescription.validateJsonElement(jsonArraynamespaces.get(i)); + }; + } + } + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + Pagination.validateJsonElement(jsonObj.get("pagination")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListNamespacesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListNamespacesResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListNamespacesResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListNamespacesResponse 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ListNamespacesResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListNamespacesResponse 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("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 ListNamespacesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListNamespacesResponse + * @throws IOException if the JSON string is invalid with respect to ListNamespacesResponse + */ + public static ListNamespacesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListNamespacesResponse.class); + } + + /** + * Convert an instance of ListNamespacesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_data/client/model/ListResponse.java b/src/main/java/org/openapitools/db_data/client/model/ListResponse.java index 2ef2033..e9fbe47 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ListResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/ListResponse.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -54,7 +54,7 @@ /** * The response for the `list` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ListResponse { public static final String SERIALIZED_NAME_VECTORS = "vectors"; @SerializedName(SERIALIZED_NAME_VECTORS) diff --git a/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.java b/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.java new file mode 100644 index 0000000..01f6c0a --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.java @@ -0,0 +1,312 @@ +/* + * Pinecone Data Plane API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.db_data.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.db_data.client.JSON; + +/** + * A description of a namespace, including the name and record count. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") +public class NamespaceDescription { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_RECORD_COUNT = "record_count"; + @SerializedName(SERIALIZED_NAME_RECORD_COUNT) + private Long recordCount; + + public NamespaceDescription() { + } + + public NamespaceDescription name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the namespace. + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public NamespaceDescription recordCount(Long recordCount) { + + this.recordCount = recordCount; + return this; + } + + /** + * The total amount of records within the namespace. + * @return recordCount + **/ + @javax.annotation.Nullable + public Long getRecordCount() { + return recordCount; + } + + + public void setRecordCount(Long recordCount) { + this.recordCount = recordCount; + } + + /** + * 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 NamespaceDescription instance itself + */ + public NamespaceDescription 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; + } + NamespaceDescription namespaceDescription = (NamespaceDescription) o; + return Objects.equals(this.name, namespaceDescription.name) && + Objects.equals(this.recordCount, namespaceDescription.recordCount)&& + Objects.equals(this.additionalProperties, namespaceDescription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, recordCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NamespaceDescription {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" recordCount: ").append(toIndentedString(recordCount)).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(); + openapiFields.add("name"); + openapiFields.add("record_count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NamespaceDescription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NamespaceDescription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NamespaceDescription is not found in the empty JSON string", NamespaceDescription.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NamespaceDescription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NamespaceDescription' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NamespaceDescription.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NamespaceDescription 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public NamespaceDescription read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NamespaceDescription 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("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 NamespaceDescription given an JSON string + * + * @param jsonString JSON string + * @return An instance of NamespaceDescription + * @throws IOException if the JSON string is invalid with respect to NamespaceDescription + */ + public static NamespaceDescription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NamespaceDescription.class); + } + + /** + * Convert an instance of NamespaceDescription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_data/client/model/NamespaceSummary.java b/src/main/java/org/openapitools/db_data/client/model/NamespaceSummary.java index 027afd1..74e4b40 100644 --- a/src/main/java/org/openapitools/db_data/client/model/NamespaceSummary.java +++ b/src/main/java/org/openapitools/db_data/client/model/NamespaceSummary.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * A summary of the contents of a namespace. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class NamespaceSummary { public static final String SERIALIZED_NAME_VECTOR_COUNT = "vectorCount"; @SerializedName(SERIALIZED_NAME_VECTOR_COUNT) diff --git a/src/main/java/org/openapitools/db_data/client/model/Pagination.java b/src/main/java/org/openapitools/db_data/client/model/Pagination.java index d73e826..67edafe 100644 --- a/src/main/java/org/openapitools/db_data/client/model/Pagination.java +++ b/src/main/java/org/openapitools/db_data/client/model/Pagination.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Pagination */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class Pagination { public static final String SERIALIZED_NAME_NEXT = "next"; @SerializedName(SERIALIZED_NAME_NEXT) diff --git a/src/main/java/org/openapitools/db_data/client/model/ProtobufAny.java b/src/main/java/org/openapitools/db_data/client/model/ProtobufAny.java index bb7b04d..6efe75e 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ProtobufAny.java +++ b/src/main/java/org/openapitools/db_data/client/model/ProtobufAny.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * ProtobufAny */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ProtobufAny { public static final String SERIALIZED_NAME_TYPE_URL = "typeUrl"; @SerializedName(SERIALIZED_NAME_TYPE_URL) diff --git a/src/main/java/org/openapitools/db_data/client/model/ProtobufNullValue.java b/src/main/java/org/openapitools/db_data/client/model/ProtobufNullValue.java index 128e67f..3e81072 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ProtobufNullValue.java +++ b/src/main/java/org/openapitools/db_data/client/model/ProtobufNullValue.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/db_data/client/model/QueryRequest.java b/src/main/java/org/openapitools/db_data/client/model/QueryRequest.java index b3b649a..8ec628a 100644 --- a/src/main/java/org/openapitools/db_data/client/model/QueryRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/QueryRequest.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * The request for the `query` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class QueryRequest { public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) @@ -146,7 +146,7 @@ public QueryRequest filter(Object filter) { } /** - * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). + * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). * @return filter **/ @javax.annotation.Nullable @@ -218,7 +218,7 @@ public QueryRequest addQueriesItem(QueryVector queriesItem) { } /** - * DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`. + * DEPRECATED. Use `vector` or `id` instead. * @return queries * @deprecated **/ @@ -292,7 +292,7 @@ public QueryRequest id(String id) { } /** - * The unique ID of the vector to be used as a query vector. Each `query` request can contain only one of the parameters `queries`, `vector`, or `id`. + * The unique ID of the vector to be used as a query vector. Each request can contain either the `vector` or `id` parameter. * @return id **/ @javax.annotation.Nullable diff --git a/src/main/java/org/openapitools/db_data/client/model/QueryResponse.java b/src/main/java/org/openapitools/db_data/client/model/QueryResponse.java index df0c92e..a5f9141 100644 --- a/src/main/java/org/openapitools/db_data/client/model/QueryResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/QueryResponse.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -54,7 +54,7 @@ /** * The response for the `query` operation. These are the matches found for a particular query vector. The matches are ordered from most similar to least similar. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class QueryResponse { public static final String SERIALIZED_NAME_RESULTS = "results"; @Deprecated diff --git a/src/main/java/org/openapitools/db_data/client/model/QueryVector.java b/src/main/java/org/openapitools/db_data/client/model/QueryVector.java index 35d7206..1cc782f 100644 --- a/src/main/java/org/openapitools/db_data/client/model/QueryVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/QueryVector.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -54,7 +54,7 @@ * @deprecated */ @Deprecated -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class QueryVector { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) diff --git a/src/main/java/org/openapitools/db_data/client/model/RpcStatus.java b/src/main/java/org/openapitools/db_data/client/model/RpcStatus.java index e57fd4c..a0e02b4 100644 --- a/src/main/java/org/openapitools/db_data/client/model/RpcStatus.java +++ b/src/main/java/org/openapitools/db_data/client/model/RpcStatus.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * RpcStatus */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class RpcStatus { public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) diff --git a/src/main/java/org/openapitools/db_data/client/model/ScoredVector.java b/src/main/java/org/openapitools/db_data/client/model/ScoredVector.java index 0c0441d..5c4446c 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ScoredVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/ScoredVector.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * ScoredVector */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class ScoredVector { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java index bb5ba63..07bd501 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * A search request for records in a specific namespace. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SearchRecordsRequest { public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) @@ -106,7 +106,7 @@ public SearchRecordsRequest addFieldsItem(String fieldsItem) { } /** - * The fields to return in the search results. + * The fields to return in the search results. If not specified, the response will include all fields. * @return fields **/ @javax.annotation.Nullable diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestQuery.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestQuery.java index 9c0e840..3d4013a 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestQuery.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestQuery.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -48,9 +48,9 @@ import org.openapitools.db_data.client.JSON; /** - * The query inputs to search with. + * . */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SearchRecordsRequestQuery { public static final String SERIALIZED_NAME_TOP_K = "top_k"; @SerializedName(SERIALIZED_NAME_TOP_K) @@ -82,7 +82,7 @@ public SearchRecordsRequestQuery topK(Integer topK) { } /** - * The number of results to return for each search. + * The number of similar records to return. * @return topK **/ @javax.annotation.Nonnull @@ -103,7 +103,7 @@ public SearchRecordsRequestQuery filter(Object filter) { } /** - * The filter to apply. + * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). * @return filter **/ @javax.annotation.Nullable diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestRerank.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestRerank.java index 0c37a17..0498d53 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestRerank.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestRerank.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * Parameters for reranking the initial search results. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SearchRecordsRequestRerank { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) @@ -114,7 +114,7 @@ public SearchRecordsRequestRerank addRankFieldsItem(String rankFieldsItem) { } /** - * The fields to use for reranking. + * The field(s) to consider for reranking. If not provided, the default is `[\"text\"]`. The number of fields supported is [model-specific](https://docs.pinecone.io/guides/inference/understanding-inference#reranking-models). * @return rankFields **/ @javax.annotation.Nonnull diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponse.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponse.java index ece9214..171e1d2 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponse.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * The records search response. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SearchRecordsResponse { public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponseResult.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponseResult.java index 75b40d2..072e724 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponseResult.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponseResult.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * SearchRecordsResponseResult */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SearchRecordsResponseResult { public static final String SERIALIZED_NAME_HITS = "hits"; @SerializedName(SERIALIZED_NAME_HITS) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsVector.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsVector.java index f86bbdb..b545d36 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsVector.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * SearchRecordsVector */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SearchRecordsVector { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchUsage.java b/src/main/java/org/openapitools/db_data/client/model/SearchUsage.java index c128463..6e8abd5 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchUsage.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchUsage.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * SearchUsage */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SearchUsage { public static final String SERIALIZED_NAME_READ_UNITS = "read_units"; @SerializedName(SERIALIZED_NAME_READ_UNITS) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchVector.java b/src/main/java/org/openapitools/db_data/client/model/SearchVector.java index 622302a..cd9667c 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchVector.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * SearchVector */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SearchVector { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) diff --git a/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java b/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java index 4356dfb..03bd84f 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java +++ b/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * SingleQueryResults */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SingleQueryResults { public static final String SERIALIZED_NAME_MATCHES = "matches"; @SerializedName(SERIALIZED_NAME_MATCHES) diff --git a/src/main/java/org/openapitools/db_data/client/model/SparseValues.java b/src/main/java/org/openapitools/db_data/client/model/SparseValues.java index 2e9938c..32c217a 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SparseValues.java +++ b/src/main/java/org/openapitools/db_data/client/model/SparseValues.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class SparseValues { public static final String SERIALIZED_NAME_INDICES = "indices"; @SerializedName(SERIALIZED_NAME_INDICES) diff --git a/src/main/java/org/openapitools/db_data/client/model/StartImportRequest.java b/src/main/java/org/openapitools/db_data/client/model/StartImportRequest.java index ec41b91..6540814 100644 --- a/src/main/java/org/openapitools/db_data/client/model/StartImportRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/StartImportRequest.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * The request for the `start_import` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class StartImportRequest { public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/StartImportResponse.java b/src/main/java/org/openapitools/db_data/client/model/StartImportResponse.java index 2361c24..4763e06 100644 --- a/src/main/java/org/openapitools/db_data/client/model/StartImportResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/StartImportResponse.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The response for the `start_import` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class StartImportResponse { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/UpdateRequest.java b/src/main/java/org/openapitools/db_data/client/model/UpdateRequest.java index 63662cf..d27fe58 100644 --- a/src/main/java/org/openapitools/db_data/client/model/UpdateRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpdateRequest.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * The request for the `update` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class UpdateRequest { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/UpsertRecord.java b/src/main/java/org/openapitools/db_data/client/model/UpsertRecord.java index d544d24..4da70b9 100644 --- a/src/main/java/org/openapitools/db_data/client/model/UpsertRecord.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpsertRecord.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The request for the `upsert` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class UpsertRecord { public static final String SERIALIZED_NAME_ID = "_id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/UpsertRequest.java b/src/main/java/org/openapitools/db_data/client/model/UpsertRequest.java index 558312f..21dc6e6 100644 --- a/src/main/java/org/openapitools/db_data/client/model/UpsertRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpsertRequest.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * The request for the `upsert` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class UpsertRequest { public static final String SERIALIZED_NAME_VECTORS = "vectors"; @SerializedName(SERIALIZED_NAME_VECTORS) diff --git a/src/main/java/org/openapitools/db_data/client/model/UpsertResponse.java b/src/main/java/org/openapitools/db_data/client/model/UpsertResponse.java index f5e5f09..50c7274 100644 --- a/src/main/java/org/openapitools/db_data/client/model/UpsertResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpsertResponse.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The response for the `upsert` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class UpsertResponse { public static final String SERIALIZED_NAME_UPSERTED_COUNT = "upsertedCount"; @SerializedName(SERIALIZED_NAME_UPSERTED_COUNT) diff --git a/src/main/java/org/openapitools/db_data/client/model/Usage.java b/src/main/java/org/openapitools/db_data/client/model/Usage.java index 1adaeea..70f6e38 100644 --- a/src/main/java/org/openapitools/db_data/client/model/Usage.java +++ b/src/main/java/org/openapitools/db_data/client/model/Usage.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Usage */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class Usage { public static final String SERIALIZED_NAME_READ_UNITS = "readUnits"; @SerializedName(SERIALIZED_NAME_READ_UNITS) diff --git a/src/main/java/org/openapitools/db_data/client/model/Vector.java b/src/main/java/org/openapitools/db_data/client/model/Vector.java index 31a7b74..b091031 100644 --- a/src/main/java/org/openapitools/db_data/client/model/Vector.java +++ b/src/main/java/org/openapitools/db_data/client/model/Vector.java @@ -2,7 +2,7 @@ * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * Vector */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:20.514422Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:47.193346Z[Etc/UTC]") public class Vector { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -60,7 +60,7 @@ public class Vector { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) - private List values = new ArrayList<>(); + private List values; public static final String SERIALIZED_NAME_SPARSE_VALUES = "sparseValues"; @SerializedName(SERIALIZED_NAME_SPARSE_VALUES) @@ -112,7 +112,7 @@ public Vector addValuesItem(Float valuesItem) { * This is the vector data included in the request. * @return values **/ - @javax.annotation.Nonnull + @javax.annotation.Nullable public List getValues() { return values; } @@ -270,7 +270,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); - openapiRequiredFields.add("values"); } /** @@ -296,10 +295,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } - // ensure the required json array is present - if (jsonObj.get("values") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("values").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonNull() && !jsonObj.get("values").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); } // validate the optional field `sparseValues` diff --git a/src/main/java/org/openapitools/inference/client/ApiCallback.java b/src/main/java/org/openapitools/inference/client/ApiCallback.java index 080a316..1297aa2 100644 --- a/src/main/java/org/openapitools/inference/client/ApiCallback.java +++ b/src/main/java/org/openapitools/inference/client/ApiCallback.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/inference/client/ApiClient.java b/src/main/java/org/openapitools/inference/client/ApiClient.java index 04ecd65..f35034c 100644 --- a/src/main/java/org/openapitools/inference/client/ApiClient.java +++ b/src/main/java/org/openapitools/inference/client/ApiClient.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -140,7 +140,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2025-01/java"); + setUserAgent("OpenAPI-Generator/2025-04/java"); authentications = new HashMap(); } diff --git a/src/main/java/org/openapitools/inference/client/ApiException.java b/src/main/java/org/openapitools/inference/client/ApiException.java index 3c64b89..1352861 100644 --- a/src/main/java/org/openapitools/inference/client/ApiException.java +++ b/src/main/java/org/openapitools/inference/client/ApiException.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/org/openapitools/inference/client/ApiResponse.java b/src/main/java/org/openapitools/inference/client/ApiResponse.java index f244e60..c531c93 100644 --- a/src/main/java/org/openapitools/inference/client/ApiResponse.java +++ b/src/main/java/org/openapitools/inference/client/ApiResponse.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/inference/client/Configuration.java b/src/main/java/org/openapitools/inference/client/Configuration.java index e02463b..90770cf 100644 --- a/src/main/java/org/openapitools/inference/client/Configuration.java +++ b/src/main/java/org/openapitools/inference/client/Configuration.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,9 +13,9 @@ package org.openapitools.inference.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class Configuration { - public static final String VERSION = "2025-01"; + public static final String VERSION = "2025-04"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/org/openapitools/inference/client/GzipRequestInterceptor.java b/src/main/java/org/openapitools/inference/client/GzipRequestInterceptor.java index 202ae52..b8a2017 100644 --- a/src/main/java/org/openapitools/inference/client/GzipRequestInterceptor.java +++ b/src/main/java/org/openapitools/inference/client/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/inference/client/JSON.java b/src/main/java/org/openapitools/inference/client/JSON.java index 7b8a6c5..ade99b1 100644 --- a/src/main/java/org/openapitools/inference/client/JSON.java +++ b/src/main/java/org/openapitools/inference/client/JSON.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -114,6 +114,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.EmbeddingsListUsage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.ErrorResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.ErrorResponseError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.ModelInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.ModelInfoList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.ModelInfoSupportedParameter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.ModelInfoSupportedParameterAllowedValuesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.ModelInfoSupportedParameterDefault.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.RankedDocument.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.RerankRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.inference.client.model.RerankResult.CustomTypeAdapterFactory()); diff --git a/src/main/java/org/openapitools/inference/client/Pair.java b/src/main/java/org/openapitools/inference/client/Pair.java index b0be8a7..2260db7 100644 --- a/src/main/java/org/openapitools/inference/client/Pair.java +++ b/src/main/java/org/openapitools/inference/client/Pair.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package org.openapitools.inference.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/org/openapitools/inference/client/ProgressRequestBody.java b/src/main/java/org/openapitools/inference/client/ProgressRequestBody.java index 3e60162..d333e52 100644 --- a/src/main/java/org/openapitools/inference/client/ProgressRequestBody.java +++ b/src/main/java/org/openapitools/inference/client/ProgressRequestBody.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/inference/client/ProgressResponseBody.java b/src/main/java/org/openapitools/inference/client/ProgressResponseBody.java index d3b6b62..0a85480 100644 --- a/src/main/java/org/openapitools/inference/client/ProgressResponseBody.java +++ b/src/main/java/org/openapitools/inference/client/ProgressResponseBody.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/inference/client/StringUtil.java b/src/main/java/org/openapitools/inference/client/StringUtil.java index e9191e6..2263d76 100644 --- a/src/main/java/org/openapitools/inference/client/StringUtil.java +++ b/src/main/java/org/openapitools/inference/client/StringUtil.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/org/openapitools/inference/client/api/InferenceApi.java b/src/main/java/org/openapitools/inference/client/api/InferenceApi.java index 03e37b6..777539d 100644 --- a/src/main/java/org/openapitools/inference/client/api/InferenceApi.java +++ b/src/main/java/org/openapitools/inference/client/api/InferenceApi.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,6 +30,8 @@ import org.openapitools.inference.client.model.EmbedRequest; import org.openapitools.inference.client.model.EmbeddingsList; import org.openapitools.inference.client.model.ErrorResponse; +import org.openapitools.inference.client.model.ModelInfo; +import org.openapitools.inference.client.model.ModelInfoList; import org.openapitools.inference.client.model.RerankRequest; import org.openapitools.inference.client.model.RerankResult; @@ -143,8 +145,8 @@ private okhttp3.Call embedValidateBeforeCall(EmbedRequest embedRequest, final Ap } /** - * Embed data - * Generate embeddings for input data. For guidance and examples, see [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings). + * Generate vectors + * Generate vector embeddings for input data. This endpoint uses [Pinecone Inference](https://docs.pinecone.io/guides/inference/understanding-inference). For guidance and examples, see [Embed data](https://docs.pinecone.io/guides/inference/generate-embeddings). * @param embedRequest Generate embeddings for inputs. (optional) * @return EmbeddingsList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -163,8 +165,8 @@ public EmbeddingsList embed(EmbedRequest embedRequest) throws ApiException { } /** - * Embed data - * Generate embeddings for input data. For guidance and examples, see [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings). + * Generate vectors + * Generate vector embeddings for input data. This endpoint uses [Pinecone Inference](https://docs.pinecone.io/guides/inference/understanding-inference). For guidance and examples, see [Embed data](https://docs.pinecone.io/guides/inference/generate-embeddings). * @param embedRequest Generate embeddings for inputs. (optional) * @return ApiResponse<EmbeddingsList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -184,8 +186,8 @@ public ApiResponse embedWithHttpInfo(EmbedRequest embedRequest) } /** - * Embed data (asynchronously) - * Generate embeddings for input data. For guidance and examples, see [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings). + * Generate vectors (asynchronously) + * Generate vector embeddings for input data. This endpoint uses [Pinecone Inference](https://docs.pinecone.io/guides/inference/understanding-inference). For guidance and examples, see [Embed data](https://docs.pinecone.io/guides/inference/generate-embeddings). * @param embedRequest Generate embeddings for inputs. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -206,6 +208,282 @@ public okhttp3.Call embedAsync(EmbedRequest embedRequest, final ApiCallback + Status Code Description Response Headers + 200 The model details. - + 401 Unauthorized. Possible causes: Invalid API key. - + 404 Model not found. - + 500 Internal server error. - + + */ + public okhttp3.Call getModelCall(String modelName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/models/{model_name}" + .replace("{" + "model_name" + "}", localVarApiClient.escapeString(modelName.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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getModelValidateBeforeCall(String modelName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'modelName' is set + if (modelName == null) { + throw new ApiException("Missing the required parameter 'modelName' when calling getModel(Async)"); + } + + return getModelCall(modelName, _callback); + + } + + /** + * Get available model details. + * Get model details. + * @param modelName The name of the model to look up. (required) + * @return ModelInfo + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 The model details. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Model not found. -
500 Internal server error. -
+ */ + public ModelInfo getModel(String modelName) throws ApiException { + ApiResponse localVarResp = getModelWithHttpInfo(modelName); + return localVarResp.getData(); + } + + /** + * Get available model details. + * Get model details. + * @param modelName The name of the model to look up. (required) + * @return ApiResponse<ModelInfo> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 The model details. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Model not found. -
500 Internal server error. -
+ */ + public ApiResponse getModelWithHttpInfo(String modelName) throws ApiException { + okhttp3.Call localVarCall = getModelValidateBeforeCall(modelName, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get available model details. (asynchronously) + * Get model details. + * @param modelName The name of the model to look up. (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 + + + + + + +
Status Code Description Response Headers
200 The model details. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Model not found. -
500 Internal server error. -
+ */ + public okhttp3.Call getModelAsync(String modelName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getModelValidateBeforeCall(modelName, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listModels + * @param type Filter models by type ('embed' or 'rerank'). (optional) + * @param vectorType Filter embedding models by vector type ('dense' or 'sparse'). Only relevant when `type=embed`. (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 + + + + + + +
Status Code Description Response Headers
200 The list of available models. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Model not found. -
500 Internal server error. -
+ */ + public okhttp3.Call listModelsCall(String type, String vectorType, 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 = "/models"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (vectorType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vector_type", vectorType)); + } + + 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[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listModelsValidateBeforeCall(String type, String vectorType, final ApiCallback _callback) throws ApiException { + return listModelsCall(type, vectorType, _callback); + + } + + /** + * Get available models. + * Get available models. + * @param type Filter models by type ('embed' or 'rerank'). (optional) + * @param vectorType Filter embedding models by vector type ('dense' or 'sparse'). Only relevant when `type=embed`. (optional) + * @return ModelInfoList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 The list of available models. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Model not found. -
500 Internal server error. -
+ */ + public ModelInfoList listModels(String type, String vectorType) throws ApiException { + ApiResponse localVarResp = listModelsWithHttpInfo(type, vectorType); + return localVarResp.getData(); + } + + /** + * Get available models. + * Get available models. + * @param type Filter models by type ('embed' or 'rerank'). (optional) + * @param vectorType Filter embedding models by vector type ('dense' or 'sparse'). Only relevant when `type=embed`. (optional) + * @return ApiResponse<ModelInfoList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 The list of available models. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Model not found. -
500 Internal server error. -
+ */ + public ApiResponse listModelsWithHttpInfo(String type, String vectorType) throws ApiException { + okhttp3.Call localVarCall = listModelsValidateBeforeCall(type, vectorType, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get available models. (asynchronously) + * Get available models. + * @param type Filter models by type ('embed' or 'rerank'). (optional) + * @param vectorType Filter embedding models by vector type ('dense' or 'sparse'). Only relevant when `type=embed`. (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 + + + + + + +
Status Code Description Response Headers
200 The list of available models. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Model not found. -
500 Internal server error. -
+ */ + public okhttp3.Call listModelsAsync(String type, String vectorType, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listModelsValidateBeforeCall(type, vectorType, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for rerank * @param rerankRequest Rerank documents for the given query (optional) diff --git a/src/main/java/org/openapitools/inference/client/auth/ApiKeyAuth.java b/src/main/java/org/openapitools/inference/client/auth/ApiKeyAuth.java index 11e166b..94ea1a4 100644 --- a/src/main/java/org/openapitools/inference/client/auth/ApiKeyAuth.java +++ b/src/main/java/org/openapitools/inference/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/org/openapitools/inference/client/auth/Authentication.java b/src/main/java/org/openapitools/inference/client/auth/Authentication.java index 2090a89..1c57703 100644 --- a/src/main/java/org/openapitools/inference/client/auth/Authentication.java +++ b/src/main/java/org/openapitools/inference/client/auth/Authentication.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/inference/client/auth/HttpBasicAuth.java b/src/main/java/org/openapitools/inference/client/auth/HttpBasicAuth.java index 815b68f..f6ae5e9 100644 --- a/src/main/java/org/openapitools/inference/client/auth/HttpBasicAuth.java +++ b/src/main/java/org/openapitools/inference/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/org/openapitools/inference/client/auth/HttpBearerAuth.java b/src/main/java/org/openapitools/inference/client/auth/HttpBearerAuth.java index b5c001f..b7f6a12 100644 --- a/src/main/java/org/openapitools/inference/client/auth/HttpBearerAuth.java +++ b/src/main/java/org/openapitools/inference/client/auth/HttpBearerAuth.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/org/openapitools/inference/client/model/AbstractOpenApiSchema.java b/src/main/java/org/openapitools/inference/client/model/AbstractOpenApiSchema.java index 4affa01..cee741e 100644 --- a/src/main/java/org/openapitools/inference/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/org/openapitools/inference/client/model/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,7 +23,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/org/openapitools/inference/client/model/DenseEmbedding.java b/src/main/java/org/openapitools/inference/client/model/DenseEmbedding.java index 946c46b..b5e2cf4 100644 --- a/src/main/java/org/openapitools/inference/client/model/DenseEmbedding.java +++ b/src/main/java/org/openapitools/inference/client/model/DenseEmbedding.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * A dense embedding of a single input */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class DenseEmbedding { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) diff --git a/src/main/java/org/openapitools/inference/client/model/EmbedRequest.java b/src/main/java/org/openapitools/inference/client/model/EmbedRequest.java index 577b454..405a252 100644 --- a/src/main/java/org/openapitools/inference/client/model/EmbedRequest.java +++ b/src/main/java/org/openapitools/inference/client/model/EmbedRequest.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -54,7 +54,7 @@ /** * EmbedRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class EmbedRequest { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/inference/client/model/EmbedRequestInputsInner.java b/src/main/java/org/openapitools/inference/client/model/EmbedRequestInputsInner.java index 187b343..06f6788 100644 --- a/src/main/java/org/openapitools/inference/client/model/EmbedRequestInputsInner.java +++ b/src/main/java/org/openapitools/inference/client/model/EmbedRequestInputsInner.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * EmbedRequestInputsInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class EmbedRequestInputsInner { public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) diff --git a/src/main/java/org/openapitools/inference/client/model/Embedding.java b/src/main/java/org/openapitools/inference/client/model/Embedding.java index 6f2a610..3a88995 100644 --- a/src/main/java/org/openapitools/inference/client/model/Embedding.java +++ b/src/main/java/org/openapitools/inference/client/model/Embedding.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -62,7 +62,7 @@ import org.openapitools.inference.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class Embedding extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(Embedding.class.getName()); diff --git a/src/main/java/org/openapitools/inference/client/model/EmbeddingsList.java b/src/main/java/org/openapitools/inference/client/model/EmbeddingsList.java index bc861c0..6c20de0 100644 --- a/src/main/java/org/openapitools/inference/client/model/EmbeddingsList.java +++ b/src/main/java/org/openapitools/inference/client/model/EmbeddingsList.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * Embeddings generated for the input. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class EmbeddingsList { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/inference/client/model/EmbeddingsListUsage.java b/src/main/java/org/openapitools/inference/client/model/EmbeddingsListUsage.java index 54128e4..bee439b 100644 --- a/src/main/java/org/openapitools/inference/client/model/EmbeddingsListUsage.java +++ b/src/main/java/org/openapitools/inference/client/model/EmbeddingsListUsage.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Usage statistics for the model inference. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class EmbeddingsListUsage { public static final String SERIALIZED_NAME_TOTAL_TOKENS = "total_tokens"; @SerializedName(SERIALIZED_NAME_TOTAL_TOKENS) diff --git a/src/main/java/org/openapitools/inference/client/model/ErrorResponse.java b/src/main/java/org/openapitools/inference/client/model/ErrorResponse.java index 5cd55da..6f60fd1 100644 --- a/src/main/java/org/openapitools/inference/client/model/ErrorResponse.java +++ b/src/main/java/org/openapitools/inference/client/model/ErrorResponse.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * The response shape used for all error responses. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class ErrorResponse { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/org/openapitools/inference/client/model/ErrorResponseError.java b/src/main/java/org/openapitools/inference/client/model/ErrorResponseError.java index 29c52f3..5717170 100644 --- a/src/main/java/org/openapitools/inference/client/model/ErrorResponseError.java +++ b/src/main/java/org/openapitools/inference/client/model/ErrorResponseError.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Detailed information about the error that occurred. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class ErrorResponseError { /** * Gets or Sets code diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfo.java b/src/main/java/org/openapitools/inference/client/model/ModelInfo.java new file mode 100644 index 0000000..c56bc71 --- /dev/null +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfo.java @@ -0,0 +1,691 @@ +/* + * Pinecone Inference API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.inference.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.inference.client.model.ModelInfoMetric; +import org.openapitools.inference.client.model.ModelInfoSupportedParameter; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.inference.client.JSON; + +/** + * Represents the model configuration including model type, supported parameters, and other model details. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") +public class ModelInfo { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SHORT_DESCRIPTION = "short_description"; + @SerializedName(SERIALIZED_NAME_SHORT_DESCRIPTION) + private String shortDescription; + + /** + * The type of model (e.g. 'embed' or 'rerank'). + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EMBED("embed"), + + RERANK("rerank"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + /** + * Whether the embedding model produces 'dense' or 'sparse' embeddings. + */ + @JsonAdapter(VectorTypeEnum.Adapter.class) + public enum VectorTypeEnum { + DENSE("dense"), + + SPARSE("sparse"); + + private String value; + + VectorTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VectorTypeEnum fromValue(String value) { + for (VectorTypeEnum b : VectorTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final VectorTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VectorTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VectorTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_VECTOR_TYPE = "vector_type"; + @SerializedName(SERIALIZED_NAME_VECTOR_TYPE) + private VectorTypeEnum vectorType; + + public static final String SERIALIZED_NAME_DIMENSION = "dimension"; + @SerializedName(SERIALIZED_NAME_DIMENSION) + private Integer dimension; + + public static final String SERIALIZED_NAME_MODALITY = "modality"; + @SerializedName(SERIALIZED_NAME_MODALITY) + private String modality; + + public static final String SERIALIZED_NAME_SEQUENCE_LENGTH = "sequence_length"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_LENGTH) + private Integer sequenceLength; + + public static final String SERIALIZED_NAME_BATCH_SIZE = "batch_size"; + @SerializedName(SERIALIZED_NAME_BATCH_SIZE) + private Integer batchSize; + + public static final String SERIALIZED_NAME_SUPPORTED_METRICS = "supported_metrics"; + @SerializedName(SERIALIZED_NAME_SUPPORTED_METRICS) + private List supportedMetrics; + + public static final String SERIALIZED_NAME_SUPPORTED_PARAMETERS = "supported_parameters"; + @SerializedName(SERIALIZED_NAME_SUPPORTED_PARAMETERS) + private List supportedParameters = new ArrayList<>(); + + public ModelInfo() { + } + + public ModelInfo name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the model. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ModelInfo shortDescription(String shortDescription) { + + this.shortDescription = shortDescription; + return this; + } + + /** + * A summary of the model. + * @return shortDescription + **/ + @javax.annotation.Nonnull + public String getShortDescription() { + return shortDescription; + } + + + public void setShortDescription(String shortDescription) { + this.shortDescription = shortDescription; + } + + + public ModelInfo type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of model (e.g. 'embed' or 'rerank'). + * @return type + **/ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public ModelInfo vectorType(VectorTypeEnum vectorType) { + + this.vectorType = vectorType; + return this; + } + + /** + * Whether the embedding model produces 'dense' or 'sparse' embeddings. + * @return vectorType + **/ + @javax.annotation.Nullable + public VectorTypeEnum getVectorType() { + return vectorType; + } + + + public void setVectorType(VectorTypeEnum vectorType) { + this.vectorType = vectorType; + } + + + public ModelInfo dimension(Integer dimension) { + + this.dimension = dimension; + return this; + } + + /** + * The embedding model dimension (applies to dense embedding models only). + * minimum: 1 + * maximum: 20000 + * @return dimension + **/ + @javax.annotation.Nullable + public Integer getDimension() { + return dimension; + } + + + public void setDimension(Integer dimension) { + this.dimension = dimension; + } + + + public ModelInfo modality(String modality) { + + this.modality = modality; + return this; + } + + /** + * The modality of the model (e.g. 'text'). + * @return modality + **/ + @javax.annotation.Nullable + public String getModality() { + return modality; + } + + + public void setModality(String modality) { + this.modality = modality; + } + + + public ModelInfo sequenceLength(Integer sequenceLength) { + + this.sequenceLength = sequenceLength; + return this; + } + + /** + * The maximum tokens per sequence supported by the model. + * minimum: 1 + * @return sequenceLength + **/ + @javax.annotation.Nullable + public Integer getSequenceLength() { + return sequenceLength; + } + + + public void setSequenceLength(Integer sequenceLength) { + this.sequenceLength = sequenceLength; + } + + + public ModelInfo batchSize(Integer batchSize) { + + this.batchSize = batchSize; + return this; + } + + /** + * The maximum batch size (number of sequences) supported by the model. + * minimum: 1 + * @return batchSize + **/ + @javax.annotation.Nullable + public Integer getBatchSize() { + return batchSize; + } + + + public void setBatchSize(Integer batchSize) { + this.batchSize = batchSize; + } + + + public ModelInfo supportedMetrics(List supportedMetrics) { + + this.supportedMetrics = supportedMetrics; + return this; + } + + public ModelInfo addSupportedMetricsItem(ModelInfoMetric supportedMetricsItem) { + if (this.supportedMetrics == null) { + this.supportedMetrics = new ArrayList<>(); + } + this.supportedMetrics.add(supportedMetricsItem); + return this; + } + + /** + * The distance metrics supported by the model for similarity search. + * @return supportedMetrics + **/ + @javax.annotation.Nullable + public List getSupportedMetrics() { + return supportedMetrics; + } + + + public void setSupportedMetrics(List supportedMetrics) { + this.supportedMetrics = supportedMetrics; + } + + + public ModelInfo supportedParameters(List supportedParameters) { + + this.supportedParameters = supportedParameters; + return this; + } + + public ModelInfo addSupportedParametersItem(ModelInfoSupportedParameter supportedParametersItem) { + if (this.supportedParameters == null) { + this.supportedParameters = new ArrayList<>(); + } + this.supportedParameters.add(supportedParametersItem); + return this; + } + + /** + * Get supportedParameters + * @return supportedParameters + **/ + @javax.annotation.Nonnull + public List getSupportedParameters() { + return supportedParameters; + } + + + public void setSupportedParameters(List supportedParameters) { + this.supportedParameters = supportedParameters; + } + + /** + * 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 ModelInfo instance itself + */ + public ModelInfo 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; + } + ModelInfo modelInfo = (ModelInfo) o; + return Objects.equals(this.name, modelInfo.name) && + Objects.equals(this.shortDescription, modelInfo.shortDescription) && + Objects.equals(this.type, modelInfo.type) && + Objects.equals(this.vectorType, modelInfo.vectorType) && + Objects.equals(this.dimension, modelInfo.dimension) && + Objects.equals(this.modality, modelInfo.modality) && + Objects.equals(this.sequenceLength, modelInfo.sequenceLength) && + Objects.equals(this.batchSize, modelInfo.batchSize) && + Objects.equals(this.supportedMetrics, modelInfo.supportedMetrics) && + Objects.equals(this.supportedParameters, modelInfo.supportedParameters)&& + Objects.equals(this.additionalProperties, modelInfo.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, shortDescription, type, vectorType, dimension, modality, sequenceLength, batchSize, supportedMetrics, supportedParameters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelInfo {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" shortDescription: ").append(toIndentedString(shortDescription)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" vectorType: ").append(toIndentedString(vectorType)).append("\n"); + sb.append(" dimension: ").append(toIndentedString(dimension)).append("\n"); + sb.append(" modality: ").append(toIndentedString(modality)).append("\n"); + sb.append(" sequenceLength: ").append(toIndentedString(sequenceLength)).append("\n"); + sb.append(" batchSize: ").append(toIndentedString(batchSize)).append("\n"); + sb.append(" supportedMetrics: ").append(toIndentedString(supportedMetrics)).append("\n"); + sb.append(" supportedParameters: ").append(toIndentedString(supportedParameters)).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(); + openapiFields.add("name"); + openapiFields.add("short_description"); + openapiFields.add("type"); + openapiFields.add("vector_type"); + openapiFields.add("dimension"); + openapiFields.add("modality"); + openapiFields.add("sequence_length"); + openapiFields.add("batch_size"); + openapiFields.add("supported_metrics"); + openapiFields.add("supported_parameters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("short_description"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("supported_parameters"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ModelInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelInfo is not found in the empty JSON string", ModelInfo.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ModelInfo.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("short_description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `short_description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("short_description").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("vector_type") != null && !jsonObj.get("vector_type").isJsonNull()) && !jsonObj.get("vector_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vector_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vector_type").toString())); + } + if ((jsonObj.get("modality") != null && !jsonObj.get("modality").isJsonNull()) && !jsonObj.get("modality").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `modality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("modality").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("supported_metrics") != null && !jsonObj.get("supported_metrics").isJsonNull() && !jsonObj.get("supported_metrics").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `supported_metrics` to be an array in the JSON string but got `%s`", jsonObj.get("supported_metrics").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("supported_parameters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `supported_parameters` to be an array in the JSON string but got `%s`", jsonObj.get("supported_parameters").toString())); + } + + JsonArray jsonArraysupportedParameters = jsonObj.getAsJsonArray("supported_parameters"); + // validate the required field `supported_parameters` (array) + for (int i = 0; i < jsonArraysupportedParameters.size(); i++) { + ModelInfoSupportedParameter.validateJsonElement(jsonArraysupportedParameters.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelInfo 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ModelInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ModelInfo 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("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 ModelInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelInfo + * @throws IOException if the JSON string is invalid with respect to ModelInfo + */ + public static ModelInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelInfo.class); + } + + /** + * Convert an instance of ModelInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java new file mode 100644 index 0000000..5bf24e7 --- /dev/null +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java @@ -0,0 +1,306 @@ +/* + * Pinecone Inference API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.inference.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.inference.client.model.ModelInfo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.inference.client.JSON; + +/** + * The list of available models. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") +public class ModelInfoList { + public static final String SERIALIZED_NAME_MODELS = "models"; + @SerializedName(SERIALIZED_NAME_MODELS) + private List models; + + public ModelInfoList() { + } + + public ModelInfoList models(List models) { + + this.models = models; + return this; + } + + public ModelInfoList addModelsItem(ModelInfo modelsItem) { + if (this.models == null) { + this.models = new ArrayList<>(); + } + this.models.add(modelsItem); + return this; + } + + /** + * Get models + * @return models + **/ + @javax.annotation.Nullable + public List getModels() { + return models; + } + + + public void setModels(List models) { + this.models = models; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ModelInfoList instance itself + */ + public ModelInfoList 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; + } + ModelInfoList modelInfoList = (ModelInfoList) o; + return Objects.equals(this.models, modelInfoList.models)&& + Objects.equals(this.additionalProperties, modelInfoList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(models, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelInfoList {\n"); + sb.append(" models: ").append(toIndentedString(models)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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(); + openapiFields.add("models"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelInfoList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ModelInfoList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelInfoList is not found in the empty JSON string", ModelInfoList.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("models") != null && !jsonObj.get("models").isJsonNull()) { + JsonArray jsonArraymodels = jsonObj.getAsJsonArray("models"); + if (jsonArraymodels != null) { + // ensure the json data is an array + if (!jsonObj.get("models").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `models` to be an array in the JSON string but got `%s`", jsonObj.get("models").toString())); + } + + // validate the optional field `models` (array) + for (int i = 0; i < jsonArraymodels.size(); i++) { + ModelInfo.validateJsonElement(jsonArraymodels.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelInfoList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelInfoList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelInfoList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelInfoList 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ModelInfoList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ModelInfoList 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("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 ModelInfoList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelInfoList + * @throws IOException if the JSON string is invalid with respect to ModelInfoList + */ + public static ModelInfoList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelInfoList.class); + } + + /** + * Convert an instance of ModelInfoList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoMetric.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoMetric.java new file mode 100644 index 0000000..8c9d84e --- /dev/null +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoMetric.java @@ -0,0 +1,74 @@ +/* + * Pinecone Inference API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.inference.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * A distance metric that the embedding model supports for similarity searches. + */ +@JsonAdapter(ModelInfoMetric.Adapter.class) +public enum ModelInfoMetric { + + COSINE("cosine"), + + EUCLIDEAN("euclidean"), + + DOTPRODUCT("dotproduct"); + + private String value; + + ModelInfoMetric(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModelInfoMetric fromValue(String value) { + for (ModelInfoMetric b : ModelInfoMetric.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModelInfoMetric enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModelInfoMetric read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModelInfoMetric.fromValue(value); + } + } +} + diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.java new file mode 100644 index 0000000..db53ad9 --- /dev/null +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.java @@ -0,0 +1,528 @@ +/* + * Pinecone Inference API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.inference.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.inference.client.model.ModelInfoSupportedParameterAllowedValuesInner; +import org.openapitools.inference.client.model.ModelInfoSupportedParameterDefault; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.inference.client.JSON; + +/** + * Describes a parameter supported by the model, including parameter value constraints. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") +public class ModelInfoSupportedParameter { + public static final String SERIALIZED_NAME_PARAMETER = "parameter"; + @SerializedName(SERIALIZED_NAME_PARAMETER) + private String parameter; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_VALUE_TYPE = "value_type"; + @SerializedName(SERIALIZED_NAME_VALUE_TYPE) + private String valueType; + + public static final String SERIALIZED_NAME_REQUIRED = "required"; + @SerializedName(SERIALIZED_NAME_REQUIRED) + private Boolean required; + + public static final String SERIALIZED_NAME_ALLOWED_VALUES = "allowed_values"; + @SerializedName(SERIALIZED_NAME_ALLOWED_VALUES) + private List allowedValues; + + public static final String SERIALIZED_NAME_MIN = "min"; + @SerializedName(SERIALIZED_NAME_MIN) + private BigDecimal min; + + public static final String SERIALIZED_NAME_MAX = "max"; + @SerializedName(SERIALIZED_NAME_MAX) + private BigDecimal max; + + public static final String SERIALIZED_NAME_DEFAULT = "default"; + @SerializedName(SERIALIZED_NAME_DEFAULT) + private ModelInfoSupportedParameterDefault _default; + + public ModelInfoSupportedParameter() { + } + + public ModelInfoSupportedParameter parameter(String parameter) { + + this.parameter = parameter; + return this; + } + + /** + * The name of the parameter. + * @return parameter + **/ + @javax.annotation.Nonnull + public String getParameter() { + return parameter; + } + + + public void setParameter(String parameter) { + this.parameter = parameter; + } + + + public ModelInfoSupportedParameter type(String type) { + + this.type = type; + return this; + } + + /** + * The parameter type e.g. 'one_of', 'numeric_range', or 'any'. If the type is 'one_of', then 'allowed_values' will be set, and the value specified must be one of the allowed values. 'one_of' is only compatible with value_type 'string' or 'integer'. If 'numeric_range', then 'min' and 'max' will be set, then the value specified must adhere to the value_type and must fall within the `[min, max]` range (inclusive). If 'any' then any value is allowed, as long as it adheres to the value_type. + * @return type + **/ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public ModelInfoSupportedParameter valueType(String valueType) { + + this.valueType = valueType; + return this; + } + + /** + * The type of value the parameter accepts, e.g. 'string', 'integer', 'float', or 'boolean'. + * @return valueType + **/ + @javax.annotation.Nonnull + public String getValueType() { + return valueType; + } + + + public void setValueType(String valueType) { + this.valueType = valueType; + } + + + public ModelInfoSupportedParameter required(Boolean required) { + + this.required = required; + return this; + } + + /** + * Whether the parameter is required (true) or optional (false). + * @return required + **/ + @javax.annotation.Nonnull + public Boolean getRequired() { + return required; + } + + + public void setRequired(Boolean required) { + this.required = required; + } + + + public ModelInfoSupportedParameter allowedValues(List allowedValues) { + + this.allowedValues = allowedValues; + return this; + } + + public ModelInfoSupportedParameter addAllowedValuesItem(ModelInfoSupportedParameterAllowedValuesInner allowedValuesItem) { + if (this.allowedValues == null) { + this.allowedValues = new ArrayList<>(); + } + this.allowedValues.add(allowedValuesItem); + return this; + } + + /** + * The allowed parameter values when the type is 'one_of'. + * @return allowedValues + **/ + @javax.annotation.Nullable + public List getAllowedValues() { + return allowedValues; + } + + + public void setAllowedValues(List allowedValues) { + this.allowedValues = allowedValues; + } + + + public ModelInfoSupportedParameter min(BigDecimal min) { + + this.min = min; + return this; + } + + /** + * The minimum allowed value (inclusive) when the type is 'numeric_range'. + * @return min + **/ + @javax.annotation.Nullable + public BigDecimal getMin() { + return min; + } + + + public void setMin(BigDecimal min) { + this.min = min; + } + + + public ModelInfoSupportedParameter max(BigDecimal max) { + + this.max = max; + return this; + } + + /** + * The maximum allowed value (inclusive) when the type is 'numeric_range'. + * @return max + **/ + @javax.annotation.Nullable + public BigDecimal getMax() { + return max; + } + + + public void setMax(BigDecimal max) { + this.max = max; + } + + + public ModelInfoSupportedParameter _default(ModelInfoSupportedParameterDefault _default) { + + this._default = _default; + return this; + } + + /** + * Get _default + * @return _default + **/ + @javax.annotation.Nullable + public ModelInfoSupportedParameterDefault getDefault() { + return _default; + } + + + public void setDefault(ModelInfoSupportedParameterDefault _default) { + this._default = _default; + } + + /** + * 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 ModelInfoSupportedParameter instance itself + */ + public ModelInfoSupportedParameter 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; + } + ModelInfoSupportedParameter modelInfoSupportedParameter = (ModelInfoSupportedParameter) o; + return Objects.equals(this.parameter, modelInfoSupportedParameter.parameter) && + Objects.equals(this.type, modelInfoSupportedParameter.type) && + Objects.equals(this.valueType, modelInfoSupportedParameter.valueType) && + Objects.equals(this.required, modelInfoSupportedParameter.required) && + Objects.equals(this.allowedValues, modelInfoSupportedParameter.allowedValues) && + Objects.equals(this.min, modelInfoSupportedParameter.min) && + Objects.equals(this.max, modelInfoSupportedParameter.max) && + Objects.equals(this._default, modelInfoSupportedParameter._default)&& + Objects.equals(this.additionalProperties, modelInfoSupportedParameter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(parameter, type, valueType, required, allowedValues, min, max, _default, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelInfoSupportedParameter {\n"); + sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" allowedValues: ").append(toIndentedString(allowedValues)).append("\n"); + sb.append(" min: ").append(toIndentedString(min)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" _default: ").append(toIndentedString(_default)).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(); + openapiFields.add("parameter"); + openapiFields.add("type"); + openapiFields.add("value_type"); + openapiFields.add("required"); + openapiFields.add("allowed_values"); + openapiFields.add("min"); + openapiFields.add("max"); + openapiFields.add("default"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("parameter"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("value_type"); + openapiRequiredFields.add("required"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelInfoSupportedParameter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ModelInfoSupportedParameter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelInfoSupportedParameter is not found in the empty JSON string", ModelInfoSupportedParameter.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ModelInfoSupportedParameter.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("parameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parameter").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("value_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value_type").toString())); + } + if (jsonObj.get("allowed_values") != null && !jsonObj.get("allowed_values").isJsonNull()) { + JsonArray jsonArrayallowedValues = jsonObj.getAsJsonArray("allowed_values"); + if (jsonArrayallowedValues != null) { + // ensure the json data is an array + if (!jsonObj.get("allowed_values").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowed_values` to be an array in the JSON string but got `%s`", jsonObj.get("allowed_values").toString())); + } + + // validate the optional field `allowed_values` (array) + for (int i = 0; i < jsonArrayallowedValues.size(); i++) { + ModelInfoSupportedParameterAllowedValuesInner.validateJsonElement(jsonArrayallowedValues.get(i)); + }; + } + } + // validate the optional field `default` + if (jsonObj.get("default") != null && !jsonObj.get("default").isJsonNull()) { + ModelInfoSupportedParameterDefault.validateJsonElement(jsonObj.get("default")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelInfoSupportedParameter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelInfoSupportedParameter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelInfoSupportedParameter.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelInfoSupportedParameter 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 { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ModelInfoSupportedParameter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ModelInfoSupportedParameter 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("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 ModelInfoSupportedParameter given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelInfoSupportedParameter + * @throws IOException if the JSON string is invalid with respect to ModelInfoSupportedParameter + */ + public static ModelInfoSupportedParameter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelInfoSupportedParameter.class); + } + + /** + * Convert an instance of ModelInfoSupportedParameter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java new file mode 100644 index 0000000..a40e377 --- /dev/null +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java @@ -0,0 +1,270 @@ +/* + * Pinecone Inference API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.inference.client.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import org.openapitools.inference.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") +public class ModelInfoSupportedParameterAllowedValuesInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ModelInfoSupportedParameterAllowedValuesInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelInfoSupportedParameterAllowedValuesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelInfoSupportedParameterAllowedValuesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelInfoSupportedParameterAllowedValuesInner value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Integer` + if (value.getActualInstance() instanceof Integer) { + JsonPrimitive primitive = adapterInteger.toJsonTree((Integer)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match anyOf schemae: Integer, String"); + } + + @Override + public ModelInfoSupportedParameterAllowedValuesInner read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if(!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + ModelInfoSupportedParameterAllowedValuesInner ret = new ModelInfoSupportedParameterAllowedValuesInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Integer + try { + // validate the JSON object to see if any exception is thrown + if(!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterInteger; + ModelInfoSupportedParameterAllowedValuesInner ret = new ModelInfoSupportedParameterAllowedValuesInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Integer'", e); + } + + throw new IOException(String.format("Failed deserialization for ModelInfoSupportedParameterAllowedValuesInner: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public ModelInfoSupportedParameterAllowedValuesInner() { + super("anyOf", Boolean.FALSE); + } + + public ModelInfoSupportedParameterAllowedValuesInner(Integer o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public ModelInfoSupportedParameterAllowedValuesInner(String o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Integer", Integer.class); + } + + @Override + public Map> getSchemas() { + return ModelInfoSupportedParameterAllowedValuesInner.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Integer, String + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Integer) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Integer, String"); + } + + /** + * Get the actual instance, which can be the following: + * Integer, String + * + * @return The actual instance (Integer, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + /** + * Get the actual instance of `Integer`. If the actual instance is not `Integer`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Integer` + * @throws ClassCastException if the instance is not `Integer` + */ + public Integer getInteger() throws ClassCastException { + return (Integer)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelInfoSupportedParameterAllowedValuesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if(!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Integer + try { + if(!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException(String.format("The JSON string is invalid for ModelInfoSupportedParameterAllowedValuesInner with anyOf schemas: Integer, String. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + + } + + /** + * Create an instance of ModelInfoSupportedParameterAllowedValuesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelInfoSupportedParameterAllowedValuesInner + * @throws IOException if the JSON string is invalid with respect to ModelInfoSupportedParameterAllowedValuesInner + */ + public static ModelInfoSupportedParameterAllowedValuesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelInfoSupportedParameterAllowedValuesInner.class); + } + + /** + * Convert an instance of ModelInfoSupportedParameterAllowedValuesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java new file mode 100644 index 0000000..e28dc62 --- /dev/null +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java @@ -0,0 +1,376 @@ +/* + * Pinecone Inference API + * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.inference.client.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import org.openapitools.inference.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") +public class ModelInfoSupportedParameterDefault extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ModelInfoSupportedParameterDefault.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelInfoSupportedParameterDefault.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelInfoSupportedParameterDefault' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class)); + final TypeAdapter adapterFloat = gson.getDelegateAdapter(this, TypeToken.get(Float.class)); + final TypeAdapter adapterBoolean = gson.getDelegateAdapter(this, TypeToken.get(Boolean.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelInfoSupportedParameterDefault value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Integer` + if (value.getActualInstance() instanceof Integer) { + JsonPrimitive primitive = adapterInteger.toJsonTree((Integer)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Float` + if (value.getActualInstance() instanceof Float) { + JsonPrimitive primitive = adapterFloat.toJsonTree((Float)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Boolean` + if (value.getActualInstance() instanceof Boolean) { + JsonPrimitive primitive = adapterBoolean.toJsonTree((Boolean)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match anyOf schemae: Boolean, Float, Integer, String"); + } + + @Override + public ModelInfoSupportedParameterDefault read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if(!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + ModelInfoSupportedParameterDefault ret = new ModelInfoSupportedParameterDefault(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Integer + try { + // validate the JSON object to see if any exception is thrown + if(!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterInteger; + ModelInfoSupportedParameterDefault ret = new ModelInfoSupportedParameterDefault(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Integer'", e); + } + // deserialize Float + try { + // validate the JSON object to see if any exception is thrown + if(!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterFloat; + ModelInfoSupportedParameterDefault ret = new ModelInfoSupportedParameterDefault(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Float failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Float'", e); + } + // deserialize Boolean + try { + // validate the JSON object to see if any exception is thrown + if(!jsonElement.getAsJsonPrimitive().isBoolean()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Boolean in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterBoolean; + ModelInfoSupportedParameterDefault ret = new ModelInfoSupportedParameterDefault(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Boolean failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Boolean'", e); + } + + throw new IOException(String.format("Failed deserialization for ModelInfoSupportedParameterDefault: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public ModelInfoSupportedParameterDefault() { + super("anyOf", Boolean.FALSE); + } + + public ModelInfoSupportedParameterDefault(Boolean o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public ModelInfoSupportedParameterDefault(Float o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public ModelInfoSupportedParameterDefault(Integer o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public ModelInfoSupportedParameterDefault(String o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Integer", Integer.class); + schemas.put("Float", Float.class); + schemas.put("Boolean", Boolean.class); + } + + @Override + public Map> getSchemas() { + return ModelInfoSupportedParameterDefault.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Boolean, Float, Integer, String + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Integer) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Float) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Boolean) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Boolean, Float, Integer, String"); + } + + /** + * Get the actual instance, which can be the following: + * Boolean, Float, Integer, String + * + * @return The actual instance (Boolean, Float, Integer, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + /** + * Get the actual instance of `Integer`. If the actual instance is not `Integer`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Integer` + * @throws ClassCastException if the instance is not `Integer` + */ + public Integer getInteger() throws ClassCastException { + return (Integer)super.getActualInstance(); + } + /** + * Get the actual instance of `Float`. If the actual instance is not `Float`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Float` + * @throws ClassCastException if the instance is not `Float` + */ + public Float getFloat() throws ClassCastException { + return (Float)super.getActualInstance(); + } + /** + * Get the actual instance of `Boolean`. If the actual instance is not `Boolean`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Boolean` + * @throws ClassCastException if the instance is not `Boolean` + */ + public Boolean getBoolean() throws ClassCastException { + return (Boolean)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelInfoSupportedParameterDefault + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if(!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Integer + try { + if(!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Float + try { + if(!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Float failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Boolean + try { + if(!jsonElement.getAsJsonPrimitive().isBoolean()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Boolean in the JSON string but got `%s`", jsonElement.toString())); + } + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Boolean failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException(String.format("The JSON string is invalid for ModelInfoSupportedParameterDefault with anyOf schemas: Boolean, Float, Integer, String. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + + } + + /** + * Create an instance of ModelInfoSupportedParameterDefault given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelInfoSupportedParameterDefault + * @throws IOException if the JSON string is invalid with respect to ModelInfoSupportedParameterDefault + */ + public static ModelInfoSupportedParameterDefault fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelInfoSupportedParameterDefault.class); + } + + /** + * Convert an instance of ModelInfoSupportedParameterDefault to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/inference/client/model/RankedDocument.java b/src/main/java/org/openapitools/inference/client/model/RankedDocument.java index 8a7c463..993ab6b 100644 --- a/src/main/java/org/openapitools/inference/client/model/RankedDocument.java +++ b/src/main/java/org/openapitools/inference/client/model/RankedDocument.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * A ranked document with a relevance score and an index position. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class RankedDocument { public static final String SERIALIZED_NAME_INDEX = "index"; @SerializedName(SERIALIZED_NAME_INDEX) diff --git a/src/main/java/org/openapitools/inference/client/model/RerankRequest.java b/src/main/java/org/openapitools/inference/client/model/RerankRequest.java index f3ca4ac..536db56 100644 --- a/src/main/java/org/openapitools/inference/client/model/RerankRequest.java +++ b/src/main/java/org/openapitools/inference/client/model/RerankRequest.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * RerankRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class RerankRequest { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) @@ -185,7 +185,7 @@ public RerankRequest addRankFieldsItem(String rankFieldsItem) { } /** - * The fields to rank the documents by. If not provided, the default is `\"text\"`. + * The field(s) to consider for reranking. If not provided, the default is `[\"text\"]`. The number of fields supported is [model-specific](https://docs.pinecone.io/guides/inference/understanding-inference#reranking-models). * @return rankFields **/ @javax.annotation.Nullable diff --git a/src/main/java/org/openapitools/inference/client/model/RerankResult.java b/src/main/java/org/openapitools/inference/client/model/RerankResult.java index 0d7398a..197d705 100644 --- a/src/main/java/org/openapitools/inference/client/model/RerankResult.java +++ b/src/main/java/org/openapitools/inference/client/model/RerankResult.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * The result of a reranking request. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class RerankResult { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/inference/client/model/RerankResultUsage.java b/src/main/java/org/openapitools/inference/client/model/RerankResultUsage.java index 462ca79..1a31958 100644 --- a/src/main/java/org/openapitools/inference/client/model/RerankResultUsage.java +++ b/src/main/java/org/openapitools/inference/client/model/RerankResultUsage.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Usage statistics for the model inference. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class RerankResultUsage { public static final String SERIALIZED_NAME_RERANK_UNITS = "rerank_units"; @SerializedName(SERIALIZED_NAME_RERANK_UNITS) diff --git a/src/main/java/org/openapitools/inference/client/model/SparseEmbedding.java b/src/main/java/org/openapitools/inference/client/model/SparseEmbedding.java index b125297..d80af60 100644 --- a/src/main/java/org/openapitools/inference/client/model/SparseEmbedding.java +++ b/src/main/java/org/openapitools/inference/client/model/SparseEmbedding.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * A sparse embedding of a single input */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:22.280429Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T20:09:49.238595Z[Etc/UTC]") public class SparseEmbedding { public static final String SERIALIZED_NAME_SPARSE_VALUES = "sparse_values"; @SerializedName(SERIALIZED_NAME_SPARSE_VALUES) diff --git a/src/main/java/org/openapitools/inference/client/model/VectorType.java b/src/main/java/org/openapitools/inference/client/model/VectorType.java index f0efa5c..a45a8bb 100644 --- a/src/main/java/org/openapitools/inference/client/model/VectorType.java +++ b/src/main/java/org/openapitools/inference/client/model/VectorType.java @@ -2,7 +2,7 @@ * Pinecone Inference API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * - * The version of the OpenAPI document: 2025-01 + * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).