diff --git a/README.md b/README.md index ba9829ea..054fd430 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,6 @@ serverless and regional availability, see [Understanding indexes](https://docs.p ```java import io.pinecone.clients.Pinecone; import org.openapitools.db_control.client.model.IndexModel; -import org.openapitools.db_control.client.model.DeletionProtection; import java.util.HashMap; ... @@ -184,7 +183,106 @@ String region = "us-west-2"; HashMap tags = new HashMap<>(); tags.put("env", "test"); -IndexModel indexModel = pinecone.createServerlessIndex(indexName, similarityMetric, dimension, cloud, region, DeletionProtection.ENABLED, tags); +IndexModel indexModel = pinecone.createServerlessIndex(indexName, similarityMetric, dimension, cloud, region, "enabled", tags); +``` + +### Create a serverless index with dedicated read capacity + +The following example creates a serverless index with dedicated read capacity nodes for better performance and cost predictability. For more information, see [Dedicated Read Nodes](https://docs.pinecone.io/guides/index-data/dedicated-read-nodes). + +```java +import io.pinecone.clients.Pinecone; +import org.openapitools.db_control.client.model.IndexModel; +import org.openapitools.db_control.client.model.ReadCapacity; +import org.openapitools.db_control.client.model.ReadCapacityDedicatedSpec; +import org.openapitools.db_control.client.model.ReadCapacityDedicatedConfig; +import org.openapitools.db_control.client.model.ScalingConfigManual; +import java.util.HashMap; +... + +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); + +String indexName = "example-index"; +String similarityMetric = "cosine"; +int dimension = 1538; +String cloud = "aws"; +String region = "us-west-2"; +HashMap tags = new HashMap<>(); +tags.put("env", "test"); + +// Configure dedicated read capacity with manual scaling +ScalingConfigManual manual = new ScalingConfigManual().shards(2).replicas(2); +ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig() + .nodeType("t1") + .scaling("Manual") + .manual(manual); +ReadCapacity readCapacity = new ReadCapacity( + new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated)); + +IndexModel indexModel = pinecone.createServerlessIndex(indexName, similarityMetric, dimension, + cloud, region, "enabled", tags, readCapacity, null); +``` + +### Create a serverless index with OnDemand read capacity + +The following example explicitly creates a serverless index with OnDemand read capacity (the default mode). OnDemand provides pay-per-use pricing with automatic scaling. + +```java +import io.pinecone.clients.Pinecone; +import org.openapitools.db_control.client.model.IndexModel; +import org.openapitools.db_control.client.model.ReadCapacity; +import org.openapitools.db_control.client.model.ReadCapacityOnDemandSpec; +import java.util.HashMap; +... + +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); + +String indexName = "example-index"; +String similarityMetric = "cosine"; +int dimension = 1538; +String cloud = "aws"; +String region = "us-west-2"; +HashMap tags = new HashMap<>(); +tags.put("env", "test"); + +// Configure OnDemand read capacity (optional - this is the default) +ReadCapacity readCapacity = new ReadCapacity(new ReadCapacityOnDemandSpec().mode("OnDemand")); + +IndexModel indexModel = pinecone.createServerlessIndex(indexName, similarityMetric, dimension, + cloud, region, "enabled", tags, readCapacity, null); +``` + +### Create a serverless index with metadata schema + +The following example creates a serverless index with metadata schema configuration to limit metadata indexing to specific fields for improved performance. + +```java +import io.pinecone.clients.Pinecone; +import org.openapitools.db_control.client.model.IndexModel; +import org.openapitools.db_control.client.model.BackupModelSchema; +import org.openapitools.db_control.client.model.BackupModelSchemaFieldsValue; +import java.util.HashMap; +... + +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); + +String indexName = "example-index"; +String similarityMetric = "cosine"; +int dimension = 1538; +String cloud = "aws"; +String region = "us-west-2"; +HashMap tags = new HashMap<>(); +tags.put("env", "test"); + +// Configure metadata schema to only index specific fields +HashMap fields = new HashMap<>(); +fields.put("genre", new BackupModelSchemaFieldsValue().filterable(true)); +fields.put("year", new BackupModelSchemaFieldsValue().filterable(true)); +fields.put("description", new BackupModelSchemaFieldsValue().filterable(true)); +BackupModelSchema schema = new BackupModelSchema().fields(fields); + +IndexModel indexModel = pinecone.createServerlessIndex(indexName, similarityMetric, dimension, + cloud, region, "enabled", tags, null, schema); ``` ### Create a sparse serverless index @@ -195,7 +293,6 @@ serverless and regional availability, see [Understanding indexes](https://docs.p ```java import io.pinecone.clients.Pinecone; import org.openapitools.db_control.client.model.IndexModel; -import org.openapitools.db_control.client.model.DeletionProtection; import java.util.HashMap; ... @@ -208,7 +305,7 @@ HashMap tags = new HashMap<>(); tags.put("env", "test"); String vectorType = "sparse"; -IndexModel indexModel = pinecone.createSparseServelessIndex(indexName, cloud, region, DeletionProtection.ENABLED, tags, vectorType); +IndexModel indexModel = pinecone.createSparseServelessIndex(indexName, cloud, region, "enabled", tags, vectorType); ``` ### Create a pod index @@ -224,12 +321,11 @@ import org.openapitools.db_control.client.model.IndexModel; Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); String indexName = "example-index"; -String similarityMetric = "cosine"; // Optional; defaults to cosine similarity int dimension = 1538; String environment = "us-east-1-aws"; String podType = "p1.x1"; -IndexModel indexModel = pinecone.createPodsIndex(indexName, dimension, environment, podType, similarityMetric); +IndexModel indexModel = pinecone.createPodsIndex(indexName, dimension, environment, podType); ``` ### Create a pod index with deletion protection enabled @@ -239,8 +335,7 @@ configuration options, see `main/java/io/pinecone/clients/Pinecone.java`. ```java import io.pinecone.clients.Pinecone; -import org.openapitools.client.model.IndexModel; -import org.openapitools.control.client.model.DeletionProtection; +import org.openapitools.db_control.client.model.IndexModel; ... Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); @@ -250,7 +345,59 @@ int dimension = 1538; String environment = "us-east-1-aws"; String podType = "p1.x1"; -IndexModel indexModel = pinecone.createPodsIndex(indexName, dimension, environment, podType, DeletionProtection.ENABLED); +IndexModel indexModel = pinecone.createPodsIndex(indexName, dimension, environment, podType, "enabled"); +``` + +### Create a BYOC index + +The following is an example of creating a BYOC (Bring Your Own Cloud) index. BYOC indexes allow you to deploy Pinecone indexes in your own cloud infrastructure. You must have a BYOC environment set up with Pinecone before creating a BYOC index. The BYOC environment name is provided during BYOC onboarding. + +```java +import io.pinecone.clients.Pinecone; +import org.openapitools.db_control.client.model.IndexModel; +... + +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); + +String indexName = "example-index"; +String similarityMetric = "cosine"; +int dimension = 1538; +String byocEnvironment = "your-byoc-environment"; + +IndexModel indexModel = pinecone.createByocIndex(indexName, similarityMetric, dimension, byocEnvironment); +``` + +### Create a BYOC index with metadata schema + +The following example creates a BYOC index with metadata schema configuration to limit metadata indexing to specific fields for improved performance. + +```java +import io.pinecone.clients.Pinecone; +import org.openapitools.db_control.client.model.IndexModel; +import org.openapitools.db_control.client.model.BackupModelSchema; +import org.openapitools.db_control.client.model.BackupModelSchemaFieldsValue; +import java.util.HashMap; +import java.util.Map; +... + +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); + +String indexName = "example-index"; +String similarityMetric = "cosine"; +int dimension = 1538; +String byocEnvironment = "your-byoc-environment"; +HashMap tags = new HashMap<>(); +tags.put("env", "production"); + +// Configure metadata schema +Map fields = new HashMap<>(); +fields.put("genre", new BackupModelSchemaFieldsValue().filterable(true)); +fields.put("year", new BackupModelSchemaFieldsValue().filterable(true)); +fields.put("description", new BackupModelSchemaFieldsValue().filterable(true)); +BackupModelSchema schema = new BackupModelSchema().fields(fields); + +IndexModel indexModel = pinecone.createByocIndex( + indexName, similarityMetric, dimension, byocEnvironment, "enabled", tags, schema); ``` ## List indexes @@ -299,7 +446,6 @@ Note: scaling replicas is only applicable to pod-based indexes. ```java import io.pinecone.clients.Pinecone; -import org.openapitools.db_control.client.model.DeletionProtection; ... Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); @@ -307,7 +453,7 @@ Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); String indexName = "example-index"; String podType = "p1.x1"; int newNumberOfReplicas = 7; -DeletionProtection deletionProtection = DeletionProtection.DISABLED; +String deletionProtection = "disabled"; pinecone.configurePodsIndex(indexName, podType, newNumberOfReplicas, deletionProtection); ``` @@ -318,13 +464,12 @@ The following example enables deletion protection for a pod-based index. ```java import io.pinecone.clients.Pinecone; -import org.openapitools.db_control.client.model.DeletionProtection; ... Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); String indexName = "example-index"; -DeletionProtection deletionProtection = DeletionProtection.ENABLED; +String deletionProtection = "enabled"; pinecone.configurePodsIndex(indexName, deletionProtection); ``` @@ -335,7 +480,6 @@ The following example enables deletion protection for a serverless index. ```java import io.pinecone.clients.Pinecone; -import org.openapitools.db_control.client.model.DeletionProtection; import java.util.HashMap; ... @@ -345,7 +489,39 @@ String indexName = "example-index"; HashMap tags = new HashMap<>(); tags.put("env", "test"); -pinecone.configureServerlessIndex(indexName, DeletionProtection.ENABLED, tags); +pinecone.configureServerlessIndex(indexName, "enabled", tags); +``` + +### Configure read capacity on an existing serverless index + +The following example shows how to configure or change the read capacity mode of an existing serverless index. You can switch between OnDemand and Dedicated modes, or scale dedicated read nodes. + +**Note:** Read capacity settings can only be updated once per hour per index. + +```java +import io.pinecone.clients.Pinecone; +import org.openapitools.db_control.client.model.IndexModel; +import java.util.HashMap; +... + +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); + +String indexName = "example-index"; +HashMap tags = new HashMap<>(); +tags.put("env", "test"); + +// Switch to Dedicated read capacity with manual scaling +// Parameters: indexName, deletionProtection, tags, embed, readCapacityMode, nodeType, shards, replicas +IndexModel indexModel = pinecone.configureServerlessIndex( + indexName, "enabled", tags, null, "Dedicated", "t1", 3, 2); + +// Switch to OnDemand read capacity +IndexModel onDemandIndex = pinecone.configureServerlessIndex( + indexName, "enabled", tags, null, "OnDemand", null, null, null); + +// Verify the configuration was applied +IndexModel desc = pinecone.describeIndex(indexName); +// Check desc.getSpec().getServerless().getReadCapacity()... ``` ## Describe index statistics @@ -521,6 +697,116 @@ List values = Arrays.asList(1F, 2F, 3F); UpdateResponse updateResponse = index.update("v1", values, "example-namespace"); ``` +## Fetch vectors by metadata + +The following example fetches vectors by metadata filter. + +```java +import io.pinecone.clients.Index; +import io.pinecone.clients.Pinecone; +import io.pinecone.proto.FetchByMetadataResponse; +import com.google.protobuf.Struct; +import com.google.protobuf.Value; +... + +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); +Index index = pinecone.getIndexConnection("example-index"); + +// Create a metadata filter +Struct filter = Struct.newBuilder() + .putFields("genre", Value.newBuilder() + .setStructValue(Struct.newBuilder() + .putFields("$eq", Value.newBuilder() + .setStringValue("action") + .build())) + .build()) + .build(); + +// Fetch vectors by metadata with limit +FetchByMetadataResponse response = index.fetchByMetadata("example-namespace", filter, 10, null); + +// Fetch with pagination +String paginationToken = null; +FetchByMetadataResponse fetchResponse = index.fetchByMetadata("example-namespace", filter, 100, paginationToken); + +// Continue pagination if needed +if (fetchResponse.hasPagination() && + fetchResponse.getPagination().getNext() != null && + !fetchResponse.getPagination().getNext().isEmpty()) { + FetchByMetadataResponse nextPage = index.fetchByMetadata( + "example-namespace", filter, 100, fetchResponse.getPagination().getNext()); +} +``` + +## Update vectors by metadata + +The following example updates vectors by metadata filter. + +```java +import io.pinecone.clients.Index; +import io.pinecone.clients.Pinecone; +import io.pinecone.proto.UpdateResponse; +import com.google.protobuf.Struct; +import com.google.protobuf.Value; +... + +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); +Index index = pinecone.getIndexConnection("example-index"); + +// Create a filter to match vectors +Struct filter = Struct.newBuilder() + .putFields("genre", Value.newBuilder() + .setStructValue(Struct.newBuilder() + .putFields("$eq", Value.newBuilder() + .setStringValue("action") + .build())) + .build()) + .build(); + +// Create new metadata to apply +Struct newMetadata = Struct.newBuilder() + .putFields("updated", Value.newBuilder().setStringValue("true").build()) + .putFields("year", Value.newBuilder().setStringValue("2024").build()) + .build(); + +// Dry run to check how many records would be updated +UpdateResponse dryRunResponse = index.updateByMetadata(filter, newMetadata, "example-namespace", true); +int matchedRecords = dryRunResponse.getMatchedRecords(); + +// Actually perform the update +UpdateResponse updateResponse = index.updateByMetadata(filter, newMetadata, "example-namespace", false); +``` + +## Create namespace + +The following example shows how to create a namespace. + +```java +import io.pinecone.clients.AsyncIndex; +import io.pinecone.clients.Index; +import io.pinecone.clients.Pinecone; +import io.pinecone.proto.MetadataFieldProperties; +import io.pinecone.proto.MetadataSchema; +import io.pinecone.proto.NamespaceDescription; + +import java.util.concurrent.ExecutionException; +... + +String indexName = "PINECONE_INDEX_NAME"; +Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build(); +Index index = pinecone.getIndexConnection(indexName); + +// create a namespace +NamespaceDescription namespaceDescription = index.createNamespace("some-namespace"); + +// create a namespace with metadata schema +MetadataSchema schema = MetadataSchema.newBuilder() + .putFields("genre", MetadataFieldProperties.newBuilder().setFilterable(true).build()) + .putFields("year", MetadataFieldProperties.newBuilder().setFilterable(true).build()) + .build(); +NamespaceDescription namespaceWithSchema = index.createNamespace("some-namespace", schema); +``` + ## List namespaces The following example shows various methods to list namespaces. @@ -546,6 +832,19 @@ listNamespacesResponse = index.listNamespaces("some-pagination-token"); // list namespaces with pagination token and a custom limit of 5 listNamespacesResponse = index.listNamespaces("some-pagination-token", 5); + +// The totalCount field returns the total number of namespaces in the index +// When prefix filtering is used, it returns the count of namespaces matching the prefix +int totalCount = listNamespacesResponse.getTotalCount(); + +// list namespaces with prefix filtering +// Prefix filtering allows you to filter namespaces that start with a specific prefix +listNamespacesResponse = index.listNamespaces("test-", null, 10); +totalCount = listNamespacesResponse.getTotalCount(); // Total count of namespaces matching "test-" prefix + +// list namespaces with prefix, pagination token, and limit +listNamespacesResponse = index.listNamespaces("test-", "some-pagination-token", 10); +totalCount = listNamespacesResponse.getTotalCount(); ``` ## Describe namespace @@ -797,7 +1096,6 @@ The following example initiates an asynchronous import of vectors from object st import io.pinecone.clients.Pinecone; import io.pinecone.clients.AsyncIndex; import org.openapitools.db_data.client.ApiException; -import org.openapitools.db_data.client.model.ImportErrorMode; import org.openapitools.db_data.client.model.StartImportResponse; ... @@ -810,7 +1108,7 @@ AsyncIndex asyncIndex = pinecone.getAsyncIndexConnection("PINECONE_INDEX_NAME"); String uri = "s3://path/to/file.parquet"; // Start an import -StartImportResponse response = asyncIndex.startImport(uri, "123-456-789", ImportErrorMode.OnErrorEnum.CONTINUE); +StartImportResponse response = asyncIndex.startImport(uri, "123-456-789", "continue"); ``` ## List imports diff --git a/codegen/add_configure_index_request_titles.sh b/codegen/add_configure_index_request_titles.sh new file mode 100755 index 00000000..0e415321 --- /dev/null +++ b/codegen/add_configure_index_request_titles.sh @@ -0,0 +1,142 @@ +#!/bin/bash + +set -eu -o pipefail + +# Simple script to add titles to nested objects in ConfigureIndexRequest schema +# Adds titles to the serverless and pod nested inline objects + +if [ $# -lt 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +file="$1" + +if [ ! -f "$file" ]; then + echo "Error: File does not exist: $file" + exit 1 +fi + +echo "Processing: $file" + +# Read file into array +lines=() +while IFS= read -r line || [ -n "$line" ]; do + lines+=("$line") +done < "$file" +total_lines=${#lines[@]} + +in_configure_index_request=false +changed=false +i=0 + +while [ $i -lt $total_lines ]; do + line="${lines[$i]}" + + # Detect ConfigureIndexRequest schema + if echo "$line" | grep -qE '^[[:space:]]*ConfigureIndexRequest:'; then + in_configure_index_request=true + fi + + # Check if we've left ConfigureIndexRequest (hit another top-level schema) + if [ "$in_configure_index_request" = true ]; then + if echo "$line" | grep -qE '^[[:space:]]*[A-Z][a-zA-Z0-9_]+:'; then + if ! echo "$line" | grep -qE '^[[:space:]]*ConfigureIndexRequest:'; then + in_configure_index_request=false + fi + fi + fi + + # Process nested objects within ConfigureIndexRequest + if [ "$in_configure_index_request" = true ]; then + # Look for "serverless:" or "pod:" property (standalone line ending with colon) + if echo "$line" | grep -qE '^[[:space:]]+(serverless|pod):[[:space:]]*$'; then + prop_name=$(echo "$line" | sed -E 's/^[[:space:]]+(serverless|pod):[[:space:]]*$/\1/') + prop_indent=$(echo "$line" | sed 's/^\([[:space:]]*\).*/\1/') + + # Look ahead for "type: object" that doesn't have a title + # Only check next 8 lines to avoid matching other properties + j=$((i + 1)) + found_type_object=false + type_object_idx=0 + + while [ $j -lt $total_lines ] && [ $j -lt $((i + 8)) ]; do + next_line="${lines[$j]}" + next_indent=$(echo "$next_line" | sed 's/^\([[:space:]]*\).*/\1/') + + # Stop if we've left this property block (less or equal indentation means different property) + if [ ${#next_indent} -le ${#prop_indent} ]; then + break + fi + + # Check for type: object (must be at same indent level as other property fields) + if echo "$next_line" | grep -qE '^[[:space:]]+type:[[:space:]]*object[[:space:]]*$'; then + found_type_object=true + type_object_idx=$j + + # Check if title already exists in next few lines + has_title=false + k=$((j + 1)) + while [ $k -lt $total_lines ] && [ $k -lt $((j + 5)) ]; do + check_line="${lines[$k]}" + check_indent=$(echo "$check_line" | sed 's/^\([[:space:]]*\).*/\1/') + + # Stop if we've left this object definition + if [ ${#check_indent} -le ${#next_indent} ]; then + break + fi + + if echo "$check_line" | grep -qE '^[[:space:]]+title:'; then + has_title=true + break + fi + if echo "$check_line" | grep -qE '^[[:space:]]+(properties|required|additionalProperties):'; then + break + fi + ((k++)) + done + + # Add title if needed + if [ "$has_title" = false ]; then + # Determine title based on property name + if [ "$prop_name" = "serverless" ]; then + title="ConfigureIndexRequestServerlessConfig" + elif [ "$prop_name" = "pod" ]; then + title="ConfigureIndexRequestPodBasedConfig" + else + break + fi + + # Get indentation from type: object line + indent=$(echo "${lines[$type_object_idx]}" | sed 's/\(^[[:space:]]*\).*/\1/') + + # Insert title after type: object + insert_idx=$((type_object_idx + 1)) + lines=("${lines[@]:0:$insert_idx}" "${indent}title: ${title}" "${lines[@]:$insert_idx}") + ((total_lines++)) + + changed=true + echo " Added title '${title}' to nested '${prop_name}' object at line $((insert_idx + 1))" + + # Skip ahead + ((i = j)) + break + fi + break + fi + + ((j++)) + done + fi + fi + + ((i++)) +done + +# Write back if changed +if [ "$changed" = true ]; then + printf '%s\n' "${lines[@]}" > "$file" + echo " File updated successfully" +else + echo " No changes needed (titles already exist)" +fi diff --git a/codegen/apis b/codegen/apis index a9158581..d5ac9319 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit a91585819b21bcd355fd76dab94546bb7908a008 +Subproject commit d5ac93191def1d9666946d2c0e67edd3140b0f0d diff --git a/codegen/buf.yaml b/codegen/buf.yaml index 63eb012b..ea9580df 100644 --- a/codegen/buf.yaml +++ b/codegen/buf.yaml @@ -9,4 +9,4 @@ breaking: deps: - buf.build/googleapis/googleapis modules: - - path: apis/_build/2025-04 \ No newline at end of file + - path: apis/_build/2025-10 \ No newline at end of file diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index 80829735..afff836a 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -97,11 +97,28 @@ generate_client() { fi } -update_apis_repo +process_oas_files() { + local version=$1 + echo "Making oneOf titles unique in OAS files" + oas_dir="codegen/apis/_build/${version}" + codegen/make_oneof_titles_unique.sh "$oas_dir" --pattern "*_${version}.oas.yaml" + + echo "Adding titles to nested objects in ConfigureIndexRequest" + # Only process db_control file + db_control_file="${oas_dir}/db_control_${version}.oas.yaml" + if [ -f "$db_control_file" ]; then + codegen/add_configure_index_request_titles.sh "$db_control_file" + else + echo " db_control_${version}.oas.yaml not found, skipping" + fi +} + +update_apis_repo $version verify_spec_version $version rm -rf "${destination}" mkdir -p "${destination}" +process_oas_files $version for module in "${modules[@]}"; do generate_client $module diff --git a/codegen/make_oneof_titles_unique.sh b/codegen/make_oneof_titles_unique.sh new file mode 100755 index 00000000..244119bd --- /dev/null +++ b/codegen/make_oneof_titles_unique.sh @@ -0,0 +1,302 @@ +#!/bin/bash + +set -eux -o pipefail + +# Script to make titles in oneOf blocks unique in YAML/OpenAPI specification files +# Pure shell script with no external dependencies + +if [ $# -lt 1 ]; then + echo "Usage: $0 [--pattern PATTERN]" + echo "" + echo "Options:" + echo " --pattern PATTERN Glob pattern for files when processing a directory (default: *.oas.yaml)" + exit 1 +fi + +TARGET_PATH="$1" +PATTERN="*.oas.yaml" + +# Parse arguments +shift +while [[ $# -gt 0 ]]; do + case $1 in + --pattern) + PATTERN="$2" + shift 2 + ;; + *) + echo "Unknown option: $1" + exit 1 + ;; + esac +done + +# Function to get indentation level (number of spaces before content) +get_indent() { + local line="$1" + echo "$line" | sed 's/^\([[:space:]]*\).*/\1/' | wc -c | tr -d ' ' +} + +# Function to make titles unique in a oneOf block +process_oneof_block() { + local file="$1" + local oneof_start_line="$2" + local tmp_file=$(mktemp) + local changed=false + + # Read the file and process the oneOf block + local in_oneof=false + local oneof_indent=0 + local current_indent=0 +} + +# Improved function that handles the file more carefully +process_yaml_file() { + local file="$1" + local tmp_file=$(mktemp) + local changed=false + + echo "Processing: $file" + + # Find all lines with oneOf: + local oneof_positions=$(awk '/oneOf:/ {print NR}' "$file") + + if [ -z "$oneof_positions" ]; then + echo " No oneOf blocks found" + rm -f "$tmp_file" + return 0 # No oneOf blocks is not an error + fi + + # Read entire file into array for processing + local lines=() + while IFS= read -r line || [ -n "$line" ]; do + lines+=("$line") + done < "$file" + local total_lines=${#lines[@]} + + # Process each oneOf block + while IFS= read -r oneof_line_num; do + local oneof_line_idx=$((oneof_line_num - 1)) + local oneof_line="${lines[$oneof_line_idx]}" + + # Get indentation of oneOf line + local oneof_indent=$(echo "$oneof_line" | sed 's/^\([[:space:]]*\).*/\1/' | wc -c) + oneof_indent=$((oneof_indent - 1)) + + # Find all titles in this oneOf block + local block_titles=() + local block_title_indices=() + + local i=$((oneof_line_idx + 1)) + while [ $i -lt $total_lines ]; do + local current_line="${lines[$i]}" + local current_indent=$(echo "$current_line" | sed 's/^\([[:space:]]*\).*/\1/' | wc -c) + current_indent=$((current_indent - 1)) + + # Stop if we've left the oneOf block (same or less indentation as oneOf) + if [ $current_indent -le $oneof_indent ]; then + # Check if this is still part of the oneOf (array item continuation) + if ! echo "$current_line" | grep -qE '^[[:space:]]+-'; then + break + fi + fi + + # Look for title lines + if echo "$current_line" | grep -qE '^[[:space:]]+- title:'; then + # Extract title value (handle quotes) + local title=$(echo "$current_line" | sed -E 's/^[[:space:]]+- title:[[:space:]]*["'\'']?([^"'\'']*)["'\'']?[[:space:]]*$/\1/' | sed -E 's/^[[:space:]]+- title:[[:space:]]*([^[:space:]].*)$/\1/') + block_titles+=("$title") + block_title_indices+=($i) + fi + + ((i++)) + done + + # Extract context for this oneOf block (schema name or property name) + # We add context to ALL titles to ensure global uniqueness + local context="" + + # Look backward to find schema name or property name + # Check if we're in a schema definition or within a property + # Skip example blocks and other content + for ((j=oneof_line_idx-1; j>=0; j--)); do + local prev_line="${lines[$j]}" + + # Skip example blocks and description blocks + if echo "$prev_line" | grep -qE '^[[:space:]]*(example|description|type|required|additionalProperties|properties):'; then + continue + fi + + # Look for schema name (e.g., "IndexSpec:") + # Schema names are typically PascalCase at the components/schemas level + if echo "$prev_line" | grep -qE '^[[:space:]]+[A-Z][A-Za-z0-9_]*:[[:space:]]*$'; then + context=$(echo "$prev_line" | sed -E 's/^[[:space:]]+([A-Z][A-Za-z0-9_]*):[[:space:]]*$/\1/') + break + fi + + # Look for property name (e.g., " spec:") + # Property names are typically camelCase or lowercase + # Must be at same or greater indentation than oneOf + if echo "$prev_line" | grep -qE '^[[:space:]]+[a-z_][a-z0-9_]*:[[:space:]]*$'; then + local prev_indent=$(echo "$prev_line" | sed 's/^\([[:space:]]*\).*/\1/' | wc -c) + prev_indent=$((prev_indent - 1)) + # Only consider properties at same level or above the oneOf + if [ $prev_indent -le $oneof_indent ]; then + local prop_name=$(echo "$prev_line" | sed -E 's/^[[:space:]]+([a-z_][a-z0-9_]*):[[:space:]]*$/\1/') + # Look further back for schema name (within last 100 lines to find parent schema) + local max_search=$((j > 100 ? j - 100 : 0)) + for ((k=j-1; k>=max_search; k--)); do + local schema_line="${lines[$k]}" + # Skip example, description, etc. + if echo "$schema_line" | grep -qE '^[[:space:]]*(example|description|type|required|additionalProperties|properties):'; then + continue + fi + # Schema names start with uppercase and are at components/schemas level + # Check if this is a schema definition (starts with uppercase, ends with colon, no content) + if echo "$schema_line" | grep -qE '^[[:space:]]+[A-Z][A-Za-z0-9_]*:[[:space:]]*$'; then + local schema_indent=$(echo "$schema_line" | sed 's/^\([[:space:]]*\).*/\1/' | wc -c) + schema_indent=$((schema_indent - 1)) + # Schema should be at same or less indentation than the property + if [ $schema_indent -le $prev_indent ]; then + local schema_name=$(echo "$schema_line" | sed -E 's/^[[:space:]]+([A-Z][A-Za-z0-9_]*):[[:space:]]*$/\1/') + # Use just the schema name (more semantic than schema + property) + context="$schema_name" + break + fi + fi + done + # If no schema found, use property name as fallback + if [ -z "$context" ]; then + context="$prop_name" + fi + break + fi + fi + done + + # Modify all titles to include context for global uniqueness + # Since parent names are unique, prepending them makes all titles unique + for idx in "${!block_title_indices[@]}"; do + local i=${block_title_indices[$idx]} + local title="${block_titles[$idx]}" + + # Use Java-friendly format (no spaces, PascalCase) + local new_title="" + + if [ -n "$context" ]; then + # Convert context to PascalCase + # If context already contains PascalCase words (schema names), preserve them + # Split on spaces, handle each word + local pascal_context="" + for word in $context; do + # Check if word is already PascalCase (starts with uppercase and has mixed case) + if echo "$word" | grep -qE '^[A-Z][a-z]'; then + # Already PascalCase, use as-is + pascal_context="${pascal_context}${word}" + else + # Convert to PascalCase: capitalize first letter, lowercase rest + local first=$(echo "$word" | cut -c1 | tr '[:lower:]' '[:upper:]') + local rest=$(echo "$word" | cut -c2- | tr '[:upper:]' '[:lower:]') + pascal_context="${pascal_context}${first}${rest}" + fi + done + + # Check if title already starts with the context (to prevent double-processing) + # Escape the context for regex matching and check if title already contains it + local escaped_context=$(echo "$pascal_context" | sed 's/[[\.*^$()+?{|]/\\&/g') + if echo "$title" | grep -qE "^${escaped_context}"; then + # Title already has context, don't add it again + new_title="$title" + else + # Prepend parent context without space (Java-friendly) + new_title="${pascal_context}${title}" + fi + else + # Fallback: keep original title if no context found + new_title="$title" + fi + + # Only update if the title actually changed + if [ "$new_title" != "$title" ]; then + local original_line="${lines[$i]}" + # Extract indentation from original line (preserve spaces/tabs) + local indent=$(echo "$original_line" | sed 's/\(^[[:space:]]*\).*/\1/') + + # Preserve quoting style + if echo "$original_line" | grep -qE '^[[:space:]]+- title:[[:space:]]*"'; then + lines[$i]="${indent}- title: \"${new_title}\"" + elif echo "$original_line" | grep -qE "^[[:space:]]+- title:[[:space:]]*'"; then + lines[$i]="${indent}- title: '${new_title}'" + else + lines[$i]="${indent}- title: ${new_title}" + fi + + changed=true + echo " Changed title '$title' to '$new_title' at line $((i+1))" + fi + done + done <<< "$oneof_positions" + + # Write back if changed + if [ "$changed" = true ]; then + printf '%s\n' "${lines[@]}" > "$tmp_file" + mv "$tmp_file" "$file" + echo " File updated successfully" + return 0 + else + rm -f "$tmp_file" + echo " No duplicate titles found" + return 0 # No changes is not an error + fi +} + +process_file() { + local file="$1" + + if [ ! -f "$file" ]; then + echo "Error: File does not exist: $file" + return 1 + fi + + process_yaml_file "$file" +} + +process_directory() { + local dir="$1" + local pattern="$2" + + if [ ! -d "$dir" ]; then + echo "Error: Directory does not exist: $dir" + exit 1 + fi + + local count=0 + local changed_count=0 + + # Find and process all matching files + while IFS= read -r -d '' file; do + count=$((count + 1)) + if process_file "$file"; then + changed_count=$((changed_count + 1)) + fi + done < <(find "$dir" -maxdepth 1 -type f -name "$pattern" -print0 2>/dev/null) + + if [ $count -eq 0 ]; then + echo "No files matching pattern '$pattern' found in $dir" + return + fi + + echo "" + echo "Processed $count file(s), made titles unique in $changed_count file(s)" +} + +# Main execution +if [ -f "$TARGET_PATH" ]; then + process_file "$TARGET_PATH" +elif [ -d "$TARGET_PATH" ]; then + process_directory "$TARGET_PATH" "$PATTERN" +else + echo "Error: Path is neither a file nor a directory: $TARGET_PATH" + exit 1 +fi + diff --git a/src/integration/java/io/pinecone/clients/ConnectionsMapTest.java b/src/integration/java/io/pinecone/clients/ConnectionsMapTest.java index 78bf3f6b..279f554c 100644 --- a/src/integration/java/io/pinecone/clients/ConnectionsMapTest.java +++ b/src/integration/java/io/pinecone/clients/ConnectionsMapTest.java @@ -6,7 +6,6 @@ import io.pinecone.helpers.RandomStringBuilder; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.openapitools.db_control.client.model.DeletionProtection; import org.openapitools.db_control.client.model.IndexModel; import java.util.HashMap; @@ -49,7 +48,7 @@ public void testMultipleIndexesWithMultipleClients() throws InterruptedException 3, "aws", "us-east-1", - DeletionProtection.DISABLED, + "disabled", tags); // Wait for index to be ready @@ -68,7 +67,7 @@ public void testMultipleIndexesWithMultipleClients() throws InterruptedException 3, "aws", "us-east-1", - DeletionProtection.DISABLED, + "disabled", tags); // Wait for index to be ready diff --git a/src/integration/java/io/pinecone/helpers/TestResourcesManager.java b/src/integration/java/io/pinecone/helpers/TestResourcesManager.java index e5079d3a..15ffe7c3 100644 --- a/src/integration/java/io/pinecone/helpers/TestResourcesManager.java +++ b/src/integration/java/io/pinecone/helpers/TestResourcesManager.java @@ -51,10 +51,10 @@ public class TestResourcesManager { ? "us-east4-gcp" : System.getenv("PINECONE_ENVIRONMENT"); private static final String metric = System.getenv("METRIC") == null - ? IndexModel.MetricEnum.DOTPRODUCT.toString() - : IndexModel.MetricEnum.valueOf(System.getenv("METRIC")).toString(); + ? "dotproduct" + : System.getenv("METRIC"); private static final String cloud = System.getenv("CLOUD") == null - ? ServerlessSpec.CloudEnum.AWS.toString() + ? "aws" : System.getenv("CLOUD"); private static final String region = System.getenv("REGION") == null ? "us-west-2" @@ -287,7 +287,8 @@ public String getOrCreatePodIndex() throws InterruptedException, PineconeExcepti String indexName = RandomStringBuilder.build("pod-index", 8); - podIndexModel = pineconeClient.createPodsIndex(indexName, dimension, environment, "p1.x1", metric); + PodSpecMetadataConfig metadataConfig = null; + podIndexModel = pineconeClient.createPodsIndex(indexName, dimension, environment, "p1.x1", metric, metadataConfig); waitUntilIndexIsReady(pineconeClient, indexName); // Additional sleep after index marked as ready to avoid "no healthy upstream" error @@ -320,7 +321,7 @@ public String getOrCreateServerlessIndex() throws InterruptedException, Pinecone tags.put("env", "testing"); serverlessIndexModel = pineconeClient.createServerlessIndex(indexName, metric, dimension, cloud, - region, DeletionProtection.DISABLED, tags); + region, "disabled", tags); waitUntilIndexIsReady(pineconeClient, indexName); // Explicitly wait after ready to avoid the "no healthy upstream" issue @@ -357,8 +358,8 @@ public String getOrCreateCollection() throws InterruptedException, PineconeExcep // Wait until collection is ready int timeWaited = 0; - CollectionModel.StatusEnum collectionReady = collectionModel.getStatus(); - while (collectionReady != CollectionModel.StatusEnum.READY && timeWaited < 120000) { + String collectionReady = collectionModel.getStatus().toLowerCase(); + while (collectionReady != "ready" && timeWaited < 120000) { logger.info("Waiting for collection " + collectionName + " to be ready. Waited " + timeWaited + " " + "milliseconds..."); Thread.sleep(5000); diff --git a/src/integration/java/io/pinecone/helpers/TestUtilities.java b/src/integration/java/io/pinecone/helpers/TestUtilities.java index 3f203ed9..6a65dc87 100644 --- a/src/integration/java/io/pinecone/helpers/TestUtilities.java +++ b/src/integration/java/io/pinecone/helpers/TestUtilities.java @@ -16,13 +16,13 @@ public static IndexModel waitUntilIndexIsReady(Pinecone pineconeClient, String i int waitedTimeMs = 0; int intervalMs = 2000; - while (index.getStatus().getState() != IndexModelStatus.StateEnum.READY) { + while (!index.getStatus().getState().equals("Ready")) { index = pineconeClient.describeIndex(indexName); if (waitedTimeMs >= totalMsToWait) { logger.info("WARNING: Index " + indexName + " not ready after " + waitedTimeMs + "ms"); break; } - if (index.getStatus().getState() == IndexModelStatus.StateEnum.READY) { + if (index.getStatus().getState().equals("Ready")) { logger.info("Index " + indexName + " is ready after " + waitedTimeMs + "ms"); Thread.sleep(20000); break; @@ -38,16 +38,91 @@ public static IndexModel waitUntilIndexIsReady(Pinecone pineconeClient, String i return waitUntilIndexIsReady(pineconeClient, indexName, 200000); } + /** + * Waits until the read capacity status is Ready for a serverless index. + * This is needed before configuring read capacity, as the API requires read capacity to be Ready before updates. + * + * @param pineconeClient The Pinecone client instance + * @param indexName The name of the index + * @param totalMsToWait Maximum time to wait in milliseconds + * @return The IndexModel with read capacity status Ready + * @throws InterruptedException if the thread is interrupted + */ + public static IndexModel waitUntilReadCapacityIsReady(Pinecone pineconeClient, String indexName, Integer totalMsToWait) throws InterruptedException { + IndexModel index = pineconeClient.describeIndex(indexName); + int waitedTimeMs = 0; + int intervalMs = 2000; + + while (true) { + // Check if index has serverless spec with read capacity + if (index.getSpec() != null && index.getSpec().getIndexModelServerless() != null) { + ServerlessSpecResponse serverless = index.getSpec().getIndexModelServerless().getServerless(); + if (serverless != null && serverless.getReadCapacity() != null) { + ReadCapacityResponse readCapacityResponse = serverless.getReadCapacity(); + ReadCapacityStatus status = null; + + // Get status from the appropriate response type + try { + ReadCapacityDedicatedSpecResponse dedicatedResponse = readCapacityResponse.getReadCapacityDedicatedSpecResponse(); + status = dedicatedResponse.getStatus(); + } catch (ClassCastException e) { + try { + ReadCapacityOnDemandSpecResponse onDemandResponse = readCapacityResponse.getReadCapacityOnDemandSpecResponse(); + status = onDemandResponse.getStatus(); + } catch (ClassCastException e2) { + logger.warn("Unknown read capacity response type for index " + indexName); + } + } + + if (status != null && "Ready".equals(status.getState())) { + logger.info("Read capacity for index " + indexName + " is ready after " + waitedTimeMs + "ms"); + break; + } + } else { + // If no read capacity is configured (OnDemand by default), consider it ready + logger.info("Index " + indexName + " has no read capacity configured (defaults to OnDemand), considering ready"); + break; + } + } else { + // Not a serverless index or spec not available yet + logger.info("Index " + indexName + " spec not available yet, waiting..."); + } + + if (waitedTimeMs >= totalMsToWait) { + logger.info("WARNING: Read capacity for index " + indexName + " not ready after " + waitedTimeMs + "ms"); + break; + } + + Thread.sleep(intervalMs); + waitedTimeMs += intervalMs; + logger.info("Waited " + waitedTimeMs + "ms for read capacity of " + indexName + " to get ready"); + index = pineconeClient.describeIndex(indexName); + } + return index; + } + + /** + * Waits until the read capacity status is Ready for a serverless index (default timeout: 200 seconds). + * + * @param pineconeClient The Pinecone client instance + * @param indexName The name of the index + * @return The IndexModel with read capacity status Ready + * @throws InterruptedException if the thread is interrupted + */ + public static IndexModel waitUntilReadCapacityIsReady(Pinecone pineconeClient, String indexName) throws InterruptedException { + return waitUntilReadCapacityIsReady(pineconeClient, indexName, 200000); + } + public static CollectionModel createCollection(Pinecone pineconeClient, String collectionName, String indexName, boolean waitUntilReady) throws InterruptedException { CollectionModel collection = pineconeClient.createCollection(collectionName, indexName); - assertEquals(collection.getStatus(), CollectionModel.StatusEnum.INITIALIZING); + assertEquals("Initializing", collection.getStatus()); // Wait until collection is ready if (waitUntilReady) { int timeWaited = 0; - CollectionModel.StatusEnum collectionReady = collection.getStatus(); - while (collectionReady != CollectionModel.StatusEnum.READY && timeWaited < 120000) { + String collectionReady = collection.getStatus(); + while (!collectionReady.equals("Ready") && timeWaited < 120000) { logger.info("Waiting for collection " + collectionName + " to be ready. Waited " + timeWaited + " " + "milliseconds..."); Thread.sleep(5000); diff --git a/src/integration/java/io/pinecone/integration/controlPlane/pod/CollectionTest.java b/src/integration/java/io/pinecone/integration/controlPlane/pod/CollectionTest.java index bd84d1b8..5903862d 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/pod/CollectionTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/pod/CollectionTest.java @@ -77,9 +77,9 @@ public void testIndexFromCollectionHappyPath() throws InterruptedException { // Verify collection can be described collection = pineconeClient.describeCollection(collectionName); - assertEquals(collection.getStatus(), CollectionModel.StatusEnum.READY); - assertEquals(collection.getDimension(), dimension); - assertNotEquals(collection.getVectorCount(), null); + assertEquals("ready", collection.getStatus()); + assertEquals(dimension, collection.getDimension()); + assertNotEquals(null, collection.getVectorCount()); assertTrue(collection.getSize() > 0); // Create index from collection @@ -94,13 +94,13 @@ public void testIndexFromCollectionHappyPath() throws InterruptedException { IndexModel indexDescription = pineconeClient.describeIndex(newIndexName); assertEquals(indexDescription.getName(), newIndexName); - assertEquals(indexDescription.getSpec().getPod().getSourceCollection(), collectionName); + assertEquals(indexDescription.getSpec().getIndexModelPodBased().getPod().getSourceCollection(), collectionName); // Wait to try and avoid "no healthy upstream" before interacting with the new index Thread.sleep(30000); // If the index is ready, validate contents - if (indexDescription.getStatus().getState() == IndexModelStatus.StateEnum.READY) { + if (indexDescription.getStatus().getState().equals("ready")) { // Set up new index data plane connection Index indexClient = pineconeClient.getIndexConnection(newIndexName); @@ -118,11 +118,11 @@ public void testIndexFromCollectionHappyPath() throws InterruptedException { public void testCreateIndexFromCollectionWithDiffMetric() throws InterruptedException { // Use a different metric than the source index String[] metrics = { - IndexModel.MetricEnum.COSINE.toString(), - IndexModel.MetricEnum.EUCLIDEAN.toString(), - IndexModel.MetricEnum.DOTPRODUCT.toString() + "cosine", + "euclidean", + "dotproduct" }; - String targetMetric = IndexModel.MetricEnum.COSINE.toString(); + String targetMetric = "cosine"; for (String metric : metrics) { if (!metric.equals(sourceIndexMetric)) { targetMetric = metric; diff --git a/src/integration/java/io/pinecone/integration/controlPlane/pod/ConfigureIndexTest.java b/src/integration/java/io/pinecone/integration/controlPlane/pod/ConfigureIndexTest.java index 151e2397..dac812f6 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/pod/ConfigureIndexTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/pod/ConfigureIndexTest.java @@ -5,16 +5,17 @@ import io.pinecone.exceptions.PineconeForbiddenException; import io.pinecone.exceptions.PineconeNotFoundException; import io.pinecone.helpers.TestResourcesManager; +import okhttp3.OkHttpClient; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.openapitools.db_control.client.model.DeletionProtection; import org.openapitools.db_control.client.model.IndexModel; -import org.openapitools.db_control.client.model.IndexModelStatus; import org.openapitools.db_control.client.model.PodSpec; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.concurrent.TimeUnit; + import static io.pinecone.helpers.AssertRetry.assertWithRetry; import static org.junit.jupiter.api.Assertions.*; @@ -24,6 +25,11 @@ public class ConfigureIndexTest { private static final Pinecone controlPlaneClient = new Pinecone .Builder(System.getenv("PINECONE_API_KEY")) .withSourceTag("pinecone_test") + .withOkHttpClient(new OkHttpClient.Builder() + .connectTimeout(10, TimeUnit.SECONDS) + .readTimeout(60, TimeUnit.SECONDS) + .writeTimeout(30, TimeUnit.SECONDS) + .build()) .build(); private static String indexName; @@ -37,7 +43,7 @@ private static void waitUntilIndexStateIsReady(String indexName) throws Interrup int timeWaited = 0; IndexModel index = controlPlaneClient.describeIndex(indexName); - while (index.getStatus().getState() != IndexModelStatus.StateEnum.READY && timeWaited <= timeToWaitMs) { + while (index.getStatus().getState() != "ready" && timeWaited <= timeToWaitMs) { Thread.sleep(2000); timeWaited += 2000; logger.info("waited 2000ms for index to upgrade, time waited: " + timeWaited); @@ -56,7 +62,7 @@ public void afterEach() throws InterruptedException { @Test public void configureIndexWithInvalidIndexName() { try { - controlPlaneClient.configurePodsIndex("non-existent-index", 3, DeletionProtection.DISABLED); + controlPlaneClient.configurePodsIndex("non-existent-index", 3, "disabled"); fail("Expected to throw PineconeNotFoundException"); } catch (PineconeNotFoundException expected) { @@ -67,7 +73,7 @@ public void configureIndexWithInvalidIndexName() { @Test public void configureIndexExceedingQuota() { try { - controlPlaneClient.configurePodsIndex(indexName, 30, DeletionProtection.DISABLED); + controlPlaneClient.configurePodsIndex(indexName, 30, "disabled"); fail("Expected to throw PineconeForbiddenException"); } catch (PineconeForbiddenException expected) { assertTrue(expected.getLocalizedMessage().contains("reached the max pods allowed")); @@ -77,25 +83,25 @@ public void configureIndexExceedingQuota() { @Test public void scaleUpAndDown() throws InterruptedException { IndexModel indexModel = controlPlaneClient.describeIndex(indexName); - assertNotNull(indexModel.getSpec().getPod()); - assertEquals(1, indexModel.getSpec().getPod().getReplicas()); + assertNotNull(indexModel.getSpec().getIndexModelPodBased().getPod()); + assertEquals(1, indexModel.getSpec().getIndexModelPodBased().getPod().getReplicas()); // Verify the scaled up replicas assertWithRetry(() -> { - controlPlaneClient.configurePodsIndex(indexName, 3, DeletionProtection.DISABLED); - PodSpec podSpec = controlPlaneClient.describeIndex(indexName).getSpec().getPod(); + controlPlaneClient.configurePodsIndex(indexName, 3, "disabled"); + PodSpec podSpec = controlPlaneClient.describeIndex(indexName).getSpec().getIndexModelPodBased().getPod(); assertNotNull(podSpec); - assertEquals(podSpec.getReplicas(), 3); + assertEquals(3, podSpec.getReplicas()); }); waitUntilIndexStateIsReady(indexName); // Verify replicas were scaled down assertWithRetry(() -> { - controlPlaneClient.configurePodsIndex(indexName, 1, DeletionProtection.DISABLED); - PodSpec podSpec = controlPlaneClient.describeIndex(indexName).getSpec().getPod(); + controlPlaneClient.configurePodsIndex(indexName, 1, "disabled"); + PodSpec podSpec = controlPlaneClient.describeIndex(indexName).getSpec().getIndexModelPodBased().getPod(); assertNotNull(podSpec); - assertEquals(podSpec.getReplicas(), 1); + assertEquals(1, podSpec.getReplicas()); }); } @@ -104,11 +110,11 @@ public void changingBasePodType() throws InterruptedException { try { // Verify the starting state IndexModel indexModel = controlPlaneClient.describeIndex(indexName); - assertNotNull(indexModel.getSpec().getPod()); - assertEquals(1, indexModel.getSpec().getPod().getReplicas()); + assertNotNull(indexModel.getSpec().getIndexModelPodBased().getPod()); + assertEquals(1, indexModel.getSpec().getIndexModelPodBased().getPod().getReplicas()); // Try to change the base pod type - controlPlaneClient.configurePodsIndex(indexName, "p2.x2"); + controlPlaneClient.configurePodsIndex(indexName, "p2.x2", null, "disabled", null); fail("Expected to throw PineconeBadRequestException"); } catch (PineconeBadRequestException expected) { @@ -120,16 +126,16 @@ public void changingBasePodType() throws InterruptedException { public void sizeIncrease() throws InterruptedException { // Verify the starting state IndexModel indexModel = controlPlaneClient.describeIndex(indexName); - assertNotNull(indexModel.getSpec().getPod()); - assertEquals("p1.x1", indexModel.getSpec().getPod().getPodType()); + assertNotNull(indexModel.getSpec().getIndexModelPodBased().getPod()); + assertEquals("p1.x1", indexModel.getSpec().getIndexModelPodBased().getPod().getPodType()); // Change the pod type to a larger one // Get the index description to verify the new pod type assertWithRetry(() -> { - controlPlaneClient.configurePodsIndex(indexName, "p1.x2"); - PodSpec podSpec = controlPlaneClient.describeIndex(indexName).getSpec().getPod(); + controlPlaneClient.configurePodsIndex(indexName, "p1.x2", null, "disabled", null); + PodSpec podSpec = controlPlaneClient.describeIndex(indexName).getSpec().getIndexModelPodBased().getPod(); assertNotNull(podSpec); - assertEquals(podSpec.getPodType(), "p1.x2"); + assertEquals("p1.x2", podSpec.getPodType()); }); } } diff --git a/src/integration/java/io/pinecone/integration/controlPlane/pod/CreateDescribeListAndDeleteIndexTest.java b/src/integration/java/io/pinecone/integration/controlPlane/pod/CreateDescribeListAndDeleteIndexTest.java index 2eea49fe..7b45d252 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/pod/CreateDescribeListAndDeleteIndexTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/pod/CreateDescribeListAndDeleteIndexTest.java @@ -26,7 +26,7 @@ public static void setUp() throws InterruptedException { indexName = indexManager.getOrCreatePodIndex(); indexDimension = indexManager.getDimension(); IndexModel podIndex = indexManager.getOrCreatePodIndexModel(); - indexPodType = podIndex.getSpec().getPod().getPodType(); + indexPodType = podIndex.getSpec().getIndexModelPodBased().getPod().getPodType(); } @Test @@ -36,9 +36,9 @@ public void describeAndListIndex() { assertNotNull(indexModel); assertEquals(indexDimension, indexModel.getDimension()); assertEquals(indexName, indexModel.getName()); - assertEquals(IndexModel.MetricEnum.DOTPRODUCT, indexModel.getMetric()); - assertNotNull(indexModel.getSpec().getPod()); - assertEquals(indexPodType, indexModel.getSpec().getPod().getPodType()); + assertEquals("dotproduct", indexModel.getMetric()); + assertNotNull(indexModel.getSpec().getIndexModelPodBased().getPod()); + assertEquals(indexPodType, indexModel.getSpec().getIndexModelPodBased().getPod().getPodType()); // List the index IndexList indexList = controlPlaneClient.listIndexes(); @@ -53,22 +53,23 @@ public void createPodsIndexWithMinimumRequiredParams() { String environment = "us-east-1-aws"; String podType = "p1.x1"; String metric = "cosine"; + PodSpecMetadataConfig metadataConfig = null; IndexModel podsIndex = controlPlaneClient.createPodsIndex(podIndexName, dimension, environment, podType, - metric); + metric, metadataConfig); assertEquals(podIndexName, podsIndex.getName()); assertEquals(dimension, podsIndex.getDimension()); - assertEquals(environment, podsIndex.getSpec().getPod().getEnvironment()); + assertEquals(environment, podsIndex.getSpec().getIndexModelPodBased().getPod().getEnvironment()); assertEquals(metric, podsIndex.getMetric().toString()); - assertEquals(podType, podsIndex.getSpec().getPod().getPodType()); + assertEquals(podType, podsIndex.getSpec().getIndexModelPodBased().getPod().getPodType()); // Confirm defaults are put in by the backend when not supplied by the user - assertEquals(IndexModel.MetricEnum.COSINE, podsIndex.getMetric()); - assertEquals(1, podsIndex.getSpec().getPod().getPods()); - assertEquals(1, podsIndex.getSpec().getPod().getReplicas()); - assertEquals(1, podsIndex.getSpec().getPod().getShards()); - assertNull(podsIndex.getSpec().getPod().getMetadataConfig()); - assertNull(podsIndex.getSpec().getPod().getSourceCollection()); + assertEquals("cosine", podsIndex.getMetric()); + assertEquals(1, podsIndex.getSpec().getIndexModelPodBased().getPod().getPods()); + assertEquals(1, podsIndex.getSpec().getIndexModelPodBased().getPod().getReplicas()); + assertEquals(1, podsIndex.getSpec().getIndexModelPodBased().getPod().getShards()); + assertNull(podsIndex.getSpec().getIndexModelPodBased().getPod().getMetadataConfig()); + assertNull(podsIndex.getSpec().getIndexModelPodBased().getPod().getSourceCollection()); // Cleanup controlPlaneClient.deleteIndex(podIndexName); diff --git a/src/integration/java/io/pinecone/integration/controlPlane/pod/DeletionProtectionTest.java b/src/integration/java/io/pinecone/integration/controlPlane/pod/DeletionProtectionTest.java index 2bcbea83..0aa14819 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/pod/DeletionProtectionTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/pod/DeletionProtectionTest.java @@ -5,7 +5,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import org.openapitools.db_control.client.model.DeletionProtection; import org.openapitools.db_control.client.model.IndexModel; @Disabled @@ -19,12 +18,12 @@ public class DeletionProtectionTest { public void createPodIndexWithDeletionProtectionEnabled() { String indexName = RandomStringBuilder.build("create-pod", 8); // Create pod index with deletion protection enabled - controlPlaneClient.createPodsIndex(indexName, 3, "us-east-1-aws", "p1.x1", DeletionProtection.ENABLED); + controlPlaneClient.createPodsIndex(indexName, 3, "us-east-1-aws", "p1.x1", "enabled"); IndexModel indexModel = controlPlaneClient.describeIndex(indexName); - DeletionProtection deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.ENABLED); + String deletionProtection = indexModel.getDeletionProtection(); + Assertions.assertEquals("enabled", deletionProtection); // Configure index to disable deletionProtection - controlPlaneClient.configurePodsIndex(indexName, DeletionProtection.DISABLED); + controlPlaneClient.configurePodsIndex(indexName, "disabled"); // Delete index controlPlaneClient.deleteIndex(indexName); } @@ -35,15 +34,15 @@ public void createPodIndexWithDeletionProtectionDisabled() { // Create pod index with deletion protection disabled controlPlaneClient.createPodsIndex(indexName, 3, "us-east-1-aws", "p1.x1"); IndexModel indexModel = controlPlaneClient.describeIndex(indexName); - DeletionProtection deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.DISABLED); + String deletionProtection = indexModel.getDeletionProtection(); + Assertions.assertEquals("disabled", deletionProtection); // Configure index to enable deletionProtection - controlPlaneClient.configurePodsIndex(indexName, DeletionProtection.ENABLED); + controlPlaneClient.configurePodsIndex(indexName, "enabled"); indexModel = controlPlaneClient.describeIndex(indexName); deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.ENABLED); + Assertions.assertEquals("enabled", deletionProtection); // Configure index to disable deletionProtection - controlPlaneClient.configurePodsIndex(indexName, DeletionProtection.DISABLED); + controlPlaneClient.configurePodsIndex(indexName, "disabled"); // Delete index controlPlaneClient.deleteIndex(indexName); } diff --git a/src/integration/java/io/pinecone/integration/controlPlane/serverless/CreateDescribeListAndDeleteIndexTest.java b/src/integration/java/io/pinecone/integration/controlPlane/serverless/CreateDescribeListAndDeleteIndexTest.java index 251fd853..196c6a22 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/serverless/CreateDescribeListAndDeleteIndexTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/serverless/CreateDescribeListAndDeleteIndexTest.java @@ -37,8 +37,8 @@ public void describeAndListIndex() { assertNotNull(indexModel); assertEquals(dimension, indexModel.getDimension()); assertEquals(indexName, indexModel.getName()); - assertEquals(IndexModel.MetricEnum.DOTPRODUCT, indexModel.getMetric()); - assertNotNull(indexModel.getSpec().getServerless()); + assertEquals("dotproduct", indexModel.getMetric()); + assertNotNull(indexModel.getSpec().getIndexModelServerless()); // List the index IndexList indexList = controlPlaneClient.listIndexes(); @@ -49,7 +49,7 @@ public void describeAndListIndex() { @Test public void createServerlessIndexWithInvalidName() { try { - controlPlaneClient.createServerlessIndex("Invalid-name", "cosine", 3, "aws", "us-west-2", DeletionProtection.DISABLED, null); + controlPlaneClient.createServerlessIndex("Invalid-name", "cosine", 3, "aws", "us-west-2", "disabled", null); fail("Expected to throw PineconeBadRequestException"); } catch (PineconeBadRequestException expected) { @@ -60,27 +60,17 @@ public void createServerlessIndexWithInvalidName() { @Test public void createServerlessIndexWithInvalidDimension() { try { - controlPlaneClient.createServerlessIndex("serverless-test-index", "cosine", -3, "aws", "us-west-2", DeletionProtection.DISABLED, null); + controlPlaneClient.createServerlessIndex("serverless-test-index", "cosine", -3, "aws", "us-west-2", "disabled", null); fail("Expected to throw PineconeValidationException"); } catch (PineconeValidationException expected) { assertTrue(expected.getLocalizedMessage().contains("Dimension must be greater than 0")); } } - @Test - public void createServerlessIndexWithInvalidCloud() { - try { - controlPlaneClient.createServerlessIndex("serverless-test-index", "cosine", 3, "blah", "us-west-2", DeletionProtection.DISABLED, null); - fail("Expected to throw PineconeValidationException"); - } catch (PineconeValidationException expected) { - assertTrue(expected.getLocalizedMessage().contains("Cloud cannot be null or empty. Must be one of " + Arrays.toString(ServerlessSpec.CloudEnum.values()))); - } - } - @Test public void createServerlessIndexWithInvalidRegion() { try { - controlPlaneClient.createServerlessIndex("serverless-test-index", "cosine", 3, "aws", "invalid-region", DeletionProtection.DISABLED, null); + controlPlaneClient.createServerlessIndex("serverless-test-index", "cosine", 3, "aws", "invalid-region", "disabled", null); fail("Expected to throw PineconeNotFoundException"); } catch (PineconeNotFoundException expected) { assertTrue(expected.getLocalizedMessage().contains("Resource cloud: aws region: invalid-region not found")); diff --git a/src/integration/java/io/pinecone/integration/controlPlane/serverless/DeletionProtectionTest.java b/src/integration/java/io/pinecone/integration/controlPlane/serverless/DeletionProtectionTest.java index 115802dd..5be96d13 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/serverless/DeletionProtectionTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/serverless/DeletionProtectionTest.java @@ -4,7 +4,6 @@ import io.pinecone.helpers.RandomStringBuilder; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.openapitools.db_control.client.model.DeletionProtection; import org.openapitools.db_control.client.model.IndexModel; import java.util.HashMap; @@ -22,11 +21,11 @@ public void createIndexWithDeletionProtectionEnabled() { HashMap expectedTags = new HashMap<>(); expectedTags.put("test", "deletion-protection-enabled"); // Create serverless index with deletion protection enabled - controlPlaneClient.createServerlessIndex(indexName, "cosine", 3, "aws", "us-west-2", DeletionProtection.ENABLED, expectedTags); + controlPlaneClient.createServerlessIndex(indexName, "cosine", 3, "aws", "us-west-2", "enabled", expectedTags); // Describe index to verify deletion protection is enabled IndexModel indexModel = controlPlaneClient.describeIndex(indexName); - DeletionProtection deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.ENABLED); + String deletionProtection = indexModel.getDeletionProtection(); + Assertions.assertEquals(deletionProtection, "enabled"); Map actualTags = indexModel.getTags(); Assertions.assertEquals(expectedTags, actualTags); } @@ -37,19 +36,19 @@ public void createPodIndexWithDeletionProtectionDisabled() { HashMap expectedTags = new HashMap<>(); expectedTags.put("test", "deletion-protection-disabled"); // Create serverless index with deletion protection disabled - controlPlaneClient.createServerlessIndex(indexName, "cosine", 3, "aws", "us-west-2", DeletionProtection.DISABLED, expectedTags); + controlPlaneClient.createServerlessIndex(indexName, "cosine", 3, "aws", "us-west-2", "disabled", expectedTags); IndexModel indexModel = controlPlaneClient.describeIndex(indexName); - DeletionProtection deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.DISABLED); + String deletionProtection = indexModel.getDeletionProtection(); + Assertions.assertEquals("disabled", deletionProtection); Map actualTags = indexModel.getTags(); Assertions.assertEquals(expectedTags, actualTags); // Configure index to enable deletionProtection - controlPlaneClient.configureServerlessIndex(indexName, DeletionProtection.ENABLED, expectedTags, null); + controlPlaneClient.configureServerlessIndex(indexName, "enabled", expectedTags, null); indexModel = controlPlaneClient.describeIndex(indexName); deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.ENABLED); + Assertions.assertEquals("enabled", deletionProtection); // Configure index to disable deletionProtection - controlPlaneClient.configureServerlessIndex(indexName, DeletionProtection.DISABLED, expectedTags, null); + controlPlaneClient.configureServerlessIndex(indexName, "disabled", expectedTags, null); // Delete index controlPlaneClient.deleteIndex(indexName); } diff --git a/src/integration/java/io/pinecone/integration/controlPlane/serverless/ReadCapacityAndSchemaTest.java b/src/integration/java/io/pinecone/integration/controlPlane/serverless/ReadCapacityAndSchemaTest.java new file mode 100644 index 00000000..24e8c19a --- /dev/null +++ b/src/integration/java/io/pinecone/integration/controlPlane/serverless/ReadCapacityAndSchemaTest.java @@ -0,0 +1,239 @@ +package io.pinecone.integration.controlPlane.serverless; + +import io.pinecone.clients.Pinecone; +import io.pinecone.helpers.RandomStringBuilder; +import okhttp3.OkHttpClient; +import org.junit.jupiter.api.*; +import org.openapitools.db_control.client.ApiException; +import org.openapitools.db_control.client.model.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import static io.pinecone.helpers.TestUtilities.waitUntilIndexIsReady; +import static io.pinecone.helpers.TestUtilities.waitUntilReadCapacityIsReady; +import static org.junit.jupiter.api.Assertions.*; + +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +public class ReadCapacityAndSchemaTest { + private static final Pinecone controlPlaneClient = new Pinecone + .Builder(System.getenv("PINECONE_API_KEY")) + .withSourceTag("pinecone_test") + .withOkHttpClient(new OkHttpClient.Builder() + .connectTimeout(30, TimeUnit.SECONDS) + .readTimeout(120, TimeUnit.SECONDS) + .writeTimeout(30, TimeUnit.SECONDS) + .build()) + .build(); + + @Test + @Order(1) + public void createServerlessIndexWithOnDemandReadCapacity() throws InterruptedException { + String indexNameOnDemand = RandomStringBuilder.build("ondemand-index", 8); + Map tags = new HashMap<>(); + tags.put("env", "test"); + tags.put("read-capacity", "ondemand"); + + // Create index with OnDemand read capacity + ReadCapacity readCapacity = new ReadCapacity(new ReadCapacityOnDemandSpec().mode("OnDemand")); + IndexModel indexModel = controlPlaneClient.createServerlessIndex( + indexNameOnDemand, "cosine", 1536, "aws", "us-west-2", + "disabled", tags, readCapacity, null); + + assertNotNull(indexModel); + assertEquals(indexNameOnDemand, indexModel.getName()); + assertEquals("cosine", indexModel.getMetric()); + assertEquals(1536, indexModel.getDimension()); + assertEquals("disabled", indexModel.getDeletionProtection()); + assertEquals(tags, indexModel.getTags()); + + // Wait for index to be ready and verify read capacity + waitUntilIndexIsReady(controlPlaneClient, indexNameOnDemand); + IndexModel describedIndex = controlPlaneClient.describeIndex(indexNameOnDemand); + assertNotNull(describedIndex.getSpec().getIndexModelServerless()); + // Note: Read capacity response may not be immediately available in describe + } + + @Test + @Order(2) + public void createServerlessIndexWithDedicatedReadCapacity() throws InterruptedException { + String indexNameDedicated = RandomStringBuilder.build("dedicated-index", 8); + Map tags = new HashMap<>(); + tags.put("env", "test"); + tags.put("read-capacity", "dedicated"); + + // Create index with Dedicated read capacity + ScalingConfigManual manual = new ScalingConfigManual().shards(2).replicas(2); + ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig() + .nodeType("t1") + .scaling("Manual") + .manual(manual); + ReadCapacity readCapacity = new ReadCapacity( + new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated)); + + IndexModel indexModel = controlPlaneClient.createServerlessIndex( + indexNameDedicated, "cosine", 1536, "aws", "us-west-2", + "disabled", tags, readCapacity, null); + + assertNotNull(indexModel); + assertEquals(indexNameDedicated, indexModel.getName()); + assertEquals("cosine", indexModel.getMetric()); + assertEquals(1536, indexModel.getDimension()); + assertEquals("disabled", indexModel.getDeletionProtection()); + assertEquals(tags, indexModel.getTags()); + + // Wait for index to be ready + waitUntilIndexIsReady(controlPlaneClient, indexNameDedicated); + } + + @Test + @Order(3) + public void createServerlessIndexWithMetadataSchema() throws InterruptedException { + String indexNameWithSchema = RandomStringBuilder.build("schema-index", 8); + Map tags = new HashMap<>(); + tags.put("env", "test"); + tags.put("schema", "configured"); + + // Create index with metadata schema + Map fields = new HashMap<>(); + fields.put("genre", new BackupModelSchemaFieldsValue().filterable(true)); + fields.put("year", new BackupModelSchemaFieldsValue().filterable(true)); + fields.put("description", new BackupModelSchemaFieldsValue().filterable(true)); + BackupModelSchema schema = new BackupModelSchema().fields(fields); + + IndexModel indexModel = controlPlaneClient.createServerlessIndex( + indexNameWithSchema, "cosine", 1536, "aws", "us-west-2", + "disabled", tags, null, schema); + + assertNotNull(indexModel); + assertEquals(indexNameWithSchema, indexModel.getName()); + assertEquals("cosine", indexModel.getMetric()); + assertEquals(1536, indexModel.getDimension()); + assertEquals("disabled", indexModel.getDeletionProtection()); + assertEquals(tags, indexModel.getTags()); + + // Wait for index to be ready + waitUntilIndexIsReady(controlPlaneClient, indexNameWithSchema); + } + + @Test + @Order(4) + public void createServerlessIndexWithBothReadCapacityAndSchema() throws InterruptedException { + String indexName = RandomStringBuilder.build("both-config-index", 8); + Map tags = new HashMap<>(); + tags.put("env", "test"); + + // Create index with both Dedicated read capacity and metadata schema + ScalingConfigManual manual = new ScalingConfigManual().shards(1).replicas(1); + ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig() + .nodeType("t1") + .scaling("Manual") + .manual(manual); + ReadCapacity readCapacity = new ReadCapacity( + new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated)); + + Map fields = new HashMap<>(); + fields.put("category", new BackupModelSchemaFieldsValue().filterable(true)); + fields.put("tags", new BackupModelSchemaFieldsValue().filterable(true)); + BackupModelSchema schema = new BackupModelSchema().fields(fields); + + IndexModel indexModel = controlPlaneClient.createServerlessIndex( + indexName, "cosine", 1536, "aws", "us-west-2", + "disabled", tags, readCapacity, schema); + + assertNotNull(indexModel); + assertEquals(indexName, indexModel.getName()); + assertEquals("cosine", indexModel.getMetric()); + assertEquals(1536, indexModel.getDimension()); + + // Wait for index to be ready + waitUntilIndexIsReady(controlPlaneClient, indexName); + + // Clean up + controlPlaneClient.deleteIndex(indexName); + } + + @Test + @Order(5) + public void createIndexForModelWithReadCapacityAndSchema() throws InterruptedException, ApiException { + String indexNameForModel = RandomStringBuilder.build("model-index", 8); + Map tags = new HashMap<>(); + tags.put("env", "test"); + + // Create index for model with Dedicated read capacity and metadata schema + ScalingConfigManual manual = new ScalingConfigManual().shards(1).replicas(1); + ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig() + .nodeType("t1") + .scaling("Manual") + .manual(manual); + ReadCapacity readCapacity = new ReadCapacity( + new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated)); + + Map fields = new HashMap<>(); + fields.put("category", new BackupModelSchemaFieldsValue().filterable(true)); + BackupModelSchema schema = new BackupModelSchema().fields(fields); + + CreateIndexForModelRequestEmbed embed = new CreateIndexForModelRequestEmbed(); + embed.model("multilingual-e5-large"); + Map fieldMap = new HashMap<>(); + fieldMap.put("text", "my-sample-text"); + embed.fieldMap(fieldMap); + + IndexModel indexModel = controlPlaneClient.createIndexForModel( + indexNameForModel, "aws", "us-east-1", embed, + "disabled", tags, readCapacity, schema); + + assertNotNull(indexModel); + assertEquals(indexNameForModel, indexModel.getName()); + assertEquals("disabled", indexModel.getDeletionProtection()); + assertEquals(tags, indexModel.getTags()); + + // Wait for index to be ready + waitUntilIndexIsReady(controlPlaneClient, indexNameForModel); + } + + @Test + @Order(6) + public void configureReadCapacityOnExistingIndex() throws InterruptedException { + String indexNameToConfigure = RandomStringBuilder.build("configure-index", 8); + Map tags = new HashMap<>(); + tags.put("env", "test"); + + // First, create an index without read capacity configuration (defaults to OnDemand) + IndexModel indexModel = controlPlaneClient.createServerlessIndex( + indexNameToConfigure, "cosine", 1536, "aws", "us-west-2", + "disabled", tags, null, null); + + assertNotNull(indexModel); + assertEquals(indexNameToConfigure, indexModel.getName()); + + // Wait for index to be ready + waitUntilIndexIsReady(controlPlaneClient, indexNameToConfigure); + // Wait for read capacity to be ready before configuring + waitUntilReadCapacityIsReady(controlPlaneClient, indexNameToConfigure); + + // Configure to Dedicated read capacity + IndexModel configuredIndex = controlPlaneClient.configureServerlessIndex( + indexNameToConfigure, "disabled", tags, null, "Dedicated", "t1", 2, 2); + + assertNotNull(configuredIndex); + assertEquals(indexNameToConfigure, configuredIndex.getName()); + + // Wait a bit for configuration to apply + Thread.sleep(10000); + + // Verify the configuration by describing the index + IndexModel describedIndex = controlPlaneClient.describeIndex(indexNameToConfigure); + assertNotNull(describedIndex); + assertEquals(indexNameToConfigure, describedIndex.getName()); + } + + // Note: Tests for switching read capacity modes and scaling are omitted due to API rate limits. + // Read capacity settings can only be updated once per hour per index. The following scenarios + // would require multiple configurations on the same index and would hit rate limits: + // - Switching from Dedicated to OnDemand + // - Scaling dedicated read capacity (changing shards/replicas) + // These operations are still supported by the API, but cannot be tested in CI/CD due to rate limits. +} + diff --git a/src/integration/java/io/pinecone/integration/controlPlane/serverless/SparseIndexTest.java b/src/integration/java/io/pinecone/integration/controlPlane/serverless/SparseIndexTest.java index fc5ff0e3..9e6d769c 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/serverless/SparseIndexTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/serverless/SparseIndexTest.java @@ -7,7 +7,6 @@ import io.pinecone.proto.UpsertResponse; import io.pinecone.unsigned_indices_model.QueryResponseWithUnsignedIndices; import org.junit.jupiter.api.*; -import org.openapitools.db_control.client.model.DeletionProtection; import org.openapitools.db_control.client.model.IndexModel; import java.util.*; @@ -39,14 +38,14 @@ public void createSparseIndex() { IndexModel indexModel = pinecone.createSparseServelessIndex(indexName, "aws", "us-east-1", - DeletionProtection.ENABLED, + "enabled", tags, "sparse"); assertNotNull(indexModel); assertEquals(indexName, indexModel.getName()); - assertEquals(IndexModel.MetricEnum.DOTPRODUCT, indexModel.getMetric()); - assertEquals(indexModel.getDeletionProtection(), DeletionProtection.ENABLED); + assertEquals("dotproduct", indexModel.getMetric()); + assertEquals(indexModel.getDeletionProtection(), "enabled"); assertEquals(indexModel.getTags(), tags); assertEquals(indexModel.getVectorType(), "sparse"); } @@ -63,12 +62,12 @@ public void configureSparseIndex() throws InterruptedException { waitUntilIndexIsReady(pinecone, indexName, 200000); // Disable deletion protection and add more index tags - pinecone.configureServerlessIndex(indexName, DeletionProtection.DISABLED, tags, null); + pinecone.configureServerlessIndex(indexName, "disabled", tags, null); Thread.sleep(7000); // Describe index to confirm deletion protection is disabled IndexModel indexModel = pinecone.describeIndex(indexName); - assertEquals(indexModel.getDeletionProtection(), DeletionProtection.DISABLED); + assertEquals(indexModel.getDeletionProtection(), "disabled"); assert indexModel.getTags() != null; assertEquals(indexModel.getTags().get(key), value); } @@ -87,12 +86,12 @@ public void upsertAndQueryVectors() { values.add(2f); UpsertResponse upsertResponse = index.upsert("v1", Collections.emptyList(), indices, values, null, ""); - assertEquals(upsertResponse.getUpsertedCount(), 1); + assertEquals(1, upsertResponse.getUpsertedCount()); // Query by vector id QueryResponseWithUnsignedIndices queryResponse = index.queryByVectorId(1, id, true, false); - assertEquals(queryResponse.getMatchesList().size(), 1); - assertEquals(queryResponse.getMatches(0).getId(), id); + assertEquals(1, queryResponse.getMatchesList().size()); + assertEquals(id, queryResponse.getMatches(0).getId()); assertEquals(queryResponse.getMatches(0).getSparseValuesWithUnsignedIndices().getIndicesWithUnsigned32IntList(), indices); assertEquals(queryResponse.getMatches(0).getSparseValuesWithUnsignedIndices().getValuesList(), values); } diff --git a/src/integration/java/io/pinecone/integration/dataPlane/FetchAndUpdateByMetadataTest.java b/src/integration/java/io/pinecone/integration/dataPlane/FetchAndUpdateByMetadataTest.java new file mode 100644 index 00000000..43377195 --- /dev/null +++ b/src/integration/java/io/pinecone/integration/dataPlane/FetchAndUpdateByMetadataTest.java @@ -0,0 +1,158 @@ +package io.pinecone.integration.dataPlane; + +import com.google.protobuf.Struct; +import com.google.protobuf.Value; +import io.pinecone.clients.AsyncIndex; +import io.pinecone.clients.Index; +import io.pinecone.helpers.RandomStringBuilder; +import io.pinecone.helpers.TestResourcesManager; +import io.pinecone.proto.FetchByMetadataResponse; +import io.pinecone.proto.UpdateResponse; +import io.pinecone.unsigned_indices_model.VectorWithUnsignedIndices; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; + +import static io.pinecone.helpers.AssertRetry.assertWithRetry; +import static io.pinecone.helpers.BuildUpsertRequest.*; +import static org.junit.jupiter.api.Assertions.*; + +public class FetchAndUpdateByMetadataTest { + + private static final TestResourcesManager indexManager = TestResourcesManager.getInstance(); + private static Index index; + private static AsyncIndex asyncIndex; + private static final String namespace = RandomStringBuilder.build("ns", 8); + + @BeforeAll + public static void setUp() throws InterruptedException { + int dimension = indexManager.getDimension(); + index = indexManager.getOrCreateServerlessIndexConnection(); + asyncIndex = indexManager.getOrCreateServerlessAsyncIndexConnection(); + + // Upsert vectors with metadata for testing + int numOfVectors = 5; + List upsertIds = getIdsList(numOfVectors); + List vectorsToUpsert = new ArrayList<>(numOfVectors); + + // Upsert vectors with different metadata values + for (int i = 0; i < numOfVectors; i++) { + Struct metadata = generateMetadataStruct(i % 3, (i + 1) % 3); + VectorWithUnsignedIndices vector = new VectorWithUnsignedIndices( + upsertIds.get(i), + generateVectorValuesByDimension(dimension), + metadata, + null + ); + vectorsToUpsert.add(vector); + } + + index.upsert(vectorsToUpsert, namespace); + + // Wait for vectors to be indexed + Thread.sleep(5000); + } + + @AfterAll + public static void cleanUp() { + index.close(); + asyncIndex.close(); + } + + @Test + public void fetchByMetadataSyncTest() throws InterruptedException { + HashMap> metadataMap = createAndGetMetadataMap(); + String filterValue = metadataMap.get(metadataFields[0]).get(0); + + Struct filter = Struct.newBuilder() + .putFields(metadataFields[0], Value.newBuilder() + .setStructValue(Struct.newBuilder() + .putFields("$eq", Value.newBuilder() + .setStringValue(filterValue) + .build())) + .build()) + .build(); + + assertWithRetry(() -> { + FetchByMetadataResponse response = index.fetchByMetadata(namespace, filter, 10, null); + assertNotNull(response); + assertTrue(response.getVectorsCount() > 0); + }, 3); + } + + @Test + public void updateByMetadataSyncTest() throws InterruptedException { + HashMap> metadataMap = createAndGetMetadataMap(); + String filterValue = metadataMap.get(metadataFields[0]).get(0); + + Struct filter = Struct.newBuilder() + .putFields(metadataFields[0], Value.newBuilder() + .setStructValue(Struct.newBuilder() + .putFields("$eq", Value.newBuilder() + .setStringValue(filterValue) + .build())) + .build()) + .build(); + + Struct newMetadata = Struct.newBuilder() + .putFields("updated", Value.newBuilder().setStringValue("true").build()) + .build(); + + assertWithRetry(() -> { + UpdateResponse response = index.updateByMetadata(filter, newMetadata, namespace, false); + assertNotNull(response); + assertTrue(response.getMatchedRecords() > 0); + }, 3); + } + + @Test + public void fetchByMetadataAsyncTest() throws InterruptedException, ExecutionException { + HashMap> metadataMap = createAndGetMetadataMap(); + String filterValue = metadataMap.get(metadataFields[1]).get(0); + + Struct filter = Struct.newBuilder() + .putFields(metadataFields[1], Value.newBuilder() + .setStructValue(Struct.newBuilder() + .putFields("$eq", Value.newBuilder() + .setStringValue(filterValue) + .build())) + .build()) + .build(); + + assertWithRetry(() -> { + FetchByMetadataResponse response = asyncIndex.fetchByMetadata(namespace, filter, 10, null).get(); + assertNotNull(response); + assertTrue(response.getVectorsCount() > 0); + }, 3); + } + + @Test + public void updateByMetadataAsyncTest() throws InterruptedException, ExecutionException { + HashMap> metadataMap = createAndGetMetadataMap(); + String filterValue = metadataMap.get(metadataFields[1]).get(0); + + Struct filter = Struct.newBuilder() + .putFields(metadataFields[1], Value.newBuilder() + .setStructValue(Struct.newBuilder() + .putFields("$eq", Value.newBuilder() + .setStringValue(filterValue) + .build())) + .build()) + .build(); + + Struct newMetadata = Struct.newBuilder() + .putFields("async_updated", Value.newBuilder().setStringValue("true").build()) + .build(); + + assertWithRetry(() -> { + UpdateResponse response = asyncIndex.updateByMetadata(filter, newMetadata, namespace, false).get(); + assertNotNull(response); + assertTrue(response.getMatchedRecords() > 0); + }, 3); + } +} diff --git a/src/integration/java/io/pinecone/integration/dataPlane/NamespacesTest.java b/src/integration/java/io/pinecone/integration/dataPlane/NamespacesTest.java index 5ed28256..dfd61de8 100644 --- a/src/integration/java/io/pinecone/integration/dataPlane/NamespacesTest.java +++ b/src/integration/java/io/pinecone/integration/dataPlane/NamespacesTest.java @@ -5,6 +5,7 @@ import io.pinecone.helpers.RandomStringBuilder; import io.pinecone.helpers.TestResourcesManager; import io.pinecone.proto.ListNamespacesResponse; +import io.pinecone.proto.NamespaceDescription; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; @@ -12,6 +13,8 @@ import static io.pinecone.helpers.BuildUpsertRequest.generateVectorValuesByDimension; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public class NamespacesTest { private static final TestResourcesManager indexManager = TestResourcesManager.getInstance(); @@ -27,12 +30,19 @@ public static void cleanUp() { @Test public void namespacesSyncTest() throws InterruptedException { - String[] namespaces = new String[3]; + String[] namespaces = new String[4]; index = indexManager.getOrCreateServerlessIndexConnection(); ListNamespacesResponse listNamespacesResponse = index.listNamespaces(); int namespaceCount = listNamespacesResponse.getNamespacesCount(); - for(int i=0; i<3; i++) { + // Create namespace explicitly using createNamespace + namespaces[0] = RandomStringBuilder.build("namespace-", 3); + NamespaceDescription createdNamespace = index.createNamespace(namespaces[0]); + assertNotNull(createdNamespace); + assertEquals(namespaces[0], createdNamespace.getName()); + + // Create namespaces implicitly by upserting vectors + for (int i=1; i<4; i++) { namespaces[i] = RandomStringBuilder.build("namespace-", 3); index.upsert("v"+i, generateVectorValuesByDimension(dimension), namespaces[i]); } @@ -40,7 +50,7 @@ public void namespacesSyncTest() throws InterruptedException { // wait for vectors to be upserted Thread.sleep(5000); listNamespacesResponse = index.listNamespaces(); - assertEquals(listNamespacesResponse.getNamespacesCount(), namespaceCount + 3); + assertEquals(listNamespacesResponse.getNamespacesCount(), namespaceCount + 4); index.describeNamespace(namespaces[0]); index.deleteNamespace(namespaces[0]); @@ -48,18 +58,43 @@ public void namespacesSyncTest() throws InterruptedException { // wait for namespace to be deleted Thread.sleep(3000); listNamespacesResponse = index.listNamespaces(); - assertEquals(listNamespacesResponse.getNamespacesCount(), namespaceCount + 2); + assertEquals(listNamespacesResponse.getNamespacesCount(), namespaceCount + 3); + + // Test prefix filtering and total count + String prefix = "namespace-"; + ListNamespacesResponse prefixResponse = index.listNamespaces(prefix, null, 100); + assertNotNull(prefixResponse); + assertTrue(prefixResponse.getTotalCount() >= 3, "totalCount should be at least 3"); + assertTrue(prefixResponse.getNamespacesCount() >= 3, "Should return at least 3 namespaces with prefix"); + + // Verify all returned namespaces start with the prefix + for (int i = 0; i < prefixResponse.getNamespacesCount(); i++) { + String namespaceName = prefixResponse.getNamespaces(i).getName(); + assertTrue(namespaceName.startsWith(prefix), + "Namespace " + namespaceName + " should start with prefix " + prefix); + } + + // Verify totalCount is at least the number of namespaces returned + assertTrue(prefixResponse.getTotalCount() >= prefixResponse.getNamespacesCount(), + "totalCount should be at least equal to the number of namespaces returned"); } @Test public void namespacesAsyncTest() throws InterruptedException, ExecutionException { - String[] namespaces = new String[3]; + String[] namespaces = new String[4]; asyncIndex = indexManager.getOrCreateServerlessAsyncIndexConnection(); ListNamespacesResponse listNamespacesResponse = asyncIndex.listNamespaces().get(); int namespaceCount = listNamespacesResponse.getNamespacesCount(); - for(int i=0; i<3; i++) { + // Create namespace explicitly using createNamespace + namespaces[0] = RandomStringBuilder.build("namespace-", 3); + NamespaceDescription createdNamespace = asyncIndex.createNamespace(namespaces[0]).get(); + assertNotNull(createdNamespace); + assertEquals(namespaces[0], createdNamespace.getName()); + + // Create namespaces implicitly by upserting vectors + for (int i=1; i<4; i++) { namespaces[i] = RandomStringBuilder.build("namespace-", 3); asyncIndex.upsert("v"+i, generateVectorValuesByDimension(dimension), namespaces[i]); } @@ -67,7 +102,7 @@ public void namespacesAsyncTest() throws InterruptedException, ExecutionExceptio // wait for vectors to be upserted Thread.sleep(5000); listNamespacesResponse = asyncIndex.listNamespaces().get(); - assertEquals(listNamespacesResponse.getNamespacesCount(), namespaceCount + 3); + assertEquals(listNamespacesResponse.getNamespacesCount(), namespaceCount + 4); asyncIndex.describeNamespace(namespaces[0]); asyncIndex.deleteNamespace(namespaces[0]); @@ -75,6 +110,24 @@ public void namespacesAsyncTest() throws InterruptedException, ExecutionExceptio // wait for namespace to be deleted Thread.sleep(3000); listNamespacesResponse = asyncIndex.listNamespaces().get(); - assertEquals(listNamespacesResponse.getNamespacesCount(), namespaceCount + 2); + assertEquals(listNamespacesResponse.getNamespacesCount(), namespaceCount + 3); + + // Test prefix filtering and total count + String prefix = "namespace-"; + ListNamespacesResponse prefixResponse = asyncIndex.listNamespaces(prefix, null, 100).get(); + assertNotNull(prefixResponse); + assertTrue(prefixResponse.getTotalCount() >= 3, "totalCount should be at least 3"); + assertTrue(prefixResponse.getNamespacesCount() >= 3, "Should return at least 3 namespaces with prefix"); + + // Verify all returned namespaces start with the prefix + for (int i = 0; i < prefixResponse.getNamespacesCount(); i++) { + String namespaceName = prefixResponse.getNamespaces(i).getName(); + assertTrue(namespaceName.startsWith(prefix), + "Namespace " + namespaceName + " should start with prefix " + prefix); + } + + // Verify totalCount is at least the number of namespaces returned + assertTrue(prefixResponse.getTotalCount() >= prefixResponse.getNamespacesCount(), + "totalCount should be at least equal to the number of namespaces returned"); } -} +} \ No newline at end of file diff --git a/src/integration/java/io/pinecone/integration/dataPlane/UpsertAndSearchRecordsTest.java b/src/integration/java/io/pinecone/integration/dataPlane/UpsertAndSearchRecordsTest.java index 0857c9ce..2a82b20a 100644 --- a/src/integration/java/io/pinecone/integration/dataPlane/UpsertAndSearchRecordsTest.java +++ b/src/integration/java/io/pinecone/integration/dataPlane/UpsertAndSearchRecordsTest.java @@ -5,9 +5,7 @@ import io.pinecone.helpers.RandomStringBuilder; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.openapitools.db_control.client.model.CreateIndexForModelRequest; import org.openapitools.db_control.client.model.CreateIndexForModelRequestEmbed; -import org.openapitools.db_control.client.model.DeletionProtection; import org.openapitools.db_data.client.ApiException; import org.openapitools.db_data.client.model.SearchRecordsRequestQuery; import org.openapitools.db_data.client.model.SearchRecordsRequestRerank; @@ -25,7 +23,7 @@ public void upsertAndSearchRecordsTest() throws ApiException, org.openapitools.d CreateIndexForModelRequestEmbed embed = new CreateIndexForModelRequestEmbed() .model("multilingual-e5-large") .fieldMap(fieldMap); - pinecone.createIndexForModel(indexName, CreateIndexForModelRequest.CloudEnum.AWS, "us-west-2", embed, DeletionProtection.DISABLED, new HashMap<>()); + pinecone.createIndexForModel(indexName, "aws", "us-west-2", embed, "disabled", new HashMap<>()); // Wait for index to be created Thread.sleep(10000); diff --git a/src/main/java/io/pinecone/clients/AsyncIndex.java b/src/main/java/io/pinecone/clients/AsyncIndex.java index 9a217ab6..08551a20 100644 --- a/src/main/java/io/pinecone/clients/AsyncIndex.java +++ b/src/main/java/io/pinecone/clients/AsyncIndex.java @@ -9,15 +9,20 @@ import io.pinecone.configs.PineconeConnection; import io.pinecone.exceptions.PineconeValidationException; import io.pinecone.proto.*; +import io.pinecone.proto.CreateNamespaceRequest; import io.pinecone.proto.DeleteRequest; import io.pinecone.proto.DescribeIndexStatsRequest; import io.pinecone.proto.FetchResponse; +import io.pinecone.proto.FetchByMetadataRequest; +import io.pinecone.proto.FetchByMetadataResponse; import io.pinecone.proto.ListNamespacesResponse; import io.pinecone.proto.ListResponse; +import io.pinecone.proto.MetadataSchema; import io.pinecone.proto.NamespaceDescription; import io.pinecone.proto.QueryRequest; import io.pinecone.proto.QueryResponse; import io.pinecone.proto.UpdateRequest; +import io.pinecone.proto.UpdateResponse; import io.pinecone.proto.UpsertRequest; import io.pinecone.proto.UpsertResponse; import io.pinecone.unsigned_indices_model.QueryResponseWithUnsignedIndices; @@ -635,6 +640,80 @@ public ListenableFuture fetch(List ids, return asyncStub.fetch(fetchRequest); } + /** + * Fetches vectors by metadata filter from a specified namespace. + *

+ * Example: + *

{@code
+     *     import io.pinecone.proto.FetchByMetadataResponse;
+     *     import com.google.protobuf.Struct;
+     *     import com.google.protobuf.Value;
+     *     import com.google.common.util.concurrent.ListenableFuture;
+     *
+     *     ...
+     *
+     *     Struct filter = Struct.newBuilder()
+     *         .putFields("genre", Value.newBuilder().setStringValue("action").build())
+     *         .build();
+     *
+     *     ListenableFuture futureResponse =
+     *     asyncIndex.fetchByMetadata("example-namespace", filter);
+     * }
+ * + * @param namespace The namespace to fetch vectors from. + * @param filter A metadata filter expression. Only vectors matching this filter will be returned. + * @return A {@link ListenableFuture} of {@link FetchByMetadataResponse} containing the fetched vectors that match the filter. + */ + public ListenableFuture fetchByMetadata(String namespace, Struct filter) { + return fetchByMetadata(namespace, filter, null, null); + } + + /** + * Fetches vectors by metadata filter from a specified namespace with optional limit and pagination. + *

+ * Example: + *

{@code
+     *     import io.pinecone.proto.FetchByMetadataResponse;
+     *     import com.google.protobuf.Struct;
+     *     import com.google.protobuf.Value;
+     *     import com.google.common.util.concurrent.ListenableFuture;
+     *     import com.google.common.util.concurrent.Futures;
+     *
+     *     ...
+     *
+     *     Struct filter = Struct.newBuilder()
+     *         .putFields("genre", Value.newBuilder().setStringValue("action").build())
+     *         .build();
+     *
+     *     // Fetch with limit
+     *     ListenableFuture futureResponse =
+     *     asyncIndex.fetchByMetadata("example-namespace", filter, 100, null);
+     *
+     *     // Fetch with pagination
+     *     String paginationToken = null;
+     *     ListenableFuture futureResponse =
+     *     asyncIndex.fetchByMetadata("example-namespace", filter, 100, paginationToken);
+     *     FetchByMetadataResponse fetchResponse = Futures.getUnchecked(futureResponse);
+     *
+     *     // Continue pagination if needed
+     *     if (fetchResponse.hasPagination() && !fetchResponse.getPagination().getNext().isEmpty()) {
+     *         ListenableFuture nextPageFuture =
+     *         asyncIndex.fetchByMetadata("example-namespace", filter, 100, fetchResponse.getPagination().getNext());
+     *     }
+     * }
+ * + * @param namespace The namespace to fetch vectors from. + * @param filter A metadata filter expression. Only vectors matching this filter will be returned. + * @param limit The maximum number of vectors to return. If null, no limit is applied. + * @param paginationToken The token to continue a previous listing operation. If null, starts from the beginning. + * @return A {@link ListenableFuture} of {@link FetchByMetadataResponse} containing the fetched vectors that match the filter. + */ + public ListenableFuture fetchByMetadata(String namespace, Struct filter, Integer limit, String paginationToken) { + FetchByMetadataRequest fetchByMetadataRequest = validateFetchByMetadataRequest(namespace, filter, limit, paginationToken); + + return asyncStub.fetchByMetadata(fetchByMetadataRequest); + } + /** * {@inheritDoc} *

@@ -714,6 +793,79 @@ public ListenableFuture update(String id, return asyncStub.update(updateRequest); } + /** + * {@inheritDoc} + *

+ * Example: + *

{@code
+     *     import io.pinecone.proto.UpdateResponse;
+     *     import com.google.protobuf.Struct;
+     *     import com.google.protobuf.Value;
+     *     import com.google.common.util.concurrent.ListenableFuture;
+     *
+     *     ...
+     *
+     *     Struct filter = Struct.newBuilder()
+     *         .putFields("genre", Value.newBuilder().setStringValue("action").build())
+     *         .build();
+     *
+     *     Struct metadata = Struct.newBuilder()
+     *         .putFields("year", Value.newBuilder().setNumberValue(2020).build())
+     *         .build();
+     *
+     *     ListenableFuture listenableFuture =
+     *     asyncIndex.updateByMetadata(filter, metadata, "example-namespace");
+     * }
+ */ + @Override + public ListenableFuture updateByMetadata(Struct filter, + Struct metadata, + String namespace) { + return updateByMetadata(filter, metadata, namespace, false); + } + + /** + * {@inheritDoc} + *

+ * Example: + *

{@code
+     *     import io.pinecone.proto.UpdateResponse;
+     *     import com.google.protobuf.Struct;
+     *     import com.google.protobuf.Value;
+     *     import com.google.common.util.concurrent.ListenableFuture;
+     *     import com.google.common.util.concurrent.Futures;
+     *
+     *     ...
+     *
+     *     Struct filter = Struct.newBuilder()
+     *         .putFields("genre", Value.newBuilder().setStringValue("action").build())
+     *         .build();
+     *
+     *     Struct metadata = Struct.newBuilder()
+     *         .putFields("year", Value.newBuilder().setNumberValue(2020).build())
+     *         .build();
+     *
+     *     // Dry run to check how many records would be updated
+     *     ListenableFuture futureResponse =
+     *     asyncIndex.updateByMetadata(filter, metadata, "example-namespace", true);
+     *     UpdateResponse updateResponse = Futures.getUnchecked(futureResponse);
+     *     int matchedRecords = updateResponse.getMatchedRecords();
+     *
+     *     // Actually perform the update
+     *     ListenableFuture actualFutureResponse =
+     *     asyncIndex.updateByMetadata(filter, metadata, "example-namespace", false);
+     * }
+ */ + @Override + public ListenableFuture updateByMetadata(Struct filter, + Struct metadata, + String namespace, + boolean dryRun) { + UpdateRequest updateRequest = validateUpdateByMetadataRequest(filter, metadata, namespace, dryRun); + + return asyncStub.update(updateRequest); + } + /** * {@inheritDoc} *

@@ -1123,6 +1275,66 @@ public ListenableFuture listNamespaces(String pagination return asyncStub.listNamespaces(listNamespacesRequest.build()); } + /** + *

+     * Get list of all namespaces within an index with optional prefix filtering, pagination token, and limit.
+     * @param prefix The prefix to filter namespaces by. Only namespaces starting with this prefix will be returned.
+     *               If null, no prefix filtering is applied.
+     * @param paginationToken The token to paginate through the list of namespaces. If null, it'll be ignored.
+     * @param limit The maximum number of namespaces you want to retrieve.
+     * @return {@link ListenableFuture} The response for the list namespace operation. The totalCount field
+     *         indicates the total number of namespaces matching the prefix (if provided).
+     * 
+ */ + @Override + public ListenableFuture listNamespaces(String prefix, String paginationToken, int limit) { + ListNamespacesRequest.Builder listNamespacesRequest = ListNamespacesRequest + .newBuilder() + .setLimit(limit); + if(prefix != null && !prefix.isEmpty()) { + listNamespacesRequest.setPrefix(prefix); + } + if(paginationToken != null) { + listNamespacesRequest.setPaginationToken(paginationToken); + } + return asyncStub.listNamespaces(listNamespacesRequest.build()); + } + + /** + *
+     * Create a namespace within an index.
+     * @param name The name of the namespace to create.
+     * @return {@link ListenableFuture} The response for the create namespace operation.
+     * 
+ */ + @Override + public ListenableFuture createNamespace(String name) { + CreateNamespaceRequest createNamespaceRequest = CreateNamespaceRequest + .newBuilder() + .setName(name) + .build(); + return asyncStub.createNamespace(createNamespaceRequest); + } + + /** + *
+     * Create a namespace within an index with a metadata schema.
+     * @param name The name of the namespace to create.
+     * @param schema The metadata schema for the namespace.
+     * @return {@link ListenableFuture} The response for the create namespace operation.
+     * 
+ */ + @Override + public ListenableFuture createNamespace(String name, MetadataSchema schema) { + CreateNamespaceRequest.Builder builder = CreateNamespaceRequest + .newBuilder() + .setName(name); + if (schema != null) { + builder.setSchema(schema); + } + return asyncStub.createNamespace(builder.build()); + } + /** *
      * Describe a namespace within an index, showing the vector count within the namespace.
@@ -1170,17 +1382,17 @@ public ListenableFuture deleteNamespace(String namespace) {
      *
      *     String uri = "s3://path/to/file.parquet";
      *     String integrationId = "123-456-789";
-     *     StartImportResponse response = asyncIndex.startImport(uri, integrationId, ImportErrorMode.OnErrorEnum.CONTINUE);
+     *     StartImportResponse response = asyncIndex.startImport(uri, integrationId, "continue");
      *  }
* * @param uri The URI prefix under which the data to import is available. * @param integrationId The ID of the storage integration to access the data. Can be null or empty. - * @param errorMode Indicates how to respond to errors during the import process. Can be null. + * @param errorMode Indicates how to respond to errors during the import process. Possible values: `abort` or `continue` * @return {@link StartImportResponse} containing the details of the initiated import operation. * @throws ApiException if there are issues processing the request or communicating with the server. * This includes network issues, server errors, or serialization issues with the request or response. */ - public StartImportResponse startImport(String uri, String integrationId, ImportErrorMode.OnErrorEnum errorMode) throws ApiException { + public StartImportResponse startImport(String uri, String integrationId, String errorMode) throws ApiException { StartImportRequest importRequest = new StartImportRequest(); importRequest.setUri(uri); if(integrationId != null && !integrationId.isEmpty()) { @@ -1191,7 +1403,7 @@ public StartImportResponse startImport(String uri, String integrationId, ImportE importRequest.setErrorMode(importErrorMode); } - return bulkOperations.startBulkImport(importRequest); + return bulkOperations.startBulkImport(Configuration.VERSION, importRequest); } /** @@ -1270,7 +1482,7 @@ public ListImportsResponse listImports(Integer limit) throws ApiException { * This includes network issues, server errors, or serialization issues with the request or response. */ public ListImportsResponse listImports(Integer limit, String paginationToken) throws ApiException { - return bulkOperations.listBulkImports(limit, paginationToken); + return bulkOperations.listBulkImports(Configuration.VERSION, limit, paginationToken); } /** @@ -1296,7 +1508,7 @@ public ListImportsResponse listImports(Integer limit, String paginationToken) th * This includes network issues, server errors, or serialization issues with the request or response. */ public ImportModel describeImport(String id) throws ApiException { - return bulkOperations.describeBulkImport(id); + return bulkOperations.describeBulkImport(Configuration.VERSION, id); } /** @@ -1319,7 +1531,7 @@ public ImportModel describeImport(String id) throws ApiException { * This includes network issues, server errors, or serialization issues with the request or response. */ public void cancelImport(String id) throws ApiException { - bulkOperations.cancelBulkImport(id); + bulkOperations.cancelBulkImport(Configuration.VERSION, id); } /** diff --git a/src/main/java/io/pinecone/clients/Index.java b/src/main/java/io/pinecone/clients/Index.java index c790dffb..53102bb7 100644 --- a/src/main/java/io/pinecone/clients/Index.java +++ b/src/main/java/io/pinecone/clients/Index.java @@ -6,14 +6,19 @@ import io.pinecone.configs.PineconeConnection; import io.pinecone.exceptions.PineconeValidationException; import io.pinecone.proto.*; +import io.pinecone.proto.CreateNamespaceRequest; import io.pinecone.proto.DeleteRequest; import io.pinecone.proto.DescribeIndexStatsRequest; import io.pinecone.proto.FetchResponse; +import io.pinecone.proto.FetchByMetadataRequest; +import io.pinecone.proto.FetchByMetadataResponse; import io.pinecone.proto.ListNamespacesResponse; import io.pinecone.proto.ListResponse; +import io.pinecone.proto.MetadataSchema; import io.pinecone.proto.NamespaceDescription; import io.pinecone.proto.QueryRequest; import io.pinecone.proto.UpdateRequest; +import io.pinecone.proto.UpdateResponse; import io.pinecone.proto.UpsertRequest; import io.pinecone.proto.UpsertResponse; import io.pinecone.unsigned_indices_model.QueryResponseWithUnsignedIndices; @@ -582,6 +587,72 @@ public FetchResponse fetch(List ids, return blockingStub.fetch(fetchRequest); } + /** + * Fetches vectors by metadata filter from a specified namespace. + *

+ * Example: + *

{@code
+     *     import io.pinecone.proto.FetchByMetadataResponse;
+     *     import com.google.protobuf.Struct;
+     *     import com.google.protobuf.Value;
+     *
+     *     ...
+     *
+     *     Struct filter = Struct.newBuilder()
+     *         .putFields("genre", Value.newBuilder().setStringValue("action").build())
+     *         .build();
+     *
+     *     FetchByMetadataResponse fetchResponse = index.fetchByMetadata("example-namespace", filter);
+     * }
+ * + * @param namespace The namespace to fetch vectors from. + * @param filter A metadata filter expression. Only vectors matching this filter will be returned. + * @return A {@link FetchByMetadataResponse} containing the fetched vectors that match the filter. + */ + public FetchByMetadataResponse fetchByMetadata(String namespace, Struct filter) { + return fetchByMetadata(namespace, filter, null, null); + } + + /** + * Fetches vectors by metadata filter from a specified namespace with optional limit and pagination. + *

+ * Example: + *

{@code
+     *     import io.pinecone.proto.FetchByMetadataResponse;
+     *     import com.google.protobuf.Struct;
+     *     import com.google.protobuf.Value;
+     *
+     *     ...
+     *
+     *     Struct filter = Struct.newBuilder()
+     *         .putFields("genre", Value.newBuilder().setStringValue("action").build())
+     *         .build();
+     *
+     *     // Fetch with limit
+     *     FetchByMetadataResponse fetchResponse = index.fetchByMetadata("example-namespace", filter, 100, null);
+     *
+     *     // Fetch with pagination
+     *     String paginationToken = null;
+     *     FetchByMetadataResponse fetchResponse = index.fetchByMetadata("example-namespace", filter, 100, paginationToken);
+     *
+     *     // Continue pagination if needed
+     *     if (fetchResponse.hasPagination() && !fetchResponse.getPagination().getNext().isEmpty()) {
+     *         FetchByMetadataResponse nextPage = index.fetchByMetadata("example-namespace", filter, 100, fetchResponse.getPagination().getNext());
+     *     }
+     * }
+ * + * @param namespace The namespace to fetch vectors from. + * @param filter A metadata filter expression. Only vectors matching this filter will be returned. + * @param limit The maximum number of vectors to return. If null, no limit is applied. + * @param paginationToken The token to continue a previous listing operation. If null, starts from the beginning. + * @return A {@link FetchByMetadataResponse} containing the fetched vectors that match the filter. + */ + public FetchByMetadataResponse fetchByMetadata(String namespace, Struct filter, Integer limit, String paginationToken) { + FetchByMetadataRequest fetchByMetadataRequest = validateFetchByMetadataRequest(namespace, filter, limit, paginationToken); + + return blockingStub.fetchByMetadata(fetchByMetadataRequest); + } + /** * {@inheritDoc} *

@@ -659,6 +730,75 @@ public UpdateResponse update(String id, return blockingStub.update(updateRequest); } + /** + * {@inheritDoc} + *

+ * Example: + *

{@code
+     *     import io.pinecone.proto.UpdateResponse;
+     *     import com.google.protobuf.Struct;
+     *     import com.google.protobuf.Value;
+     *
+     *     ...
+     *
+     *     Struct filter = Struct.newBuilder()
+     *         .putFields("genre", Value.newBuilder().setStringValue("action").build())
+     *         .build();
+     *
+     *     Struct metadata = Struct.newBuilder()
+     *         .putFields("year", Value.newBuilder().setNumberValue(2020).build())
+     *         .build();
+     *
+     *     UpdateResponse updateResponse =
+     *     index.updateByMetadata(filter, metadata, "example-namespace");
+     * }
+ */ + @Override + public UpdateResponse updateByMetadata(Struct filter, + Struct metadata, + String namespace) { + return updateByMetadata(filter, metadata, namespace, false); + } + + /** + * {@inheritDoc} + *

+ * Example: + *

{@code
+     *     import io.pinecone.proto.UpdateResponse;
+     *     import com.google.protobuf.Struct;
+     *     import com.google.protobuf.Value;
+     *
+     *     ...
+     *
+     *     Struct filter = Struct.newBuilder()
+     *         .putFields("genre", Value.newBuilder().setStringValue("action").build())
+     *         .build();
+     *
+     *     Struct metadata = Struct.newBuilder()
+     *         .putFields("year", Value.newBuilder().setNumberValue(2020).build())
+     *         .build();
+     *
+     *     // Dry run to check how many records would be updated
+     *     UpdateResponse updateResponse =
+     *     index.updateByMetadata(filter, metadata, "example-namespace", true);
+     *     int matchedRecords = updateResponse.getMatchedRecords();
+     *
+     *     // Actually perform the update
+     *     UpdateResponse actualUpdateResponse =
+     *     index.updateByMetadata(filter, metadata, "example-namespace", false);
+     * }
+ */ + @Override + public UpdateResponse updateByMetadata(Struct filter, + Struct metadata, + String namespace, + boolean dryRun) { + UpdateRequest updateRequest = validateUpdateByMetadataRequest(filter, metadata, namespace, dryRun); + + return blockingStub.update(updateRequest); + } + /** * {@inheritDoc} *

@@ -1033,6 +1173,66 @@ public ListNamespacesResponse listNamespaces(String paginationToken, int limit) return blockingStub.listNamespaces(listNamespacesRequest.build()); } + /** + *

+     * Get list of all namespaces within an index with optional prefix filtering, pagination token, and limit.
+     * @param prefix The prefix to filter namespaces by. Only namespaces starting with this prefix will be returned.
+     *               If null, no prefix filtering is applied.
+     * @param paginationToken The token to paginate through the list of namespaces. If null, it'll be ignored.
+     * @param limit The maximum number of namespaces you want to retrieve.
+     * @return {@link ListNamespacesResponse} The response for the list namespace operation. The totalCount field
+     *         indicates the total number of namespaces matching the prefix (if provided).
+     * 
+ */ + @Override + public ListNamespacesResponse listNamespaces(String prefix, String paginationToken, int limit) { + ListNamespacesRequest.Builder listNamespacesRequest = ListNamespacesRequest + .newBuilder() + .setLimit(limit); + if(prefix != null && !prefix.isEmpty()) { + listNamespacesRequest.setPrefix(prefix); + } + if(paginationToken != null) { + listNamespacesRequest.setPaginationToken(paginationToken); + } + return blockingStub.listNamespaces(listNamespacesRequest.build()); + } + + /** + *
+     * Create a namespace within an index.
+     * @param name The name of the namespace to create.
+     * @return {@link NamespaceDescription} The response for the create namespace operation.
+     * 
+ */ + @Override + public NamespaceDescription createNamespace(String name) { + CreateNamespaceRequest createNamespaceRequest = CreateNamespaceRequest + .newBuilder() + .setName(name) + .build(); + return blockingStub.createNamespace(createNamespaceRequest); + } + + /** + *
+     * Create a namespace within an index with a metadata schema.
+     * @param name The name of the namespace to create.
+     * @param schema The metadata schema for the namespace.
+     * @return {@link NamespaceDescription} The response for the create namespace operation.
+     * 
+ */ + @Override + public NamespaceDescription createNamespace(String name, MetadataSchema schema) { + CreateNamespaceRequest.Builder builder = CreateNamespaceRequest + .newBuilder() + .setName(name); + if (schema != null) { + builder.setSchema(schema); + } + return blockingStub.createNamespace(builder.build()); + } + /** *
      * Describe a namespace within an index, showing the vector count within the namespace.
@@ -1107,7 +1307,7 @@ public void upsertRecords(String namespace, List> upsertReco
 
             records.add(upsertRecord);
         }
-        vectorOperations.upsertRecordsNamespace(namespace, records);
+        vectorOperations.upsertRecordsNamespace(Configuration.VERSION, namespace, records);
     }
 
     /**
@@ -1154,7 +1354,7 @@ public SearchRecordsResponse searchRecords(String namespace,
                 .fields(fields)
                 .rerank(rerank);
 
-        return vectorOperations.searchRecordsNamespace(namespace, request);
+        return vectorOperations.searchRecordsNamespace(Configuration.VERSION, namespace, request);
     }
 
     /**
@@ -1208,7 +1408,7 @@ public SearchRecordsResponse searchRecordsById(String id,
                 .fields(fields)
                 .rerank(rerank);
 
-        return vectorOperations.searchRecordsNamespace(namespace, request);
+        return vectorOperations.searchRecordsNamespace(Configuration.VERSION, namespace, request);
     }
 
     /**
@@ -1270,7 +1470,7 @@ public SearchRecordsResponse searchRecordsByVector(SearchRecordsVector vector,
                 .fields(fields)
                 .rerank(rerank);
 
-        return vectorOperations.searchRecordsNamespace(namespace, request);
+        return vectorOperations.searchRecordsNamespace(Configuration.VERSION, namespace, request);
     }
 
     /**
@@ -1324,7 +1524,7 @@ public SearchRecordsResponse searchRecordsByText(String text,
                 .fields(fields)
                 .rerank(rerank);
 
-        return vectorOperations.searchRecordsNamespace(namespace, request);
+        return vectorOperations.searchRecordsNamespace(Configuration.VERSION, namespace, request);
     }
 
     /**
diff --git a/src/main/java/io/pinecone/clients/Inference.java b/src/main/java/io/pinecone/clients/Inference.java
index 29b2d144..d3a9a110 100644
--- a/src/main/java/io/pinecone/clients/Inference.java
+++ b/src/main/java/io/pinecone/clients/Inference.java
@@ -54,7 +54,7 @@ public EmbeddingsList embed(String model, Map parameters, List tags) throws PineconeException {
+        return createServerlessIndex(indexName, metric, dimension, cloud, region, deletionProtection, tags, null, null);
+    }
+
+    /**
+     * Creates a new serverless index with the specified parameters, including optional read capacity and metadata schema configuration.
+     * 

+ * This method allows you to configure dedicated read capacity nodes for better performance and cost predictability, + * and to limit metadata indexing to specific fields for improved performance. + *

+ * Example - Create index with OnDemand read capacity (default): + *

{@code
+     *     import org.openapitools.db_control.client.model.ReadCapacity;
+     *     import org.openapitools.db_control.client.model.ReadCapacityOnDemandSpec;
+     *     ...
+     *     
+     *     ReadCapacity readCapacity = new ReadCapacity(new ReadCapacityOnDemandSpec().mode("OnDemand"));
+     *     client.createServerlessIndex("YOUR-INDEX", "cosine", 1536, "aws", "us-west-2", 
+     *                                  DeletionProtection.ENABLED, null, readCapacity, null);
+     * }
+ *

+ * Example - Create index with Dedicated read capacity: + *

{@code
+     *     import org.openapitools.db_control.client.model.ReadCapacity;
+     *     import org.openapitools.db_control.client.model.ReadCapacityDedicatedSpec;
+     *     import org.openapitools.db_control.client.model.ReadCapacityDedicatedConfig;
+     *     import org.openapitools.db_control.client.model.ScalingConfigManual;
+     *     ...
+     *     
+     *     ScalingConfigManual manual = new ScalingConfigManual().shards(2).replicas(2);
+     *     ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig()
+     *         .nodeType("t1")
+     *         .scaling("Manual")
+     *         .manual(manual);
+     *     ReadCapacity readCapacity = new ReadCapacity(
+     *         new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated));
+     *     client.createServerlessIndex("YOUR-INDEX", "cosine", 1536, "aws", "us-west-2", 
+     *                                  DeletionProtection.ENABLED, null, readCapacity, null);
+     * }
+ *

+ * Example - Create index with metadata schema: + *

{@code
+     *     import org.openapitools.db_control.client.model.BackupModelSchema;
+     *     import org.openapitools.db_control.client.model.BackupModelSchemaFieldsValue;
+     *     ...
+     *     
+     *     Map fields = new HashMap<>();
+     *     fields.put("genre", new BackupModelSchemaFieldsValue().filterable(true));
+     *     fields.put("year", new BackupModelSchemaFieldsValue().filterable(true));
+     *     BackupModelSchema schema = new BackupModelSchema().fields(fields);
+     *     client.createServerlessIndex("YOUR-INDEX", "cosine", 1536, "aws", "us-west-2", 
+     *                                  DeletionProtection.ENABLED, null, null, schema);
+     * }
+ * + * @param indexName The name of the index to be created. + * @param metric The metric type for the index. Must be one of "cosine", "euclidean", or "dotproduct". + * @param dimension The number of dimensions for the index. + * @param cloud The cloud provider for the index. + * @param region The cloud region for the index. + * @param deletionProtection Enable or disable deletion protection for the index. + * @param tags A map of tags to associate with the Index. + * @param readCapacity The read capacity configuration. If null, defaults to OnDemand mode. + * Use {@link ReadCapacityOnDemandSpec} for OnDemand or {@link ReadCapacityDedicatedSpec} for Dedicated mode. + * @param schema The metadata schema configuration. If null, all metadata fields are indexed. + * Use this to limit metadata indexing to specific fields for improved performance. + * @return {@link IndexModel} representing the created serverless index. + * @throws PineconeException if the API encounters an error during index creation or if any of the arguments are invalid. + */ + public IndexModel createServerlessIndex(String indexName, + String metric, + int dimension, + String cloud, + String region, + String deletionProtection, + Map tags, + ReadCapacity readCapacity, + BackupModelSchema schema) throws PineconeException { if (indexName == null || indexName.isEmpty()) { throw new PineconeValidationException("Index name cannot be null or empty"); } @@ -90,44 +166,36 @@ public IndexModel createServerlessIndex(String indexName, metric = "cosine"; } - try { - CreateIndexRequest.MetricEnum.fromValue(metric.toLowerCase()); - } catch (IllegalArgumentException e) { - throw new PineconeValidationException("Metric cannot be null or empty. Must be one of " + Arrays.toString(CreateIndexRequest.MetricEnum.values())); - } - if (dimension < 1) { throw new PineconeValidationException("Dimension must be greater than 0. See limits for more info: https://docs.pinecone.io/reference/limits"); } if (cloud == null || cloud.isEmpty()) { - throw new PineconeValidationException("Cloud cannot be null or empty. Must be one of " + Arrays.toString(ServerlessSpec.CloudEnum.values())); - } - try { - ServerlessSpec.CloudEnum.fromValue(cloud.toLowerCase()); - } catch (IllegalArgumentException e) { - throw new PineconeValidationException("Cloud cannot be null or empty. Must be one of " + Arrays.toString(ServerlessSpec.CloudEnum.values())); + throw new PineconeValidationException("Cloud cannot be null or empty"); } if (region == null || region.isEmpty()) { throw new PineconeValidationException("Region cannot be null or empty"); } - // Convert user string for "metric" arg into IndexMetric - CreateIndexRequest.MetricEnum userMetric = CreateIndexRequest.MetricEnum.fromValue(metric.toLowerCase()); - - // Convert user string for "cloud" arg into ServerlessSpec.CloudEnum - ServerlessSpec.CloudEnum cloudProvider = ServerlessSpec.CloudEnum.fromValue(cloud.toLowerCase()); - - ServerlessSpec serverlessSpec = new ServerlessSpec().cloud(cloudProvider).region(region); - IndexSpec createServerlessIndexRequestSpec = new IndexSpec().serverless(serverlessSpec); + ServerlessSpec serverlessSpec = new ServerlessSpec().cloud(cloud).region(region); + + if (readCapacity != null) { + serverlessSpec.readCapacity(readCapacity); + } + + if (schema != null) { + serverlessSpec.schema(schema); + } + + IndexSpec createServerlessIndexRequestSpec = new IndexSpec(new IndexSpecServerless().serverless(serverlessSpec)); IndexModel indexModel = null; try { CreateIndexRequest createIndexRequest = new CreateIndexRequest() .name(indexName) - .metric(userMetric) + .metric(metric) .dimension(dimension) .spec(createServerlessIndexRequestSpec) .deletionProtection(deletionProtection); @@ -136,7 +204,7 @@ public IndexModel createServerlessIndex(String indexName, createIndexRequest.tags(tags); } - indexModel = manageIndexesApi.createIndex(createIndexRequest); + indexModel = manageIndexesApi.createIndex(Configuration.VERSION, createIndexRequest); } catch (ApiException apiException) { handleApiException(apiException); } @@ -163,7 +231,7 @@ public IndexModel createServerlessIndex(String indexName, public IndexModel createSparseServelessIndex(String indexName, String cloud, String region, - DeletionProtection deletionProtection, + String deletionProtection, Map tags, String vectorType) throws PineconeException { if (indexName == null || indexName.isEmpty()) { @@ -171,13 +239,7 @@ public IndexModel createSparseServelessIndex(String indexName, } if (cloud == null || cloud.isEmpty()) { - throw new PineconeValidationException("Cloud cannot be null or empty. Must be one of " + Arrays.toString(ServerlessSpec.CloudEnum.values())); - } - - try { - ServerlessSpec.CloudEnum.fromValue(cloud.toLowerCase()); - } catch (IllegalArgumentException e) { - throw new PineconeValidationException("Cloud cannot be null or empty. Must be one of " + Arrays.toString(ServerlessSpec.CloudEnum.values())); + throw new PineconeValidationException("Cloud cannot be null or empty"); } if (region == null || region.isEmpty()) { @@ -188,18 +250,15 @@ public IndexModel createSparseServelessIndex(String indexName, throw new PineconeValidationException("vectorType must be sparse or dense"); } - // Convert user string for "cloud" arg into ServerlessSpec.CloudEnum - ServerlessSpec.CloudEnum cloudProvider = ServerlessSpec.CloudEnum.fromValue(cloud.toLowerCase()); - - ServerlessSpec serverlessSpec = new ServerlessSpec().cloud(cloudProvider).region(region); - IndexSpec createServerlessIndexRequestSpec = new IndexSpec().serverless(serverlessSpec); + ServerlessSpec serverlessSpec = new ServerlessSpec().cloud(cloud).region(region); + IndexSpec createServerlessIndexRequestSpec = new IndexSpec(new IndexSpecServerless().serverless(serverlessSpec)); IndexModel indexModel = null; try { CreateIndexRequest createIndexRequest = new CreateIndexRequest() .name(indexName) - .metric(CreateIndexRequest.MetricEnum.DOTPRODUCT) + .metric("dotproduct") .spec(createServerlessIndexRequestSpec) .deletionProtection(deletionProtection) .vectorType(vectorType); @@ -208,7 +267,7 @@ public IndexModel createSparseServelessIndex(String indexName, createIndexRequest.tags(tags); } - indexModel = manageIndexesApi.createIndex(createIndexRequest); + indexModel = manageIndexesApi.createIndex(Configuration.VERSION, createIndexRequest); } catch (ApiException apiException) { handleApiException(apiException); } @@ -242,11 +301,96 @@ public IndexModel createSparseServelessIndex(String indexName, * @throws ApiException if an error occurs while communicating with the API. */ public IndexModel createIndexForModel(String name, - CreateIndexForModelRequest.CloudEnum cloud, + String cloud, String region, CreateIndexForModelRequestEmbed embed, - DeletionProtection deletionProtection, + String deletionProtection, Map tags) throws PineconeException, ApiException { + return createIndexForModel(name, cloud, region, embed, deletionProtection, tags, null, null); + } + + /** + * Creates a new serverless index with an associated embedding model, including optional read capacity and metadata schema configuration. + *

+ * This method allows you to configure dedicated read capacity nodes for better performance and cost predictability, + * and to limit metadata indexing to specific fields for improved performance. + *

+ * Example - Create index for model with Dedicated read capacity: + *

{@code
+     *     import org.openapitools.db_control.client.model.ReadCapacity;
+     *     import org.openapitools.db_control.client.model.ReadCapacityDedicatedSpec;
+     *     import org.openapitools.db_control.client.model.ReadCapacityDedicatedConfig;
+     *     import org.openapitools.db_control.client.model.ScalingConfigManual;
+     *     ...
+     *     
+     *     ScalingConfigManual manual = new ScalingConfigManual().shards(1).replicas(1);
+     *     ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig()
+     *         .nodeType("t1")
+     *         .scaling("Manual")
+     *         .manual(manual);
+     *     ReadCapacity readCapacity = new ReadCapacity(
+     *         new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated));
+     *     
+     *     CreateIndexForModelRequestEmbed embed = new CreateIndexForModelRequestEmbed();
+     *     embed.model("multilingual-e5-large");
+     *     Map fieldMap = new HashMap<>();
+     *     fieldMap.put("text", "my-sample-text");
+     *     embed.fieldMap(fieldMap);
+     *     
+     *     client.createIndexForModel("my-index", "aws", "us-east-1", embed, 
+     *                                DeletionProtection.DISABLED, null, readCapacity, null);
+     * }
+ *

+ * Example - Create index for model with metadata schema: + *

{@code
+     *     import org.openapitools.db_control.client.model.BackupModelSchema;
+     *     import org.openapitools.db_control.client.model.BackupModelSchemaFieldsValue;
+     *     ...
+     *     
+     *     Map fields = new HashMap<>();
+     *     fields.put("category", new BackupModelSchemaFieldsValue().filterable(true));
+     *     fields.put("tags", new BackupModelSchemaFieldsValue().filterable(true));
+     *     BackupModelSchema schema = new BackupModelSchema().fields(fields);
+     *     
+     *     CreateIndexForModelRequestEmbed embed = new CreateIndexForModelRequestEmbed();
+     *     embed.model("multilingual-e5-large");
+     *     Map fieldMap = new HashMap<>();
+     *     fieldMap.put("text", "my-sample-text");
+     *     embed.fieldMap(fieldMap);
+     *     
+     *     client.createIndexForModel("my-index", "aws", "us-east-1", embed, 
+     *                                DeletionProtection.DISABLED, null, null, schema);
+     * }
+ * + * @param name The name of the index to be created. The name must be between 1 and 45 characters, + * start and end with an alphanumeric character, and consist only of lowercase alphanumeric + * characters or hyphens ('-'). + * @param cloud The cloud provider where the index will be hosted. Must be one of the supported cloud providers. + * @param region The cloud region where the index will be created. + * @param embed The embedding model configuration. Once set, the model cannot be changed, but configurations + * such as field map and parameters can be updated. + * @param deletionProtection Whether deletion protection is enabled for the index. If enabled, the index + * cannot be deleted. Defaults to disabled if not provided. + * @param tags A map of custom user tags to associate with the index. Keys must be alphanumeric or contain + * underscores ('_') or hyphens ('-'). Values must be alphanumeric, or contain characters such + * as ';', '@', '_', '-', '.', '+', or spaces. + * @param readCapacity The read capacity configuration. If null, defaults to OnDemand mode. + * Use {@link ReadCapacityOnDemandSpec} for OnDemand or {@link ReadCapacityDedicatedSpec} for Dedicated mode. + * @param schema The metadata schema configuration. If null, all metadata fields are indexed. + * Use this to limit metadata indexing to specific fields for improved performance. + * @return {@link IndexModel} representing the created serverless index with the associated embedding model. + * @throws PineconeException if the API encounters an error during index creation, or if any of the arguments + * are invalid. + * @throws ApiException if an error occurs while communicating with the API. + */ + public IndexModel createIndexForModel(String name, + String cloud, + String region, + CreateIndexForModelRequestEmbed embed, + String deletionProtection, + Map tags, + ReadCapacity readCapacity, + BackupModelSchema schema) throws PineconeException, ApiException { CreateIndexForModelRequest createIndexForModelRequest = new CreateIndexForModelRequest() .name(name) @@ -256,7 +400,123 @@ public IndexModel createIndexForModel(String name, .deletionProtection(deletionProtection) .tags(tags); - return manageIndexesApi.createIndexForModel(createIndexForModelRequest); + if (readCapacity != null) { + createIndexForModelRequest.readCapacity(readCapacity); + } + + if (schema != null) { + createIndexForModelRequest.schema(schema); + } + + return manageIndexesApi.createIndexForModel(Configuration.VERSION, createIndexForModelRequest); + } + + /** + * Creates a new BYOC (Bring Your Own Cloud) index with minimal required parameters. + *

+ * BYOC indexes allow you to deploy Pinecone indexes in your own cloud infrastructure. + * You must have a BYOC environment set up with Pinecone before creating a BYOC index. + *

+ * Example: + *

{@code
+     *     client.createByocIndex("YOUR-INDEX", "cosine", 1536, "your-byoc-environment");
+     * }
+ * + * @param indexName The name of the index to be created. + * @param metric The metric type for the index. Must be one of "cosine", "euclidean", or "dotproduct". + * @param dimension The number of dimensions for the index. + * @param environment The BYOC environment where the index will be hosted. This is provided during BYOC onboarding. + * @return {@link IndexModel} representing the created BYOC index. + * @throws PineconeException if the API encounters an error during index creation or if any of the arguments are invalid. + */ + public IndexModel createByocIndex(String indexName, + String metric, + int dimension, + String environment) throws PineconeException { + return createByocIndex(indexName, metric, dimension, environment, "disabled", null, null); + } + + /** + * Creates a new BYOC (Bring Your Own Cloud) index with the specified parameters, including optional deletion protection, tags, and metadata schema configuration. + *

+ * BYOC indexes allow you to deploy Pinecone indexes in your own cloud infrastructure. + * You must have a BYOC environment set up with Pinecone before creating a BYOC index. + *

+ * Example with metadata schema: + *

{@code
+     *     import org.openapitools.db_control.client.model.BackupModelSchema;
+     *     import org.openapitools.db_control.client.model.BackupModelSchemaFieldsValue;
+     *     ...
+     *
+     *     Map fields = new HashMap<>();
+     *     fields.put("genre", new BackupModelSchemaFieldsValue().filterable(true));
+     *     fields.put("year", new BackupModelSchemaFieldsValue().filterable(true));
+     *     BackupModelSchema schema = new BackupModelSchema().fields(fields);
+     *     client.createByocIndex("YOUR-INDEX", "cosine", 1536, "aws-us-east-1-b921",
+     *                            DeletionProtection.ENABLED, null, schema);
+     * }
+ * + * @param indexName The name of the index to be created. + * @param metric The metric type for the index. Must be one of "cosine", "euclidean", or "dotproduct". + * @param dimension The number of dimensions for the index. + * @param environment The BYOC environment where the index will be hosted. This is provided during BYOC onboarding. + * @param deletionProtection Enable or disable deletion protection for the index. + * @param tags A map of tags to associate with the Index. + * @param schema The metadata schema configuration. If null, all metadata fields are indexed. + * Use this to limit metadata indexing to specific fields for improved performance. + * @return {@link IndexModel} representing the created BYOC index. + * @throws PineconeException if the API encounters an error during index creation or if any of the arguments are invalid. + */ + public IndexModel createByocIndex(String indexName, + String metric, + int dimension, + String environment, + String deletionProtection, + Map tags, + BackupModelSchema schema) throws PineconeException { + if (indexName == null || indexName.isEmpty()) { + throw new PineconeValidationException("Index name cannot be null or empty"); + } + + if (metric == null || metric.isEmpty()) { + metric = "cosine"; + } + + if (dimension < 1) { + throw new PineconeValidationException("Dimension must be greater than 0. See limits for more info: https://docs.pinecone.io/reference/limits"); + } + + if (environment == null || environment.isEmpty()) { + throw new PineconeValidationException("Environment cannot be null or empty"); + } + + ByocSpec byocSpec = new ByocSpec().environment(environment); + + if (schema != null) { + byocSpec.schema(schema); + } + + IndexSpec createByocIndexRequestSpec = new IndexSpec(new IndexSpecBYOC().byoc(byocSpec)); + + IndexModel indexModel = null; + + try { + CreateIndexRequest createIndexRequest = new CreateIndexRequest() + .name(indexName) + .metric(metric) + .dimension(dimension) + .spec(createByocIndexRequestSpec) + .deletionProtection(deletionProtection); + + if(tags != null && !tags.isEmpty()) { + createIndexRequest.tags(tags); + } + + indexModel = manageIndexesApi.createIndex(Configuration.VERSION, createIndexRequest); + } catch (ApiException apiException) { + handleApiException(apiException); + } + return indexModel; } /** @@ -276,7 +536,7 @@ public IndexModel createIndexForModel(String name, */ public IndexModel createPodsIndex(String indexName, Integer dimension, String environment, String podType) { return createPodsIndex(indexName, dimension, environment, podType, null, null, null, - null, null, null, DeletionProtection.DISABLED, null); + null, null, null, "disabled", null); } /** @@ -299,33 +559,11 @@ public IndexModel createPodsIndex(String indexName, Integer dimension, String environment, String podType, - DeletionProtection deletionProtection) { + String deletionProtection) { return createPodsIndex(indexName, dimension, environment, podType, null, null, null, null, null, null, deletionProtection, null); } - /** - * Overload for creating a new pods index with environment, podType, and metric. - *

- * Example: - *

{@code 
-     *     client.createPodsIndex("YOUR-INDEX", 1536, "us-east4-gcp", "p1.x2", "cosine");
-     * }
- * - * @param indexName The name of the index to be created. - * @param dimension The number of dimensions for the index. - * @param environment The cloud environment where you want the index to be hosted. - * @param podType The type of pod to use. A string with one of s1, p1, or p2 appended with a "." and one of x1, x2, x4, or x8. - * @param metric The metric type for the index. Must be one of "cosine", "euclidean", or "dotproduct". - * @return {@link IndexModel} representing the created serverless index. - * @throws PineconeException if the API encounters an error during index creation or if any of the arguments are invalid. - */ - public IndexModel createPodsIndex(String indexName, Integer dimension, String environment, - String podType, String metric) { - return createPodsIndex(indexName, dimension, environment, podType, metric, null, null, - null, null, null, DeletionProtection.DISABLED, null); - } - /** * Overload for creating a new pods index with environment, podType, metric, and metadataConfig. *

@@ -354,7 +592,7 @@ public IndexModel createPodsIndex(String indexName, Integer dimension, String en public IndexModel createPodsIndex(String indexName, Integer dimension, String environment, String podType, String metric, PodSpecMetadataConfig metadataConfig) { return createPodsIndex(indexName, dimension, environment, podType, metric, null, null, null, - metadataConfig,null, DeletionProtection.DISABLED, null); + metadataConfig,null, "disabled", null); } /** @@ -377,7 +615,7 @@ public IndexModel createPodsIndex(String indexName, Integer dimension, String en public IndexModel createPodsIndex(String indexName, Integer dimension, String environment, String podType, String metric, String sourceCollection) { return createPodsIndex(indexName, dimension, environment, podType, metric, null, null, null, null, - sourceCollection, DeletionProtection.DISABLED, null); + sourceCollection, "disabled", null); } /** @@ -399,7 +637,7 @@ public IndexModel createPodsIndex(String indexName, Integer dimension, String en public IndexModel createPodsIndex(String indexName, Integer dimension, String environment, String podType, Integer pods) { return createPodsIndex(indexName, dimension, environment, podType, null, null, null, pods, - null, null, DeletionProtection.DISABLED, null); + null, null, "disabled", null); } /** @@ -428,7 +666,7 @@ public IndexModel createPodsIndex(String indexName, Integer dimension, String en String podType, Integer pods, PodSpecMetadataConfig metadataConfig) { return createPodsIndex(indexName, dimension, environment, podType, null, null, null, pods, metadataConfig, - null, DeletionProtection.DISABLED, null); + null, "disabled", null); } /** @@ -452,7 +690,7 @@ public IndexModel createPodsIndex(String indexName, Integer dimension, String en String podType, Integer replicas, Integer shards) { return createPodsIndex(indexName, dimension, environment, podType, null, replicas, shards, null, - null, null, DeletionProtection.DISABLED, null); + null, null, "disabled", null); } /** @@ -484,7 +722,7 @@ public IndexModel createPodsIndex(String indexName, Integer dimension, String en return createPodsIndex(indexName, dimension, environment, podType, null, replicas, shards, null, metadataConfig, - null, DeletionProtection.DISABLED, null); + null, "disabled", null); } /** @@ -527,7 +765,7 @@ public IndexModel createPodsIndex(String indexName, Integer pods, PodSpecMetadataConfig metadataConfig, String sourceCollection, - DeletionProtection deletionProtection, + String deletionProtection, Map tags) throws PineconeException { validatePodIndexParams(indexName, dimension, environment, podType, metric, replicas, shards, pods); @@ -538,11 +776,11 @@ public IndexModel createPodsIndex(String indexName, .pods(pods) .metadataConfig(metadataConfig) .sourceCollection(sourceCollection); - IndexSpec createIndexRequestSpec = new IndexSpec().pod(podSpec); + IndexSpec createIndexRequestSpec = new IndexSpec(new IndexSpecPodBased().pod(podSpec)); CreateIndexRequest createIndexRequest = new CreateIndexRequest() .name(indexName) .dimension(dimension) - .metric(metric != null ? CreateIndexRequest.MetricEnum.fromValue(metric) : CreateIndexRequest.MetricEnum.COSINE) + .metric(metric) .spec(createIndexRequestSpec) .deletionProtection(deletionProtection); @@ -552,7 +790,7 @@ public IndexModel createPodsIndex(String indexName, IndexModel indexModel = null; try { - indexModel = manageIndexesApi.createIndex(createIndexRequest); + indexModel = manageIndexesApi.createIndex(Configuration.VERSION, createIndexRequest); } catch (ApiException apiException) { handleApiException(apiException); } @@ -584,7 +822,7 @@ public static void validatePodIndexParams(String indexName, Integer dimension, S } if (metric != null && metric.isEmpty()) { - throw new PineconeValidationException("Metric cannot be null or empty. Must be one of " + Arrays.toString(IndexModel.MetricEnum.values())); + throw new PineconeValidationException("Metric cannot be null or empty. Must be cosine, euclidean, or dotproduct."); } if (replicas != null && replicas < 1) { @@ -622,7 +860,7 @@ public static void validatePodIndexParams(String indexName, Integer dimension, S public IndexModel describeIndex(String indexName) throws PineconeException { IndexModel indexModel = null; try { - indexModel = manageIndexesApi.describeIndex(indexName); + indexModel = manageIndexesApi.describeIndex(Configuration.VERSION, indexName); } catch (ApiException apiException) { handleApiException(apiException); } @@ -655,7 +893,7 @@ public IndexModel describeIndex(String indexName) throws PineconeException { public IndexModel configurePodsIndex(String indexName, String podType, Integer replicas, - DeletionProtection deletionProtection, + String deletionProtection, Map tags) throws PineconeException { if (indexName == null || indexName.isEmpty()) { throw new PineconeValidationException("indexName cannot be null or empty"); @@ -670,12 +908,13 @@ public IndexModel configurePodsIndex(String indexName, // Build ConfigureIndexRequest object ConfigureIndexRequest configureIndexRequest = new ConfigureIndexRequest() - .spec(new ConfigureIndexRequestSpec() - .pod(new ConfigureIndexRequestSpecPod() - .replicas(replicas) - .podType(podType) - ) - ).deletionProtection(deletionProtection); + .spec(new ConfigureIndexRequestSpec( + new ConfigureIndexRequestPodBased() + .pod(new ConfigureIndexRequestPodBasedConfig() + .replicas(replicas) + .podType(podType) + ) + )).deletionProtection(deletionProtection); if(tags != null && !tags.isEmpty()) { configureIndexRequest.tags(tags); @@ -683,7 +922,7 @@ public IndexModel configurePodsIndex(String indexName, IndexModel indexModel = null; try { - indexModel = manageIndexesApi.configureIndex(indexName, configureIndexRequest); + indexModel = manageIndexesApi.configureIndex(Configuration.VERSION, indexName, configureIndexRequest); } catch (ApiException apiException) { handleApiException(apiException); } @@ -707,31 +946,10 @@ public IndexModel configurePodsIndex(String indexName, * @return {@link IndexModel} of the configured index. * @throws PineconeException if an error occurs during the operation, the index does not exist, or if the number of replicas is invalid. */ - public IndexModel configurePodsIndex(String indexName, Integer replicas, DeletionProtection deletionProtection) throws PineconeException { + public IndexModel configurePodsIndex(String indexName, Integer replicas, String deletionProtection) throws PineconeException { return configurePodsIndex(indexName, null, replicas, deletionProtection, null); } - /** - * Overload for configurePodsIndex to only change the podType of an index. - *

- * Example: - *

{@code 
-     *     import org.openapitools.control.client.model.IndexModel;
-     *     ...
-     *
-     *     IndexModel indexModel = client.configurePodsIndex("YOUR-INDEX", "p1.x2");
-     * }
- * - * @param indexName The name of the index. - * @param podType The new podType for the index. - * @return {@link IndexModel} of the configured index. - * @throws PineconeException if an error occurs during the operation, the index does not exist, or if the podType is invalid. - */ - public IndexModel configurePodsIndex(String indexName, String podType) throws PineconeException { - DeletionProtection deletionProtection = describeIndex(indexName).getDeletionProtection(); - return configurePodsIndex(indexName, podType, null, deletionProtection, null); - } - /** * Overload for configurePodsIndex to only change the deletion protection of an index. *

@@ -748,7 +966,7 @@ public IndexModel configurePodsIndex(String indexName, String podType) throws Pi * @return {@link IndexModel} of the configured index. * @throws PineconeException if an error occurs during the operation, the index does not exist, or if the podType is invalid. */ - public IndexModel configurePodsIndex(String indexName, DeletionProtection deletionProtection) throws PineconeException { + public IndexModel configurePodsIndex(String indexName, String deletionProtection) throws PineconeException { return configurePodsIndex(indexName, null, null, deletionProtection, null); } @@ -786,9 +1004,59 @@ public IndexModel configurePodsIndex(String indexName, DeletionProtection deleti * @throws PineconeException if an error occurs during the operation, the index does not exist, or if any of the arguments are invalid. */ public IndexModel configureServerlessIndex(String indexName, - DeletionProtection deletionProtection, + String deletionProtection, Map tags, ConfigureIndexRequestEmbed embed) throws PineconeException { + return configureServerlessIndex(indexName, deletionProtection, tags, embed, null, null, null, null); + } + + /** + * Configures an existing serverless index with deletion protection, tags, embed settings, and optional read capacity configuration. + *

+ * This method allows you to configure or change the read capacity mode of an existing serverless index. + * You can switch between OnDemand and Dedicated modes, or scale dedicated read nodes. + *

+ * Example - Switch to OnDemand read capacity: + *

{@code
+     *     client.configureServerlessIndex("my-index", "enabled", null, null, "OnDemand", null, null, null);
+     * }
+ *

+ * Example - Switch to Dedicated read capacity with manual scaling: + *

{@code
+     *     client.configureServerlessIndex("my-index", "enabled", null, null, "Dedicated", "t1", 2, 2);
+     * }
+ *

+ * Example - Scale up dedicated read capacity: + *

{@code
+     *     // Scale up by increasing shards and replicas
+     *     client.configureServerlessIndex("my-index", "enabled", null, null, "Dedicated", "t1", 4, 3);
+     *     
+     *     // Verify the configuration was applied
+     *     IndexModel desc = client.describeIndex("my-index");
+     *     // Check desc.getSpec().getServerless().getReadCapacity()...
+     * }
+ * + * @param indexName The name of the index to configure. + * @param deletionProtection Enable or disable deletion protection for the index. + * @param tags A map of tags to associate with the Index. + * @param embed 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 + * @param readCapacityMode The read capacity mode. Must be "OnDemand" or "Dedicated". If null, read capacity is not changed. + * @param nodeType The node type for Dedicated mode (e.g., "t1"). Required if readCapacityMode is "Dedicated", ignored otherwise. + * @param shards The number of shards for Dedicated mode. Required if readCapacityMode is "Dedicated", ignored otherwise. + * @param replicas The number of replicas for Dedicated mode. Required if readCapacityMode is "Dedicated", ignored otherwise. + * @return {@link IndexModel} representing the configured index. + * @throws PineconeException if an error occurs during the operation, the index does not exist, or if any of the arguments are invalid. + */ + public IndexModel configureServerlessIndex(String indexName, + String deletionProtection, + Map tags, + ConfigureIndexRequestEmbed embed, + String readCapacityMode, + String nodeType, + Integer shards, + Integer replicas) throws PineconeException { if (indexName == null || indexName.isEmpty()) { throw new PineconeValidationException("indexName cannot be null or empty"); } @@ -805,9 +1073,47 @@ public IndexModel configureServerlessIndex(String indexName, configureIndexRequest.embed(embed); } + // Build ReadCapacity from primitive parameters if readCapacityMode is provided + ReadCapacity readCapacity = null; + if (readCapacityMode != null) { + if ("OnDemand".equals(readCapacityMode)) { + readCapacity = new ReadCapacity(new ReadCapacityOnDemandSpec().mode("OnDemand")); + } else if ("Dedicated".equals(readCapacityMode)) { + if (nodeType == null || nodeType.isEmpty()) { + throw new PineconeValidationException("nodeType is required when readCapacityMode is 'Dedicated'"); + } + if (shards == null || shards < 1) { + throw new PineconeValidationException("shards must be at least 1 when readCapacityMode is 'Dedicated'"); + } + if (replicas == null || replicas < 1) { + throw new PineconeValidationException("replicas must be at least 1 when readCapacityMode is 'Dedicated'"); + } + + ScalingConfigManual manual = new ScalingConfigManual().shards(shards).replicas(replicas); + ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig() + .nodeType(nodeType) + .scaling("Manual") + .manual(manual); + readCapacity = new ReadCapacity( + new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated)); + } else { + throw new PineconeValidationException("readCapacityMode must be 'OnDemand' or 'Dedicated'"); + } + } + + // If readCapacity is provided, configure it via spec + if (readCapacity != null) { + ConfigureIndexRequestServerlessConfig serverlessConfig = new ConfigureIndexRequestServerlessConfig() + .readCapacity(readCapacity); + ConfigureIndexRequestServerless serverless = new ConfigureIndexRequestServerless() + .serverless(serverlessConfig); + ConfigureIndexRequestSpec spec = new ConfigureIndexRequestSpec(serverless); + configureIndexRequest.spec(spec); + } + IndexModel indexModel = null; try { - indexModel = manageIndexesApi.configureIndex(indexName, configureIndexRequest); + indexModel = manageIndexesApi.configureIndex(Configuration.VERSION, indexName, configureIndexRequest); } catch (ApiException apiException) { handleApiException(apiException); } @@ -831,7 +1137,7 @@ public IndexModel configureServerlessIndex(String indexName, public IndexList listIndexes() throws PineconeException { IndexList indexList = null; try { - indexList = manageIndexesApi.listIndexes(); + indexList = manageIndexesApi.listIndexes(Configuration.VERSION); } catch (ApiException apiException) { handleApiException(apiException); } @@ -868,7 +1174,7 @@ public IndexList listIndexes() throws PineconeException { */ public void deleteIndex(String indexName) throws PineconeException { try { - manageIndexesApi.deleteIndex(indexName); + manageIndexesApi.deleteIndex(Configuration.VERSION, indexName); } catch (ApiException apiException) { handleApiException(apiException); } @@ -883,7 +1189,7 @@ public void deleteIndex(String indexName) throws PineconeException { * @return BackupModel */ public BackupModel createBackup(String indexName, String backupName, String description) throws ApiException { - return manageIndexesApi.createBackup(indexName, + return manageIndexesApi.createBackup(Configuration.VERSION, indexName, new CreateBackupRequest().name(backupName).description(description)); } @@ -896,7 +1202,7 @@ public BackupModel createBackup(String indexName, String backupName, String desc * @return BackupList */ public BackupList listIndexBackups(String indexName) throws ApiException { - return manageIndexesApi.listIndexBackups(indexName, 10, null); + return manageIndexesApi.listIndexBackups(Configuration.VERSION, indexName, 10, null); } /** @@ -908,7 +1214,7 @@ public BackupList listIndexBackups(String indexName) throws ApiException { * @return BackupList */ public BackupList listIndexBackups(String indexName, Integer limit, String paginationToken) throws ApiException { - return manageIndexesApi.listIndexBackups(indexName, limit, paginationToken); + return manageIndexesApi.listIndexBackups(Configuration.VERSION, indexName, limit, paginationToken); } /** @@ -928,7 +1234,7 @@ public BackupList listProjectBackups() throws ApiException { * @return BackupList */ public BackupList listProjectBackups(Integer limit, String paginationToken) throws ApiException { - return manageIndexesApi.listProjectBackups(limit, paginationToken); + return manageIndexesApi.listProjectBackups(Configuration.VERSION, limit, paginationToken); } /** @@ -938,7 +1244,7 @@ public BackupList listProjectBackups(Integer limit, String paginationToken) thro * @return BackupModel */ public BackupModel describeBackup(String backupId) throws ApiException { - return manageIndexesApi.describeBackup(backupId); + return manageIndexesApi.describeBackup(Configuration.VERSION, backupId); } /** @@ -947,7 +1253,7 @@ public BackupModel describeBackup(String backupId) throws ApiException { * @param backupId The ID of the backup to delete. (required) */ public void deleteBackup(String backupId) throws ApiException { - manageIndexesApi.deleteBackup(backupId); + manageIndexesApi.deleteBackup(Configuration.VERSION, backupId); } /** @@ -960,7 +1266,7 @@ public void deleteBackup(String backupId) throws ApiException { * @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 indexName, Map tags, DeletionProtection deletionProtection) throws ApiException { + public void createIndexFromBackup(String backupId, String indexName, Map tags, String deletionProtection) throws ApiException { CreateIndexFromBackupRequest createIndexFromBackupRequest = new CreateIndexFromBackupRequest() .name(indexName) .tags(tags); @@ -968,7 +1274,7 @@ public void createIndexFromBackup(String backupId, String indexName, Map ids, String namespace) { return fetchRequest.build(); } + /** + * Validates and constructs a fetch by metadata request for retrieving vectors that match a metadata filter. + * + * @param namespace The namespace to fetch vectors from. + * @param filter A metadata filter expression. Only vectors matching this filter will be returned. + * @param limit The maximum number of vectors to return. + * @param paginationToken The token to continue a previous listing operation. + * @return A {@link FetchByMetadataRequest} object constructed from the provided parameters. + * @throws PineconeValidationException if the namespace is not provided. + */ + default FetchByMetadataRequest validateFetchByMetadataRequest(String namespace, + Struct filter, + Integer limit, + String paginationToken) { + FetchByMetadataRequest.Builder fetchByMetadataRequest = FetchByMetadataRequest.newBuilder(); + + if (namespace == null || namespace.isEmpty()) { + throw new PineconeValidationException("Invalid fetch by metadata request. Namespace must be present"); + } + fetchByMetadataRequest.setNamespace(namespace); + + if (filter != null) { + fetchByMetadataRequest.setFilter(filter); + } + + if (limit != null && limit > 0) { + fetchByMetadataRequest.setLimit(limit); + } + + if (paginationToken != null && !paginationToken.isEmpty()) { + fetchByMetadataRequest.setPaginationToken(paginationToken); + } + + return fetchByMetadataRequest.build(); + } + /** * Validates and constructs an update request for modifying an existing vector. * @@ -332,6 +370,44 @@ default UpdateRequest validateUpdateRequest(String id, return updateRequest.build(); } + /** + * Validates and constructs an update request for modifying vectors by metadata filter. + * + * @param filter A metadata filter expression. When updating metadata across records in a namespace, + * the update is applied to all records that match the filter. + * @param metadata The new metadata to set for the vectors. If provided, it replaces the existing metadata. + * @param namespace The namespace containing the records to update. + * @param dryRun If true, return the number of records that match the filter, but do not execute the update. + * Default is false. + * @return An {@link UpdateRequest} object constructed from the provided parameters. + * @throws PineconeValidationException if there are invalid arguments. + */ + default UpdateRequest validateUpdateByMetadataRequest(Struct filter, + Struct metadata, + String namespace, + Boolean dryRun) { + UpdateRequest.Builder updateRequest = UpdateRequest.newBuilder(); + + if (filter == null) { + throw new PineconeValidationException("Invalid update by metadata request. Filter must be present"); + } + updateRequest.setFilter(filter); + + if (metadata != null) { + updateRequest.setSetMetadata(metadata); + } + + if (namespace != null) { + updateRequest.setNamespace(namespace); + } + + if (dryRun != null) { + updateRequest.setDryRun(dryRun); + } + + return updateRequest.build(); + } + /** * Validates and constructs a delete request for removing vectors by their IDs or based on a filter. * Can also handle requests for deleting all vectors within a namespace. @@ -596,6 +672,7 @@ U query(int topK, List vector, List sparseIndices, List spar */ V fetch(List ids, String namespace); + /** * Updates an existing vector by ID with new values in the default namespace. * @@ -630,6 +707,29 @@ U query(int topK, List vector, List sparseIndices, List spar W update(String id, List values, Struct metadata, String namespace, List sparseIndices, List sparseValues); + /** + * Updates vectors by metadata filter in a specified namespace. The update is applied to all records that match the filter. + * + * @param filter A metadata filter expression. The update is applied to all records that match the filter. + * @param metadata The new metadata to set for the vectors. If provided, it replaces the existing metadata. + * @param namespace The namespace containing the records to update. + * @return A generic type {@code W} representing the result of the update operation. + */ + W updateByMetadata(Struct filter, Struct metadata, String namespace); + + /** + * Updates vectors by metadata filter in a specified namespace with optional dry run mode. + * The update is applied to all records that match the filter. + * + * @param filter A metadata filter expression. The update is applied to all records that match the filter. + * @param metadata The new metadata to set for the vectors. If provided, it replaces the existing metadata. + * @param namespace The namespace containing the records to update. + * @param dryRun If true, return the number of records that match the filter, but do not execute the update. + * Default is false. + * @return A generic type {@code W} representing the result of the update operation. + */ + W updateByMetadata(Struct filter, Struct metadata, String namespace, boolean dryRun); + /** * Deletes a list of vectors by ID from the default namespace. * @@ -854,6 +954,38 @@ default void validateListEndpointParameters(String namespace, String prefix, Str */ A listNamespaces(String paginationToken, int limit); + /** + *
+     * Get list of all namespaces within an index with optional prefix filtering, pagination token, and limit.
+     * @param prefix The prefix to filter namespaces by. Only namespaces starting with this prefix will be returned.
+     *               If null, no prefix filtering is applied.
+     * @param paginationToken The token to paginate through the list of namespaces. If null, it'll be ignored.
+     * @param limit The maximum number of namespaces you want to retrieve.
+     * @return {@link ListNamespacesResponse} The response for the list namespace operation. The totalCount field
+     *         indicates the total number of namespaces matching the prefix (if provided).
+     * 
+ */ + A listNamespaces(String prefix, String paginationToken, int limit); + + /** + *
+     * Create a namespace within an index.
+     * @param name The name of the namespace to create.
+     * @return {@link NamespaceDescription} The response for the create namespace operation.
+     * 
+ */ + B createNamespace(String name); + + /** + *
+     * Create a namespace within an index with a metadata schema.
+     * @param name The name of the namespace to create.
+     * @param schema The metadata schema for the namespace.
+     * @return {@link NamespaceDescription} The response for the create namespace operation.
+     * 
+ */ + B createNamespace(String name, io.pinecone.proto.MetadataSchema schema); + /** *
      * Describe a namespace within an index, showing the vector count within the namespace.
diff --git a/src/main/java/io/pinecone/configs/PineconeConnection.java b/src/main/java/io/pinecone/configs/PineconeConnection.java
index 523e469f..212bb27b 100644
--- a/src/main/java/io/pinecone/configs/PineconeConnection.java
+++ b/src/main/java/io/pinecone/configs/PineconeConnection.java
@@ -178,7 +178,7 @@ private ProxyDetector getProxyDetector() {
     private static Metadata assembleMetadata(PineconeConfig config) {
         Metadata metadata = new Metadata();
         metadata.put(Metadata.Key.of("api-key", Metadata.ASCII_STRING_MARSHALLER), config.getApiKey());
-        metadata.put(Metadata.Key.of("X-Pinecone-api-version", Metadata.ASCII_STRING_MARSHALLER), "2025-04");
+        metadata.put(Metadata.Key.of("X-Pinecone-api-version", Metadata.ASCII_STRING_MARSHALLER), "2025-10");
         return metadata;
     }
 
diff --git a/src/main/java/io/pinecone/helpers/IndexCleanupUtility.java b/src/main/java/io/pinecone/helpers/IndexCleanupUtility.java
index 9a9cf601..72d73d3d 100644
--- a/src/main/java/io/pinecone/helpers/IndexCleanupUtility.java
+++ b/src/main/java/io/pinecone/helpers/IndexCleanupUtility.java
@@ -1,7 +1,6 @@
 package io.pinecone.helpers;
 
 import io.pinecone.clients.Pinecone;
-import org.openapitools.db_control.client.model.DeletionProtection;
 import org.openapitools.db_control.client.model.IndexModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -16,11 +15,14 @@ public static void main(String[] args) {
             
             for(IndexModel model : pinecone.listIndexes().getIndexes()) {
                 String indexName = model.getName();
-                if(model.getDeletionProtection().equals(DeletionProtection.ENABLED)) {
-                    if(model.getSpec().getPod() != null) {
-                        pinecone.configurePodsIndex(indexName, DeletionProtection.DISABLED);
+                if(model.getDeletionProtection().equals("enabled")) {
+                    try {
+                        model.getSpec().getIndexModelPodBased();
+                        pinecone.configurePodsIndex(indexName, "disabled");
+                    } catch (ClassCastException e) {
+                        // Not a pod-based index, continue
                     }
-                    pinecone.configureServerlessIndex(indexName, DeletionProtection.DISABLED, null, null);
+                    pinecone.configureServerlessIndex(indexName, "disabled", null, null);
                 }
                 Thread.sleep(5000);
                 pinecone.deleteIndex(indexName);
diff --git a/src/main/java/io/pinecone/proto/CreateNamespaceRequest.java b/src/main/java/io/pinecone/proto/CreateNamespaceRequest.java
new file mode 100644
index 00000000..adf39b3a
--- /dev/null
+++ b/src/main/java/io/pinecone/proto/CreateNamespaceRequest.java
@@ -0,0 +1,826 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// NO CHECKED-IN PROTOBUF GENCODE
+// source: db_data_2025-10.proto
+// Protobuf Java Version: 4.29.3
+
+package io.pinecone.proto;
+
+/**
+ * 
+ * The request for the create namespace operation
+ * 
+ * + * Protobuf type {@code CreateNamespaceRequest} + */ +public final class CreateNamespaceRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:CreateNamespaceRequest) + CreateNamespaceRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 3, + /* suffix= */ "", + CreateNamespaceRequest.class.getName()); + } + // Use CreateNamespaceRequest.newBuilder() to construct. + private CreateNamespaceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CreateNamespaceRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_CreateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.CreateNamespaceRequest.class, io.pinecone.proto.CreateNamespaceRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * The name of the namespace to be created
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the namespace to be created
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEMA_FIELD_NUMBER = 2; + private io.pinecone.proto.MetadataSchema schema_; + /** + *
+   * Schema for the behavior of Pinecone's internal metadata index.
+   * By default, all metadata is indexed; when `schema` is present,
+   * only fields which are present in the `fields` object with a
+   * `filterable: true` are indexed.
+   * Note that `filterable: false` is not currently supported.
+   * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * Schema for the behavior of Pinecone's internal metadata index.
+   * By default, all metadata is indexed; when `schema` is present,
+   * only fields which are present in the `fields` object with a
+   * `filterable: true` are indexed.
+   * Note that `filterable: false` is not currently supported.
+   * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + * @return The schema. + */ + @java.lang.Override + public io.pinecone.proto.MetadataSchema getSchema() { + return schema_ == null ? io.pinecone.proto.MetadataSchema.getDefaultInstance() : schema_; + } + /** + *
+   * Schema for the behavior of Pinecone's internal metadata index.
+   * By default, all metadata is indexed; when `schema` is present,
+   * only fields which are present in the `fields` object with a
+   * `filterable: true` are indexed.
+   * Note that `filterable: false` is not currently supported.
+   * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + @java.lang.Override + public io.pinecone.proto.MetadataSchemaOrBuilder getSchemaOrBuilder() { + return schema_ == null ? io.pinecone.proto.MetadataSchema.getDefaultInstance() : schema_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSchema()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSchema()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.pinecone.proto.CreateNamespaceRequest)) { + return super.equals(obj); + } + io.pinecone.proto.CreateNamespaceRequest other = (io.pinecone.proto.CreateNamespaceRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasSchema() != other.hasSchema()) return false; + if (hasSchema()) { + if (!getSchema() + .equals(other.getSchema())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasSchema()) { + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.pinecone.proto.CreateNamespaceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.pinecone.proto.CreateNamespaceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.pinecone.proto.CreateNamespaceRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.CreateNamespaceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.pinecone.proto.CreateNamespaceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The request for the create namespace operation
+   * 
+ * + * Protobuf type {@code CreateNamespaceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:CreateNamespaceRequest) + io.pinecone.proto.CreateNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_CreateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.CreateNamespaceRequest.class, io.pinecone.proto.CreateNamespaceRequest.Builder.class); + } + + // Construct using io.pinecone.proto.CreateNamespaceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getSchemaFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + schema_ = null; + if (schemaBuilder_ != null) { + schemaBuilder_.dispose(); + schemaBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.pinecone.proto.DbData202510.internal_static_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + public io.pinecone.proto.CreateNamespaceRequest getDefaultInstanceForType() { + return io.pinecone.proto.CreateNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.pinecone.proto.CreateNamespaceRequest build() { + io.pinecone.proto.CreateNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.pinecone.proto.CreateNamespaceRequest buildPartial() { + io.pinecone.proto.CreateNamespaceRequest result = new io.pinecone.proto.CreateNamespaceRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.pinecone.proto.CreateNamespaceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.schema_ = schemaBuilder_ == null + ? schema_ + : schemaBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.pinecone.proto.CreateNamespaceRequest) { + return mergeFrom((io.pinecone.proto.CreateNamespaceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.pinecone.proto.CreateNamespaceRequest other) { + if (other == io.pinecone.proto.CreateNamespaceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSchema()) { + mergeSchema(other.getSchema()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getSchemaFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the namespace to be created
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the namespace to be created
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the namespace to be created
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The name of the namespace to be created
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The name of the namespace to be created
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private io.pinecone.proto.MetadataSchema schema_; + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.MetadataSchema, io.pinecone.proto.MetadataSchema.Builder, io.pinecone.proto.MetadataSchemaOrBuilder> schemaBuilder_; + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + * @return Whether the schema field is set. + */ + public boolean hasSchema() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + * @return The schema. + */ + public io.pinecone.proto.MetadataSchema getSchema() { + if (schemaBuilder_ == null) { + return schema_ == null ? io.pinecone.proto.MetadataSchema.getDefaultInstance() : schema_; + } else { + return schemaBuilder_.getMessage(); + } + } + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + public Builder setSchema(io.pinecone.proto.MetadataSchema value) { + if (schemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + } else { + schemaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + public Builder setSchema( + io.pinecone.proto.MetadataSchema.Builder builderForValue) { + if (schemaBuilder_ == null) { + schema_ = builderForValue.build(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + public Builder mergeSchema(io.pinecone.proto.MetadataSchema value) { + if (schemaBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + schema_ != null && + schema_ != io.pinecone.proto.MetadataSchema.getDefaultInstance()) { + getSchemaBuilder().mergeFrom(value); + } else { + schema_ = value; + } + } else { + schemaBuilder_.mergeFrom(value); + } + if (schema_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + public Builder clearSchema() { + bitField0_ = (bitField0_ & ~0x00000002); + schema_ = null; + if (schemaBuilder_ != null) { + schemaBuilder_.dispose(); + schemaBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + public io.pinecone.proto.MetadataSchema.Builder getSchemaBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSchemaFieldBuilder().getBuilder(); + } + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + public io.pinecone.proto.MetadataSchemaOrBuilder getSchemaOrBuilder() { + if (schemaBuilder_ != null) { + return schemaBuilder_.getMessageOrBuilder(); + } else { + return schema_ == null ? + io.pinecone.proto.MetadataSchema.getDefaultInstance() : schema_; + } + } + /** + *
+     * Schema for the behavior of Pinecone's internal metadata index.
+     * By default, all metadata is indexed; when `schema` is present,
+     * only fields which are present in the `fields` object with a
+     * `filterable: true` are indexed.
+     * Note that `filterable: false` is not currently supported.
+     * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.MetadataSchema, io.pinecone.proto.MetadataSchema.Builder, io.pinecone.proto.MetadataSchemaOrBuilder> + getSchemaFieldBuilder() { + if (schemaBuilder_ == null) { + schemaBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.MetadataSchema, io.pinecone.proto.MetadataSchema.Builder, io.pinecone.proto.MetadataSchemaOrBuilder>( + getSchema(), + getParentForChildren(), + isClean()); + schema_ = null; + } + return schemaBuilder_; + } + + // @@protoc_insertion_point(builder_scope:CreateNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:CreateNamespaceRequest) + private static final io.pinecone.proto.CreateNamespaceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.pinecone.proto.CreateNamespaceRequest(); + } + + public static io.pinecone.proto.CreateNamespaceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateNamespaceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.pinecone.proto.CreateNamespaceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/io/pinecone/proto/CreateNamespaceRequestOrBuilder.java b/src/main/java/io/pinecone/proto/CreateNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..d53d609d --- /dev/null +++ b/src/main/java/io/pinecone/proto/CreateNamespaceRequestOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +public interface CreateNamespaceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:CreateNamespaceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the namespace to be created
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The name of the namespace to be created
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Schema for the behavior of Pinecone's internal metadata index.
+   * By default, all metadata is indexed; when `schema` is present,
+   * only fields which are present in the `fields` object with a
+   * `filterable: true` are indexed.
+   * Note that `filterable: false` is not currently supported.
+   * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + *
+   * Schema for the behavior of Pinecone's internal metadata index.
+   * By default, all metadata is indexed; when `schema` is present,
+   * only fields which are present in the `fields` object with a
+   * `filterable: true` are indexed.
+   * Note that `filterable: false` is not currently supported.
+   * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + * @return The schema. + */ + io.pinecone.proto.MetadataSchema getSchema(); + /** + *
+   * Schema for the behavior of Pinecone's internal metadata index.
+   * By default, all metadata is indexed; when `schema` is present,
+   * only fields which are present in the `fields` object with a
+   * `filterable: true` are indexed.
+   * Note that `filterable: false` is not currently supported.
+   * 
+ * + * optional .MetadataSchema schema = 2 [json_name = "schema"]; + */ + io.pinecone.proto.MetadataSchemaOrBuilder getSchemaOrBuilder(); +} diff --git a/src/main/java/io/pinecone/proto/DbData202510.java b/src/main/java/io/pinecone/proto/DbData202510.java new file mode 100644 index 00000000..59a89cef --- /dev/null +++ b/src/main/java/io/pinecone/proto/DbData202510.java @@ -0,0 +1,648 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +public final class DbData202510 { + private DbData202510() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 3, + /* suffix= */ "", + DbData202510.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_SparseValues_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_SparseValues_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_Vector_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Vector_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_ScoredVector_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ScoredVector_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_RequestUnion_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RequestUnion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_UpsertRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_UpsertRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_UpsertResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_UpsertResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_DeleteRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DeleteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_DeleteResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DeleteResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_FetchRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_FetchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_FetchByMetadataRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_FetchByMetadataRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_FetchByMetadataResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_FetchByMetadataResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_FetchByMetadataResponse_VectorsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_FetchByMetadataResponse_VectorsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_FetchResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_FetchResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_FetchResponse_VectorsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_FetchResponse_VectorsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_ListRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ListRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_Pagination_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Pagination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_ListItem_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ListItem_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_ListResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ListResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_QueryVector_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_QueryVector_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_QueryRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_QueryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_SingleQueryResults_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_SingleQueryResults_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_QueryResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_QueryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_Usage_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Usage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_UpdateRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_UpdateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_UpdateResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_UpdateResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_DescribeIndexStatsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DescribeIndexStatsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_NamespaceSummary_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_NamespaceSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_ListNamespacesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ListNamespacesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_ListNamespacesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ListNamespacesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_DescribeNamespaceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DescribeNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_CreateNamespaceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_CreateNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_IndexedFields_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_IndexedFields_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_NamespaceDescription_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_NamespaceDescription_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_DeleteNamespaceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DeleteNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_DescribeIndexStatsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DescribeIndexStatsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_DescribeIndexStatsResponse_NamespacesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DescribeIndexStatsResponse_NamespacesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_MetadataFieldProperties_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_MetadataFieldProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_MetadataSchema_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_MetadataSchema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_MetadataSchema_FieldsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_MetadataSchema_FieldsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025db_data_2025-10.proto\032\034google/protobuf" + + "/struct.proto\032\034google/api/annotations.pr" + + "oto\032\037google/api/field_behavior.proto\"J\n\014" + + "SparseValues\022\035\n\007indices\030\001 \003(\rB\003\340A\002R\007indi" + + "ces\022\033\n\006values\030\002 \003(\002B\003\340A\002R\006values\"\236\001\n\006Vec" + + "tor\022\023\n\002id\030\001 \001(\tB\003\340A\002R\002id\022\026\n\006values\030\002 \003(\002" + + "R\006values\0222\n\rsparse_values\030\004 \001(\0132\r.Sparse" + + "ValuesR\014sparseValues\0223\n\010metadata\030\003 \001(\0132\027" + + ".google.protobuf.StructR\010metadata\"\272\001\n\014Sc" + + "oredVector\022\023\n\002id\030\001 \001(\tB\003\340A\002R\002id\022\024\n\005score" + + "\030\002 \001(\002R\005score\022\026\n\006values\030\003 \003(\002R\006values\0222\n" + + "\rsparse_values\030\005 \001(\0132\r.SparseValuesR\014spa" + + "rseValues\0223\n\010metadata\030\004 \001(\0132\027.google.pro" + + "tobuf.StructR\010metadata\"\241\001\n\014RequestUnion\022" + + "(\n\006upsert\030\001 \001(\0132\016.UpsertRequestH\000R\006upser" + + "t\022(\n\006delete\030\002 \001(\0132\016.DeleteRequestH\000R\006del" + + "ete\022(\n\006update\030\003 \001(\0132\016.UpdateRequestH\000R\006u" + + "pdateB\023\n\021RequestUnionInner\"U\n\rUpsertRequ" + + "est\022&\n\007vectors\030\001 \003(\0132\007.VectorB\003\340A\002R\007vect" + + "ors\022\034\n\tnamespace\030\002 \001(\tR\tnamespace\"7\n\016Ups" + + "ertResponse\022%\n\016upserted_count\030\001 \001(\rR\rups" + + "ertedCount\"\217\001\n\rDeleteRequest\022\020\n\003ids\030\001 \003(" + + "\tR\003ids\022\035\n\ndelete_all\030\002 \001(\010R\tdeleteAll\022\034\n" + + "\tnamespace\030\003 \001(\tR\tnamespace\022/\n\006filter\030\004 " + + "\001(\0132\027.google.protobuf.StructR\006filter\"\020\n\016" + + "DeleteResponse\"C\n\014FetchRequest\022\025\n\003ids\030\001 " + + "\003(\tB\003\340A\002R\003ids\022\034\n\tnamespace\030\002 \001(\tR\tnamesp" + + "ace\"\341\001\n\026FetchByMetadataRequest\022\034\n\tnamesp" + + "ace\030\001 \001(\tR\tnamespace\0224\n\006filter\030\002 \001(\0132\027.g" + + "oogle.protobuf.StructH\000R\006filter\210\001\001\022\031\n\005li" + + "mit\030\003 \001(\rH\001R\005limit\210\001\001\022.\n\020pagination_toke" + + "n\030\004 \001(\tH\002R\017paginationToken\210\001\001B\t\n\007_filter" + + "B\010\n\006_limitB\023\n\021_pagination_token\"\253\002\n\027Fetc" + + "hByMetadataResponse\022?\n\007vectors\030\001 \003(\0132%.F" + + "etchByMetadataResponse.VectorsEntryR\007vec" + + "tors\022\034\n\tnamespace\030\002 \001(\tR\tnamespace\022!\n\005us" + + "age\030\003 \001(\0132\006.UsageH\000R\005usage\210\001\001\0220\n\npaginat" + + "ion\030\004 \001(\0132\013.PaginationH\001R\npagination\210\001\001\032" + + "C\n\014VectorsEntry\022\020\n\003key\030\001 \001(\tR\003key\022\035\n\005val" + + "ue\030\002 \001(\0132\007.VectorR\005value:\0028\001B\010\n\006_usageB\r" + + "\n\013_pagination\"\326\001\n\rFetchResponse\0225\n\007vecto" + + "rs\030\001 \003(\0132\033.FetchResponse.VectorsEntryR\007v" + + "ectors\022\034\n\tnamespace\030\002 \001(\tR\tnamespace\022!\n\005" + + "usage\030\003 \001(\0132\006.UsageH\000R\005usage\210\001\001\032C\n\014Vecto" + + "rsEntry\022\020\n\003key\030\001 \001(\tR\003key\022\035\n\005value\030\002 \001(\013" + + "2\007.VectorR\005value:\0028\001B\010\n\006_usage\"\275\001\n\013ListR" + + "equest\022\033\n\006prefix\030\001 \001(\tH\000R\006prefix\210\001\001\022\031\n\005l" + + "imit\030\002 \001(\rH\001R\005limit\210\001\001\022.\n\020pagination_tok" + + "en\030\003 \001(\tH\002R\017paginationToken\210\001\001\022\034\n\tnamesp" + + "ace\030\004 \001(\tR\tnamespaceB\t\n\007_prefixB\010\n\006_limi" + + "tB\023\n\021_pagination_token\" \n\nPagination\022\022\n\004" + + "next\030\001 \001(\tR\004next\"\032\n\010ListItem\022\016\n\002id\030\001 \001(\t" + + "R\002id\"\277\001\n\014ListResponse\022#\n\007vectors\030\001 \003(\0132\t" + + ".ListItemR\007vectors\0220\n\npagination\030\002 \001(\0132\013" + + ".PaginationH\000R\npagination\210\001\001\022\034\n\tnamespac" + + "e\030\003 \001(\tR\tnamespace\022!\n\005usage\030\004 \001(\0132\006.Usag" + + "eH\001R\005usage\210\001\001B\r\n\013_paginationB\010\n\006_usage\"\275" + + "\001\n\013QueryVector\022\026\n\006values\030\001 \003(\002R\006values\0222" + + "\n\rsparse_values\030\005 \001(\0132\r.SparseValuesR\014sp" + + "arseValues\022\023\n\005top_k\030\002 \001(\rR\004topK\022\034\n\tnames" + + "pace\030\003 \001(\tR\tnamespace\022/\n\006filter\030\004 \001(\0132\027." + + "google.protobuf.StructR\006filter\"\321\002\n\014Query" + + "Request\022\034\n\tnamespace\030\001 \001(\tR\tnamespace\022\030\n" + + "\005top_k\030\002 \001(\rB\003\340A\002R\004topK\022/\n\006filter\030\003 \001(\0132" + + "\027.google.protobuf.StructR\006filter\022%\n\016incl" + + "ude_values\030\004 \001(\010R\rincludeValues\022)\n\020inclu" + + "de_metadata\030\005 \001(\010R\017includeMetadata\022*\n\007qu" + + "eries\030\006 \003(\0132\014.QueryVectorB\002\030\001R\007queries\022\026" + + "\n\006vector\030\007 \003(\002R\006vector\0222\n\rsparse_vector\030" + + "\t \001(\0132\r.SparseValuesR\014sparseVector\022\016\n\002id" + + "\030\010 \001(\tR\002id\"[\n\022SingleQueryResults\022\'\n\007matc" + + "hes\030\001 \003(\0132\r.ScoredVectorR\007matches\022\034\n\tnam" + + "espace\030\002 \001(\tR\tnamespace\"\266\001\n\rQueryRespons" + + "e\0221\n\007results\030\001 \003(\0132\023.SingleQueryResultsB" + + "\002\030\001R\007results\022\'\n\007matches\030\002 \003(\0132\r.ScoredVe" + + "ctorR\007matches\022\034\n\tnamespace\030\003 \001(\tR\tnamesp" + + "ace\022!\n\005usage\030\004 \001(\0132\006.UsageH\000R\005usage\210\001\001B\010" + + "\n\006_usage\":\n\005Usage\022\"\n\nread_units\030\001 \001(\rH\000R" + + "\treadUnits\210\001\001B\r\n\013_read_units\"\260\002\n\rUpdateR" + + "equest\022\016\n\002id\030\001 \001(\tR\002id\022\026\n\006values\030\002 \003(\002R\006" + + "values\0222\n\rsparse_values\030\005 \001(\0132\r.SparseVa" + + "luesR\014sparseValues\022:\n\014set_metadata\030\003 \001(\013" + + "2\027.google.protobuf.StructR\013setMetadata\022\034" + + "\n\tnamespace\030\004 \001(\tR\tnamespace\0224\n\006filter\030\006" + + " \001(\0132\027.google.protobuf.StructH\000R\006filter\210" + + "\001\001\022\034\n\007dry_run\030\007 \001(\010H\001R\006dryRun\210\001\001B\t\n\007_fil" + + "terB\n\n\010_dry_run\"R\n\016UpdateResponse\022,\n\017mat" + + "ched_records\030\001 \001(\005H\000R\016matchedRecords\210\001\001B" + + "\022\n\020_matched_records\"L\n\031DescribeIndexStat" + + "sRequest\022/\n\006filter\030\001 \001(\0132\027.google.protob" + + "uf.StructR\006filter\"5\n\020NamespaceSummary\022!\n" + + "\014vector_count\030\001 \001(\rR\013vectorCount\"\251\001\n\025Lis" + + "tNamespacesRequest\022.\n\020pagination_token\030\001" + + " \001(\tH\000R\017paginationToken\210\001\001\022\031\n\005limit\030\002 \001(" + + "\rH\001R\005limit\210\001\001\022\033\n\006prefix\030\003 \001(\tH\002R\006prefix\210" + + "\001\001B\023\n\021_pagination_tokenB\010\n\006_limitB\t\n\007_pr" + + "efix\"\261\001\n\026ListNamespacesResponse\0225\n\nnames" + + "paces\030\001 \003(\0132\025.NamespaceDescriptionR\nname" + + "spaces\0220\n\npagination\030\002 \001(\0132\013.PaginationH" + + "\000R\npagination\210\001\001\022\037\n\013total_count\030\003 \001(\005R\nt" + + "otalCountB\r\n\013_pagination\"8\n\030DescribeName" + + "spaceRequest\022\034\n\tnamespace\030\001 \001(\tR\tnamespa" + + "ce\"e\n\026CreateNamespaceRequest\022\022\n\004name\030\001 \001" + + "(\tR\004name\022,\n\006schema\030\002 \001(\0132\017.MetadataSchem" + + "aH\000R\006schema\210\001\001B\t\n\007_schema\"\'\n\rIndexedFiel" + + "ds\022\026\n\006fields\030\001 \003(\tR\006fields\"\325\001\n\024Namespace" + + "Description\022\022\n\004name\030\001 \001(\tR\004name\022!\n\014recor" + + "d_count\030\002 \001(\004R\013recordCount\022,\n\006schema\030\003 \001" + + "(\0132\017.MetadataSchemaH\000R\006schema\210\001\001\022:\n\016inde" + + "xed_fields\030\004 \001(\0132\016.IndexedFieldsH\001R\rinde" + + "xedFields\210\001\001B\t\n\007_schemaB\021\n\017_indexed_fiel" + + "ds\"6\n\026DeleteNamespaceRequest\022\034\n\tnamespac" + + "e\030\001 \001(\tR\tnamespace\"\246\004\n\032DescribeIndexStat" + + "sResponse\022K\n\nnamespaces\030\001 \003(\0132+.Describe" + + "IndexStatsResponse.NamespacesEntryR\nname" + + "spaces\022!\n\tdimension\030\002 \001(\rH\000R\tdimension\210\001" + + "\001\022%\n\016index_fullness\030\003 \001(\002R\rindexFullness" + + "\022,\n\022total_vector_count\030\004 \001(\rR\020totalVecto" + + "rCount\022\033\n\006metric\030\005 \001(\tH\001R\006metric\210\001\001\022$\n\013v" + + "ector_type\030\006 \001(\tH\002R\nvectorType\210\001\001\022,\n\017mem" + + "ory_fullness\030\007 \001(\002H\003R\016memoryFullness\210\001\001\022" + + ".\n\020storage_fullness\030\010 \001(\002H\004R\017storageFull" + + "ness\210\001\001\032P\n\017NamespacesEntry\022\020\n\003key\030\001 \001(\tR" + + "\003key\022\'\n\005value\030\002 \001(\0132\021.NamespaceSummaryR\005" + + "value:\0028\001B\014\n\n_dimensionB\t\n\007_metricB\016\n\014_v" + + "ector_typeB\022\n\020_memory_fullnessB\023\n\021_stora" + + "ge_fullness\"9\n\027MetadataFieldProperties\022\036" + + "\n\nfilterable\030\001 \001(\010R\nfilterable\"\232\001\n\016Metad" + + "ataSchema\0223\n\006fields\030\001 \003(\0132\033.MetadataSche" + + "ma.FieldsEntryR\006fields\032S\n\013FieldsEntry\022\020\n" + + "\003key\030\001 \001(\tR\003key\022.\n\005value\030\002 \001(\0132\030.Metadat" + + "aFieldPropertiesR\005value:\0028\0012\234\010\n\rVectorSe" + + "rvice\022E\n\006Upsert\022\016.UpsertRequest\032\017.Upsert" + + "Response\"\032\202\323\344\223\002\024\"\017/vectors/upsert:\001*\022X\n\006" + + "Delete\022\016.DeleteRequest\032\017.DeleteResponse\"" + + "-\202\323\344\223\002\'\"\017/vectors/delete:\001*Z\021*\017/vectors/" + + "delete\022>\n\005Fetch\022\r.FetchRequest\032\016.FetchRe" + + "sponse\"\026\202\323\344\223\002\020\022\016/vectors/fetch\022:\n\004List\022\014" + + ".ListRequest\032\r.ListResponse\"\025\202\323\344\223\002\017\022\r/ve" + + "ctors/list\0229\n\005Query\022\r.QueryRequest\032\016.Que" + + "ryResponse\"\021\202\323\344\223\002\013\"\006/query:\001*\022E\n\006Update\022" + + "\016.UpdateRequest\032\017.UpdateResponse\"\032\202\323\344\223\002\024" + + "\"\017/vectors/update:\001*\022\210\001\n\022DescribeIndexSt" + + "ats\022\032.DescribeIndexStatsRequest\032\033.Descri" + + "beIndexStatsResponse\"9\202\323\344\223\0023\"\025/describe_" + + "index_stats:\001*Z\027\022\025/describe_index_stats\022" + + "V\n\016ListNamespaces\022\026.ListNamespacesReques" + + "t\032\027.ListNamespacesResponse\"\023\202\323\344\223\002\r\022\013/nam" + + "espaces\022f\n\021DescribeNamespace\022\031.DescribeN" + + "amespaceRequest\032\025.NamespaceDescription\"\037" + + "\202\323\344\223\002\031\022\027/namespaces/{namespace}\022\\\n\017Delet" + + "eNamespace\022\027.DeleteNamespaceRequest\032\017.De" + + "leteResponse\"\037\202\323\344\223\002\031*\027/namespaces/{names" + + "pace}\022V\n\017CreateNamespace\022\027.CreateNamespa" + + "ceRequest\032\025.NamespaceDescription\"\023\202\323\344\223\002\r" + + "\"\013/namespaces\022k\n\017FetchByMetadata\022\027.Fetch" + + "ByMetadataRequest\032\030.FetchByMetadataRespo" + + "nse\"%\202\323\344\223\002\037\"\032/vectors/fetch_by_metadata:" + + "\001*BS\n\021io.pinecone.protoP\001Z * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive * with specifying ids to delete in the ids param or using `delete_all=True`. - * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). - * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID. + * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata). *
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -186,8 +185,7 @@ public boolean hasFilter() { *
    * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
    * with specifying ids to delete in the ids param or using `delete_all=True`.
-   * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-   * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+   * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
    * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -201,8 +199,7 @@ public com.google.protobuf.Struct getFilter() { *
    * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
    * with specifying ids to delete in the ids param or using `delete_all=True`.
-   * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-   * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+   * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
    * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -426,13 +423,13 @@ public static final class Builder extends io.pinecone.proto.DeleteRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DeleteRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DeleteRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DeleteRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DeleteRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DeleteRequest.class, io.pinecone.proto.DeleteRequest.Builder.class); } @@ -472,7 +469,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_DeleteRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DeleteRequest_descriptor; } @java.lang.Override @@ -908,8 +905,7 @@ public Builder setNamespaceBytes( *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -922,8 +918,7 @@ public boolean hasFilter() { *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -940,8 +935,7 @@ public com.google.protobuf.Struct getFilter() { *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -963,8 +957,7 @@ public Builder setFilter(com.google.protobuf.Struct value) { *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -984,8 +977,7 @@ public Builder setFilter( *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -1012,8 +1004,7 @@ public Builder mergeFilter(com.google.protobuf.Struct value) { *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -1032,8 +1023,7 @@ public Builder clearFilter() { *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -1047,8 +1037,7 @@ public com.google.protobuf.Struct.Builder getFilterBuilder() { *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -1065,8 +1054,7 @@ public com.google.protobuf.StructOrBuilder getFilterOrBuilder() { *
      * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
      * with specifying ids to delete in the ids param or using `delete_all=True`.
-     * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-     * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
      * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; diff --git a/src/main/java/io/pinecone/proto/DeleteRequestOrBuilder.java b/src/main/java/io/pinecone/proto/DeleteRequestOrBuilder.java index 85727f24..ebe9894e 100644 --- a/src/main/java/io/pinecone/proto/DeleteRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/DeleteRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -84,8 +84,7 @@ public interface DeleteRequestOrBuilder extends *
    * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
    * with specifying ids to delete in the ids param or using `delete_all=True`.
-   * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-   * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+   * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
    * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -96,8 +95,7 @@ public interface DeleteRequestOrBuilder extends *
    * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
    * with specifying ids to delete in the ids param or using `delete_all=True`.
-   * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-   * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+   * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
    * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; @@ -108,8 +106,7 @@ public interface DeleteRequestOrBuilder extends *
    * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
    * with specifying ids to delete in the ids param or using `delete_all=True`.
-   * For guidance and examples, see [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata).
-   * Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID.
+   * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata).
    * 
* * .google.protobuf.Struct filter = 4 [json_name = "filter"]; diff --git a/src/main/java/io/pinecone/proto/DeleteResponse.java b/src/main/java/io/pinecone/proto/DeleteResponse.java index 65653242..90235c05 100644 --- a/src/main/java/io/pinecone/proto/DeleteResponse.java +++ b/src/main/java/io/pinecone/proto/DeleteResponse.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -35,13 +35,13 @@ private DeleteResponse() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DeleteResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DeleteResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DeleteResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DeleteResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DeleteResponse.class, io.pinecone.proto.DeleteResponse.Builder.class); } @@ -205,13 +205,13 @@ public static final class Builder extends io.pinecone.proto.DeleteResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DeleteResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DeleteResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DeleteResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DeleteResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DeleteResponse.class, io.pinecone.proto.DeleteResponse.Builder.class); } @@ -235,7 +235,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_DeleteResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DeleteResponse_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/DeleteResponseOrBuilder.java b/src/main/java/io/pinecone/proto/DeleteResponseOrBuilder.java index e38fead4..8ab8b4cd 100644 --- a/src/main/java/io/pinecone/proto/DeleteResponseOrBuilder.java +++ b/src/main/java/io/pinecone/proto/DeleteResponseOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/DescribeIndexStatsRequest.java b/src/main/java/io/pinecone/proto/DescribeIndexStatsRequest.java index 257bf1f8..50a64bb3 100644 --- a/src/main/java/io/pinecone/proto/DescribeIndexStatsRequest.java +++ b/src/main/java/io/pinecone/proto/DescribeIndexStatsRequest.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -35,13 +35,13 @@ private DescribeIndexStatsRequest() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DescribeIndexStatsRequest.class, io.pinecone.proto.DescribeIndexStatsRequest.Builder.class); } @@ -53,7 +53,7 @@ private DescribeIndexStatsRequest() { *
    * If this parameter is present, the operation only returns statistics
    * for vectors that satisfy the filter.
-   * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+   * See https://docs.pinecone.io/guides/search/filter-with-metadata.
    * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -67,7 +67,7 @@ public boolean hasFilter() { *
    * If this parameter is present, the operation only returns statistics
    * for vectors that satisfy the filter.
-   * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+   * See https://docs.pinecone.io/guides/search/filter-with-metadata.
    * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -81,7 +81,7 @@ public com.google.protobuf.Struct getFilter() { *
    * If this parameter is present, the operation only returns statistics
    * for vectors that satisfy the filter.
-   * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+   * See https://docs.pinecone.io/guides/search/filter-with-metadata.
    * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -266,13 +266,13 @@ public static final class Builder extends io.pinecone.proto.DescribeIndexStatsRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DescribeIndexStatsRequest.class, io.pinecone.proto.DescribeIndexStatsRequest.Builder.class); } @@ -308,7 +308,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsRequest_descriptor; } @java.lang.Override @@ -417,7 +417,7 @@ public Builder mergeFrom( *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -430,7 +430,7 @@ public boolean hasFilter() { *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -447,7 +447,7 @@ public com.google.protobuf.Struct getFilter() { *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -469,7 +469,7 @@ public Builder setFilter(com.google.protobuf.Struct value) { *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -489,7 +489,7 @@ public Builder setFilter( *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -516,7 +516,7 @@ public Builder mergeFilter(com.google.protobuf.Struct value) { *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -535,7 +535,7 @@ public Builder clearFilter() { *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -549,7 +549,7 @@ public com.google.protobuf.Struct.Builder getFilterBuilder() { *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -566,7 +566,7 @@ public com.google.protobuf.StructOrBuilder getFilterOrBuilder() { *
      * If this parameter is present, the operation only returns statistics
      * for vectors that satisfy the filter.
-     * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+     * See https://docs.pinecone.io/guides/search/filter-with-metadata.
      * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; diff --git a/src/main/java/io/pinecone/proto/DescribeIndexStatsRequestOrBuilder.java b/src/main/java/io/pinecone/proto/DescribeIndexStatsRequestOrBuilder.java index 92623536..ec369eeb 100644 --- a/src/main/java/io/pinecone/proto/DescribeIndexStatsRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/DescribeIndexStatsRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -13,7 +13,7 @@ public interface DescribeIndexStatsRequestOrBuilder extends *
    * If this parameter is present, the operation only returns statistics
    * for vectors that satisfy the filter.
-   * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+   * See https://docs.pinecone.io/guides/search/filter-with-metadata.
    * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -24,7 +24,7 @@ public interface DescribeIndexStatsRequestOrBuilder extends *
    * If this parameter is present, the operation only returns statistics
    * for vectors that satisfy the filter.
-   * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+   * See https://docs.pinecone.io/guides/search/filter-with-metadata.
    * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; @@ -35,7 +35,7 @@ public interface DescribeIndexStatsRequestOrBuilder extends *
    * If this parameter is present, the operation only returns statistics
    * for vectors that satisfy the filter.
-   * See https://docs.pinecone.io/guides/data/filtering-with-metadata.
+   * See https://docs.pinecone.io/guides/search/filter-with-metadata.
    * 
* * .google.protobuf.Struct filter = 1 [json_name = "filter"]; diff --git a/src/main/java/io/pinecone/proto/DescribeIndexStatsResponse.java b/src/main/java/io/pinecone/proto/DescribeIndexStatsResponse.java index 3f8dc79d..0d034360 100644 --- a/src/main/java/io/pinecone/proto/DescribeIndexStatsResponse.java +++ b/src/main/java/io/pinecone/proto/DescribeIndexStatsResponse.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -37,7 +37,7 @@ private DescribeIndexStatsResponse() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsResponse_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -55,7 +55,7 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DescribeIndexStatsResponse.class, io.pinecone.proto.DescribeIndexStatsResponse.Builder.class); } @@ -67,7 +67,7 @@ private static final class NamespacesDefaultEntryHolder { java.lang.String, io.pinecone.proto.NamespaceSummary> defaultEntry = com.google.protobuf.MapEntry .newDefaultInstance( - io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsResponse_NamespacesEntry_descriptor, + io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsResponse_NamespacesEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.MESSAGE, @@ -343,6 +343,60 @@ public java.lang.String getVectorType() { } } + public static final int MEMORY_FULLNESS_FIELD_NUMBER = 7; + private float memoryFullness_ = 0F; + /** + *
+   * The amount of memory used by a dedicated index
+   * 
+ * + * optional float memory_fullness = 7 [json_name = "memoryFullness"]; + * @return Whether the memoryFullness field is set. + */ + @java.lang.Override + public boolean hasMemoryFullness() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+   * The amount of memory used by a dedicated index
+   * 
+ * + * optional float memory_fullness = 7 [json_name = "memoryFullness"]; + * @return The memoryFullness. + */ + @java.lang.Override + public float getMemoryFullness() { + return memoryFullness_; + } + + public static final int STORAGE_FULLNESS_FIELD_NUMBER = 8; + private float storageFullness_ = 0F; + /** + *
+   * The amount of storage used by a dedicated index
+   * 
+ * + * optional float storage_fullness = 8 [json_name = "storageFullness"]; + * @return Whether the storageFullness field is set. + */ + @java.lang.Override + public boolean hasStorageFullness() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+   * The amount of storage used by a dedicated index
+   * 
+ * + * optional float storage_fullness = 8 [json_name = "storageFullness"]; + * @return The storageFullness. + */ + @java.lang.Override + public float getStorageFullness() { + return storageFullness_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -378,6 +432,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 6, vectorType_); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeFloat(7, memoryFullness_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeFloat(8, storageFullness_); + } getUnknownFields().writeTo(output); } @@ -415,6 +475,14 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(6, vectorType_); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(7, memoryFullness_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(8, storageFullness_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -452,6 +520,18 @@ public boolean equals(final java.lang.Object obj) { if (!getVectorType() .equals(other.getVectorType())) return false; } + if (hasMemoryFullness() != other.hasMemoryFullness()) return false; + if (hasMemoryFullness()) { + if (java.lang.Float.floatToIntBits(getMemoryFullness()) + != java.lang.Float.floatToIntBits( + other.getMemoryFullness())) return false; + } + if (hasStorageFullness() != other.hasStorageFullness()) return false; + if (hasStorageFullness()) { + if (java.lang.Float.floatToIntBits(getStorageFullness()) + != java.lang.Float.floatToIntBits( + other.getStorageFullness())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -484,6 +564,16 @@ public int hashCode() { hash = (37 * hash) + VECTOR_TYPE_FIELD_NUMBER; hash = (53 * hash) + getVectorType().hashCode(); } + if (hasMemoryFullness()) { + hash = (37 * hash) + MEMORY_FULLNESS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMemoryFullness()); + } + if (hasStorageFullness()) { + hash = (37 * hash) + STORAGE_FULLNESS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getStorageFullness()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -594,7 +684,7 @@ public static final class Builder extends io.pinecone.proto.DescribeIndexStatsResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsResponse_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -622,7 +712,7 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFi @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DescribeIndexStatsResponse.class, io.pinecone.proto.DescribeIndexStatsResponse.Builder.class); } @@ -647,13 +737,15 @@ public Builder clear() { totalVectorCount_ = 0; metric_ = ""; vectorType_ = ""; + memoryFullness_ = 0F; + storageFullness_ = 0F; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_DescribeIndexStatsResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeIndexStatsResponse_descriptor; } @java.lang.Override @@ -702,6 +794,14 @@ private void buildPartial0(io.pinecone.proto.DescribeIndexStatsResponse result) result.vectorType_ = vectorType_; to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.memoryFullness_ = memoryFullness_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.storageFullness_ = storageFullness_; + to_bitField0_ |= 0x00000010; + } result.bitField0_ |= to_bitField0_; } @@ -739,6 +839,12 @@ public Builder mergeFrom(io.pinecone.proto.DescribeIndexStatsResponse other) { bitField0_ |= 0x00000020; onChanged(); } + if (other.hasMemoryFullness()) { + setMemoryFullness(other.getMemoryFullness()); + } + if (other.hasStorageFullness()) { + setStorageFullness(other.getStorageFullness()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -799,6 +905,16 @@ public Builder mergeFrom( bitField0_ |= 0x00000020; break; } // case 50 + case 61: { + memoryFullness_ = input.readFloat(); + bitField0_ |= 0x00000040; + break; + } // case 61 + case 69: { + storageFullness_ = input.readFloat(); + bitField0_ |= 0x00000080; + break; + } // case 69 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1381,6 +1497,118 @@ public Builder setVectorTypeBytes( return this; } + private float memoryFullness_ ; + /** + *
+     * The amount of memory used by a dedicated index
+     * 
+ * + * optional float memory_fullness = 7 [json_name = "memoryFullness"]; + * @return Whether the memoryFullness field is set. + */ + @java.lang.Override + public boolean hasMemoryFullness() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
+     * The amount of memory used by a dedicated index
+     * 
+ * + * optional float memory_fullness = 7 [json_name = "memoryFullness"]; + * @return The memoryFullness. + */ + @java.lang.Override + public float getMemoryFullness() { + return memoryFullness_; + } + /** + *
+     * The amount of memory used by a dedicated index
+     * 
+ * + * optional float memory_fullness = 7 [json_name = "memoryFullness"]; + * @param value The memoryFullness to set. + * @return This builder for chaining. + */ + public Builder setMemoryFullness(float value) { + + memoryFullness_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * The amount of memory used by a dedicated index
+     * 
+ * + * optional float memory_fullness = 7 [json_name = "memoryFullness"]; + * @return This builder for chaining. + */ + public Builder clearMemoryFullness() { + bitField0_ = (bitField0_ & ~0x00000040); + memoryFullness_ = 0F; + onChanged(); + return this; + } + + private float storageFullness_ ; + /** + *
+     * The amount of storage used by a dedicated index
+     * 
+ * + * optional float storage_fullness = 8 [json_name = "storageFullness"]; + * @return Whether the storageFullness field is set. + */ + @java.lang.Override + public boolean hasStorageFullness() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
+     * The amount of storage used by a dedicated index
+     * 
+ * + * optional float storage_fullness = 8 [json_name = "storageFullness"]; + * @return The storageFullness. + */ + @java.lang.Override + public float getStorageFullness() { + return storageFullness_; + } + /** + *
+     * The amount of storage used by a dedicated index
+     * 
+ * + * optional float storage_fullness = 8 [json_name = "storageFullness"]; + * @param value The storageFullness to set. + * @return This builder for chaining. + */ + public Builder setStorageFullness(float value) { + + storageFullness_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * The amount of storage used by a dedicated index
+     * 
+ * + * optional float storage_fullness = 8 [json_name = "storageFullness"]; + * @return This builder for chaining. + */ + public Builder clearStorageFullness() { + bitField0_ = (bitField0_ & ~0x00000080); + storageFullness_ = 0F; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:DescribeIndexStatsResponse) } diff --git a/src/main/java/io/pinecone/proto/DescribeIndexStatsResponseOrBuilder.java b/src/main/java/io/pinecone/proto/DescribeIndexStatsResponseOrBuilder.java index 702a9bb7..708c355d 100644 --- a/src/main/java/io/pinecone/proto/DescribeIndexStatsResponseOrBuilder.java +++ b/src/main/java/io/pinecone/proto/DescribeIndexStatsResponseOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -173,4 +173,42 @@ io.pinecone.proto.NamespaceSummary getNamespacesOrThrow( */ com.google.protobuf.ByteString getVectorTypeBytes(); + + /** + *
+   * The amount of memory used by a dedicated index
+   * 
+ * + * optional float memory_fullness = 7 [json_name = "memoryFullness"]; + * @return Whether the memoryFullness field is set. + */ + boolean hasMemoryFullness(); + /** + *
+   * The amount of memory used by a dedicated index
+   * 
+ * + * optional float memory_fullness = 7 [json_name = "memoryFullness"]; + * @return The memoryFullness. + */ + float getMemoryFullness(); + + /** + *
+   * The amount of storage used by a dedicated index
+   * 
+ * + * optional float storage_fullness = 8 [json_name = "storageFullness"]; + * @return Whether the storageFullness field is set. + */ + boolean hasStorageFullness(); + /** + *
+   * The amount of storage used by a dedicated index
+   * 
+ * + * optional float storage_fullness = 8 [json_name = "storageFullness"]; + * @return The storageFullness. + */ + float getStorageFullness(); } diff --git a/src/main/java/io/pinecone/proto/DescribeNamespaceRequest.java b/src/main/java/io/pinecone/proto/DescribeNamespaceRequest.java index bfe4d089..089479a7 100644 --- a/src/main/java/io/pinecone/proto/DescribeNamespaceRequest.java +++ b/src/main/java/io/pinecone/proto/DescribeNamespaceRequest.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -36,13 +36,13 @@ private DescribeNamespaceRequest() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DescribeNamespaceRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeNamespaceRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DescribeNamespaceRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DescribeNamespaceRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DescribeNamespaceRequest.class, io.pinecone.proto.DescribeNamespaceRequest.Builder.class); } @@ -263,13 +263,13 @@ public static final class Builder extends io.pinecone.proto.DescribeNamespaceRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_DescribeNamespaceRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeNamespaceRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_DescribeNamespaceRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_DescribeNamespaceRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.DescribeNamespaceRequest.class, io.pinecone.proto.DescribeNamespaceRequest.Builder.class); } @@ -295,7 +295,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_DescribeNamespaceRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_DescribeNamespaceRequest_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/DescribeNamespaceRequestOrBuilder.java b/src/main/java/io/pinecone/proto/DescribeNamespaceRequestOrBuilder.java index bac25ec3..0b811be0 100644 --- a/src/main/java/io/pinecone/proto/DescribeNamespaceRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/DescribeNamespaceRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/FetchByMetadataRequest.java b/src/main/java/io/pinecone/proto/FetchByMetadataRequest.java new file mode 100644 index 00000000..4b7f79c8 --- /dev/null +++ b/src/main/java/io/pinecone/proto/FetchByMetadataRequest.java @@ -0,0 +1,1047 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +/** + * Protobuf type {@code FetchByMetadataRequest} + */ +public final class FetchByMetadataRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:FetchByMetadataRequest) + FetchByMetadataRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 3, + /* suffix= */ "", + FetchByMetadataRequest.class.getName()); + } + // Use FetchByMetadataRequest.newBuilder() to construct. + private FetchByMetadataRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FetchByMetadataRequest() { + namespace_ = ""; + paginationToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.FetchByMetadataRequest.class, io.pinecone.proto.FetchByMetadataRequest.Builder.class); + } + + private int bitField0_; + public static final int NAMESPACE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object namespace_ = ""; + /** + * string namespace = 1 [json_name = "namespace"]; + * @return The namespace. + */ + @java.lang.Override + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespace_ = s; + return s; + } + } + /** + * string namespace = 1 [json_name = "namespace"]; + * @return The bytes for namespace. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private com.google.protobuf.Struct filter_; + /** + *
+   * Metadata filter
+   * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + * @return Whether the filter field is set. + */ + @java.lang.Override + public boolean hasFilter() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * Metadata filter
+   * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + * @return The filter. + */ + @java.lang.Override + public com.google.protobuf.Struct getFilter() { + return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_; + } + /** + *
+   * Metadata filter
+   * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getFilterOrBuilder() { + return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_; + } + + public static final int LIMIT_FIELD_NUMBER = 3; + private int limit_ = 0; + /** + *
+   * Max number of ids to return
+   * 
+ * + * optional uint32 limit = 3 [json_name = "limit"]; + * @return Whether the limit field is set. + */ + @java.lang.Override + public boolean hasLimit() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * Max number of ids to return
+   * 
+ * + * optional uint32 limit = 3 [json_name = "limit"]; + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + + public static final int PAGINATION_TOKEN_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object paginationToken_ = ""; + /** + *
+   * Pagination token to continue a previous listing operation
+   * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return Whether the paginationToken field is set. + */ + @java.lang.Override + public boolean hasPaginationToken() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+   * Pagination token to continue a previous listing operation
+   * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return The paginationToken. + */ + @java.lang.Override + public java.lang.String getPaginationToken() { + java.lang.Object ref = paginationToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + paginationToken_ = s; + return s; + } + } + /** + *
+   * Pagination token to continue a previous listing operation
+   * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return The bytes for paginationToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPaginationTokenBytes() { + java.lang.Object ref = paginationToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + paginationToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(namespace_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, namespace_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFilter()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeUInt32(3, limit_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, paginationToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(namespace_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, namespace_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFilter()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, limit_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, paginationToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.pinecone.proto.FetchByMetadataRequest)) { + return super.equals(obj); + } + io.pinecone.proto.FetchByMetadataRequest other = (io.pinecone.proto.FetchByMetadataRequest) obj; + + if (!getNamespace() + .equals(other.getNamespace())) return false; + if (hasFilter() != other.hasFilter()) return false; + if (hasFilter()) { + if (!getFilter() + .equals(other.getFilter())) return false; + } + if (hasLimit() != other.hasLimit()) return false; + if (hasLimit()) { + if (getLimit() + != other.getLimit()) return false; + } + if (hasPaginationToken() != other.hasPaginationToken()) return false; + if (hasPaginationToken()) { + if (!getPaginationToken() + .equals(other.getPaginationToken())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + if (hasFilter()) { + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + } + if (hasLimit()) { + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit(); + } + if (hasPaginationToken()) { + hash = (37 * hash) + PAGINATION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPaginationToken().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.pinecone.proto.FetchByMetadataRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.pinecone.proto.FetchByMetadataRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.pinecone.proto.FetchByMetadataRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.FetchByMetadataRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.pinecone.proto.FetchByMetadataRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code FetchByMetadataRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:FetchByMetadataRequest) + io.pinecone.proto.FetchByMetadataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.FetchByMetadataRequest.class, io.pinecone.proto.FetchByMetadataRequest.Builder.class); + } + + // Construct using io.pinecone.proto.FetchByMetadataRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getFilterFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + namespace_ = ""; + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + limit_ = 0; + paginationToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataRequest_descriptor; + } + + @java.lang.Override + public io.pinecone.proto.FetchByMetadataRequest getDefaultInstanceForType() { + return io.pinecone.proto.FetchByMetadataRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.pinecone.proto.FetchByMetadataRequest build() { + io.pinecone.proto.FetchByMetadataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.pinecone.proto.FetchByMetadataRequest buildPartial() { + io.pinecone.proto.FetchByMetadataRequest result = new io.pinecone.proto.FetchByMetadataRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.pinecone.proto.FetchByMetadataRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.namespace_ = namespace_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filterBuilder_ == null + ? filter_ + : filterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.limit_ = limit_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.paginationToken_ = paginationToken_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.pinecone.proto.FetchByMetadataRequest) { + return mergeFrom((io.pinecone.proto.FetchByMetadataRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.pinecone.proto.FetchByMetadataRequest other) { + if (other == io.pinecone.proto.FetchByMetadataRequest.getDefaultInstance()) return this; + if (!other.getNamespace().isEmpty()) { + namespace_ = other.namespace_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFilter()) { + mergeFilter(other.getFilter()); + } + if (other.hasLimit()) { + setLimit(other.getLimit()); + } + if (other.hasPaginationToken()) { + paginationToken_ = other.paginationToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + namespace_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getFilterFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + limit_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + paginationToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object namespace_ = ""; + /** + * string namespace = 1 [json_name = "namespace"]; + * @return The namespace. + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string namespace = 1 [json_name = "namespace"]; + * @return The bytes for namespace. + */ + public com.google.protobuf.ByteString + getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string namespace = 1 [json_name = "namespace"]; + * @param value The namespace to set. + * @return This builder for chaining. + */ + public Builder setNamespace( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + namespace_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string namespace = 1 [json_name = "namespace"]; + * @return This builder for chaining. + */ + public Builder clearNamespace() { + namespace_ = getDefaultInstance().getNamespace(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string namespace = 1 [json_name = "namespace"]; + * @param value The bytes for namespace to set. + * @return This builder for chaining. + */ + public Builder setNamespaceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + namespace_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Struct filter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> filterBuilder_; + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + * @return Whether the filter field is set. + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + * @return The filter. + */ + public com.google.protobuf.Struct getFilter() { + if (filterBuilder_ == null) { + return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_; + } else { + return filterBuilder_.getMessage(); + } + } + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + public Builder setFilter(com.google.protobuf.Struct value) { + if (filterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + } else { + filterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + public Builder setFilter( + com.google.protobuf.Struct.Builder builderForValue) { + if (filterBuilder_ == null) { + filter_ = builderForValue.build(); + } else { + filterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + public Builder mergeFilter(com.google.protobuf.Struct value) { + if (filterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + filter_ != null && + filter_ != com.google.protobuf.Struct.getDefaultInstance()) { + getFilterBuilder().mergeFrom(value); + } else { + filter_ = value; + } + } else { + filterBuilder_.mergeFrom(value); + } + if (filter_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000002); + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + public com.google.protobuf.Struct.Builder getFilterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFilterFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + public com.google.protobuf.StructOrBuilder getFilterOrBuilder() { + if (filterBuilder_ != null) { + return filterBuilder_.getMessageOrBuilder(); + } else { + return filter_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : filter_; + } + } + /** + *
+     * Metadata filter
+     * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + getFilterFieldBuilder() { + if (filterBuilder_ == null) { + filterBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getFilter(), + getParentForChildren(), + isClean()); + filter_ = null; + } + return filterBuilder_; + } + + private int limit_ ; + /** + *
+     * Max number of ids to return
+     * 
+ * + * optional uint32 limit = 3 [json_name = "limit"]; + * @return Whether the limit field is set. + */ + @java.lang.Override + public boolean hasLimit() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * Max number of ids to return
+     * 
+ * + * optional uint32 limit = 3 [json_name = "limit"]; + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + /** + *
+     * Max number of ids to return
+     * 
+ * + * optional uint32 limit = 3 [json_name = "limit"]; + * @param value The limit to set. + * @return This builder for chaining. + */ + public Builder setLimit(int value) { + + limit_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * Max number of ids to return
+     * 
+ * + * optional uint32 limit = 3 [json_name = "limit"]; + * @return This builder for chaining. + */ + public Builder clearLimit() { + bitField0_ = (bitField0_ & ~0x00000004); + limit_ = 0; + onChanged(); + return this; + } + + private java.lang.Object paginationToken_ = ""; + /** + *
+     * Pagination token to continue a previous listing operation
+     * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return Whether the paginationToken field is set. + */ + public boolean hasPaginationToken() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * Pagination token to continue a previous listing operation
+     * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return The paginationToken. + */ + public java.lang.String getPaginationToken() { + java.lang.Object ref = paginationToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + paginationToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Pagination token to continue a previous listing operation
+     * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return The bytes for paginationToken. + */ + public com.google.protobuf.ByteString + getPaginationTokenBytes() { + java.lang.Object ref = paginationToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + paginationToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Pagination token to continue a previous listing operation
+     * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @param value The paginationToken to set. + * @return This builder for chaining. + */ + public Builder setPaginationToken( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + paginationToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Pagination token to continue a previous listing operation
+     * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return This builder for chaining. + */ + public Builder clearPaginationToken() { + paginationToken_ = getDefaultInstance().getPaginationToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
+     * Pagination token to continue a previous listing operation
+     * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @param value The bytes for paginationToken to set. + * @return This builder for chaining. + */ + public Builder setPaginationTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + paginationToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:FetchByMetadataRequest) + } + + // @@protoc_insertion_point(class_scope:FetchByMetadataRequest) + private static final io.pinecone.proto.FetchByMetadataRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.pinecone.proto.FetchByMetadataRequest(); + } + + public static io.pinecone.proto.FetchByMetadataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchByMetadataRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.pinecone.proto.FetchByMetadataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/io/pinecone/proto/FetchByMetadataRequestOrBuilder.java b/src/main/java/io/pinecone/proto/FetchByMetadataRequestOrBuilder.java new file mode 100644 index 00000000..6a138c3b --- /dev/null +++ b/src/main/java/io/pinecone/proto/FetchByMetadataRequestOrBuilder.java @@ -0,0 +1,98 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +public interface FetchByMetadataRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:FetchByMetadataRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string namespace = 1 [json_name = "namespace"]; + * @return The namespace. + */ + java.lang.String getNamespace(); + /** + * string namespace = 1 [json_name = "namespace"]; + * @return The bytes for namespace. + */ + com.google.protobuf.ByteString + getNamespaceBytes(); + + /** + *
+   * Metadata filter
+   * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + * @return Whether the filter field is set. + */ + boolean hasFilter(); + /** + *
+   * Metadata filter
+   * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + * @return The filter. + */ + com.google.protobuf.Struct getFilter(); + /** + *
+   * Metadata filter
+   * 
+ * + * optional .google.protobuf.Struct filter = 2 [json_name = "filter"]; + */ + com.google.protobuf.StructOrBuilder getFilterOrBuilder(); + + /** + *
+   * Max number of ids to return
+   * 
+ * + * optional uint32 limit = 3 [json_name = "limit"]; + * @return Whether the limit field is set. + */ + boolean hasLimit(); + /** + *
+   * Max number of ids to return
+   * 
+ * + * optional uint32 limit = 3 [json_name = "limit"]; + * @return The limit. + */ + int getLimit(); + + /** + *
+   * Pagination token to continue a previous listing operation
+   * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return Whether the paginationToken field is set. + */ + boolean hasPaginationToken(); + /** + *
+   * Pagination token to continue a previous listing operation
+   * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return The paginationToken. + */ + java.lang.String getPaginationToken(); + /** + *
+   * Pagination token to continue a previous listing operation
+   * 
+ * + * optional string pagination_token = 4 [json_name = "paginationToken"]; + * @return The bytes for paginationToken. + */ + com.google.protobuf.ByteString + getPaginationTokenBytes(); +} diff --git a/src/main/java/io/pinecone/proto/FetchByMetadataResponse.java b/src/main/java/io/pinecone/proto/FetchByMetadataResponse.java new file mode 100644 index 00000000..118bf9b7 --- /dev/null +++ b/src/main/java/io/pinecone/proto/FetchByMetadataResponse.java @@ -0,0 +1,1365 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +/** + *
+ * The response for the `FetchByMetadata` operation.
+ * 
+ * + * Protobuf type {@code FetchByMetadataResponse} + */ +public final class FetchByMetadataResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:FetchByMetadataResponse) + FetchByMetadataResponseOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 3, + /* suffix= */ "", + FetchByMetadataResponse.class.getName()); + } + // Use FetchByMetadataResponse.newBuilder() to construct. + private FetchByMetadataResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FetchByMetadataResponse() { + namespace_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetVectors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.FetchByMetadataResponse.class, io.pinecone.proto.FetchByMetadataResponse.Builder.class); + } + + private int bitField0_; + public static final int VECTORS_FIELD_NUMBER = 1; + private static final class VectorsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, io.pinecone.proto.Vector> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.pinecone.proto.DbData202510.internal_static_FetchByMetadataResponse_VectorsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + io.pinecone.proto.Vector.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, io.pinecone.proto.Vector> vectors_; + private com.google.protobuf.MapField + internalGetVectors() { + if (vectors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + VectorsDefaultEntryHolder.defaultEntry); + } + return vectors_; + } + public int getVectorsCount() { + return internalGetVectors().getMap().size(); + } + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + @java.lang.Override + public boolean containsVectors( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetVectors().getMap().containsKey(key); + } + /** + * Use {@link #getVectorsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVectors() { + return getVectorsMap(); + } + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + @java.lang.Override + public java.util.Map getVectorsMap() { + return internalGetVectors().getMap(); + } + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + @java.lang.Override + public /* nullable */ +io.pinecone.proto.Vector getVectorsOrDefault( + java.lang.String key, + /* nullable */ +io.pinecone.proto.Vector defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetVectors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + @java.lang.Override + public io.pinecone.proto.Vector getVectorsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetVectors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NAMESPACE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object namespace_ = ""; + /** + *
+   * The namespace of the vectors.
+   * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @return The namespace. + */ + @java.lang.Override + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespace_ = s; + return s; + } + } + /** + *
+   * The namespace of the vectors.
+   * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @return The bytes for namespace. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USAGE_FIELD_NUMBER = 3; + private io.pinecone.proto.Usage usage_; + /** + *
+   * The usage for this operation.
+   * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + * @return Whether the usage field is set. + */ + @java.lang.Override + public boolean hasUsage() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * The usage for this operation.
+   * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + * @return The usage. + */ + @java.lang.Override + public io.pinecone.proto.Usage getUsage() { + return usage_ == null ? io.pinecone.proto.Usage.getDefaultInstance() : usage_; + } + /** + *
+   * The usage for this operation.
+   * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + @java.lang.Override + public io.pinecone.proto.UsageOrBuilder getUsageOrBuilder() { + return usage_ == null ? io.pinecone.proto.Usage.getDefaultInstance() : usage_; + } + + public static final int PAGINATION_FIELD_NUMBER = 4; + private io.pinecone.proto.Pagination pagination_; + /** + *
+   * Pagination token to continue past this listing
+   * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + * @return Whether the pagination field is set. + */ + @java.lang.Override + public boolean hasPagination() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * Pagination token to continue past this listing
+   * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + * @return The pagination. + */ + @java.lang.Override + public io.pinecone.proto.Pagination getPagination() { + return pagination_ == null ? io.pinecone.proto.Pagination.getDefaultInstance() : pagination_; + } + /** + *
+   * Pagination token to continue past this listing
+   * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + @java.lang.Override + public io.pinecone.proto.PaginationOrBuilder getPaginationOrBuilder() { + return pagination_ == null ? io.pinecone.proto.Pagination.getDefaultInstance() : pagination_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetVectors(), + VectorsDefaultEntryHolder.defaultEntry, + 1); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(namespace_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, namespace_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getUsage()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getPagination()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVectors().getMap().entrySet()) { + com.google.protobuf.MapEntry + vectors__ = VectorsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, vectors__); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(namespace_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, namespace_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getUsage()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getPagination()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.pinecone.proto.FetchByMetadataResponse)) { + return super.equals(obj); + } + io.pinecone.proto.FetchByMetadataResponse other = (io.pinecone.proto.FetchByMetadataResponse) obj; + + if (!internalGetVectors().equals( + other.internalGetVectors())) return false; + if (!getNamespace() + .equals(other.getNamespace())) return false; + if (hasUsage() != other.hasUsage()) return false; + if (hasUsage()) { + if (!getUsage() + .equals(other.getUsage())) return false; + } + if (hasPagination() != other.hasPagination()) return false; + if (hasPagination()) { + if (!getPagination() + .equals(other.getPagination())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVectors().getMap().isEmpty()) { + hash = (37 * hash) + VECTORS_FIELD_NUMBER; + hash = (53 * hash) + internalGetVectors().hashCode(); + } + hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + if (hasUsage()) { + hash = (37 * hash) + USAGE_FIELD_NUMBER; + hash = (53 * hash) + getUsage().hashCode(); + } + if (hasPagination()) { + hash = (37 * hash) + PAGINATION_FIELD_NUMBER; + hash = (53 * hash) + getPagination().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.pinecone.proto.FetchByMetadataResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.pinecone.proto.FetchByMetadataResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.pinecone.proto.FetchByMetadataResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.FetchByMetadataResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.pinecone.proto.FetchByMetadataResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The response for the `FetchByMetadata` operation.
+   * 
+ * + * Protobuf type {@code FetchByMetadataResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:FetchByMetadataResponse) + io.pinecone.proto.FetchByMetadataResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetVectors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableVectors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.FetchByMetadataResponse.class, io.pinecone.proto.FetchByMetadataResponse.Builder.class); + } + + // Construct using io.pinecone.proto.FetchByMetadataResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getUsageFieldBuilder(); + getPaginationFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVectors().clear(); + namespace_ = ""; + usage_ = null; + if (usageBuilder_ != null) { + usageBuilder_.dispose(); + usageBuilder_ = null; + } + pagination_ = null; + if (paginationBuilder_ != null) { + paginationBuilder_.dispose(); + paginationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.pinecone.proto.DbData202510.internal_static_FetchByMetadataResponse_descriptor; + } + + @java.lang.Override + public io.pinecone.proto.FetchByMetadataResponse getDefaultInstanceForType() { + return io.pinecone.proto.FetchByMetadataResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.pinecone.proto.FetchByMetadataResponse build() { + io.pinecone.proto.FetchByMetadataResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.pinecone.proto.FetchByMetadataResponse buildPartial() { + io.pinecone.proto.FetchByMetadataResponse result = new io.pinecone.proto.FetchByMetadataResponse(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.pinecone.proto.FetchByMetadataResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.vectors_ = internalGetVectors().build(VectorsDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.namespace_ = namespace_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.usage_ = usageBuilder_ == null + ? usage_ + : usageBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pagination_ = paginationBuilder_ == null + ? pagination_ + : paginationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.pinecone.proto.FetchByMetadataResponse) { + return mergeFrom((io.pinecone.proto.FetchByMetadataResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.pinecone.proto.FetchByMetadataResponse other) { + if (other == io.pinecone.proto.FetchByMetadataResponse.getDefaultInstance()) return this; + internalGetMutableVectors().mergeFrom( + other.internalGetVectors()); + bitField0_ |= 0x00000001; + if (!other.getNamespace().isEmpty()) { + namespace_ = other.namespace_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasUsage()) { + mergeUsage(other.getUsage()); + } + if (other.hasPagination()) { + mergePagination(other.getPagination()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + vectors__ = input.readMessage( + VectorsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVectors().ensureBuilderMap().put( + vectors__.getKey(), vectors__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + namespace_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getUsageFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getPaginationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private static final class VectorsConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public io.pinecone.proto.Vector build(io.pinecone.proto.VectorOrBuilder val) { + if (val instanceof io.pinecone.proto.Vector) { return (io.pinecone.proto.Vector) val; } + return ((io.pinecone.proto.Vector.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return VectorsDefaultEntryHolder.defaultEntry; + } + }; + private static final VectorsConverter vectorsConverter = new VectorsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, io.pinecone.proto.VectorOrBuilder, io.pinecone.proto.Vector, io.pinecone.proto.Vector.Builder> vectors_; + private com.google.protobuf.MapFieldBuilder + internalGetVectors() { + if (vectors_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(vectorsConverter); + } + return vectors_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableVectors() { + if (vectors_ == null) { + vectors_ = new com.google.protobuf.MapFieldBuilder<>(vectorsConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return vectors_; + } + public int getVectorsCount() { + return internalGetVectors().ensureBuilderMap().size(); + } + /** + *
+     * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+     * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + @java.lang.Override + public boolean containsVectors( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetVectors().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getVectorsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVectors() { + return getVectorsMap(); + } + /** + *
+     * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+     * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + @java.lang.Override + public java.util.Map getVectorsMap() { + return internalGetVectors().getImmutableMap(); + } + /** + *
+     * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+     * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + @java.lang.Override + public /* nullable */ +io.pinecone.proto.Vector getVectorsOrDefault( + java.lang.String key, + /* nullable */ +io.pinecone.proto.Vector defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableVectors().ensureBuilderMap(); + return map.containsKey(key) ? vectorsConverter.build(map.get(key)) : defaultValue; + } + /** + *
+     * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+     * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + @java.lang.Override + public io.pinecone.proto.Vector getVectorsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableVectors().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return vectorsConverter.build(map.get(key)); + } + public Builder clearVectors() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVectors().clear(); + return this; + } + /** + *
+     * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+     * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + public Builder removeVectors( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableVectors().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVectors() { + bitField0_ |= 0x00000001; + return internalGetMutableVectors().ensureMessageMap(); + } + /** + *
+     * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+     * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + public Builder putVectors( + java.lang.String key, + io.pinecone.proto.Vector value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableVectors().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + *
+     * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+     * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + public Builder putAllVectors( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableVectors().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + *
+     * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+     * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + public io.pinecone.proto.Vector.Builder putVectorsBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableVectors().ensureBuilderMap(); + io.pinecone.proto.VectorOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = io.pinecone.proto.Vector.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof io.pinecone.proto.Vector) { + entry = ((io.pinecone.proto.Vector) entry).toBuilder(); + builderMap.put(key, entry); + } + return (io.pinecone.proto.Vector.Builder) entry; + } + + private java.lang.Object namespace_ = ""; + /** + *
+     * The namespace of the vectors.
+     * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @return The namespace. + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The namespace of the vectors.
+     * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @return The bytes for namespace. + */ + public com.google.protobuf.ByteString + getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The namespace of the vectors.
+     * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @param value The namespace to set. + * @return This builder for chaining. + */ + public Builder setNamespace( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + namespace_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The namespace of the vectors.
+     * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @return This builder for chaining. + */ + public Builder clearNamespace() { + namespace_ = getDefaultInstance().getNamespace(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The namespace of the vectors.
+     * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @param value The bytes for namespace to set. + * @return This builder for chaining. + */ + public Builder setNamespaceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + namespace_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private io.pinecone.proto.Usage usage_; + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.Usage, io.pinecone.proto.Usage.Builder, io.pinecone.proto.UsageOrBuilder> usageBuilder_; + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + * @return Whether the usage field is set. + */ + public boolean hasUsage() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + * @return The usage. + */ + public io.pinecone.proto.Usage getUsage() { + if (usageBuilder_ == null) { + return usage_ == null ? io.pinecone.proto.Usage.getDefaultInstance() : usage_; + } else { + return usageBuilder_.getMessage(); + } + } + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + public Builder setUsage(io.pinecone.proto.Usage value) { + if (usageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + usage_ = value; + } else { + usageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + public Builder setUsage( + io.pinecone.proto.Usage.Builder builderForValue) { + if (usageBuilder_ == null) { + usage_ = builderForValue.build(); + } else { + usageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + public Builder mergeUsage(io.pinecone.proto.Usage value) { + if (usageBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + usage_ != null && + usage_ != io.pinecone.proto.Usage.getDefaultInstance()) { + getUsageBuilder().mergeFrom(value); + } else { + usage_ = value; + } + } else { + usageBuilder_.mergeFrom(value); + } + if (usage_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + public Builder clearUsage() { + bitField0_ = (bitField0_ & ~0x00000004); + usage_ = null; + if (usageBuilder_ != null) { + usageBuilder_.dispose(); + usageBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + public io.pinecone.proto.Usage.Builder getUsageBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUsageFieldBuilder().getBuilder(); + } + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + public io.pinecone.proto.UsageOrBuilder getUsageOrBuilder() { + if (usageBuilder_ != null) { + return usageBuilder_.getMessageOrBuilder(); + } else { + return usage_ == null ? + io.pinecone.proto.Usage.getDefaultInstance() : usage_; + } + } + /** + *
+     * The usage for this operation.
+     * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.Usage, io.pinecone.proto.Usage.Builder, io.pinecone.proto.UsageOrBuilder> + getUsageFieldBuilder() { + if (usageBuilder_ == null) { + usageBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.Usage, io.pinecone.proto.Usage.Builder, io.pinecone.proto.UsageOrBuilder>( + getUsage(), + getParentForChildren(), + isClean()); + usage_ = null; + } + return usageBuilder_; + } + + private io.pinecone.proto.Pagination pagination_; + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.Pagination, io.pinecone.proto.Pagination.Builder, io.pinecone.proto.PaginationOrBuilder> paginationBuilder_; + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + * @return Whether the pagination field is set. + */ + public boolean hasPagination() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + * @return The pagination. + */ + public io.pinecone.proto.Pagination getPagination() { + if (paginationBuilder_ == null) { + return pagination_ == null ? io.pinecone.proto.Pagination.getDefaultInstance() : pagination_; + } else { + return paginationBuilder_.getMessage(); + } + } + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + public Builder setPagination(io.pinecone.proto.Pagination value) { + if (paginationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pagination_ = value; + } else { + paginationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + public Builder setPagination( + io.pinecone.proto.Pagination.Builder builderForValue) { + if (paginationBuilder_ == null) { + pagination_ = builderForValue.build(); + } else { + paginationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + public Builder mergePagination(io.pinecone.proto.Pagination value) { + if (paginationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + pagination_ != null && + pagination_ != io.pinecone.proto.Pagination.getDefaultInstance()) { + getPaginationBuilder().mergeFrom(value); + } else { + pagination_ = value; + } + } else { + paginationBuilder_.mergeFrom(value); + } + if (pagination_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + public Builder clearPagination() { + bitField0_ = (bitField0_ & ~0x00000008); + pagination_ = null; + if (paginationBuilder_ != null) { + paginationBuilder_.dispose(); + paginationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + public io.pinecone.proto.Pagination.Builder getPaginationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getPaginationFieldBuilder().getBuilder(); + } + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + public io.pinecone.proto.PaginationOrBuilder getPaginationOrBuilder() { + if (paginationBuilder_ != null) { + return paginationBuilder_.getMessageOrBuilder(); + } else { + return pagination_ == null ? + io.pinecone.proto.Pagination.getDefaultInstance() : pagination_; + } + } + /** + *
+     * Pagination token to continue past this listing
+     * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.Pagination, io.pinecone.proto.Pagination.Builder, io.pinecone.proto.PaginationOrBuilder> + getPaginationFieldBuilder() { + if (paginationBuilder_ == null) { + paginationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.Pagination, io.pinecone.proto.Pagination.Builder, io.pinecone.proto.PaginationOrBuilder>( + getPagination(), + getParentForChildren(), + isClean()); + pagination_ = null; + } + return paginationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:FetchByMetadataResponse) + } + + // @@protoc_insertion_point(class_scope:FetchByMetadataResponse) + private static final io.pinecone.proto.FetchByMetadataResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.pinecone.proto.FetchByMetadataResponse(); + } + + public static io.pinecone.proto.FetchByMetadataResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchByMetadataResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.pinecone.proto.FetchByMetadataResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/io/pinecone/proto/FetchByMetadataResponseOrBuilder.java b/src/main/java/io/pinecone/proto/FetchByMetadataResponseOrBuilder.java new file mode 100644 index 00000000..ed967b00 --- /dev/null +++ b/src/main/java/io/pinecone/proto/FetchByMetadataResponseOrBuilder.java @@ -0,0 +1,139 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +public interface FetchByMetadataResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:FetchByMetadataResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + int getVectorsCount(); + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + boolean containsVectors( + java.lang.String key); + /** + * Use {@link #getVectorsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVectors(); + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + java.util.Map + getVectorsMap(); + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + /* nullable */ +io.pinecone.proto.Vector getVectorsOrDefault( + java.lang.String key, + /* nullable */ +io.pinecone.proto.Vector defaultValue); + /** + *
+   * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors
+   * 
+ * + * map<string, .Vector> vectors = 1 [json_name = "vectors"]; + */ + io.pinecone.proto.Vector getVectorsOrThrow( + java.lang.String key); + + /** + *
+   * The namespace of the vectors.
+   * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @return The namespace. + */ + java.lang.String getNamespace(); + /** + *
+   * The namespace of the vectors.
+   * 
+ * + * string namespace = 2 [json_name = "namespace"]; + * @return The bytes for namespace. + */ + com.google.protobuf.ByteString + getNamespaceBytes(); + + /** + *
+   * The usage for this operation.
+   * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + * @return Whether the usage field is set. + */ + boolean hasUsage(); + /** + *
+   * The usage for this operation.
+   * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + * @return The usage. + */ + io.pinecone.proto.Usage getUsage(); + /** + *
+   * The usage for this operation.
+   * 
+ * + * optional .Usage usage = 3 [json_name = "usage"]; + */ + io.pinecone.proto.UsageOrBuilder getUsageOrBuilder(); + + /** + *
+   * Pagination token to continue past this listing
+   * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + * @return Whether the pagination field is set. + */ + boolean hasPagination(); + /** + *
+   * Pagination token to continue past this listing
+   * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + * @return The pagination. + */ + io.pinecone.proto.Pagination getPagination(); + /** + *
+   * Pagination token to continue past this listing
+   * 
+ * + * optional .Pagination pagination = 4 [json_name = "pagination"]; + */ + io.pinecone.proto.PaginationOrBuilder getPaginationOrBuilder(); +} diff --git a/src/main/java/io/pinecone/proto/FetchRequest.java b/src/main/java/io/pinecone/proto/FetchRequest.java index 337e9975..2628bef2 100644 --- a/src/main/java/io/pinecone/proto/FetchRequest.java +++ b/src/main/java/io/pinecone/proto/FetchRequest.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -38,13 +38,13 @@ private FetchRequest() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_FetchRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_FetchRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_FetchRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_FetchRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.FetchRequest.class, io.pinecone.proto.FetchRequest.Builder.class); } @@ -327,13 +327,13 @@ public static final class Builder extends io.pinecone.proto.FetchRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_FetchRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_FetchRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_FetchRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_FetchRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.FetchRequest.class, io.pinecone.proto.FetchRequest.Builder.class); } @@ -361,7 +361,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_FetchRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_FetchRequest_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/FetchRequestOrBuilder.java b/src/main/java/io/pinecone/proto/FetchRequestOrBuilder.java index 6abcefe3..267efa76 100644 --- a/src/main/java/io/pinecone/proto/FetchRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/FetchRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/FetchResponse.java b/src/main/java/io/pinecone/proto/FetchResponse.java index 28c70456..b7edabfe 100644 --- a/src/main/java/io/pinecone/proto/FetchResponse.java +++ b/src/main/java/io/pinecone/proto/FetchResponse.java @@ -1,13 +1,13 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; /** *
- * The response for the `fetch` operation.
+ * The response for the `FetchByMetadata` operation.
  * 
* * Protobuf type {@code FetchResponse} @@ -36,7 +36,7 @@ private FetchResponse() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_FetchResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_FetchResponse_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -54,7 +54,7 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_FetchResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_FetchResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.FetchResponse.class, io.pinecone.proto.FetchResponse.Builder.class); } @@ -66,7 +66,7 @@ private static final class VectorsDefaultEntryHolder { java.lang.String, io.pinecone.proto.Vector> defaultEntry = com.google.protobuf.MapEntry .newDefaultInstance( - io.pinecone.proto.DbData202504.internal_static_FetchResponse_VectorsEntry_descriptor, + io.pinecone.proto.DbData202510.internal_static_FetchResponse_VectorsEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.MESSAGE, @@ -436,7 +436,7 @@ protected Builder newBuilderForType( } /** *
-   * The response for the `fetch` operation.
+   * The response for the `FetchByMetadata` operation.
    * 
* * Protobuf type {@code FetchResponse} @@ -447,7 +447,7 @@ public static final class Builder extends io.pinecone.proto.FetchResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_FetchResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_FetchResponse_descriptor; } @SuppressWarnings({"rawtypes"}) @@ -475,7 +475,7 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFi @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_FetchResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_FetchResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.FetchResponse.class, io.pinecone.proto.FetchResponse.Builder.class); } @@ -513,7 +513,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_FetchResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_FetchResponse_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/FetchResponseOrBuilder.java b/src/main/java/io/pinecone/proto/FetchResponseOrBuilder.java index a07cb972..cc5798a7 100644 --- a/src/main/java/io/pinecone/proto/FetchResponseOrBuilder.java +++ b/src/main/java/io/pinecone/proto/FetchResponseOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/IndexedFields.java b/src/main/java/io/pinecone/proto/IndexedFields.java new file mode 100644 index 00000000..4ca291d9 --- /dev/null +++ b/src/main/java/io/pinecone/proto/IndexedFields.java @@ -0,0 +1,554 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +/** + * Protobuf type {@code IndexedFields} + */ +public final class IndexedFields extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:IndexedFields) + IndexedFieldsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 3, + /* suffix= */ "", + IndexedFields.class.getName()); + } + // Use IndexedFields.newBuilder() to construct. + private IndexedFields(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private IndexedFields() { + fields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_IndexedFields_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_IndexedFields_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.IndexedFields.class, io.pinecone.proto.IndexedFields.Builder.class); + } + + public static final int FIELDS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList fields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string fields = 1 [json_name = "fields"]; + * @return A list containing the fields. + */ + public com.google.protobuf.ProtocolStringList + getFieldsList() { + return fields_; + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @return The count of fields. + */ + public int getFieldsCount() { + return fields_.size(); + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param index The index of the element to return. + * @return The fields at the given index. + */ + public java.lang.String getFields(int index) { + return fields_.get(index); + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param index The index of the value to return. + * @return The bytes of the fields at the given index. + */ + public com.google.protobuf.ByteString + getFieldsBytes(int index) { + return fields_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < fields_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, fields_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < fields_.size(); i++) { + dataSize += computeStringSizeNoTag(fields_.getRaw(i)); + } + size += dataSize; + size += 1 * getFieldsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.pinecone.proto.IndexedFields)) { + return super.equals(obj); + } + io.pinecone.proto.IndexedFields other = (io.pinecone.proto.IndexedFields) obj; + + if (!getFieldsList() + .equals(other.getFieldsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.pinecone.proto.IndexedFields parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.IndexedFields parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.IndexedFields parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.IndexedFields parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.IndexedFields parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.IndexedFields parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.IndexedFields parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.IndexedFields parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.pinecone.proto.IndexedFields parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.pinecone.proto.IndexedFields parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.pinecone.proto.IndexedFields parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.IndexedFields parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.pinecone.proto.IndexedFields prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IndexedFields} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:IndexedFields) + io.pinecone.proto.IndexedFieldsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_IndexedFields_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_IndexedFields_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.IndexedFields.class, io.pinecone.proto.IndexedFields.Builder.class); + } + + // Construct using io.pinecone.proto.IndexedFields.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.pinecone.proto.DbData202510.internal_static_IndexedFields_descriptor; + } + + @java.lang.Override + public io.pinecone.proto.IndexedFields getDefaultInstanceForType() { + return io.pinecone.proto.IndexedFields.getDefaultInstance(); + } + + @java.lang.Override + public io.pinecone.proto.IndexedFields build() { + io.pinecone.proto.IndexedFields result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.pinecone.proto.IndexedFields buildPartial() { + io.pinecone.proto.IndexedFields result = new io.pinecone.proto.IndexedFields(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.pinecone.proto.IndexedFields result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + fields_.makeImmutable(); + result.fields_ = fields_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.pinecone.proto.IndexedFields) { + return mergeFrom((io.pinecone.proto.IndexedFields)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.pinecone.proto.IndexedFields other) { + if (other == io.pinecone.proto.IndexedFields.getDefaultInstance()) return this; + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ |= 0x00000001; + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + ensureFieldsIsMutable(); + fields_.add(s); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList fields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureFieldsIsMutable() { + if (!fields_.isModifiable()) { + fields_ = new com.google.protobuf.LazyStringArrayList(fields_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @return A list containing the fields. + */ + public com.google.protobuf.ProtocolStringList + getFieldsList() { + fields_.makeImmutable(); + return fields_; + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @return The count of fields. + */ + public int getFieldsCount() { + return fields_.size(); + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param index The index of the element to return. + * @return The fields at the given index. + */ + public java.lang.String getFields(int index) { + return fields_.get(index); + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param index The index of the value to return. + * @return The bytes of the fields at the given index. + */ + public com.google.protobuf.ByteString + getFieldsBytes(int index) { + return fields_.getByteString(index); + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param index The index to set the value at. + * @param value The fields to set. + * @return This builder for chaining. + */ + public Builder setFields( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFieldsIsMutable(); + fields_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param value The fields to add. + * @return This builder for chaining. + */ + public Builder addFields( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFieldsIsMutable(); + fields_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param values The fields to add. + * @return This builder for chaining. + */ + public Builder addAllFields( + java.lang.Iterable values) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fields_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @return This builder for chaining. + */ + public Builder clearFields() { + fields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param value The bytes of the fields to add. + * @return This builder for chaining. + */ + public Builder addFieldsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureFieldsIsMutable(); + fields_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:IndexedFields) + } + + // @@protoc_insertion_point(class_scope:IndexedFields) + private static final io.pinecone.proto.IndexedFields DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.pinecone.proto.IndexedFields(); + } + + public static io.pinecone.proto.IndexedFields getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndexedFields parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.pinecone.proto.IndexedFields getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/io/pinecone/proto/IndexedFieldsOrBuilder.java b/src/main/java/io/pinecone/proto/IndexedFieldsOrBuilder.java new file mode 100644 index 00000000..faa0a036 --- /dev/null +++ b/src/main/java/io/pinecone/proto/IndexedFieldsOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +public interface IndexedFieldsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IndexedFields) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string fields = 1 [json_name = "fields"]; + * @return A list containing the fields. + */ + java.util.List + getFieldsList(); + /** + * repeated string fields = 1 [json_name = "fields"]; + * @return The count of fields. + */ + int getFieldsCount(); + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param index The index of the element to return. + * @return The fields at the given index. + */ + java.lang.String getFields(int index); + /** + * repeated string fields = 1 [json_name = "fields"]; + * @param index The index of the value to return. + * @return The bytes of the fields at the given index. + */ + com.google.protobuf.ByteString + getFieldsBytes(int index); +} diff --git a/src/main/java/io/pinecone/proto/ListItem.java b/src/main/java/io/pinecone/proto/ListItem.java index 6da06946..1d56abf9 100644 --- a/src/main/java/io/pinecone/proto/ListItem.java +++ b/src/main/java/io/pinecone/proto/ListItem.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -32,13 +32,13 @@ private ListItem() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListItem_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListItem_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListItem_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListItem_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListItem.class, io.pinecone.proto.ListItem.Builder.class); } @@ -247,13 +247,13 @@ public static final class Builder extends io.pinecone.proto.ListItemOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListItem_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListItem_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListItem_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListItem_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListItem.class, io.pinecone.proto.ListItem.Builder.class); } @@ -279,7 +279,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_ListItem_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListItem_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/ListItemOrBuilder.java b/src/main/java/io/pinecone/proto/ListItemOrBuilder.java index 66eb1067..5d98edbc 100644 --- a/src/main/java/io/pinecone/proto/ListItemOrBuilder.java +++ b/src/main/java/io/pinecone/proto/ListItemOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/ListNamespacesRequest.java b/src/main/java/io/pinecone/proto/ListNamespacesRequest.java index a9bc8098..a3b706d6 100644 --- a/src/main/java/io/pinecone/proto/ListNamespacesRequest.java +++ b/src/main/java/io/pinecone/proto/ListNamespacesRequest.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -32,17 +32,18 @@ private ListNamespacesRequest(com.google.protobuf.GeneratedMessage.Builder bu } private ListNamespacesRequest() { paginationToken_ = ""; + prefix_ = ""; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListNamespacesRequest.class, io.pinecone.proto.ListNamespacesRequest.Builder.class); } @@ -134,6 +135,65 @@ public int getLimit() { return limit_; } + public static final int PREFIX_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object prefix_ = ""; + /** + *
+   * Prefix of the namespaces to list
+   * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return Whether the prefix field is set. + */ + @java.lang.Override + public boolean hasPrefix() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+   * Prefix of the namespaces to list
+   * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return The prefix. + */ + @java.lang.Override + public java.lang.String getPrefix() { + java.lang.Object ref = prefix_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + prefix_ = s; + return s; + } + } + /** + *
+   * Prefix of the namespaces to list
+   * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return The bytes for prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPrefixBytes() { + java.lang.Object ref = prefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + prefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -154,6 +214,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000002) != 0)) { output.writeUInt32(2, limit_); } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, prefix_); + } getUnknownFields().writeTo(output); } @@ -170,6 +233,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, limit_); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, prefix_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -195,6 +261,11 @@ public boolean equals(final java.lang.Object obj) { if (getLimit() != other.getLimit()) return false; } + if (hasPrefix() != other.hasPrefix()) return false; + if (hasPrefix()) { + if (!getPrefix() + .equals(other.getPrefix())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -214,6 +285,10 @@ public int hashCode() { hash = (37 * hash) + LIMIT_FIELD_NUMBER; hash = (53 * hash) + getLimit(); } + if (hasPrefix()) { + hash = (37 * hash) + PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getPrefix().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -324,13 +399,13 @@ public static final class Builder extends io.pinecone.proto.ListNamespacesRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListNamespacesRequest.class, io.pinecone.proto.ListNamespacesRequest.Builder.class); } @@ -351,13 +426,14 @@ public Builder clear() { bitField0_ = 0; paginationToken_ = ""; limit_ = 0; + prefix_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesRequest_descriptor; } @java.lang.Override @@ -393,6 +469,10 @@ private void buildPartial0(io.pinecone.proto.ListNamespacesRequest result) { result.limit_ = limit_; to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.prefix_ = prefix_; + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -416,6 +496,11 @@ public Builder mergeFrom(io.pinecone.proto.ListNamespacesRequest other) { if (other.hasLimit()) { setLimit(other.getLimit()); } + if (other.hasPrefix()) { + prefix_ = other.prefix_; + bitField0_ |= 0x00000004; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -452,6 +537,11 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 16 + case 26: { + prefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -628,6 +718,109 @@ public Builder clearLimit() { return this; } + private java.lang.Object prefix_ = ""; + /** + *
+     * Prefix of the namespaces to list
+     * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return Whether the prefix field is set. + */ + public boolean hasPrefix() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * Prefix of the namespaces to list
+     * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return The prefix. + */ + public java.lang.String getPrefix() { + java.lang.Object ref = prefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + prefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Prefix of the namespaces to list
+     * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return The bytes for prefix. + */ + public com.google.protobuf.ByteString + getPrefixBytes() { + java.lang.Object ref = prefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + prefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Prefix of the namespaces to list
+     * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @param value The prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefix( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + prefix_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * Prefix of the namespaces to list
+     * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return This builder for chaining. + */ + public Builder clearPrefix() { + prefix_ = getDefaultInstance().getPrefix(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * Prefix of the namespaces to list
+     * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @param value The bytes for prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefixBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + prefix_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:ListNamespacesRequest) } diff --git a/src/main/java/io/pinecone/proto/ListNamespacesRequestOrBuilder.java b/src/main/java/io/pinecone/proto/ListNamespacesRequestOrBuilder.java index 3fd07006..fd78e13e 100644 --- a/src/main/java/io/pinecone/proto/ListNamespacesRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/ListNamespacesRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -56,4 +56,33 @@ public interface ListNamespacesRequestOrBuilder extends * @return The limit. */ int getLimit(); + + /** + *
+   * Prefix of the namespaces to list
+   * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return Whether the prefix field is set. + */ + boolean hasPrefix(); + /** + *
+   * Prefix of the namespaces to list
+   * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return The prefix. + */ + java.lang.String getPrefix(); + /** + *
+   * Prefix of the namespaces to list
+   * 
+ * + * optional string prefix = 3 [json_name = "prefix"]; + * @return The bytes for prefix. + */ + com.google.protobuf.ByteString + getPrefixBytes(); } diff --git a/src/main/java/io/pinecone/proto/ListNamespacesResponse.java b/src/main/java/io/pinecone/proto/ListNamespacesResponse.java index 872fd97b..16193f76 100644 --- a/src/main/java/io/pinecone/proto/ListNamespacesResponse.java +++ b/src/main/java/io/pinecone/proto/ListNamespacesResponse.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -36,13 +36,13 @@ private ListNamespacesResponse() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListNamespacesResponse.class, io.pinecone.proto.ListNamespacesResponse.Builder.class); } @@ -147,6 +147,21 @@ public io.pinecone.proto.PaginationOrBuilder getPaginationOrBuilder() { return pagination_ == null ? io.pinecone.proto.Pagination.getDefaultInstance() : pagination_; } + public static final int TOTAL_COUNT_FIELD_NUMBER = 3; + private int totalCount_ = 0; + /** + *
+   * The total number of namespaces in the index matching the prefix
+   * 
+ * + * int32 total_count = 3 [json_name = "totalCount"]; + * @return The totalCount. + */ + @java.lang.Override + public int getTotalCount() { + return totalCount_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -167,6 +182,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getPagination()); } + if (totalCount_ != 0) { + output.writeInt32(3, totalCount_); + } getUnknownFields().writeTo(output); } @@ -184,6 +202,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getPagination()); } + if (totalCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, totalCount_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -206,6 +228,8 @@ public boolean equals(final java.lang.Object obj) { if (!getPagination() .equals(other.getPagination())) return false; } + if (getTotalCount() + != other.getTotalCount()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -225,6 +249,8 @@ public int hashCode() { hash = (37 * hash) + PAGINATION_FIELD_NUMBER; hash = (53 * hash) + getPagination().hashCode(); } + hash = (37 * hash) + TOTAL_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTotalCount(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -335,13 +361,13 @@ public static final class Builder extends io.pinecone.proto.ListNamespacesResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListNamespacesResponse.class, io.pinecone.proto.ListNamespacesResponse.Builder.class); } @@ -379,13 +405,14 @@ public Builder clear() { paginationBuilder_.dispose(); paginationBuilder_ = null; } + totalCount_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_ListNamespacesResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListNamespacesResponse_descriptor; } @java.lang.Override @@ -432,6 +459,9 @@ private void buildPartial0(io.pinecone.proto.ListNamespacesResponse result) { : paginationBuilder_.build(); to_bitField0_ |= 0x00000001; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.totalCount_ = totalCount_; + } result.bitField0_ |= to_bitField0_; } @@ -476,6 +506,9 @@ public Builder mergeFrom(io.pinecone.proto.ListNamespacesResponse other) { if (other.hasPagination()) { mergePagination(other.getPagination()); } + if (other.getTotalCount() != 0) { + setTotalCount(other.getTotalCount()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -522,6 +555,11 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 18 + case 24: { + totalCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1008,6 +1046,50 @@ public io.pinecone.proto.PaginationOrBuilder getPaginationOrBuilder() { return paginationBuilder_; } + private int totalCount_ ; + /** + *
+     * The total number of namespaces in the index matching the prefix
+     * 
+ * + * int32 total_count = 3 [json_name = "totalCount"]; + * @return The totalCount. + */ + @java.lang.Override + public int getTotalCount() { + return totalCount_; + } + /** + *
+     * The total number of namespaces in the index matching the prefix
+     * 
+ * + * int32 total_count = 3 [json_name = "totalCount"]; + * @param value The totalCount to set. + * @return This builder for chaining. + */ + public Builder setTotalCount(int value) { + + totalCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The total number of namespaces in the index matching the prefix
+     * 
+ * + * int32 total_count = 3 [json_name = "totalCount"]; + * @return This builder for chaining. + */ + public Builder clearTotalCount() { + bitField0_ = (bitField0_ & ~0x00000004); + totalCount_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:ListNamespacesResponse) } diff --git a/src/main/java/io/pinecone/proto/ListNamespacesResponseOrBuilder.java b/src/main/java/io/pinecone/proto/ListNamespacesResponseOrBuilder.java index 3b8eeea0..57bac011 100644 --- a/src/main/java/io/pinecone/proto/ListNamespacesResponseOrBuilder.java +++ b/src/main/java/io/pinecone/proto/ListNamespacesResponseOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -79,4 +79,14 @@ io.pinecone.proto.NamespaceDescriptionOrBuilder getNamespacesOrBuilder( * optional .Pagination pagination = 2 [json_name = "pagination"]; */ io.pinecone.proto.PaginationOrBuilder getPaginationOrBuilder(); + + /** + *
+   * The total number of namespaces in the index matching the prefix
+   * 
+ * + * int32 total_count = 3 [json_name = "totalCount"]; + * @return The totalCount. + */ + int getTotalCount(); } diff --git a/src/main/java/io/pinecone/proto/ListRequest.java b/src/main/java/io/pinecone/proto/ListRequest.java index bda90f3b..929e985a 100644 --- a/src/main/java/io/pinecone/proto/ListRequest.java +++ b/src/main/java/io/pinecone/proto/ListRequest.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -38,13 +38,13 @@ private ListRequest() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListRequest.class, io.pinecone.proto.ListRequest.Builder.class); } @@ -449,13 +449,13 @@ public static final class Builder extends io.pinecone.proto.ListRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListRequest.class, io.pinecone.proto.ListRequest.Builder.class); } @@ -484,7 +484,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_ListRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListRequest_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/ListRequestOrBuilder.java b/src/main/java/io/pinecone/proto/ListRequestOrBuilder.java index 5a6c2f4c..94940f65 100644 --- a/src/main/java/io/pinecone/proto/ListRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/ListRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/ListResponse.java b/src/main/java/io/pinecone/proto/ListResponse.java index 9b7d4c73..4eec7ecc 100644 --- a/src/main/java/io/pinecone/proto/ListResponse.java +++ b/src/main/java/io/pinecone/proto/ListResponse.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -37,13 +37,13 @@ private ListResponse() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListResponse.class, io.pinecone.proto.ListResponse.Builder.class); } @@ -447,13 +447,13 @@ public static final class Builder extends io.pinecone.proto.ListResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ListResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ListResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ListResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ListResponse.class, io.pinecone.proto.ListResponse.Builder.class); } @@ -504,7 +504,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_ListResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ListResponse_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/ListResponseOrBuilder.java b/src/main/java/io/pinecone/proto/ListResponseOrBuilder.java index b55eadbc..75dd54cc 100644 --- a/src/main/java/io/pinecone/proto/ListResponseOrBuilder.java +++ b/src/main/java/io/pinecone/proto/ListResponseOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/MetadataFieldProperties.java b/src/main/java/io/pinecone/proto/MetadataFieldProperties.java new file mode 100644 index 00000000..ad316207 --- /dev/null +++ b/src/main/java/io/pinecone/proto/MetadataFieldProperties.java @@ -0,0 +1,460 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +/** + *
+ * Properties for a metadata field that control its indexing behavior.
+ * 
+ * + * Protobuf type {@code MetadataFieldProperties} + */ +public final class MetadataFieldProperties extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:MetadataFieldProperties) + MetadataFieldPropertiesOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 3, + /* suffix= */ "", + MetadataFieldProperties.class.getName()); + } + // Use MetadataFieldProperties.newBuilder() to construct. + private MetadataFieldProperties(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MetadataFieldProperties() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_MetadataFieldProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_MetadataFieldProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.MetadataFieldProperties.class, io.pinecone.proto.MetadataFieldProperties.Builder.class); + } + + public static final int FILTERABLE_FIELD_NUMBER = 1; + private boolean filterable_ = false; + /** + *
+   * Whether this field should be indexed for filtering.
+   * Only values of true are supported; all other fields will not be indexed.
+   * 
+ * + * bool filterable = 1 [json_name = "filterable"]; + * @return The filterable. + */ + @java.lang.Override + public boolean getFilterable() { + return filterable_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (filterable_ != false) { + output.writeBool(1, filterable_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (filterable_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, filterable_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.pinecone.proto.MetadataFieldProperties)) { + return super.equals(obj); + } + io.pinecone.proto.MetadataFieldProperties other = (io.pinecone.proto.MetadataFieldProperties) obj; + + if (getFilterable() + != other.getFilterable()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILTERABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFilterable()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.pinecone.proto.MetadataFieldProperties parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.pinecone.proto.MetadataFieldProperties parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.pinecone.proto.MetadataFieldProperties parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.MetadataFieldProperties parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.pinecone.proto.MetadataFieldProperties prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Properties for a metadata field that control its indexing behavior.
+   * 
+ * + * Protobuf type {@code MetadataFieldProperties} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:MetadataFieldProperties) + io.pinecone.proto.MetadataFieldPropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_MetadataFieldProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_MetadataFieldProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.MetadataFieldProperties.class, io.pinecone.proto.MetadataFieldProperties.Builder.class); + } + + // Construct using io.pinecone.proto.MetadataFieldProperties.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filterable_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.pinecone.proto.DbData202510.internal_static_MetadataFieldProperties_descriptor; + } + + @java.lang.Override + public io.pinecone.proto.MetadataFieldProperties getDefaultInstanceForType() { + return io.pinecone.proto.MetadataFieldProperties.getDefaultInstance(); + } + + @java.lang.Override + public io.pinecone.proto.MetadataFieldProperties build() { + io.pinecone.proto.MetadataFieldProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.pinecone.proto.MetadataFieldProperties buildPartial() { + io.pinecone.proto.MetadataFieldProperties result = new io.pinecone.proto.MetadataFieldProperties(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.pinecone.proto.MetadataFieldProperties result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filterable_ = filterable_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.pinecone.proto.MetadataFieldProperties) { + return mergeFrom((io.pinecone.proto.MetadataFieldProperties)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.pinecone.proto.MetadataFieldProperties other) { + if (other == io.pinecone.proto.MetadataFieldProperties.getDefaultInstance()) return this; + if (other.getFilterable() != false) { + setFilterable(other.getFilterable()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + filterable_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean filterable_ ; + /** + *
+     * Whether this field should be indexed for filtering.
+     * Only values of true are supported; all other fields will not be indexed.
+     * 
+ * + * bool filterable = 1 [json_name = "filterable"]; + * @return The filterable. + */ + @java.lang.Override + public boolean getFilterable() { + return filterable_; + } + /** + *
+     * Whether this field should be indexed for filtering.
+     * Only values of true are supported; all other fields will not be indexed.
+     * 
+ * + * bool filterable = 1 [json_name = "filterable"]; + * @param value The filterable to set. + * @return This builder for chaining. + */ + public Builder setFilterable(boolean value) { + + filterable_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Whether this field should be indexed for filtering.
+     * Only values of true are supported; all other fields will not be indexed.
+     * 
+ * + * bool filterable = 1 [json_name = "filterable"]; + * @return This builder for chaining. + */ + public Builder clearFilterable() { + bitField0_ = (bitField0_ & ~0x00000001); + filterable_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:MetadataFieldProperties) + } + + // @@protoc_insertion_point(class_scope:MetadataFieldProperties) + private static final io.pinecone.proto.MetadataFieldProperties DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.pinecone.proto.MetadataFieldProperties(); + } + + public static io.pinecone.proto.MetadataFieldProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetadataFieldProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.pinecone.proto.MetadataFieldProperties getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/io/pinecone/proto/MetadataFieldPropertiesOrBuilder.java b/src/main/java/io/pinecone/proto/MetadataFieldPropertiesOrBuilder.java new file mode 100644 index 00000000..218a363c --- /dev/null +++ b/src/main/java/io/pinecone/proto/MetadataFieldPropertiesOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +public interface MetadataFieldPropertiesOrBuilder extends + // @@protoc_insertion_point(interface_extends:MetadataFieldProperties) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Whether this field should be indexed for filtering.
+   * Only values of true are supported; all other fields will not be indexed.
+   * 
+ * + * bool filterable = 1 [json_name = "filterable"]; + * @return The filterable. + */ + boolean getFilterable(); +} diff --git a/src/main/java/io/pinecone/proto/MetadataSchema.java b/src/main/java/io/pinecone/proto/MetadataSchema.java new file mode 100644 index 00000000..2eb78cb4 --- /dev/null +++ b/src/main/java/io/pinecone/proto/MetadataSchema.java @@ -0,0 +1,733 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +/** + *
+ * Schema for the behavior of Pinecone's internal metadata index.
+ * By default, all metadata is indexed; when `schema` is present,
+ * only fields which are present in the `fields` object with a
+ * `filterable: true` are indexed.
+ * 
+ * + * Protobuf type {@code MetadataSchema} + */ +public final class MetadataSchema extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:MetadataSchema) + MetadataSchemaOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 3, + /* suffix= */ "", + MetadataSchema.class.getName()); + } + // Use MetadataSchema.newBuilder() to construct. + private MetadataSchema(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MetadataSchema() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_MetadataSchema_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFields(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_MetadataSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.MetadataSchema.class, io.pinecone.proto.MetadataSchema.Builder.class); + } + + public static final int FIELDS_FIELD_NUMBER = 1; + private static final class FieldsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, io.pinecone.proto.MetadataFieldProperties> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.pinecone.proto.DbData202510.internal_static_MetadataSchema_FieldsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + io.pinecone.proto.MetadataFieldProperties.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, io.pinecone.proto.MetadataFieldProperties> fields_; + private com.google.protobuf.MapField + internalGetFields() { + if (fields_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FieldsDefaultEntryHolder.defaultEntry); + } + return fields_; + } + public int getFieldsCount() { + return internalGetFields().getMap().size(); + } + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + @java.lang.Override + public boolean containsFields( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFields().getMap().containsKey(key); + } + /** + * Use {@link #getFieldsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + @java.lang.Override + public java.util.Map getFieldsMap() { + return internalGetFields().getMap(); + } + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + @java.lang.Override + public /* nullable */ +io.pinecone.proto.MetadataFieldProperties getFieldsOrDefault( + java.lang.String key, + /* nullable */ +io.pinecone.proto.MetadataFieldProperties defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + @java.lang.Override + public io.pinecone.proto.MetadataFieldProperties getFieldsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetFields(), + FieldsDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetFields().getMap().entrySet()) { + com.google.protobuf.MapEntry + fields__ = FieldsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, fields__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.pinecone.proto.MetadataSchema)) { + return super.equals(obj); + } + io.pinecone.proto.MetadataSchema other = (io.pinecone.proto.MetadataSchema) obj; + + if (!internalGetFields().equals( + other.internalGetFields())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetFields().getMap().isEmpty()) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetFields().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.pinecone.proto.MetadataSchema parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.MetadataSchema parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.MetadataSchema parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.MetadataSchema parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.MetadataSchema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.pinecone.proto.MetadataSchema parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.pinecone.proto.MetadataSchema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.MetadataSchema parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.pinecone.proto.MetadataSchema parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.pinecone.proto.MetadataSchema parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.pinecone.proto.MetadataSchema parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.pinecone.proto.MetadataSchema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.pinecone.proto.MetadataSchema prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Schema for the behavior of Pinecone's internal metadata index.
+   * By default, all metadata is indexed; when `schema` is present,
+   * only fields which are present in the `fields` object with a
+   * `filterable: true` are indexed.
+   * 
+ * + * Protobuf type {@code MetadataSchema} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:MetadataSchema) + io.pinecone.proto.MetadataSchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.pinecone.proto.DbData202510.internal_static_MetadataSchema_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFields(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableFields(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.pinecone.proto.DbData202510.internal_static_MetadataSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.pinecone.proto.MetadataSchema.class, io.pinecone.proto.MetadataSchema.Builder.class); + } + + // Construct using io.pinecone.proto.MetadataSchema.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableFields().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.pinecone.proto.DbData202510.internal_static_MetadataSchema_descriptor; + } + + @java.lang.Override + public io.pinecone.proto.MetadataSchema getDefaultInstanceForType() { + return io.pinecone.proto.MetadataSchema.getDefaultInstance(); + } + + @java.lang.Override + public io.pinecone.proto.MetadataSchema build() { + io.pinecone.proto.MetadataSchema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.pinecone.proto.MetadataSchema buildPartial() { + io.pinecone.proto.MetadataSchema result = new io.pinecone.proto.MetadataSchema(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.pinecone.proto.MetadataSchema result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fields_ = internalGetFields().build(FieldsDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.pinecone.proto.MetadataSchema) { + return mergeFrom((io.pinecone.proto.MetadataSchema)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.pinecone.proto.MetadataSchema other) { + if (other == io.pinecone.proto.MetadataSchema.getDefaultInstance()) return this; + internalGetMutableFields().mergeFrom( + other.internalGetFields()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + fields__ = input.readMessage( + FieldsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFields().ensureBuilderMap().put( + fields__.getKey(), fields__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private static final class FieldsConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public io.pinecone.proto.MetadataFieldProperties build(io.pinecone.proto.MetadataFieldPropertiesOrBuilder val) { + if (val instanceof io.pinecone.proto.MetadataFieldProperties) { return (io.pinecone.proto.MetadataFieldProperties) val; } + return ((io.pinecone.proto.MetadataFieldProperties.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return FieldsDefaultEntryHolder.defaultEntry; + } + }; + private static final FieldsConverter fieldsConverter = new FieldsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, io.pinecone.proto.MetadataFieldPropertiesOrBuilder, io.pinecone.proto.MetadataFieldProperties, io.pinecone.proto.MetadataFieldProperties.Builder> fields_; + private com.google.protobuf.MapFieldBuilder + internalGetFields() { + if (fields_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(fieldsConverter); + } + return fields_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableFields() { + if (fields_ == null) { + fields_ = new com.google.protobuf.MapFieldBuilder<>(fieldsConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return fields_; + } + public int getFieldsCount() { + return internalGetFields().ensureBuilderMap().size(); + } + /** + *
+     * A map of field names to their properties.
+     * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + @java.lang.Override + public boolean containsFields( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFields().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getFieldsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + *
+     * A map of field names to their properties.
+     * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + @java.lang.Override + public java.util.Map getFieldsMap() { + return internalGetFields().getImmutableMap(); + } + /** + *
+     * A map of field names to their properties.
+     * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + @java.lang.Override + public /* nullable */ +io.pinecone.proto.MetadataFieldProperties getFieldsOrDefault( + java.lang.String key, + /* nullable */ +io.pinecone.proto.MetadataFieldProperties defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFields().ensureBuilderMap(); + return map.containsKey(key) ? fieldsConverter.build(map.get(key)) : defaultValue; + } + /** + *
+     * A map of field names to their properties.
+     * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + @java.lang.Override + public io.pinecone.proto.MetadataFieldProperties getFieldsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFields().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return fieldsConverter.build(map.get(key)); + } + public Builder clearFields() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableFields().clear(); + return this; + } + /** + *
+     * A map of field names to their properties.
+     * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + public Builder removeFields( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableFields().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFields() { + bitField0_ |= 0x00000001; + return internalGetMutableFields().ensureMessageMap(); + } + /** + *
+     * A map of field names to their properties.
+     * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + public Builder putFields( + java.lang.String key, + io.pinecone.proto.MetadataFieldProperties value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFields().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + *
+     * A map of field names to their properties.
+     * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + public Builder putAllFields( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableFields().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + *
+     * A map of field names to their properties.
+     * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + public io.pinecone.proto.MetadataFieldProperties.Builder putFieldsBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableFields().ensureBuilderMap(); + io.pinecone.proto.MetadataFieldPropertiesOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = io.pinecone.proto.MetadataFieldProperties.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof io.pinecone.proto.MetadataFieldProperties) { + entry = ((io.pinecone.proto.MetadataFieldProperties) entry).toBuilder(); + builderMap.put(key, entry); + } + return (io.pinecone.proto.MetadataFieldProperties.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:MetadataSchema) + } + + // @@protoc_insertion_point(class_scope:MetadataSchema) + private static final io.pinecone.proto.MetadataSchema DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.pinecone.proto.MetadataSchema(); + } + + public static io.pinecone.proto.MetadataSchema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetadataSchema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.pinecone.proto.MetadataSchema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/io/pinecone/proto/MetadataSchemaOrBuilder.java b/src/main/java/io/pinecone/proto/MetadataSchemaOrBuilder.java new file mode 100644 index 00000000..6b9aaabc --- /dev/null +++ b/src/main/java/io/pinecone/proto/MetadataSchemaOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: db_data_2025-10.proto +// Protobuf Java Version: 4.29.3 + +package io.pinecone.proto; + +public interface MetadataSchemaOrBuilder extends + // @@protoc_insertion_point(interface_extends:MetadataSchema) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + int getFieldsCount(); + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + boolean containsFields( + java.lang.String key); + /** + * Use {@link #getFieldsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getFields(); + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + java.util.Map + getFieldsMap(); + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + /* nullable */ +io.pinecone.proto.MetadataFieldProperties getFieldsOrDefault( + java.lang.String key, + /* nullable */ +io.pinecone.proto.MetadataFieldProperties defaultValue); + /** + *
+   * A map of field names to their properties.
+   * 
+ * + * map<string, .MetadataFieldProperties> fields = 1 [json_name = "fields"]; + */ + io.pinecone.proto.MetadataFieldProperties getFieldsOrThrow( + java.lang.String key); +} diff --git a/src/main/java/io/pinecone/proto/NamespaceDescription.java b/src/main/java/io/pinecone/proto/NamespaceDescription.java index 8f398c0c..eac8f5d4 100644 --- a/src/main/java/io/pinecone/proto/NamespaceDescription.java +++ b/src/main/java/io/pinecone/proto/NamespaceDescription.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -32,17 +32,18 @@ private NamespaceDescription() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceDescription_descriptor; + return io.pinecone.proto.DbData202510.internal_static_NamespaceDescription_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceDescription_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_NamespaceDescription_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.NamespaceDescription.class, io.pinecone.proto.NamespaceDescription.Builder.class); } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object name_ = ""; @@ -93,6 +94,70 @@ public long getRecordCount() { return recordCount_; } + public static final int SCHEMA_FIELD_NUMBER = 3; + private io.pinecone.proto.MetadataSchema schema_; + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + * @return The schema. + */ + @java.lang.Override + public io.pinecone.proto.MetadataSchema getSchema() { + return schema_ == null ? io.pinecone.proto.MetadataSchema.getDefaultInstance() : schema_; + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + @java.lang.Override + public io.pinecone.proto.MetadataSchemaOrBuilder getSchemaOrBuilder() { + return schema_ == null ? io.pinecone.proto.MetadataSchema.getDefaultInstance() : schema_; + } + + public static final int INDEXED_FIELDS_FIELD_NUMBER = 4; + private io.pinecone.proto.IndexedFields indexedFields_; + /** + *
+   * List of indexed fields in the namespace
+   * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + * @return Whether the indexedFields field is set. + */ + @java.lang.Override + public boolean hasIndexedFields() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * List of indexed fields in the namespace
+   * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + * @return The indexedFields. + */ + @java.lang.Override + public io.pinecone.proto.IndexedFields getIndexedFields() { + return indexedFields_ == null ? io.pinecone.proto.IndexedFields.getDefaultInstance() : indexedFields_; + } + /** + *
+   * List of indexed fields in the namespace
+   * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + @java.lang.Override + public io.pinecone.proto.IndexedFieldsOrBuilder getIndexedFieldsOrBuilder() { + return indexedFields_ == null ? io.pinecone.proto.IndexedFields.getDefaultInstance() : indexedFields_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -113,6 +178,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (recordCount_ != 0L) { output.writeUInt64(2, recordCount_); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSchema()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getIndexedFields()); + } getUnknownFields().writeTo(output); } @@ -129,6 +200,14 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeUInt64Size(2, recordCount_); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getSchema()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getIndexedFields()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -148,6 +227,16 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getName())) return false; if (getRecordCount() != other.getRecordCount()) return false; + if (hasSchema() != other.hasSchema()) return false; + if (hasSchema()) { + if (!getSchema() + .equals(other.getSchema())) return false; + } + if (hasIndexedFields() != other.hasIndexedFields()) return false; + if (hasIndexedFields()) { + if (!getIndexedFields() + .equals(other.getIndexedFields())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -164,6 +253,14 @@ public int hashCode() { hash = (37 * hash) + RECORD_COUNT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getRecordCount()); + if (hasSchema()) { + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + } + if (hasIndexedFields()) { + hash = (37 * hash) + INDEXED_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getIndexedFields().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -270,26 +367,33 @@ public static final class Builder extends io.pinecone.proto.NamespaceDescriptionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceDescription_descriptor; + return io.pinecone.proto.DbData202510.internal_static_NamespaceDescription_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceDescription_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_NamespaceDescription_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.NamespaceDescription.class, io.pinecone.proto.NamespaceDescription.Builder.class); } // Construct using io.pinecone.proto.NamespaceDescription.newBuilder() private Builder() { - + maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getSchemaFieldBuilder(); + getIndexedFieldsFieldBuilder(); + } } @java.lang.Override public Builder clear() { @@ -297,13 +401,23 @@ public Builder clear() { bitField0_ = 0; name_ = ""; recordCount_ = 0L; + schema_ = null; + if (schemaBuilder_ != null) { + schemaBuilder_.dispose(); + schemaBuilder_ = null; + } + indexedFields_ = null; + if (indexedFieldsBuilder_ != null) { + indexedFieldsBuilder_.dispose(); + indexedFieldsBuilder_ = null; + } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceDescription_descriptor; + return io.pinecone.proto.DbData202510.internal_static_NamespaceDescription_descriptor; } @java.lang.Override @@ -336,6 +450,20 @@ private void buildPartial0(io.pinecone.proto.NamespaceDescription result) { if (((from_bitField0_ & 0x00000002) != 0)) { result.recordCount_ = recordCount_; } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.schema_ = schemaBuilder_ == null + ? schema_ + : schemaBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.indexedFields_ = indexedFieldsBuilder_ == null + ? indexedFields_ + : indexedFieldsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -358,6 +486,12 @@ public Builder mergeFrom(io.pinecone.proto.NamespaceDescription other) { if (other.getRecordCount() != 0L) { setRecordCount(other.getRecordCount()); } + if (other.hasSchema()) { + mergeSchema(other.getSchema()); + } + if (other.hasIndexedFields()) { + mergeIndexedFields(other.getIndexedFields()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -394,6 +528,20 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 16 + case 26: { + input.readMessage( + getSchemaFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getIndexedFieldsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -515,6 +663,284 @@ public Builder clearRecordCount() { return this; } + private io.pinecone.proto.MetadataSchema schema_; + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.MetadataSchema, io.pinecone.proto.MetadataSchema.Builder, io.pinecone.proto.MetadataSchemaOrBuilder> schemaBuilder_; + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + * @return Whether the schema field is set. + */ + public boolean hasSchema() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + * @return The schema. + */ + public io.pinecone.proto.MetadataSchema getSchema() { + if (schemaBuilder_ == null) { + return schema_ == null ? io.pinecone.proto.MetadataSchema.getDefaultInstance() : schema_; + } else { + return schemaBuilder_.getMessage(); + } + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + public Builder setSchema(io.pinecone.proto.MetadataSchema value) { + if (schemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + } else { + schemaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + public Builder setSchema( + io.pinecone.proto.MetadataSchema.Builder builderForValue) { + if (schemaBuilder_ == null) { + schema_ = builderForValue.build(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + public Builder mergeSchema(io.pinecone.proto.MetadataSchema value) { + if (schemaBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + schema_ != null && + schema_ != io.pinecone.proto.MetadataSchema.getDefaultInstance()) { + getSchemaBuilder().mergeFrom(value); + } else { + schema_ = value; + } + } else { + schemaBuilder_.mergeFrom(value); + } + if (schema_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + public Builder clearSchema() { + bitField0_ = (bitField0_ & ~0x00000004); + schema_ = null; + if (schemaBuilder_ != null) { + schemaBuilder_.dispose(); + schemaBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + public io.pinecone.proto.MetadataSchema.Builder getSchemaBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSchemaFieldBuilder().getBuilder(); + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + public io.pinecone.proto.MetadataSchemaOrBuilder getSchemaOrBuilder() { + if (schemaBuilder_ != null) { + return schemaBuilder_.getMessageOrBuilder(); + } else { + return schema_ == null ? + io.pinecone.proto.MetadataSchema.getDefaultInstance() : schema_; + } + } + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.MetadataSchema, io.pinecone.proto.MetadataSchema.Builder, io.pinecone.proto.MetadataSchemaOrBuilder> + getSchemaFieldBuilder() { + if (schemaBuilder_ == null) { + schemaBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.MetadataSchema, io.pinecone.proto.MetadataSchema.Builder, io.pinecone.proto.MetadataSchemaOrBuilder>( + getSchema(), + getParentForChildren(), + isClean()); + schema_ = null; + } + return schemaBuilder_; + } + + private io.pinecone.proto.IndexedFields indexedFields_; + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.IndexedFields, io.pinecone.proto.IndexedFields.Builder, io.pinecone.proto.IndexedFieldsOrBuilder> indexedFieldsBuilder_; + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + * @return Whether the indexedFields field is set. + */ + public boolean hasIndexedFields() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + * @return The indexedFields. + */ + public io.pinecone.proto.IndexedFields getIndexedFields() { + if (indexedFieldsBuilder_ == null) { + return indexedFields_ == null ? io.pinecone.proto.IndexedFields.getDefaultInstance() : indexedFields_; + } else { + return indexedFieldsBuilder_.getMessage(); + } + } + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + public Builder setIndexedFields(io.pinecone.proto.IndexedFields value) { + if (indexedFieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + indexedFields_ = value; + } else { + indexedFieldsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + public Builder setIndexedFields( + io.pinecone.proto.IndexedFields.Builder builderForValue) { + if (indexedFieldsBuilder_ == null) { + indexedFields_ = builderForValue.build(); + } else { + indexedFieldsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + public Builder mergeIndexedFields(io.pinecone.proto.IndexedFields value) { + if (indexedFieldsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + indexedFields_ != null && + indexedFields_ != io.pinecone.proto.IndexedFields.getDefaultInstance()) { + getIndexedFieldsBuilder().mergeFrom(value); + } else { + indexedFields_ = value; + } + } else { + indexedFieldsBuilder_.mergeFrom(value); + } + if (indexedFields_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + public Builder clearIndexedFields() { + bitField0_ = (bitField0_ & ~0x00000008); + indexedFields_ = null; + if (indexedFieldsBuilder_ != null) { + indexedFieldsBuilder_.dispose(); + indexedFieldsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + public io.pinecone.proto.IndexedFields.Builder getIndexedFieldsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getIndexedFieldsFieldBuilder().getBuilder(); + } + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + public io.pinecone.proto.IndexedFieldsOrBuilder getIndexedFieldsOrBuilder() { + if (indexedFieldsBuilder_ != null) { + return indexedFieldsBuilder_.getMessageOrBuilder(); + } else { + return indexedFields_ == null ? + io.pinecone.proto.IndexedFields.getDefaultInstance() : indexedFields_; + } + } + /** + *
+     * List of indexed fields in the namespace
+     * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.IndexedFields, io.pinecone.proto.IndexedFields.Builder, io.pinecone.proto.IndexedFieldsOrBuilder> + getIndexedFieldsFieldBuilder() { + if (indexedFieldsBuilder_ == null) { + indexedFieldsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.pinecone.proto.IndexedFields, io.pinecone.proto.IndexedFields.Builder, io.pinecone.proto.IndexedFieldsOrBuilder>( + getIndexedFields(), + getParentForChildren(), + isClean()); + indexedFields_ = null; + } + return indexedFieldsBuilder_; + } + // @@protoc_insertion_point(builder_scope:NamespaceDescription) } diff --git a/src/main/java/io/pinecone/proto/NamespaceDescriptionOrBuilder.java b/src/main/java/io/pinecone/proto/NamespaceDescriptionOrBuilder.java index 9c25ec80..e6c6d394 100644 --- a/src/main/java/io/pinecone/proto/NamespaceDescriptionOrBuilder.java +++ b/src/main/java/io/pinecone/proto/NamespaceDescriptionOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -26,4 +26,46 @@ public interface NamespaceDescriptionOrBuilder extends * @return The recordCount. */ long getRecordCount(); + + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + * @return The schema. + */ + io.pinecone.proto.MetadataSchema getSchema(); + /** + * optional .MetadataSchema schema = 3 [json_name = "schema"]; + */ + io.pinecone.proto.MetadataSchemaOrBuilder getSchemaOrBuilder(); + + /** + *
+   * List of indexed fields in the namespace
+   * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + * @return Whether the indexedFields field is set. + */ + boolean hasIndexedFields(); + /** + *
+   * List of indexed fields in the namespace
+   * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + * @return The indexedFields. + */ + io.pinecone.proto.IndexedFields getIndexedFields(); + /** + *
+   * List of indexed fields in the namespace
+   * 
+ * + * optional .IndexedFields indexed_fields = 4 [json_name = "indexedFields"]; + */ + io.pinecone.proto.IndexedFieldsOrBuilder getIndexedFieldsOrBuilder(); } diff --git a/src/main/java/io/pinecone/proto/NamespaceSummary.java b/src/main/java/io/pinecone/proto/NamespaceSummary.java index 804619be..efcd10d0 100644 --- a/src/main/java/io/pinecone/proto/NamespaceSummary.java +++ b/src/main/java/io/pinecone/proto/NamespaceSummary.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -35,13 +35,13 @@ private NamespaceSummary() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceSummary_descriptor; + return io.pinecone.proto.DbData202510.internal_static_NamespaceSummary_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceSummary_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_NamespaceSummary_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.NamespaceSummary.class, io.pinecone.proto.NamespaceSummary.Builder.class); } @@ -232,13 +232,13 @@ public static final class Builder extends io.pinecone.proto.NamespaceSummaryOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceSummary_descriptor; + return io.pinecone.proto.DbData202510.internal_static_NamespaceSummary_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceSummary_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_NamespaceSummary_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.NamespaceSummary.class, io.pinecone.proto.NamespaceSummary.Builder.class); } @@ -264,7 +264,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_NamespaceSummary_descriptor; + return io.pinecone.proto.DbData202510.internal_static_NamespaceSummary_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/NamespaceSummaryOrBuilder.java b/src/main/java/io/pinecone/proto/NamespaceSummaryOrBuilder.java index 3babbe1f..766b31e2 100644 --- a/src/main/java/io/pinecone/proto/NamespaceSummaryOrBuilder.java +++ b/src/main/java/io/pinecone/proto/NamespaceSummaryOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/Pagination.java b/src/main/java/io/pinecone/proto/Pagination.java index 39640dec..8cdc68ae 100644 --- a/src/main/java/io/pinecone/proto/Pagination.java +++ b/src/main/java/io/pinecone/proto/Pagination.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -32,13 +32,13 @@ private Pagination() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_Pagination_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Pagination_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_Pagination_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_Pagination_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.Pagination.class, io.pinecone.proto.Pagination.Builder.class); } @@ -247,13 +247,13 @@ public static final class Builder extends io.pinecone.proto.PaginationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_Pagination_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Pagination_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_Pagination_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_Pagination_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.Pagination.class, io.pinecone.proto.Pagination.Builder.class); } @@ -279,7 +279,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_Pagination_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Pagination_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/PaginationOrBuilder.java b/src/main/java/io/pinecone/proto/PaginationOrBuilder.java index 4ec0507a..0790315c 100644 --- a/src/main/java/io/pinecone/proto/PaginationOrBuilder.java +++ b/src/main/java/io/pinecone/proto/PaginationOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/QueryRequest.java b/src/main/java/io/pinecone/proto/QueryRequest.java index 21cbef9b..04dd2741 100644 --- a/src/main/java/io/pinecone/proto/QueryRequest.java +++ b/src/main/java/io/pinecone/proto/QueryRequest.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -39,13 +39,13 @@ private QueryRequest() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_QueryRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_QueryRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_QueryRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.QueryRequest.class, io.pinecone.proto.QueryRequest.Builder.class); } @@ -117,7 +117,7 @@ public int getTopK() { private com.google.protobuf.Struct 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). 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/index-data/indexing-overview#metadata).
    * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -129,7 +129,7 @@ public boolean hasFilter() { } /** *
-   * 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).
+   * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
    * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -141,7 +141,7 @@ public com.google.protobuf.Struct getFilter() { } /** *
-   * 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).
+   * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
    * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -653,13 +653,13 @@ public static final class Builder extends io.pinecone.proto.QueryRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_QueryRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_QueryRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_QueryRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.QueryRequest.class, io.pinecone.proto.QueryRequest.Builder.class); } @@ -715,7 +715,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_QueryRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryRequest_descriptor; } @java.lang.Override @@ -1117,7 +1117,7 @@ public Builder clearTopK() { com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> filterBuilder_; /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -1128,7 +1128,7 @@ public boolean hasFilter() { } /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -1143,7 +1143,7 @@ public com.google.protobuf.Struct getFilter() { } /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -1163,7 +1163,7 @@ public Builder setFilter(com.google.protobuf.Struct value) { } /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -1181,7 +1181,7 @@ public Builder setFilter( } /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -1206,7 +1206,7 @@ public Builder mergeFilter(com.google.protobuf.Struct value) { } /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -1223,7 +1223,7 @@ public Builder clearFilter() { } /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -1235,7 +1235,7 @@ public com.google.protobuf.Struct.Builder getFilterBuilder() { } /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -1250,7 +1250,7 @@ public com.google.protobuf.StructOrBuilder getFilterOrBuilder() { } /** *
-     * 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).
+     * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
      * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; diff --git a/src/main/java/io/pinecone/proto/QueryRequestOrBuilder.java b/src/main/java/io/pinecone/proto/QueryRequestOrBuilder.java index 5fd81f2b..c8d1f6bd 100644 --- a/src/main/java/io/pinecone/proto/QueryRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/QueryRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -41,7 +41,7 @@ public interface QueryRequestOrBuilder extends /** *
-   * 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).
+   * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
    * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -50,7 +50,7 @@ public interface QueryRequestOrBuilder extends boolean hasFilter(); /** *
-   * 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).
+   * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
    * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; @@ -59,7 +59,7 @@ public interface QueryRequestOrBuilder extends com.google.protobuf.Struct getFilter(); /** *
-   * 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).
+   * The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata).
    * 
* * .google.protobuf.Struct filter = 3 [json_name = "filter"]; diff --git a/src/main/java/io/pinecone/proto/QueryResponse.java b/src/main/java/io/pinecone/proto/QueryResponse.java index 705af3b2..85fcdc04 100644 --- a/src/main/java/io/pinecone/proto/QueryResponse.java +++ b/src/main/java/io/pinecone/proto/QueryResponse.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -38,13 +38,13 @@ private QueryResponse() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_QueryResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_QueryResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_QueryResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.QueryResponse.class, io.pinecone.proto.QueryResponse.Builder.class); } @@ -468,13 +468,13 @@ public static final class Builder extends io.pinecone.proto.QueryResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_QueryResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_QueryResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_QueryResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.QueryResponse.class, io.pinecone.proto.QueryResponse.Builder.class); } @@ -527,7 +527,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_QueryResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryResponse_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/QueryResponseOrBuilder.java b/src/main/java/io/pinecone/proto/QueryResponseOrBuilder.java index 872c6001..5d8a2320 100644 --- a/src/main/java/io/pinecone/proto/QueryResponseOrBuilder.java +++ b/src/main/java/io/pinecone/proto/QueryResponseOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/QueryVector.java b/src/main/java/io/pinecone/proto/QueryVector.java index 2226ffd7..df913006 100644 --- a/src/main/java/io/pinecone/proto/QueryVector.java +++ b/src/main/java/io/pinecone/proto/QueryVector.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -37,13 +37,13 @@ private QueryVector() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_QueryVector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_QueryVector_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_QueryVector_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.QueryVector.class, io.pinecone.proto.QueryVector.Builder.class); } @@ -466,13 +466,13 @@ public static final class Builder extends io.pinecone.proto.QueryVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_QueryVector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_QueryVector_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_QueryVector_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.QueryVector.class, io.pinecone.proto.QueryVector.Builder.class); } @@ -517,7 +517,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_QueryVector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_QueryVector_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/QueryVectorOrBuilder.java b/src/main/java/io/pinecone/proto/QueryVectorOrBuilder.java index a66641d5..e18276bd 100644 --- a/src/main/java/io/pinecone/proto/QueryVectorOrBuilder.java +++ b/src/main/java/io/pinecone/proto/QueryVectorOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/RequestUnion.java b/src/main/java/io/pinecone/proto/RequestUnion.java index 320ae051..f9d807a1 100644 --- a/src/main/java/io/pinecone/proto/RequestUnion.java +++ b/src/main/java/io/pinecone/proto/RequestUnion.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -36,13 +36,13 @@ private RequestUnion() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_RequestUnion_descriptor; + return io.pinecone.proto.DbData202510.internal_static_RequestUnion_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_RequestUnion_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_RequestUnion_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.RequestUnion.class, io.pinecone.proto.RequestUnion.Builder.class); } @@ -398,13 +398,13 @@ public static final class Builder extends io.pinecone.proto.RequestUnionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_RequestUnion_descriptor; + return io.pinecone.proto.DbData202510.internal_static_RequestUnion_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_RequestUnion_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_RequestUnion_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.RequestUnion.class, io.pinecone.proto.RequestUnion.Builder.class); } @@ -440,7 +440,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_RequestUnion_descriptor; + return io.pinecone.proto.DbData202510.internal_static_RequestUnion_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/RequestUnionOrBuilder.java b/src/main/java/io/pinecone/proto/RequestUnionOrBuilder.java index 007d6f42..49e5560a 100644 --- a/src/main/java/io/pinecone/proto/RequestUnionOrBuilder.java +++ b/src/main/java/io/pinecone/proto/RequestUnionOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/ScoredVector.java b/src/main/java/io/pinecone/proto/ScoredVector.java index d7b81ff7..4f74c15b 100644 --- a/src/main/java/io/pinecone/proto/ScoredVector.java +++ b/src/main/java/io/pinecone/proto/ScoredVector.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -33,13 +33,13 @@ private ScoredVector() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ScoredVector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ScoredVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ScoredVector_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ScoredVector_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ScoredVector.class, io.pinecone.proto.ScoredVector.Builder.class); } @@ -460,13 +460,13 @@ public static final class Builder extends io.pinecone.proto.ScoredVectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_ScoredVector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ScoredVector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_ScoredVector_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_ScoredVector_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.ScoredVector.class, io.pinecone.proto.ScoredVector.Builder.class); } @@ -511,7 +511,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_ScoredVector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_ScoredVector_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/ScoredVectorOrBuilder.java b/src/main/java/io/pinecone/proto/ScoredVectorOrBuilder.java index 3bacfef0..479beeac 100644 --- a/src/main/java/io/pinecone/proto/ScoredVectorOrBuilder.java +++ b/src/main/java/io/pinecone/proto/ScoredVectorOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/SingleQueryResults.java b/src/main/java/io/pinecone/proto/SingleQueryResults.java index dfb6b3c9..6fcbf512 100644 --- a/src/main/java/io/pinecone/proto/SingleQueryResults.java +++ b/src/main/java/io/pinecone/proto/SingleQueryResults.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -37,13 +37,13 @@ private SingleQueryResults() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_SingleQueryResults_descriptor; + return io.pinecone.proto.DbData202510.internal_static_SingleQueryResults_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_SingleQueryResults_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_SingleQueryResults_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.SingleQueryResults.class, io.pinecone.proto.SingleQueryResults.Builder.class); } @@ -338,13 +338,13 @@ public static final class Builder extends io.pinecone.proto.SingleQueryResultsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_SingleQueryResults_descriptor; + return io.pinecone.proto.DbData202510.internal_static_SingleQueryResults_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_SingleQueryResults_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_SingleQueryResults_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.SingleQueryResults.class, io.pinecone.proto.SingleQueryResults.Builder.class); } @@ -377,7 +377,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_SingleQueryResults_descriptor; + return io.pinecone.proto.DbData202510.internal_static_SingleQueryResults_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/SingleQueryResultsOrBuilder.java b/src/main/java/io/pinecone/proto/SingleQueryResultsOrBuilder.java index d7c53603..ed715422 100644 --- a/src/main/java/io/pinecone/proto/SingleQueryResultsOrBuilder.java +++ b/src/main/java/io/pinecone/proto/SingleQueryResultsOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/SparseValues.java b/src/main/java/io/pinecone/proto/SparseValues.java index 3ea4a559..b22bccf3 100644 --- a/src/main/java/io/pinecone/proto/SparseValues.java +++ b/src/main/java/io/pinecone/proto/SparseValues.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -33,13 +33,13 @@ private SparseValues() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_SparseValues_descriptor; + return io.pinecone.proto.DbData202510.internal_static_SparseValues_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_SparseValues_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_SparseValues_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.SparseValues.class, io.pinecone.proto.SparseValues.Builder.class); } @@ -311,13 +311,13 @@ public static final class Builder extends io.pinecone.proto.SparseValuesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_SparseValues_descriptor; + return io.pinecone.proto.DbData202510.internal_static_SparseValues_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_SparseValues_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_SparseValues_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.SparseValues.class, io.pinecone.proto.SparseValues.Builder.class); } @@ -344,7 +344,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_SparseValues_descriptor; + return io.pinecone.proto.DbData202510.internal_static_SparseValues_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/SparseValuesOrBuilder.java b/src/main/java/io/pinecone/proto/SparseValuesOrBuilder.java index 2732b1be..b0391f6e 100644 --- a/src/main/java/io/pinecone/proto/SparseValuesOrBuilder.java +++ b/src/main/java/io/pinecone/proto/SparseValuesOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/UpdateRequest.java b/src/main/java/io/pinecone/proto/UpdateRequest.java index febc054a..9897e82c 100644 --- a/src/main/java/io/pinecone/proto/UpdateRequest.java +++ b/src/main/java/io/pinecone/proto/UpdateRequest.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -38,13 +38,13 @@ private UpdateRequest() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_UpdateRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpdateRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_UpdateRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_UpdateRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.UpdateRequest.class, io.pinecone.proto.UpdateRequest.Builder.class); } @@ -55,10 +55,10 @@ private UpdateRequest() { private volatile java.lang.Object id_ = ""; /** *
-   * Vector's unique id.
+   * The unique ID of the record.
    * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @return The id. */ @java.lang.Override @@ -76,10 +76,10 @@ public java.lang.String getId() { } /** *
-   * Vector's unique id.
+   * The unique ID of the record.
    * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @return The bytes for id. */ @java.lang.Override @@ -220,7 +220,7 @@ public com.google.protobuf.StructOrBuilder getSetMetadataOrBuilder() { private volatile java.lang.Object namespace_ = ""; /** *
-   * The namespace containing the vector to update.
+   * The namespace containing the record(s) to update.
    * 
* * string namespace = 4 [json_name = "namespace"]; @@ -241,7 +241,7 @@ public java.lang.String getNamespace() { } /** *
-   * The namespace containing the vector to update.
+   * The namespace containing the record(s) to update.
    * 
* * string namespace = 4 [json_name = "namespace"]; @@ -262,6 +262,71 @@ public java.lang.String getNamespace() { } } + public static final int FILTER_FIELD_NUMBER = 6; + private com.google.protobuf.Struct filter_; + /** + *
+   * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+   * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + * @return Whether the filter field is set. + */ + @java.lang.Override + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+   * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+   * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + * @return The filter. + */ + @java.lang.Override + public com.google.protobuf.Struct getFilter() { + return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_; + } + /** + *
+   * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+   * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getFilterOrBuilder() { + return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_; + } + + public static final int DRY_RUN_FIELD_NUMBER = 7; + private boolean dryRun_ = false; + /** + *
+   * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`.
+   * 
+ * + * optional bool dry_run = 7 [json_name = "dryRun"]; + * @return Whether the dryRun field is set. + */ + @java.lang.Override + public boolean hasDryRun() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+   * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`.
+   * 
+ * + * optional bool dry_run = 7 [json_name = "dryRun"]; + * @return The dryRun. + */ + @java.lang.Override + public boolean getDryRun() { + return dryRun_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -296,6 +361,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(5, getSparseValues()); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getFilter()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(7, dryRun_); + } getUnknownFields().writeTo(output); } @@ -330,6 +401,14 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getSparseValues()); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getFilter()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, dryRun_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -361,6 +440,16 @@ public boolean equals(final java.lang.Object obj) { } if (!getNamespace() .equals(other.getNamespace())) return false; + if (hasFilter() != other.hasFilter()) return false; + if (hasFilter()) { + if (!getFilter() + .equals(other.getFilter())) return false; + } + if (hasDryRun() != other.hasDryRun()) return false; + if (hasDryRun()) { + if (getDryRun() + != other.getDryRun()) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -388,6 +477,15 @@ public int hashCode() { } hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; hash = (53 * hash) + getNamespace().hashCode(); + if (hasFilter()) { + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + } + if (hasDryRun()) { + hash = (37 * hash) + DRY_RUN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDryRun()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -498,13 +596,13 @@ public static final class Builder extends io.pinecone.proto.UpdateRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_UpdateRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpdateRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_UpdateRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_UpdateRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.UpdateRequest.class, io.pinecone.proto.UpdateRequest.Builder.class); } @@ -524,6 +622,7 @@ private void maybeForceBuilderInitialization() { .alwaysUseFieldBuilders) { getSparseValuesFieldBuilder(); getSetMetadataFieldBuilder(); + getFilterFieldBuilder(); } } @java.lang.Override @@ -543,13 +642,19 @@ public Builder clear() { setMetadataBuilder_ = null; } namespace_ = ""; + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + dryRun_ = false; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_UpdateRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpdateRequest_descriptor; } @java.lang.Override @@ -599,6 +704,16 @@ private void buildPartial0(io.pinecone.proto.UpdateRequest result) { if (((from_bitField0_ & 0x00000010) != 0)) { result.namespace_ = namespace_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.filter_ = filterBuilder_ == null + ? filter_ + : filterBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.dryRun_ = dryRun_; + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -641,6 +756,12 @@ public Builder mergeFrom(io.pinecone.proto.UpdateRequest other) { bitField0_ |= 0x00000010; onChanged(); } + if (other.hasFilter()) { + mergeFilter(other.getFilter()); + } + if (other.hasDryRun()) { + setDryRun(other.getDryRun()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -708,6 +829,18 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 42 + case 50: { + input.readMessage( + getFilterFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: { + dryRun_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -728,10 +861,10 @@ public Builder mergeFrom( private java.lang.Object id_ = ""; /** *
-     * Vector's unique id.
+     * The unique ID of the record.
      * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @return The id. */ public java.lang.String getId() { @@ -748,10 +881,10 @@ public java.lang.String getId() { } /** *
-     * Vector's unique id.
+     * The unique ID of the record.
      * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @return The bytes for id. */ public com.google.protobuf.ByteString @@ -769,10 +902,10 @@ public java.lang.String getId() { } /** *
-     * Vector's unique id.
+     * The unique ID of the record.
      * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @param value The id to set. * @return This builder for chaining. */ @@ -786,10 +919,10 @@ public Builder setId( } /** *
-     * Vector's unique id.
+     * The unique ID of the record.
      * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @return This builder for chaining. */ public Builder clearId() { @@ -800,10 +933,10 @@ public Builder clearId() { } /** *
-     * Vector's unique id.
+     * The unique ID of the record.
      * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @param value The bytes for id to set. * @return This builder for chaining. */ @@ -1252,7 +1385,7 @@ public com.google.protobuf.StructOrBuilder getSetMetadataOrBuilder() { private java.lang.Object namespace_ = ""; /** *
-     * The namespace containing the vector to update.
+     * The namespace containing the record(s) to update.
      * 
* * string namespace = 4 [json_name = "namespace"]; @@ -1272,7 +1405,7 @@ public java.lang.String getNamespace() { } /** *
-     * The namespace containing the vector to update.
+     * The namespace containing the record(s) to update.
      * 
* * string namespace = 4 [json_name = "namespace"]; @@ -1293,7 +1426,7 @@ public java.lang.String getNamespace() { } /** *
-     * The namespace containing the vector to update.
+     * The namespace containing the record(s) to update.
      * 
* * string namespace = 4 [json_name = "namespace"]; @@ -1310,7 +1443,7 @@ public Builder setNamespace( } /** *
-     * The namespace containing the vector to update.
+     * The namespace containing the record(s) to update.
      * 
* * string namespace = 4 [json_name = "namespace"]; @@ -1324,7 +1457,7 @@ public Builder clearNamespace() { } /** *
-     * The namespace containing the vector to update.
+     * The namespace containing the record(s) to update.
      * 
* * string namespace = 4 [json_name = "namespace"]; @@ -1341,6 +1474,219 @@ public Builder setNamespaceBytes( return this; } + private com.google.protobuf.Struct filter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> filterBuilder_; + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + * @return Whether the filter field is set. + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + * @return The filter. + */ + public com.google.protobuf.Struct getFilter() { + if (filterBuilder_ == null) { + return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_; + } else { + return filterBuilder_.getMessage(); + } + } + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + public Builder setFilter(com.google.protobuf.Struct value) { + if (filterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + } else { + filterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + public Builder setFilter( + com.google.protobuf.Struct.Builder builderForValue) { + if (filterBuilder_ == null) { + filter_ = builderForValue.build(); + } else { + filterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + public Builder mergeFilter(com.google.protobuf.Struct value) { + if (filterBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + filter_ != null && + filter_ != com.google.protobuf.Struct.getDefaultInstance()) { + getFilterBuilder().mergeFrom(value); + } else { + filter_ = value; + } + } else { + filterBuilder_.mergeFrom(value); + } + if (filter_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000020); + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + public com.google.protobuf.Struct.Builder getFilterBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getFilterFieldBuilder().getBuilder(); + } + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + public com.google.protobuf.StructOrBuilder getFilterOrBuilder() { + if (filterBuilder_ != null) { + return filterBuilder_.getMessageOrBuilder(); + } else { + return filter_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : filter_; + } + } + /** + *
+     * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+     * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + getFilterFieldBuilder() { + if (filterBuilder_ == null) { + filterBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getFilter(), + getParentForChildren(), + isClean()); + filter_ = null; + } + return filterBuilder_; + } + + private boolean dryRun_ ; + /** + *
+     * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`.
+     * 
+ * + * optional bool dry_run = 7 [json_name = "dryRun"]; + * @return Whether the dryRun field is set. + */ + @java.lang.Override + public boolean hasDryRun() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
+     * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`.
+     * 
+ * + * optional bool dry_run = 7 [json_name = "dryRun"]; + * @return The dryRun. + */ + @java.lang.Override + public boolean getDryRun() { + return dryRun_; + } + /** + *
+     * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`.
+     * 
+ * + * optional bool dry_run = 7 [json_name = "dryRun"]; + * @param value The dryRun to set. + * @return This builder for chaining. + */ + public Builder setDryRun(boolean value) { + + dryRun_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`.
+     * 
+ * + * optional bool dry_run = 7 [json_name = "dryRun"]; + * @return This builder for chaining. + */ + public Builder clearDryRun() { + bitField0_ = (bitField0_ & ~0x00000040); + dryRun_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:UpdateRequest) } diff --git a/src/main/java/io/pinecone/proto/UpdateRequestOrBuilder.java b/src/main/java/io/pinecone/proto/UpdateRequestOrBuilder.java index 08976fbb..0f184913 100644 --- a/src/main/java/io/pinecone/proto/UpdateRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/UpdateRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -11,19 +11,19 @@ public interface UpdateRequestOrBuilder extends /** *
-   * Vector's unique id.
+   * The unique ID of the record.
    * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @return The id. */ java.lang.String getId(); /** *
-   * Vector's unique id.
+   * The unique ID of the record.
    * 
* - * string id = 1 [json_name = "id", (.google.api.field_behavior) = REQUIRED]; + * string id = 1 [json_name = "id"]; * @return The bytes for id. */ com.google.protobuf.ByteString @@ -114,7 +114,7 @@ public interface UpdateRequestOrBuilder extends /** *
-   * The namespace containing the vector to update.
+   * The namespace containing the record(s) to update.
    * 
* * string namespace = 4 [json_name = "namespace"]; @@ -123,7 +123,7 @@ public interface UpdateRequestOrBuilder extends java.lang.String getNamespace(); /** *
-   * The namespace containing the vector to update.
+   * The namespace containing the record(s) to update.
    * 
* * string namespace = 4 [json_name = "namespace"]; @@ -131,4 +131,50 @@ public interface UpdateRequestOrBuilder extends */ com.google.protobuf.ByteString getNamespaceBytes(); + + /** + *
+   * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+   * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + * @return Whether the filter field is set. + */ + boolean hasFilter(); + /** + *
+   * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+   * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + * @return The filter. + */ + com.google.protobuf.Struct getFilter(); + /** + *
+   * A [metadata filter expression](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata-filter-expressions. When updating metadata across records in a namespace, the update is applied to all records that match the filter.
+   * 
+ * + * optional .google.protobuf.Struct filter = 6 [json_name = "filter"]; + */ + com.google.protobuf.StructOrBuilder getFilterOrBuilder(); + + /** + *
+   * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`.
+   * 
+ * + * optional bool dry_run = 7 [json_name = "dryRun"]; + * @return Whether the dryRun field is set. + */ + boolean hasDryRun(); + /** + *
+   * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`.
+   * 
+ * + * optional bool dry_run = 7 [json_name = "dryRun"]; + * @return The dryRun. + */ + boolean getDryRun(); } diff --git a/src/main/java/io/pinecone/proto/UpdateResponse.java b/src/main/java/io/pinecone/proto/UpdateResponse.java index 3aec52d2..d59b6a72 100644 --- a/src/main/java/io/pinecone/proto/UpdateResponse.java +++ b/src/main/java/io/pinecone/proto/UpdateResponse.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -35,17 +35,37 @@ private UpdateResponse() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_UpdateResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpdateResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_UpdateResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_UpdateResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.UpdateResponse.class, io.pinecone.proto.UpdateResponse.Builder.class); } + private int bitField0_; + public static final int MATCHED_RECORDS_FIELD_NUMBER = 1; + private int matchedRecords_ = 0; + /** + * optional int32 matched_records = 1 [json_name = "matchedRecords"]; + * @return Whether the matchedRecords field is set. + */ + @java.lang.Override + public boolean hasMatchedRecords() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 matched_records = 1 [json_name = "matchedRecords"]; + * @return The matchedRecords. + */ + @java.lang.Override + public int getMatchedRecords() { + return matchedRecords_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -60,6 +80,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, matchedRecords_); + } getUnknownFields().writeTo(output); } @@ -69,6 +92,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, matchedRecords_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -84,6 +111,11 @@ public boolean equals(final java.lang.Object obj) { } io.pinecone.proto.UpdateResponse other = (io.pinecone.proto.UpdateResponse) obj; + if (hasMatchedRecords() != other.hasMatchedRecords()) return false; + if (hasMatchedRecords()) { + if (getMatchedRecords() + != other.getMatchedRecords()) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -95,6 +127,10 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMatchedRecords()) { + hash = (37 * hash) + MATCHED_RECORDS_FIELD_NUMBER; + hash = (53 * hash) + getMatchedRecords(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -205,13 +241,13 @@ public static final class Builder extends io.pinecone.proto.UpdateResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_UpdateResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpdateResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_UpdateResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_UpdateResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.UpdateResponse.class, io.pinecone.proto.UpdateResponse.Builder.class); } @@ -229,13 +265,15 @@ private Builder( @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; + matchedRecords_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_UpdateResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpdateResponse_descriptor; } @java.lang.Override @@ -255,10 +293,21 @@ public io.pinecone.proto.UpdateResponse build() { @java.lang.Override public io.pinecone.proto.UpdateResponse buildPartial() { io.pinecone.proto.UpdateResponse result = new io.pinecone.proto.UpdateResponse(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } + private void buildPartial0(io.pinecone.proto.UpdateResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.matchedRecords_ = matchedRecords_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.pinecone.proto.UpdateResponse) { @@ -271,6 +320,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(io.pinecone.proto.UpdateResponse other) { if (other == io.pinecone.proto.UpdateResponse.getDefaultInstance()) return this; + if (other.hasMatchedRecords()) { + setMatchedRecords(other.getMatchedRecords()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -297,6 +349,11 @@ public Builder mergeFrom( case 0: done = true; break; + case 8: { + matchedRecords_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -312,6 +369,47 @@ public Builder mergeFrom( } // finally return this; } + private int bitField0_; + + private int matchedRecords_ ; + /** + * optional int32 matched_records = 1 [json_name = "matchedRecords"]; + * @return Whether the matchedRecords field is set. + */ + @java.lang.Override + public boolean hasMatchedRecords() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 matched_records = 1 [json_name = "matchedRecords"]; + * @return The matchedRecords. + */ + @java.lang.Override + public int getMatchedRecords() { + return matchedRecords_; + } + /** + * optional int32 matched_records = 1 [json_name = "matchedRecords"]; + * @param value The matchedRecords to set. + * @return This builder for chaining. + */ + public Builder setMatchedRecords(int value) { + + matchedRecords_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 matched_records = 1 [json_name = "matchedRecords"]; + * @return This builder for chaining. + */ + public Builder clearMatchedRecords() { + bitField0_ = (bitField0_ & ~0x00000001); + matchedRecords_ = 0; + onChanged(); + return this; + } // @@protoc_insertion_point(builder_scope:UpdateResponse) } diff --git a/src/main/java/io/pinecone/proto/UpdateResponseOrBuilder.java b/src/main/java/io/pinecone/proto/UpdateResponseOrBuilder.java index 55166fa8..7f805df0 100644 --- a/src/main/java/io/pinecone/proto/UpdateResponseOrBuilder.java +++ b/src/main/java/io/pinecone/proto/UpdateResponseOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -8,4 +8,15 @@ public interface UpdateResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:UpdateResponse) com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 matched_records = 1 [json_name = "matchedRecords"]; + * @return Whether the matchedRecords field is set. + */ + boolean hasMatchedRecords(); + /** + * optional int32 matched_records = 1 [json_name = "matchedRecords"]; + * @return The matchedRecords. + */ + int getMatchedRecords(); } diff --git a/src/main/java/io/pinecone/proto/UpsertRequest.java b/src/main/java/io/pinecone/proto/UpsertRequest.java index f75777ed..6c68adc6 100644 --- a/src/main/java/io/pinecone/proto/UpsertRequest.java +++ b/src/main/java/io/pinecone/proto/UpsertRequest.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -37,13 +37,13 @@ private UpsertRequest() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_UpsertRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpsertRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_UpsertRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_UpsertRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.UpsertRequest.class, io.pinecone.proto.UpsertRequest.Builder.class); } @@ -53,7 +53,7 @@ private UpsertRequest() { private java.util.List vectors_; /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -64,7 +64,7 @@ public java.util.List getVectorsList() { } /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -76,7 +76,7 @@ public java.util.List getVectorsList() { } /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -87,7 +87,7 @@ public int getVectorsCount() { } /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -98,7 +98,7 @@ public io.pinecone.proto.Vector getVectors(int index) { } /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -338,13 +338,13 @@ public static final class Builder extends io.pinecone.proto.UpsertRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_UpsertRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpsertRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_UpsertRequest_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_UpsertRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.UpsertRequest.class, io.pinecone.proto.UpsertRequest.Builder.class); } @@ -377,7 +377,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_UpsertRequest_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpsertRequest_descriptor; } @java.lang.Override @@ -540,7 +540,7 @@ private void ensureVectorsIsMutable() { /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -554,7 +554,7 @@ public java.util.List getVectorsList() { } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -568,7 +568,7 @@ public int getVectorsCount() { } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -582,7 +582,7 @@ public io.pinecone.proto.Vector getVectors(int index) { } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -603,7 +603,7 @@ public Builder setVectors( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -621,7 +621,7 @@ public Builder setVectors( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -641,7 +641,7 @@ public Builder addVectors(io.pinecone.proto.Vector value) { } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -662,7 +662,7 @@ public Builder addVectors( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -680,7 +680,7 @@ public Builder addVectors( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -698,7 +698,7 @@ public Builder addVectors( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -717,7 +717,7 @@ public Builder addAllVectors( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -734,7 +734,7 @@ public Builder clearVectors() { } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -751,7 +751,7 @@ public Builder removeVectors(int index) { } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -762,7 +762,7 @@ public io.pinecone.proto.Vector.Builder getVectorsBuilder( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -776,7 +776,7 @@ public io.pinecone.proto.VectorOrBuilder getVectorsOrBuilder( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -791,7 +791,7 @@ public io.pinecone.proto.VectorOrBuilder getVectorsOrBuilder( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -802,7 +802,7 @@ public io.pinecone.proto.Vector.Builder addVectorsBuilder() { } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -814,7 +814,7 @@ public io.pinecone.proto.Vector.Builder addVectorsBuilder( } /** *
-     * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+     * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
      * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; diff --git a/src/main/java/io/pinecone/proto/UpsertRequestOrBuilder.java b/src/main/java/io/pinecone/proto/UpsertRequestOrBuilder.java index 8bdd77aa..225b37d0 100644 --- a/src/main/java/io/pinecone/proto/UpsertRequestOrBuilder.java +++ b/src/main/java/io/pinecone/proto/UpsertRequestOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -11,7 +11,7 @@ public interface UpsertRequestOrBuilder extends /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -20,7 +20,7 @@ public interface UpsertRequestOrBuilder extends getVectorsList(); /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -28,7 +28,7 @@ public interface UpsertRequestOrBuilder extends io.pinecone.proto.Vector getVectors(int index); /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -36,7 +36,7 @@ public interface UpsertRequestOrBuilder extends int getVectorsCount(); /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; @@ -45,7 +45,7 @@ public interface UpsertRequestOrBuilder extends getVectorsOrBuilderList(); /** *
-   * An array containing the vectors to upsert. Recommended batch limit is 100 vectors.
+   * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    * 
* * repeated .Vector vectors = 1 [json_name = "vectors", (.google.api.field_behavior) = REQUIRED]; diff --git a/src/main/java/io/pinecone/proto/UpsertResponse.java b/src/main/java/io/pinecone/proto/UpsertResponse.java index 8f9be1b8..12f4ab12 100644 --- a/src/main/java/io/pinecone/proto/UpsertResponse.java +++ b/src/main/java/io/pinecone/proto/UpsertResponse.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -35,13 +35,13 @@ private UpsertResponse() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_UpsertResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpsertResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_UpsertResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_UpsertResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.UpsertResponse.class, io.pinecone.proto.UpsertResponse.Builder.class); } @@ -231,13 +231,13 @@ public static final class Builder extends io.pinecone.proto.UpsertResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_UpsertResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpsertResponse_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_UpsertResponse_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_UpsertResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.UpsertResponse.class, io.pinecone.proto.UpsertResponse.Builder.class); } @@ -263,7 +263,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_UpsertResponse_descriptor; + return io.pinecone.proto.DbData202510.internal_static_UpsertResponse_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/UpsertResponseOrBuilder.java b/src/main/java/io/pinecone/proto/UpsertResponseOrBuilder.java index 26074997..bdc22d90 100644 --- a/src/main/java/io/pinecone/proto/UpsertResponseOrBuilder.java +++ b/src/main/java/io/pinecone/proto/UpsertResponseOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/Usage.java b/src/main/java/io/pinecone/proto/Usage.java index fb4f96fa..49b4a30c 100644 --- a/src/main/java/io/pinecone/proto/Usage.java +++ b/src/main/java/io/pinecone/proto/Usage.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -31,13 +31,13 @@ private Usage() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_Usage_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Usage_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_Usage_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_Usage_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.Usage.class, io.pinecone.proto.Usage.Builder.class); } @@ -241,13 +241,13 @@ public static final class Builder extends io.pinecone.proto.UsageOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_Usage_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Usage_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_Usage_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_Usage_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.Usage.class, io.pinecone.proto.Usage.Builder.class); } @@ -273,7 +273,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_Usage_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Usage_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/UsageOrBuilder.java b/src/main/java/io/pinecone/proto/UsageOrBuilder.java index 4757f9ad..39b3b631 100644 --- a/src/main/java/io/pinecone/proto/UsageOrBuilder.java +++ b/src/main/java/io/pinecone/proto/UsageOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/Vector.java b/src/main/java/io/pinecone/proto/Vector.java index 40a059be..e0d28e53 100644 --- a/src/main/java/io/pinecone/proto/Vector.java +++ b/src/main/java/io/pinecone/proto/Vector.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; @@ -33,13 +33,13 @@ private Vector() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_Vector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Vector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_Vector_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_Vector_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.Vector.class, io.pinecone.proto.Vector.Builder.class); } @@ -432,13 +432,13 @@ public static final class Builder extends io.pinecone.proto.VectorOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.pinecone.proto.DbData202504.internal_static_Vector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Vector_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.pinecone.proto.DbData202504.internal_static_Vector_fieldAccessorTable + return io.pinecone.proto.DbData202510.internal_static_Vector_fieldAccessorTable .ensureFieldAccessorsInitialized( io.pinecone.proto.Vector.class, io.pinecone.proto.Vector.Builder.class); } @@ -482,7 +482,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.pinecone.proto.DbData202504.internal_static_Vector_descriptor; + return io.pinecone.proto.DbData202510.internal_static_Vector_descriptor; } @java.lang.Override diff --git a/src/main/java/io/pinecone/proto/VectorOrBuilder.java b/src/main/java/io/pinecone/proto/VectorOrBuilder.java index 596819a8..27e11fdb 100644 --- a/src/main/java/io/pinecone/proto/VectorOrBuilder.java +++ b/src/main/java/io/pinecone/proto/VectorOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: db_data_2025-04.proto +// source: db_data_2025-10.proto // Protobuf Java Version: 4.29.3 package io.pinecone.proto; diff --git a/src/main/java/io/pinecone/proto/VectorServiceGrpc.java b/src/main/java/io/pinecone/proto/VectorServiceGrpc.java index 384d3b8c..c3d9f84b 100644 --- a/src/main/java/io/pinecone/proto/VectorServiceGrpc.java +++ b/src/main/java/io/pinecone/proto/VectorServiceGrpc.java @@ -10,7 +10,7 @@ */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 1.64.0)", - comments = "Source: db_data_2025-04.proto") + comments = "Source: db_data_2025-10.proto") @io.grpc.stub.annotations.GrpcGenerated public final class VectorServiceGrpc { @@ -329,6 +329,68 @@ io.pinecone.proto.DeleteResponse> getDeleteNamespaceMethod() { return getDeleteNamespaceMethod; } + private static volatile io.grpc.MethodDescriptor getCreateNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNamespace", + requestType = io.pinecone.proto.CreateNamespaceRequest.class, + responseType = io.pinecone.proto.NamespaceDescription.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateNamespaceMethod() { + io.grpc.MethodDescriptor getCreateNamespaceMethod; + if ((getCreateNamespaceMethod = VectorServiceGrpc.getCreateNamespaceMethod) == null) { + synchronized (VectorServiceGrpc.class) { + if ((getCreateNamespaceMethod = VectorServiceGrpc.getCreateNamespaceMethod) == null) { + VectorServiceGrpc.getCreateNamespaceMethod = getCreateNamespaceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateNamespace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.pinecone.proto.CreateNamespaceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.pinecone.proto.NamespaceDescription.getDefaultInstance())) + .setSchemaDescriptor(new VectorServiceMethodDescriptorSupplier("CreateNamespace")) + .build(); + } + } + } + return getCreateNamespaceMethod; + } + + private static volatile io.grpc.MethodDescriptor getFetchByMetadataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchByMetadata", + requestType = io.pinecone.proto.FetchByMetadataRequest.class, + responseType = io.pinecone.proto.FetchByMetadataResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getFetchByMetadataMethod() { + io.grpc.MethodDescriptor getFetchByMetadataMethod; + if ((getFetchByMetadataMethod = VectorServiceGrpc.getFetchByMetadataMethod) == null) { + synchronized (VectorServiceGrpc.class) { + if ((getFetchByMetadataMethod = VectorServiceGrpc.getFetchByMetadataMethod) == null) { + VectorServiceGrpc.getFetchByMetadataMethod = getFetchByMetadataMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchByMetadata")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.pinecone.proto.FetchByMetadataRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.pinecone.proto.FetchByMetadataResponse.getDefaultInstance())) + .setSchemaDescriptor(new VectorServiceMethodDescriptorSupplier("FetchByMetadata")) + .build(); + } + } + } + return getFetchByMetadataMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -385,7 +447,7 @@ public interface AsyncService { *
      * Upsert vectors
      * 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).
+     * For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data).
      * 
*/ default void upsert(io.pinecone.proto.UpsertRequest request, @@ -397,7 +459,7 @@ default void upsert(io.pinecone.proto.UpsertRequest request, *
      * 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).
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data).
      * 
*/ default void delete(io.pinecone.proto.DeleteRequest request, @@ -409,7 +471,7 @@ default void delete(io.pinecone.proto.DeleteRequest request, *
      * 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).
+     * For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/manage-data/fetch-data).
      * 
*/ default void fetch(io.pinecone.proto.FetchRequest request, @@ -422,7 +484,7 @@ default void fetch(io.pinecone.proto.FetchRequest request, * 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). + * For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/manage-data/list-record-ids). * **Note:** `list` is supported only for serverless indexes. *
*/ @@ -435,7 +497,7 @@ default void list(io.pinecone.proto.ListRequest request, *
      * Search with a vector
      * Search a namespace with a query vector or record ID and return the IDs of the most similar records, along with their similarity scores.
-     * For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data).
+     * For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview).
      * 
*/ default void query(io.pinecone.proto.QueryRequest request, @@ -447,7 +509,7 @@ default void query(io.pinecone.proto.QueryRequest request, *
      * Update a vector
      * Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value.
-     * For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data).
+     * For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data).
      * 
*/ default void update(io.pinecone.proto.UpdateRequest request, @@ -469,8 +531,12 @@ default void describeIndexStats(io.pinecone.proto.DescribeIndexStatsRequest requ /** *
-     * Get list of all namespaces
-     * Get a list of all namespaces within an index.
+     * List namespaces
+     * List all namespaces in a serverless index.
+     *      
+     * Up to 100 namespaces are returned at a time by default, in sorted order (bitwise "C" collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ default void listNamespaces(io.pinecone.proto.ListNamespacesRequest request, @@ -481,7 +547,9 @@ default void listNamespaces(io.pinecone.proto.ListNamespacesRequest request, /** *
      * Describe a namespace
-     * Describe a namespace within an index, showing the vector count within the namespace.
+     * Describe a namespace in a serverless index, including the total number of vectors in the namespace.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ default void describeNamespace(io.pinecone.proto.DescribeNamespaceRequest request, @@ -492,13 +560,36 @@ default void describeNamespace(io.pinecone.proto.DescribeNamespaceRequest reques /** *
      * Delete a namespace
-     * Delete a namespace from an index.
+     * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ default void deleteNamespace(io.pinecone.proto.DeleteNamespaceRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteNamespaceMethod(), responseObserver); } + + /** + *
+     * Create a namespace
+     * Create a namespace in a serverless index.
+     * 
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
+     * 
+ */ + default void createNamespace(io.pinecone.proto.CreateNamespaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateNamespaceMethod(), responseObserver); + } + + /** + */ + default void fetchByMetadata(io.pinecone.proto.FetchByMetadataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchByMetadataMethod(), responseObserver); + } } /** @@ -540,7 +631,7 @@ protected VectorServiceStub build( *
      * Upsert vectors
      * 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).
+     * For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data).
      * 
*/ public void upsert(io.pinecone.proto.UpsertRequest request, @@ -553,7 +644,7 @@ public void upsert(io.pinecone.proto.UpsertRequest request, *
      * 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).
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data).
      * 
*/ public void delete(io.pinecone.proto.DeleteRequest request, @@ -566,7 +657,7 @@ public void delete(io.pinecone.proto.DeleteRequest request, *
      * 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).
+     * For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/manage-data/fetch-data).
      * 
*/ public void fetch(io.pinecone.proto.FetchRequest request, @@ -580,7 +671,7 @@ public void fetch(io.pinecone.proto.FetchRequest request, * 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). + * For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/manage-data/list-record-ids). * **Note:** `list` is supported only for serverless indexes. * */ @@ -594,7 +685,7 @@ public void list(io.pinecone.proto.ListRequest request, *
      * Search with a vector
      * Search a namespace with a query vector or record ID and return the IDs of the most similar records, along with their similarity scores.
-     * For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data).
+     * For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview).
      * 
*/ public void query(io.pinecone.proto.QueryRequest request, @@ -607,7 +698,7 @@ public void query(io.pinecone.proto.QueryRequest request, *
      * Update a vector
      * Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value.
-     * For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data).
+     * For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data).
      * 
*/ public void update(io.pinecone.proto.UpdateRequest request, @@ -631,8 +722,12 @@ public void describeIndexStats(io.pinecone.proto.DescribeIndexStatsRequest reque /** *
-     * Get list of all namespaces
-     * Get a list of all namespaces within an index.
+     * List namespaces
+     * List all namespaces in a serverless index.
+     *      
+     * Up to 100 namespaces are returned at a time by default, in sorted order (bitwise "C" collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ public void listNamespaces(io.pinecone.proto.ListNamespacesRequest request, @@ -644,7 +739,9 @@ public void listNamespaces(io.pinecone.proto.ListNamespacesRequest request, /** *
      * Describe a namespace
-     * Describe a namespace within an index, showing the vector count within the namespace.
+     * Describe a namespace in a serverless index, including the total number of vectors in the namespace.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ public void describeNamespace(io.pinecone.proto.DescribeNamespaceRequest request, @@ -656,7 +753,9 @@ public void describeNamespace(io.pinecone.proto.DescribeNamespaceRequest request /** *
      * Delete a namespace
-     * Delete a namespace from an index.
+     * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ public void deleteNamespace(io.pinecone.proto.DeleteNamespaceRequest request, @@ -664,6 +763,29 @@ public void deleteNamespace(io.pinecone.proto.DeleteNamespaceRequest request, io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getDeleteNamespaceMethod(), getCallOptions()), request, responseObserver); } + + /** + *
+     * Create a namespace
+     * Create a namespace in a serverless index.
+     * 
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
+     * 
+ */ + public void createNamespace(io.pinecone.proto.CreateNamespaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateNamespaceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void fetchByMetadata(io.pinecone.proto.FetchByMetadataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchByMetadataMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -690,7 +812,7 @@ protected VectorServiceBlockingStub build( *
      * Upsert vectors
      * 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).
+     * For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data).
      * 
*/ public io.pinecone.proto.UpsertResponse upsert(io.pinecone.proto.UpsertRequest request) { @@ -702,7 +824,7 @@ public io.pinecone.proto.UpsertResponse upsert(io.pinecone.proto.UpsertRequest r *
      * 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).
+     * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data).
      * 
*/ public io.pinecone.proto.DeleteResponse delete(io.pinecone.proto.DeleteRequest request) { @@ -714,7 +836,7 @@ public io.pinecone.proto.DeleteResponse delete(io.pinecone.proto.DeleteRequest r *
      * 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).
+     * For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/manage-data/fetch-data).
      * 
*/ public io.pinecone.proto.FetchResponse fetch(io.pinecone.proto.FetchRequest request) { @@ -727,7 +849,7 @@ public io.pinecone.proto.FetchResponse fetch(io.pinecone.proto.FetchRequest requ * 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). + * For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/manage-data/list-record-ids). * **Note:** `list` is supported only for serverless indexes. * */ @@ -740,7 +862,7 @@ public io.pinecone.proto.ListResponse list(io.pinecone.proto.ListRequest request *
      * Search with a vector
      * Search a namespace with a query vector or record ID and return the IDs of the most similar records, along with their similarity scores.
-     * For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data).
+     * For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview).
      * 
*/ public io.pinecone.proto.QueryResponse query(io.pinecone.proto.QueryRequest request) { @@ -752,7 +874,7 @@ public io.pinecone.proto.QueryResponse query(io.pinecone.proto.QueryRequest requ *
      * Update a vector
      * Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value.
-     * For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data).
+     * For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data).
      * 
*/ public io.pinecone.proto.UpdateResponse update(io.pinecone.proto.UpdateRequest request) { @@ -774,8 +896,12 @@ public io.pinecone.proto.DescribeIndexStatsResponse describeIndexStats(io.pineco /** *
-     * Get list of all namespaces
-     * Get a list of all namespaces within an index.
+     * List namespaces
+     * List all namespaces in a serverless index.
+     *      
+     * Up to 100 namespaces are returned at a time by default, in sorted order (bitwise "C" collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ public io.pinecone.proto.ListNamespacesResponse listNamespaces(io.pinecone.proto.ListNamespacesRequest request) { @@ -786,7 +912,9 @@ public io.pinecone.proto.ListNamespacesResponse listNamespaces(io.pinecone.proto /** *
      * Describe a namespace
-     * Describe a namespace within an index, showing the vector count within the namespace.
+     * Describe a namespace in a serverless index, including the total number of vectors in the namespace.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ public io.pinecone.proto.NamespaceDescription describeNamespace(io.pinecone.proto.DescribeNamespaceRequest request) { @@ -797,13 +925,36 @@ public io.pinecone.proto.NamespaceDescription describeNamespace(io.pinecone.prot /** *
      * Delete a namespace
-     * Delete a namespace from an index.
+     * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted.
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
      * 
*/ public io.pinecone.proto.DeleteResponse deleteNamespace(io.pinecone.proto.DeleteNamespaceRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteNamespaceMethod(), getCallOptions(), request); } + + /** + *
+     * Create a namespace
+     * Create a namespace in a serverless index.
+     * 
+     * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).
+     * **Note:** This operation is not supported for pod-based indexes.
+     * 
+ */ + public io.pinecone.proto.NamespaceDescription createNamespace(io.pinecone.proto.CreateNamespaceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateNamespaceMethod(), getCallOptions(), request); + } + + /** + */ + public io.pinecone.proto.FetchByMetadataResponse fetchByMetadata(io.pinecone.proto.FetchByMetadataRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchByMetadataMethod(), getCallOptions(), request); + } } /** @@ -830,7 +981,7 @@ protected VectorServiceFutureStub build( *
      * Upsert vectors
      * 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).
+     * For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data).
      * 
*/ public com.google.common.util.concurrent.ListenableFuture upsert( @@ -843,7 +994,7 @@ public com.google.common.util.concurrent.ListenableFuture * 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). + * For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data). * */ public com.google.common.util.concurrent.ListenableFuture delete( @@ -856,7 +1007,7 @@ public com.google.common.util.concurrent.ListenableFuture * 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). + * For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/manage-data/fetch-data). * */ public com.google.common.util.concurrent.ListenableFuture fetch( @@ -870,7 +1021,7 @@ public com.google.common.util.concurrent.ListenableFuture */ @@ -884,7 +1035,7 @@ public com.google.common.util.concurrent.ListenableFuture * Search with a vector * Search a namespace with a query vector or record ID and return the IDs of the most similar records, along with their similarity scores. - * For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). + * For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). * */ public com.google.common.util.concurrent.ListenableFuture query( @@ -897,7 +1048,7 @@ public com.google.common.util.concurrent.ListenableFuture * Update a vector * Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value. - * For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data). + * For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data). * */ public com.google.common.util.concurrent.ListenableFuture update( @@ -921,8 +1072,12 @@ public com.google.common.util.concurrent.ListenableFuture - * Get list of all namespaces - * Get a list of all namespaces within an index. + * List namespaces + * List all namespaces in a serverless index. + * + * Up to 100 namespaces are returned at a time by default, in sorted order (bitwise "C" collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. + * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). + * **Note:** This operation is not supported for pod-based indexes. * */ public com.google.common.util.concurrent.ListenableFuture listNamespaces( @@ -934,7 +1089,9 @@ public com.google.common.util.concurrent.ListenableFuture * Describe a namespace - * Describe a namespace within an index, showing the vector count within the namespace. + * Describe a namespace in a serverless index, including the total number of vectors in the namespace. + * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). + * **Note:** This operation is not supported for pod-based indexes. * */ public com.google.common.util.concurrent.ListenableFuture describeNamespace( @@ -946,7 +1103,9 @@ public com.google.common.util.concurrent.ListenableFuture * Delete a namespace - * Delete a namespace from an index. + * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. + * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). + * **Note:** This operation is not supported for pod-based indexes. * */ public com.google.common.util.concurrent.ListenableFuture deleteNamespace( @@ -954,6 +1113,29 @@ public com.google.common.util.concurrent.ListenableFuture + * Create a namespace + * Create a namespace in a serverless index. + * + * For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). + * **Note:** This operation is not supported for pod-based indexes. + * + */ + public com.google.common.util.concurrent.ListenableFuture createNamespace( + io.pinecone.proto.CreateNamespaceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateNamespaceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture fetchByMetadata( + io.pinecone.proto.FetchByMetadataRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchByMetadataMethod(), getCallOptions()), request); + } } private static final int METHODID_UPSERT = 0; @@ -966,6 +1148,8 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1024,6 +1208,14 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.deleteNamespace((io.pinecone.proto.DeleteNamespaceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_CREATE_NAMESPACE: + serviceImpl.createNamespace((io.pinecone.proto.CreateNamespaceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FETCH_BY_METADATA: + serviceImpl.fetchByMetadata((io.pinecone.proto.FetchByMetadataRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -1112,6 +1304,20 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser io.pinecone.proto.DeleteNamespaceRequest, io.pinecone.proto.DeleteResponse>( service, METHODID_DELETE_NAMESPACE))) + .addMethod( + getCreateNamespaceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.pinecone.proto.CreateNamespaceRequest, + io.pinecone.proto.NamespaceDescription>( + service, METHODID_CREATE_NAMESPACE))) + .addMethod( + getFetchByMetadataMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.pinecone.proto.FetchByMetadataRequest, + io.pinecone.proto.FetchByMetadataResponse>( + service, METHODID_FETCH_BY_METADATA))) .build(); } @@ -1121,7 +1327,7 @@ private static abstract class VectorServiceBaseDescriptorSupplier @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return io.pinecone.proto.DbData202504.getDescriptor(); + return io.pinecone.proto.DbData202510.getDescriptor(); } @java.lang.Override @@ -1170,6 +1376,8 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListNamespacesMethod()) .addMethod(getDescribeNamespaceMethod()) .addMethod(getDeleteNamespaceMethod()) + .addMethod(getCreateNamespaceMethod()) + .addMethod(getFetchByMetadataMethod()) .build(); } } 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 f0157ee7..6ce86102 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-04 + * The version of the OpenAPI document: 2025-10 * 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 5ada77ef..be19fd4d 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-04 + * The version of the OpenAPI document: 2025-10 * 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-04/java"); + setUserAgent("OpenAPI-Generator/2025-10/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 16f807ef..89d23da3 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 9e1f0f9c..3ab7eb48 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-04 + * The version of the OpenAPI document: 2025-10 * 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 34f7bbdd..f4748f10 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class Configuration { - public static final String VERSION = "2025-04"; + public static final String VERSION = "2025-10"; 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 5a2b990c..6265196b 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-04 + * The version of the OpenAPI document: 2025-10 * 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 768b57f2..6fd39d0f 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -58,6 +58,32 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.db_control.client.model.ReadCapacity.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Dedicated", org.openapitools.db_control.client.model.ReadCapacityDedicatedSpec.class); + classByDiscriminatorValue.put("OnDemand", org.openapitools.db_control.client.model.ReadCapacityOnDemandSpec.class); + classByDiscriminatorValue.put("ReadCapacityDedicatedSpec", org.openapitools.db_control.client.model.ReadCapacityDedicatedSpec.class); + classByDiscriminatorValue.put("ReadCapacityOnDemandSpec", org.openapitools.db_control.client.model.ReadCapacityOnDemandSpec.class); + classByDiscriminatorValue.put("ReadCapacity", org.openapitools.db_control.client.model.ReadCapacity.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "mode")); + } + }) + .registerTypeSelector(org.openapitools.db_control.client.model.ReadCapacityResponse.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Dedicated", org.openapitools.db_control.client.model.ReadCapacityDedicatedSpecResponse.class); + classByDiscriminatorValue.put("OnDemand", org.openapitools.db_control.client.model.ReadCapacityOnDemandSpecResponse.class); + classByDiscriminatorValue.put("ReadCapacityDedicatedSpecResponse", org.openapitools.db_control.client.model.ReadCapacityDedicatedSpecResponse.class); + classByDiscriminatorValue.put("ReadCapacityOnDemandSpecResponse", org.openapitools.db_control.client.model.ReadCapacityOnDemandSpecResponse.class); + classByDiscriminatorValue.put("ReadCapacityResponse", org.openapitools.db_control.client.model.ReadCapacityResponse.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "mode")); + } + }) ; GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; @@ -95,13 +121,18 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.BackupModelSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.BackupModelSchemaFieldsValue.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.ConfigureIndexRequestPodBased.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestPodBasedConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestServerless.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestServerlessConfig.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()); @@ -113,16 +144,32 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ErrorResponseError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexModelBYOC.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexModelPodBased.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexModelServerless.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexModelSpec.CustomTypeAdapterFactory()); 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.IndexSpecBYOC.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexSpecPodBased.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexSpecServerless.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.ReadCapacity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ReadCapacityDedicatedConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ReadCapacityDedicatedSpec.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ReadCapacityDedicatedSpecResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ReadCapacityOnDemandSpec.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ReadCapacityOnDemandSpecResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ReadCapacityResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ReadCapacityStatus.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.ScalingConfigManual.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ServerlessSpec.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ServerlessSpecResponse.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 04eaa37e..e0d2dee9 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 f297ddb0..b061529a 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-04 + * The version of the OpenAPI document: 2025-10 * 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 b8b1ff1a..9b5a2dab 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-04 + * The version of the OpenAPI document: 2025-10 * 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 85bd0759..49352913 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 5dbe9aa8..b989c4d1 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -89,6 +89,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for configureIndex + * @param xPineconeApiVersion Required date-based version header (required) * @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 Callback for upload/download progress @@ -107,7 +108,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 500 Internal server error. - */ - public okhttp3.Call configureIndexCall(String indexName, ConfigureIndexRequest configureIndexRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call configureIndexCall(String xPineconeApiVersion, String indexName, ConfigureIndexRequest configureIndexRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -133,6 +134,10 @@ public okhttp3.Call configureIndexCall(String indexName, ConfigureIndexRequest c Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -154,7 +159,12 @@ public okhttp3.Call configureIndexCall(String indexName, ConfigureIndexRequest c } @SuppressWarnings("rawtypes") - private okhttp3.Call configureIndexValidateBeforeCall(String indexName, ConfigureIndexRequest configureIndexRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call configureIndexValidateBeforeCall(String xPineconeApiVersion, String indexName, ConfigureIndexRequest configureIndexRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling configureIndex(Async)"); + } + // verify the required parameter 'indexName' is set if (indexName == null) { throw new ApiException("Missing the required parameter 'indexName' when calling configureIndex(Async)"); @@ -165,13 +175,14 @@ private okhttp3.Call configureIndexValidateBeforeCall(String indexName, Configur throw new ApiException("Missing the required parameter 'configureIndexRequest' when calling configureIndex(Async)"); } - return configureIndexCall(indexName, configureIndexRequest, _callback); + return configureIndexCall(xPineconeApiVersion, indexName, configureIndexRequest, _callback); } /** * Configure an index * 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 xPineconeApiVersion Required date-based version header (required) * @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,14 +200,15 @@ private okhttp3.Call configureIndexValidateBeforeCall(String indexName, Configur 500 Internal server error. - */ - public IndexModel configureIndex(String indexName, ConfigureIndexRequest configureIndexRequest) throws ApiException { - ApiResponse localVarResp = configureIndexWithHttpInfo(indexName, configureIndexRequest); + public IndexModel configureIndex(String xPineconeApiVersion, String indexName, ConfigureIndexRequest configureIndexRequest) throws ApiException { + ApiResponse localVarResp = configureIndexWithHttpInfo(xPineconeApiVersion, indexName, configureIndexRequest); return localVarResp.getData(); } /** * Configure an index * 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 xPineconeApiVersion Required date-based version header (required) * @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> @@ -214,8 +226,8 @@ public IndexModel configureIndex(String indexName, ConfigureIndexRequest configu 500 Internal server error. - */ - public ApiResponse configureIndexWithHttpInfo(String indexName, ConfigureIndexRequest configureIndexRequest) throws ApiException { - okhttp3.Call localVarCall = configureIndexValidateBeforeCall(indexName, configureIndexRequest, null); + public ApiResponse configureIndexWithHttpInfo(String xPineconeApiVersion, String indexName, ConfigureIndexRequest configureIndexRequest) throws ApiException { + okhttp3.Call localVarCall = configureIndexValidateBeforeCall(xPineconeApiVersion, indexName, configureIndexRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -223,6 +235,7 @@ public ApiResponse configureIndexWithHttpInfo(String indexName, Conf /** * Configure an index (asynchronously) * 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 xPineconeApiVersion Required date-based version header (required) * @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,15 +254,16 @@ public ApiResponse configureIndexWithHttpInfo(String indexName, Conf 500 Internal server error. - */ - public okhttp3.Call configureIndexAsync(String indexName, ConfigureIndexRequest configureIndexRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call configureIndexAsync(String xPineconeApiVersion, String indexName, ConfigureIndexRequest configureIndexRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = configureIndexValidateBeforeCall(indexName, configureIndexRequest, _callback); + okhttp3.Call localVarCall = configureIndexValidateBeforeCall(xPineconeApiVersion, indexName, configureIndexRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createBackup + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -267,7 +281,7 @@ public okhttp3.Call configureIndexAsync(String indexName, ConfigureIndexRequest 500 Internal server error. - */ - public okhttp3.Call createBackupCall(String indexName, CreateBackupRequest createBackupRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createBackupCall(String xPineconeApiVersion, String indexName, CreateBackupRequest createBackupRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -293,6 +307,10 @@ public okhttp3.Call createBackupCall(String indexName, CreateBackupRequest creat Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -314,7 +332,12 @@ public okhttp3.Call createBackupCall(String indexName, CreateBackupRequest creat } @SuppressWarnings("rawtypes") - private okhttp3.Call createBackupValidateBeforeCall(String indexName, CreateBackupRequest createBackupRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createBackupValidateBeforeCall(String xPineconeApiVersion, String indexName, CreateBackupRequest createBackupRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling createBackup(Async)"); + } + // verify the required parameter 'indexName' is set if (indexName == null) { throw new ApiException("Missing the required parameter 'indexName' when calling createBackup(Async)"); @@ -325,13 +348,14 @@ private okhttp3.Call createBackupValidateBeforeCall(String indexName, CreateBack throw new ApiException("Missing the required parameter 'createBackupRequest' when calling createBackup(Async)"); } - return createBackupCall(indexName, createBackupRequest, _callback); + return createBackupCall(xPineconeApiVersion, indexName, createBackupRequest, _callback); } /** * Create a backup of an index * Create a backup of an index. + * @param xPineconeApiVersion Required date-based version header (required) * @param indexName Name of the index to backup (required) * @param createBackupRequest The desired configuration for the backup. (required) * @return BackupModel @@ -348,14 +372,15 @@ private okhttp3.Call createBackupValidateBeforeCall(String indexName, CreateBack 500 Internal server error. - */ - public BackupModel createBackup(String indexName, CreateBackupRequest createBackupRequest) throws ApiException { - ApiResponse localVarResp = createBackupWithHttpInfo(indexName, createBackupRequest); + public BackupModel createBackup(String xPineconeApiVersion, String indexName, CreateBackupRequest createBackupRequest) throws ApiException { + ApiResponse localVarResp = createBackupWithHttpInfo(xPineconeApiVersion, indexName, createBackupRequest); return localVarResp.getData(); } /** * Create a backup of an index * Create a backup of an index. + * @param xPineconeApiVersion Required date-based version header (required) * @param indexName Name of the index to backup (required) * @param createBackupRequest The desired configuration for the backup. (required) * @return ApiResponse<BackupModel> @@ -372,8 +397,8 @@ public BackupModel createBackup(String indexName, CreateBackupRequest createBack 500 Internal server error. - */ - public ApiResponse createBackupWithHttpInfo(String indexName, CreateBackupRequest createBackupRequest) throws ApiException { - okhttp3.Call localVarCall = createBackupValidateBeforeCall(indexName, createBackupRequest, null); + public ApiResponse createBackupWithHttpInfo(String xPineconeApiVersion, String indexName, CreateBackupRequest createBackupRequest) throws ApiException { + okhttp3.Call localVarCall = createBackupValidateBeforeCall(xPineconeApiVersion, indexName, createBackupRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -381,6 +406,7 @@ public ApiResponse createBackupWithHttpInfo(String indexName, Creat /** * Create a backup of an index (asynchronously) * Create a backup of an index. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -398,15 +424,16 @@ public ApiResponse createBackupWithHttpInfo(String indexName, Creat 500 Internal server error. - */ - public okhttp3.Call createBackupAsync(String indexName, CreateBackupRequest createBackupRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createBackupAsync(String xPineconeApiVersion, String indexName, CreateBackupRequest createBackupRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createBackupValidateBeforeCall(indexName, createBackupRequest, _callback); + okhttp3.Call localVarCall = createBackupValidateBeforeCall(xPineconeApiVersion, indexName, createBackupRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createCollection + * @param xPineconeApiVersion Required date-based version header (required) * @param createCollectionRequest The desired configuration for the collection. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -424,7 +451,7 @@ public okhttp3.Call createBackupAsync(String indexName, CreateBackupRequest crea 500 Internal server error. - */ - public okhttp3.Call createCollectionCall(CreateCollectionRequest createCollectionRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createCollectionCall(String xPineconeApiVersion, CreateCollectionRequest createCollectionRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -449,6 +476,10 @@ public okhttp3.Call createCollectionCall(CreateCollectionRequest createCollectio Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -470,19 +501,25 @@ public okhttp3.Call createCollectionCall(CreateCollectionRequest createCollectio } @SuppressWarnings("rawtypes") - private okhttp3.Call createCollectionValidateBeforeCall(CreateCollectionRequest createCollectionRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createCollectionValidateBeforeCall(String xPineconeApiVersion, CreateCollectionRequest createCollectionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling createCollection(Async)"); + } + // verify the required parameter 'createCollectionRequest' is set if (createCollectionRequest == null) { throw new ApiException("Missing the required parameter 'createCollectionRequest' when calling createCollection(Async)"); } - return createCollectionCall(createCollectionRequest, _callback); + return createCollectionCall(xPineconeApiVersion, createCollectionRequest, _callback); } /** * Create a collection * Create a Pinecone collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -499,14 +536,15 @@ private okhttp3.Call createCollectionValidateBeforeCall(CreateCollectionRequest 500 Internal server error. - */ - public CollectionModel createCollection(CreateCollectionRequest createCollectionRequest) throws ApiException { - ApiResponse localVarResp = createCollectionWithHttpInfo(createCollectionRequest); + public CollectionModel createCollection(String xPineconeApiVersion, CreateCollectionRequest createCollectionRequest) throws ApiException { + ApiResponse localVarResp = createCollectionWithHttpInfo(xPineconeApiVersion, createCollectionRequest); return localVarResp.getData(); } /** * Create a collection * Create a Pinecone collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -523,8 +561,8 @@ public CollectionModel createCollection(CreateCollectionRequest createCollection 500 Internal server error. - */ - public ApiResponse createCollectionWithHttpInfo(CreateCollectionRequest createCollectionRequest) throws ApiException { - okhttp3.Call localVarCall = createCollectionValidateBeforeCall(createCollectionRequest, null); + public ApiResponse createCollectionWithHttpInfo(String xPineconeApiVersion, CreateCollectionRequest createCollectionRequest) throws ApiException { + okhttp3.Call localVarCall = createCollectionValidateBeforeCall(xPineconeApiVersion, createCollectionRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -532,6 +570,7 @@ public ApiResponse createCollectionWithHttpInfo(CreateCollectio /** * Create a collection (asynchronously) * Create a Pinecone collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -549,15 +588,16 @@ public ApiResponse createCollectionWithHttpInfo(CreateCollectio 500 Internal server error. - */ - public okhttp3.Call createCollectionAsync(CreateCollectionRequest createCollectionRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createCollectionAsync(String xPineconeApiVersion, CreateCollectionRequest createCollectionRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createCollectionValidateBeforeCall(createCollectionRequest, _callback); + okhttp3.Call localVarCall = createCollectionValidateBeforeCall(xPineconeApiVersion, createCollectionRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createIndex + * @param xPineconeApiVersion Required date-based version header (required) * @param createIndexRequest The desired configuration for the index. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -576,7 +616,7 @@ public okhttp3.Call createCollectionAsync(CreateCollectionRequest createCollecti 500 Internal server error. - */ - public okhttp3.Call createIndexCall(CreateIndexRequest createIndexRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createIndexCall(String xPineconeApiVersion, CreateIndexRequest createIndexRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -601,6 +641,10 @@ public okhttp3.Call createIndexCall(CreateIndexRequest createIndexRequest, final Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -622,19 +666,25 @@ public okhttp3.Call createIndexCall(CreateIndexRequest createIndexRequest, final } @SuppressWarnings("rawtypes") - private okhttp3.Call createIndexValidateBeforeCall(CreateIndexRequest createIndexRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createIndexValidateBeforeCall(String xPineconeApiVersion, CreateIndexRequest createIndexRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling createIndex(Async)"); + } + // verify the required parameter 'createIndexRequest' is set if (createIndexRequest == null) { throw new ApiException("Missing the required parameter 'createIndexRequest' when calling createIndex(Async)"); } - return createIndexCall(createIndexRequest, _callback); + return createIndexCall(xPineconeApiVersion, createIndexRequest, _callback); } /** * Create an 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/index-data/create-an-index). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -652,14 +702,15 @@ private okhttp3.Call createIndexValidateBeforeCall(CreateIndexRequest createInde 500 Internal server error. - */ - public IndexModel createIndex(CreateIndexRequest createIndexRequest) throws ApiException { - ApiResponse localVarResp = createIndexWithHttpInfo(createIndexRequest); + public IndexModel createIndex(String xPineconeApiVersion, CreateIndexRequest createIndexRequest) throws ApiException { + ApiResponse localVarResp = createIndexWithHttpInfo(xPineconeApiVersion, createIndexRequest); return localVarResp.getData(); } /** * Create an 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/index-data/create-an-index). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -677,8 +728,8 @@ public IndexModel createIndex(CreateIndexRequest createIndexRequest) throws ApiE 500 Internal server error. - */ - public ApiResponse createIndexWithHttpInfo(CreateIndexRequest createIndexRequest) throws ApiException { - okhttp3.Call localVarCall = createIndexValidateBeforeCall(createIndexRequest, null); + public ApiResponse createIndexWithHttpInfo(String xPineconeApiVersion, CreateIndexRequest createIndexRequest) throws ApiException { + okhttp3.Call localVarCall = createIndexValidateBeforeCall(xPineconeApiVersion, createIndexRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -686,6 +737,7 @@ public ApiResponse createIndexWithHttpInfo(CreateIndexRequest create /** * Create an index (asynchronously) * 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/index-data/create-an-index). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -704,15 +756,16 @@ public ApiResponse createIndexWithHttpInfo(CreateIndexRequest create 500 Internal server error. - */ - public okhttp3.Call createIndexAsync(CreateIndexRequest createIndexRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createIndexAsync(String xPineconeApiVersion, CreateIndexRequest createIndexRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createIndexValidateBeforeCall(createIndexRequest, _callback); + okhttp3.Call localVarCall = createIndexValidateBeforeCall(xPineconeApiVersion, createIndexRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createIndexForModel + * @param xPineconeApiVersion Required date-based version header (required) * @param createIndexForModelRequest The desired configuration for the index and associated embedding model. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -729,7 +782,7 @@ public okhttp3.Call createIndexAsync(CreateIndexRequest createIndexRequest, fina 500 Internal server error. - */ - public okhttp3.Call createIndexForModelCall(CreateIndexForModelRequest createIndexForModelRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createIndexForModelCall(String xPineconeApiVersion, CreateIndexForModelRequest createIndexForModelRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -754,6 +807,10 @@ public okhttp3.Call createIndexForModelCall(CreateIndexForModelRequest createInd Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -775,19 +832,25 @@ public okhttp3.Call createIndexForModelCall(CreateIndexForModelRequest createInd } @SuppressWarnings("rawtypes") - private okhttp3.Call createIndexForModelValidateBeforeCall(CreateIndexForModelRequest createIndexForModelRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createIndexForModelValidateBeforeCall(String xPineconeApiVersion, CreateIndexForModelRequest createIndexForModelRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling createIndexForModel(Async)"); + } + // verify the required parameter 'createIndexForModelRequest' is set if (createIndexForModelRequest == null) { throw new ApiException("Missing the required parameter 'createIndexForModelRequest' when calling createIndexForModel(Async)"); } - return createIndexForModelCall(createIndexForModelRequest, _callback); + return createIndexForModelCall(xPineconeApiVersion, createIndexForModelRequest, _callback); } /** * 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/index-data/create-an-index#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/index-data/create-an-index#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/index-data/create-an-index#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-10/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-10/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/create-an-index#integrated-embedding). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -803,14 +866,15 @@ private okhttp3.Call createIndexForModelValidateBeforeCall(CreateIndexForModelRe 500 Internal server error. - */ - public IndexModel createIndexForModel(CreateIndexForModelRequest createIndexForModelRequest) throws ApiException { - ApiResponse localVarResp = createIndexForModelWithHttpInfo(createIndexForModelRequest); + public IndexModel createIndexForModel(String xPineconeApiVersion, CreateIndexForModelRequest createIndexForModelRequest) throws ApiException { + ApiResponse localVarResp = createIndexForModelWithHttpInfo(xPineconeApiVersion, createIndexForModelRequest); return localVarResp.getData(); } /** * 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/index-data/create-an-index#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/index-data/create-an-index#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/index-data/create-an-index#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-10/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-10/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/create-an-index#integrated-embedding). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -826,15 +890,16 @@ public IndexModel createIndexForModel(CreateIndexForModelRequest createIndexForM 500 Internal server error. - */ - public ApiResponse createIndexForModelWithHttpInfo(CreateIndexForModelRequest createIndexForModelRequest) throws ApiException { - okhttp3.Call localVarCall = createIndexForModelValidateBeforeCall(createIndexForModelRequest, null); + public ApiResponse createIndexForModelWithHttpInfo(String xPineconeApiVersion, CreateIndexForModelRequest createIndexForModelRequest) throws ApiException { + okhttp3.Call localVarCall = createIndexForModelValidateBeforeCall(xPineconeApiVersion, createIndexForModelRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * 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/index-data/create-an-index#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/index-data/create-an-index#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/index-data/create-an-index#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-10/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-10/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/create-an-index#integrated-embedding). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -851,15 +916,16 @@ public ApiResponse createIndexForModelWithHttpInfo(CreateIndexForMod 500 Internal server error. - */ - public okhttp3.Call createIndexForModelAsync(CreateIndexForModelRequest createIndexForModelRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createIndexForModelAsync(String xPineconeApiVersion, CreateIndexForModelRequest createIndexForModelRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createIndexForModelValidateBeforeCall(createIndexForModelRequest, _callback); + okhttp3.Call localVarCall = createIndexForModelValidateBeforeCall(xPineconeApiVersion, createIndexForModelRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createIndexFromBackupOperation + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -879,7 +945,7 @@ public okhttp3.Call createIndexForModelAsync(CreateIndexForModelRequest createIn 500 Internal server error. - */ - public okhttp3.Call createIndexFromBackupOperationCall(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createIndexFromBackupOperationCall(String xPineconeApiVersion, String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -905,6 +971,10 @@ public okhttp3.Call createIndexFromBackupOperationCall(String backupId, CreateIn Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -926,7 +996,12 @@ public okhttp3.Call createIndexFromBackupOperationCall(String backupId, CreateIn } @SuppressWarnings("rawtypes") - private okhttp3.Call createIndexFromBackupOperationValidateBeforeCall(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createIndexFromBackupOperationValidateBeforeCall(String xPineconeApiVersion, String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling createIndexFromBackupOperation(Async)"); + } + // verify the required parameter 'backupId' is set if (backupId == null) { throw new ApiException("Missing the required parameter 'backupId' when calling createIndexFromBackupOperation(Async)"); @@ -937,13 +1012,14 @@ private okhttp3.Call createIndexFromBackupOperationValidateBeforeCall(String bac throw new ApiException("Missing the required parameter 'createIndexFromBackupRequest' when calling createIndexFromBackupOperation(Async)"); } - return createIndexFromBackupOperationCall(backupId, createIndexFromBackupRequest, _callback); + return createIndexFromBackupOperationCall(xPineconeApiVersion, backupId, createIndexFromBackupRequest, _callback); } /** * Create an index from a backup * Create an index from a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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 CreateIndexFromBackupResponse @@ -962,14 +1038,15 @@ private okhttp3.Call createIndexFromBackupOperationValidateBeforeCall(String bac 500 Internal server error. - */ - public CreateIndexFromBackupResponse createIndexFromBackupOperation(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest) throws ApiException { - ApiResponse localVarResp = createIndexFromBackupOperationWithHttpInfo(backupId, createIndexFromBackupRequest); + public CreateIndexFromBackupResponse createIndexFromBackupOperation(String xPineconeApiVersion, String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest) throws ApiException { + ApiResponse localVarResp = createIndexFromBackupOperationWithHttpInfo(xPineconeApiVersion, backupId, createIndexFromBackupRequest); return localVarResp.getData(); } /** * Create an index from a backup * Create an index from a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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<CreateIndexFromBackupResponse> @@ -988,8 +1065,8 @@ public CreateIndexFromBackupResponse createIndexFromBackupOperation(String backu 500 Internal server error. - */ - public ApiResponse createIndexFromBackupOperationWithHttpInfo(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest) throws ApiException { - okhttp3.Call localVarCall = createIndexFromBackupOperationValidateBeforeCall(backupId, createIndexFromBackupRequest, null); + public ApiResponse createIndexFromBackupOperationWithHttpInfo(String xPineconeApiVersion, String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest) throws ApiException { + okhttp3.Call localVarCall = createIndexFromBackupOperationValidateBeforeCall(xPineconeApiVersion, backupId, createIndexFromBackupRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -997,6 +1074,7 @@ public ApiResponse createIndexFromBackupOperation /** * Create an index from a backup (asynchronously) * Create an index from a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1016,15 +1094,16 @@ public ApiResponse createIndexFromBackupOperation 500 Internal server error. - */ - public okhttp3.Call createIndexFromBackupOperationAsync(String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createIndexFromBackupOperationAsync(String xPineconeApiVersion, String backupId, CreateIndexFromBackupRequest createIndexFromBackupRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createIndexFromBackupOperationValidateBeforeCall(backupId, createIndexFromBackupRequest, _callback); + okhttp3.Call localVarCall = createIndexFromBackupOperationValidateBeforeCall(xPineconeApiVersion, backupId, createIndexFromBackupRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteBackup + * @param xPineconeApiVersion Required date-based version header (required) * @param backupId The ID of the backup to delete. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1039,7 +1118,7 @@ public okhttp3.Call createIndexFromBackupOperationAsync(String backupId, CreateI 500 Internal server error. - */ - public okhttp3.Call deleteBackupCall(String backupId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteBackupCall(String xPineconeApiVersion, String backupId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1065,6 +1144,10 @@ public okhttp3.Call deleteBackupCall(String backupId, final ApiCallback _callbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1085,19 +1168,25 @@ public okhttp3.Call deleteBackupCall(String backupId, final ApiCallback _callbac } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteBackupValidateBeforeCall(String backupId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteBackupValidateBeforeCall(String xPineconeApiVersion, String backupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling deleteBackup(Async)"); + } + // verify the required parameter 'backupId' is set if (backupId == null) { throw new ApiException("Missing the required parameter 'backupId' when calling deleteBackup(Async)"); } - return deleteBackupCall(backupId, _callback); + return deleteBackupCall(xPineconeApiVersion, backupId, _callback); } /** * Delete a backup * Delete a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1110,13 +1199,14 @@ private okhttp3.Call deleteBackupValidateBeforeCall(String backupId, final ApiCa 500 Internal server error. - */ - public void deleteBackup(String backupId) throws ApiException { - deleteBackupWithHttpInfo(backupId); + public void deleteBackup(String xPineconeApiVersion, String backupId) throws ApiException { + deleteBackupWithHttpInfo(xPineconeApiVersion, backupId); } /** * Delete a backup * Delete a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1130,14 +1220,15 @@ public void deleteBackup(String backupId) throws ApiException { 500 Internal server error. - */ - public ApiResponse deleteBackupWithHttpInfo(String backupId) throws ApiException { - okhttp3.Call localVarCall = deleteBackupValidateBeforeCall(backupId, null); + public ApiResponse deleteBackupWithHttpInfo(String xPineconeApiVersion, String backupId) throws ApiException { + okhttp3.Call localVarCall = deleteBackupValidateBeforeCall(xPineconeApiVersion, backupId, null); return localVarApiClient.execute(localVarCall); } /** * Delete a backup (asynchronously) * Delete a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1152,14 +1243,15 @@ public ApiResponse deleteBackupWithHttpInfo(String backupId) throws ApiExc 500 Internal server error. - */ - public okhttp3.Call deleteBackupAsync(String backupId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteBackupAsync(String xPineconeApiVersion, String backupId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteBackupValidateBeforeCall(backupId, _callback); + okhttp3.Call localVarCall = deleteBackupValidateBeforeCall(xPineconeApiVersion, backupId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for deleteCollection + * @param xPineconeApiVersion Required date-based version header (required) * @param collectionName The name of the collection. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1173,7 +1265,7 @@ public okhttp3.Call deleteBackupAsync(String backupId, final ApiCallback _ 500 Internal server error. - */ - public okhttp3.Call deleteCollectionCall(String collectionName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteCollectionCall(String xPineconeApiVersion, String collectionName, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1199,6 +1291,10 @@ public okhttp3.Call deleteCollectionCall(String collectionName, final ApiCallbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1219,19 +1315,25 @@ public okhttp3.Call deleteCollectionCall(String collectionName, final ApiCallbac } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteCollectionValidateBeforeCall(String collectionName, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteCollectionValidateBeforeCall(String xPineconeApiVersion, String collectionName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling deleteCollection(Async)"); + } + // verify the required parameter 'collectionName' is set if (collectionName == null) { throw new ApiException("Missing the required parameter 'collectionName' when calling deleteCollection(Async)"); } - return deleteCollectionCall(collectionName, _callback); + return deleteCollectionCall(xPineconeApiVersion, collectionName, _callback); } /** * Delete a collection * Delete an existing collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1243,13 +1345,14 @@ private okhttp3.Call deleteCollectionValidateBeforeCall(String collectionName, f 500 Internal server error. - */ - public void deleteCollection(String collectionName) throws ApiException { - deleteCollectionWithHttpInfo(collectionName); + public void deleteCollection(String xPineconeApiVersion, String collectionName) throws ApiException { + deleteCollectionWithHttpInfo(xPineconeApiVersion, collectionName); } /** * Delete a collection * Delete an existing collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1262,14 +1365,15 @@ public void deleteCollection(String collectionName) throws ApiException { 500 Internal server error. - */ - public ApiResponse deleteCollectionWithHttpInfo(String collectionName) throws ApiException { - okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionName, null); + public ApiResponse deleteCollectionWithHttpInfo(String xPineconeApiVersion, String collectionName) throws ApiException { + okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(xPineconeApiVersion, collectionName, null); return localVarApiClient.execute(localVarCall); } /** * Delete a collection (asynchronously) * Delete an existing collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @param collectionName The name of the collection. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -1283,14 +1387,15 @@ public ApiResponse deleteCollectionWithHttpInfo(String collectionName) thr 500 Internal server error. - */ - public okhttp3.Call deleteCollectionAsync(String collectionName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteCollectionAsync(String xPineconeApiVersion, String collectionName, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collectionName, _callback); + okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(xPineconeApiVersion, collectionName, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for deleteIndex + * @param xPineconeApiVersion Required date-based version header (required) * @param indexName The name of the index to delete. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1306,7 +1411,7 @@ public okhttp3.Call deleteCollectionAsync(String collectionName, final ApiCallba 500 Internal server error. - */ - public okhttp3.Call deleteIndexCall(String indexName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteIndexCall(String xPineconeApiVersion, String indexName, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1332,6 +1437,10 @@ public okhttp3.Call deleteIndexCall(String indexName, final ApiCallback _callbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1352,19 +1461,25 @@ public okhttp3.Call deleteIndexCall(String indexName, final ApiCallback _callbac } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteIndexValidateBeforeCall(String indexName, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteIndexValidateBeforeCall(String xPineconeApiVersion, String indexName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling deleteIndex(Async)"); + } + // 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); + return deleteIndexCall(xPineconeApiVersion, indexName, _callback); } /** * Delete an index * Delete an existing index. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1378,13 +1493,14 @@ private okhttp3.Call deleteIndexValidateBeforeCall(String indexName, final ApiCa 500 Internal server error. - */ - public void deleteIndex(String indexName) throws ApiException { - deleteIndexWithHttpInfo(indexName); + public void deleteIndex(String xPineconeApiVersion, String indexName) throws ApiException { + deleteIndexWithHttpInfo(xPineconeApiVersion, indexName); } /** * Delete an index * Delete an existing index. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1399,14 +1515,15 @@ public void deleteIndex(String indexName) throws ApiException { 500 Internal server error. - */ - public ApiResponse deleteIndexWithHttpInfo(String indexName) throws ApiException { - okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(indexName, null); + public ApiResponse deleteIndexWithHttpInfo(String xPineconeApiVersion, String indexName) throws ApiException { + okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(xPineconeApiVersion, indexName, null); return localVarApiClient.execute(localVarCall); } /** * Delete an index (asynchronously) * Delete an existing index. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1422,14 +1539,15 @@ public ApiResponse deleteIndexWithHttpInfo(String indexName) throws ApiExc 500 Internal server error. - */ - public okhttp3.Call deleteIndexAsync(String indexName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteIndexAsync(String xPineconeApiVersion, String indexName, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(indexName, _callback); + okhttp3.Call localVarCall = deleteIndexValidateBeforeCall(xPineconeApiVersion, indexName, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for describeBackup + * @param xPineconeApiVersion Required date-based version header (required) * @param backupId The ID of the backup to describe. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1443,7 +1561,7 @@ public okhttp3.Call deleteIndexAsync(String indexName, final ApiCallback _ 500 Internal server error. - */ - public okhttp3.Call describeBackupCall(String backupId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeBackupCall(String xPineconeApiVersion, String backupId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1469,6 +1587,10 @@ public okhttp3.Call describeBackupCall(String backupId, final ApiCallback _callb Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1489,19 +1611,25 @@ public okhttp3.Call describeBackupCall(String backupId, final ApiCallback _callb } @SuppressWarnings("rawtypes") - private okhttp3.Call describeBackupValidateBeforeCall(String backupId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call describeBackupValidateBeforeCall(String xPineconeApiVersion, String backupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling describeBackup(Async)"); + } + // 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); + return describeBackupCall(xPineconeApiVersion, backupId, _callback); } /** * Describe a backup * Get a description of a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1514,14 +1642,15 @@ private okhttp3.Call describeBackupValidateBeforeCall(String backupId, final Api 500 Internal server error. - */ - public BackupModel describeBackup(String backupId) throws ApiException { - ApiResponse localVarResp = describeBackupWithHttpInfo(backupId); + public BackupModel describeBackup(String xPineconeApiVersion, String backupId) throws ApiException { + ApiResponse localVarResp = describeBackupWithHttpInfo(xPineconeApiVersion, backupId); return localVarResp.getData(); } /** * Describe a backup * Get a description of a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1534,8 +1663,8 @@ public BackupModel describeBackup(String backupId) throws ApiException { 500 Internal server error. - */ - public ApiResponse describeBackupWithHttpInfo(String backupId) throws ApiException { - okhttp3.Call localVarCall = describeBackupValidateBeforeCall(backupId, null); + public ApiResponse describeBackupWithHttpInfo(String xPineconeApiVersion, String backupId) throws ApiException { + okhttp3.Call localVarCall = describeBackupValidateBeforeCall(xPineconeApiVersion, backupId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1543,6 +1672,7 @@ public ApiResponse describeBackupWithHttpInfo(String backupId) thro /** * Describe a backup (asynchronously) * Get a description of a backup. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1556,15 +1686,16 @@ public ApiResponse describeBackupWithHttpInfo(String backupId) thro 500 Internal server error. - */ - public okhttp3.Call describeBackupAsync(String backupId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeBackupAsync(String xPineconeApiVersion, String backupId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = describeBackupValidateBeforeCall(backupId, _callback); + okhttp3.Call localVarCall = describeBackupValidateBeforeCall(xPineconeApiVersion, backupId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for describeCollection + * @param xPineconeApiVersion Required date-based version header (required) * @param collectionName The name of the collection to be described. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1578,7 +1709,7 @@ public okhttp3.Call describeBackupAsync(String backupId, final ApiCallback 500 Internal server error. - */ - public okhttp3.Call describeCollectionCall(String collectionName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeCollectionCall(String xPineconeApiVersion, String collectionName, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1604,6 +1735,10 @@ public okhttp3.Call describeCollectionCall(String collectionName, final ApiCallb Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1624,19 +1759,25 @@ public okhttp3.Call describeCollectionCall(String collectionName, final ApiCallb } @SuppressWarnings("rawtypes") - private okhttp3.Call describeCollectionValidateBeforeCall(String collectionName, final ApiCallback _callback) throws ApiException { + private okhttp3.Call describeCollectionValidateBeforeCall(String xPineconeApiVersion, String collectionName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling describeCollection(Async)"); + } + // 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); + return describeCollectionCall(xPineconeApiVersion, collectionName, _callback); } /** * Describe a collection * Get a description of a collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1649,14 +1790,15 @@ private okhttp3.Call describeCollectionValidateBeforeCall(String collectionName, 500 Internal server error. - */ - public CollectionModel describeCollection(String collectionName) throws ApiException { - ApiResponse localVarResp = describeCollectionWithHttpInfo(collectionName); + public CollectionModel describeCollection(String xPineconeApiVersion, String collectionName) throws ApiException { + ApiResponse localVarResp = describeCollectionWithHttpInfo(xPineconeApiVersion, collectionName); return localVarResp.getData(); } /** * Describe a collection * Get a description of a collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1669,8 +1811,8 @@ public CollectionModel describeCollection(String collectionName) throws ApiExcep 500 Internal server error. - */ - public ApiResponse describeCollectionWithHttpInfo(String collectionName) throws ApiException { - okhttp3.Call localVarCall = describeCollectionValidateBeforeCall(collectionName, null); + public ApiResponse describeCollectionWithHttpInfo(String xPineconeApiVersion, String collectionName) throws ApiException { + okhttp3.Call localVarCall = describeCollectionValidateBeforeCall(xPineconeApiVersion, collectionName, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1678,6 +1820,7 @@ public ApiResponse describeCollectionWithHttpInfo(String collec /** * Describe a collection (asynchronously) * Get a description of a collection. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1691,15 +1834,16 @@ public ApiResponse describeCollectionWithHttpInfo(String collec 500 Internal server error. - */ - public okhttp3.Call describeCollectionAsync(String collectionName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeCollectionAsync(String xPineconeApiVersion, String collectionName, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = describeCollectionValidateBeforeCall(collectionName, _callback); + okhttp3.Call localVarCall = describeCollectionValidateBeforeCall(xPineconeApiVersion, collectionName, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for describeIndex + * @param xPineconeApiVersion Required date-based version header (required) * @param indexName The name of the index to be described. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1713,7 +1857,7 @@ public okhttp3.Call describeCollectionAsync(String collectionName, final ApiCall 500 Internal server error. - */ - public okhttp3.Call describeIndexCall(String indexName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeIndexCall(String xPineconeApiVersion, String indexName, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1739,6 +1883,10 @@ public okhttp3.Call describeIndexCall(String indexName, final ApiCallback _callb Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1759,19 +1907,25 @@ 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 describeIndexValidateBeforeCall(String xPineconeApiVersion, String indexName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling describeIndex(Async)"); + } + // 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); + return describeIndexCall(xPineconeApiVersion, indexName, _callback); } /** * Describe an index * Get a description of an index. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1784,14 +1938,15 @@ private okhttp3.Call describeIndexValidateBeforeCall(String indexName, final Api 500 Internal server error. - */ - public IndexModel describeIndex(String indexName) throws ApiException { - ApiResponse localVarResp = describeIndexWithHttpInfo(indexName); + public IndexModel describeIndex(String xPineconeApiVersion, String indexName) throws ApiException { + ApiResponse localVarResp = describeIndexWithHttpInfo(xPineconeApiVersion, indexName); return localVarResp.getData(); } /** * Describe an index * Get a description of an index. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1804,8 +1959,8 @@ public IndexModel describeIndex(String indexName) throws ApiException { 500 Internal server error. - */ - public ApiResponse describeIndexWithHttpInfo(String indexName) throws ApiException { - okhttp3.Call localVarCall = describeIndexValidateBeforeCall(indexName, null); + public ApiResponse describeIndexWithHttpInfo(String xPineconeApiVersion, String indexName) throws ApiException { + okhttp3.Call localVarCall = describeIndexValidateBeforeCall(xPineconeApiVersion, indexName, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1813,6 +1968,7 @@ public ApiResponse describeIndexWithHttpInfo(String indexName) throw /** * Describe an index (asynchronously) * Get a description of an index. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1826,15 +1982,16 @@ public ApiResponse describeIndexWithHttpInfo(String indexName) throw 500 Internal server error. - */ - public okhttp3.Call describeIndexAsync(String indexName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeIndexAsync(String xPineconeApiVersion, String indexName, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = describeIndexValidateBeforeCall(indexName, _callback); + okhttp3.Call localVarCall = describeIndexValidateBeforeCall(xPineconeApiVersion, indexName, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for describeRestoreJob + * @param xPineconeApiVersion Required date-based version header (required) * @param jobId The ID of the restore job to describe. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1848,7 +2005,7 @@ public okhttp3.Call describeIndexAsync(String indexName, final ApiCallback 500 Internal server error. - */ - public okhttp3.Call describeRestoreJobCall(String jobId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeRestoreJobCall(String xPineconeApiVersion, String jobId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1874,6 +2031,10 @@ public okhttp3.Call describeRestoreJobCall(String jobId, final ApiCallback _call Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1894,19 +2055,25 @@ public okhttp3.Call describeRestoreJobCall(String jobId, final ApiCallback _call } @SuppressWarnings("rawtypes") - private okhttp3.Call describeRestoreJobValidateBeforeCall(String jobId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call describeRestoreJobValidateBeforeCall(String xPineconeApiVersion, String jobId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling describeRestoreJob(Async)"); + } + // 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); + return describeRestoreJobCall(xPineconeApiVersion, jobId, _callback); } /** * Describe a restore job * Get a description of a restore job. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1919,14 +2086,15 @@ private okhttp3.Call describeRestoreJobValidateBeforeCall(String jobId, final Ap 500 Internal server error. - */ - public RestoreJobModel describeRestoreJob(String jobId) throws ApiException { - ApiResponse localVarResp = describeRestoreJobWithHttpInfo(jobId); + public RestoreJobModel describeRestoreJob(String xPineconeApiVersion, String jobId) throws ApiException { + ApiResponse localVarResp = describeRestoreJobWithHttpInfo(xPineconeApiVersion, jobId); return localVarResp.getData(); } /** * Describe a restore job * Get a description of a restore job. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1939,8 +2107,8 @@ public RestoreJobModel describeRestoreJob(String jobId) throws ApiException { 500 Internal server error. - */ - public ApiResponse describeRestoreJobWithHttpInfo(String jobId) throws ApiException { - okhttp3.Call localVarCall = describeRestoreJobValidateBeforeCall(jobId, null); + public ApiResponse describeRestoreJobWithHttpInfo(String xPineconeApiVersion, String jobId) throws ApiException { + okhttp3.Call localVarCall = describeRestoreJobValidateBeforeCall(xPineconeApiVersion, jobId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1948,6 +2116,7 @@ public ApiResponse describeRestoreJobWithHttpInfo(String jobId) /** * Describe a restore job (asynchronously) * Get a description of a restore job. + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1961,15 +2130,16 @@ public ApiResponse describeRestoreJobWithHttpInfo(String jobId) 500 Internal server error. - */ - public okhttp3.Call describeRestoreJobAsync(String jobId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeRestoreJobAsync(String xPineconeApiVersion, String jobId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = describeRestoreJobValidateBeforeCall(jobId, _callback); + okhttp3.Call localVarCall = describeRestoreJobValidateBeforeCall(xPineconeApiVersion, jobId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listCollections + * @param xPineconeApiVersion Required date-based version header (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1981,7 +2151,7 @@ public okhttp3.Call describeRestoreJobAsync(String jobId, final ApiCallback 500 Internal server error. - */ - public okhttp3.Call listCollectionsCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listCollectionsCall(String xPineconeApiVersion, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2006,6 +2176,10 @@ public okhttp3.Call listCollectionsCall(final ApiCallback _callback) throws ApiE Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -2026,14 +2200,20 @@ 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 listCollectionsValidateBeforeCall(String xPineconeApiVersion, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listCollections(Async)"); + } + + return listCollectionsCall(xPineconeApiVersion, _callback); } /** * List collections * List all collections in a project. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @return CollectionList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2044,14 +2224,15 @@ private okhttp3.Call listCollectionsValidateBeforeCall(final ApiCallback _callba 500 Internal server error. - */ - public CollectionList listCollections() throws ApiException { - ApiResponse localVarResp = listCollectionsWithHttpInfo(); + public CollectionList listCollections(String xPineconeApiVersion) throws ApiException { + ApiResponse localVarResp = listCollectionsWithHttpInfo(xPineconeApiVersion); return localVarResp.getData(); } /** * List collections * List all collections in a project. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (required) * @return ApiResponse<CollectionList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2062,8 +2243,8 @@ public CollectionList listCollections() throws ApiException { 500 Internal server error. - */ - public ApiResponse listCollectionsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(null); + public ApiResponse listCollectionsWithHttpInfo(String xPineconeApiVersion) throws ApiException { + okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(xPineconeApiVersion, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2071,6 +2252,7 @@ public ApiResponse listCollectionsWithHttpInfo() throws ApiExcep /** * List collections (asynchronously) * List all collections in a project. Serverless indexes do not support collections. + * @param xPineconeApiVersion Required date-based version header (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 @@ -2082,15 +2264,16 @@ public ApiResponse listCollectionsWithHttpInfo() throws ApiExcep 500 Internal server error. - */ - public okhttp3.Call listCollectionsAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listCollectionsAsync(String xPineconeApiVersion, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(_callback); + okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(xPineconeApiVersion, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listIndexBackups + * @param xPineconeApiVersion Required date-based version header (required) * @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) @@ -2106,7 +2289,7 @@ public okhttp3.Call listCollectionsAsync(final ApiCallback _call 500 Internal server error. - */ - public okhttp3.Call listIndexBackupsCall(String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listIndexBackupsCall(String xPineconeApiVersion, String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2140,6 +2323,10 @@ public okhttp3.Call listIndexBackupsCall(String indexName, Integer limit, String localVarQueryParams.addAll(localVarApiClient.parameterToPair("paginationToken", paginationToken)); } + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -2160,19 +2347,25 @@ public okhttp3.Call listIndexBackupsCall(String indexName, Integer limit, String } @SuppressWarnings("rawtypes") - private okhttp3.Call listIndexBackupsValidateBeforeCall(String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listIndexBackupsValidateBeforeCall(String xPineconeApiVersion, String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listIndexBackups(Async)"); + } + // verify the required parameter 'indexName' is set if (indexName == null) { throw new ApiException("Missing the required parameter 'indexName' when calling listIndexBackups(Async)"); } - return listIndexBackupsCall(indexName, limit, paginationToken, _callback); + return listIndexBackupsCall(xPineconeApiVersion, indexName, limit, paginationToken, _callback); } /** * List backups for an index * List all backups for an index. + * @param xPineconeApiVersion Required date-based version header (required) * @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) @@ -2187,14 +2380,15 @@ private okhttp3.Call listIndexBackupsValidateBeforeCall(String indexName, Intege 500 Internal server error. - */ - public BackupList listIndexBackups(String indexName, Integer limit, String paginationToken) throws ApiException { - ApiResponse localVarResp = listIndexBackupsWithHttpInfo(indexName, limit, paginationToken); + public BackupList listIndexBackups(String xPineconeApiVersion, String indexName, Integer limit, String paginationToken) throws ApiException { + ApiResponse localVarResp = listIndexBackupsWithHttpInfo(xPineconeApiVersion, indexName, limit, paginationToken); return localVarResp.getData(); } /** * List backups for an index * List all backups for an index. + * @param xPineconeApiVersion Required date-based version header (required) * @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) @@ -2209,8 +2403,8 @@ public BackupList listIndexBackups(String indexName, Integer limit, String pagin 500 Internal server error. - */ - public ApiResponse listIndexBackupsWithHttpInfo(String indexName, Integer limit, String paginationToken) throws ApiException { - okhttp3.Call localVarCall = listIndexBackupsValidateBeforeCall(indexName, limit, paginationToken, null); + public ApiResponse listIndexBackupsWithHttpInfo(String xPineconeApiVersion, String indexName, Integer limit, String paginationToken) throws ApiException { + okhttp3.Call localVarCall = listIndexBackupsValidateBeforeCall(xPineconeApiVersion, indexName, limit, paginationToken, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2218,6 +2412,7 @@ public ApiResponse listIndexBackupsWithHttpInfo(String indexName, In /** * List backups for an index (asynchronously) * List all backups for an index. + * @param xPineconeApiVersion Required date-based version header (required) * @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) @@ -2233,15 +2428,16 @@ public ApiResponse listIndexBackupsWithHttpInfo(String indexName, In 500 Internal server error. - */ - public okhttp3.Call listIndexBackupsAsync(String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listIndexBackupsAsync(String xPineconeApiVersion, String indexName, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listIndexBackupsValidateBeforeCall(indexName, limit, paginationToken, _callback); + okhttp3.Call localVarCall = listIndexBackupsValidateBeforeCall(xPineconeApiVersion, indexName, limit, paginationToken, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listIndexes + * @param xPineconeApiVersion Required date-based version header (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2253,7 +2449,7 @@ public okhttp3.Call listIndexBackupsAsync(String indexName, Integer limit, Strin 500 Internal server error. - */ - public okhttp3.Call listIndexesCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listIndexesCall(String xPineconeApiVersion, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2278,6 +2474,10 @@ public okhttp3.Call listIndexesCall(final ApiCallback _callback) throws ApiExcep Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -2298,14 +2498,20 @@ 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 listIndexesValidateBeforeCall(String xPineconeApiVersion, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listIndexes(Async)"); + } + + return listIndexesCall(xPineconeApiVersion, _callback); } /** * List indexes * List all indexes in a project. + * @param xPineconeApiVersion Required date-based version header (required) * @return IndexList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2316,14 +2522,15 @@ private okhttp3.Call listIndexesValidateBeforeCall(final ApiCallback _callback) 500 Internal server error. - */ - public IndexList listIndexes() throws ApiException { - ApiResponse localVarResp = listIndexesWithHttpInfo(); + public IndexList listIndexes(String xPineconeApiVersion) throws ApiException { + ApiResponse localVarResp = listIndexesWithHttpInfo(xPineconeApiVersion); return localVarResp.getData(); } /** * List indexes * List all indexes in a project. + * @param xPineconeApiVersion Required date-based version header (required) * @return ApiResponse<IndexList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2334,8 +2541,8 @@ public IndexList listIndexes() throws ApiException { 500 Internal server error. - */ - public ApiResponse listIndexesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = listIndexesValidateBeforeCall(null); + public ApiResponse listIndexesWithHttpInfo(String xPineconeApiVersion) throws ApiException { + okhttp3.Call localVarCall = listIndexesValidateBeforeCall(xPineconeApiVersion, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2343,6 +2550,7 @@ public ApiResponse listIndexesWithHttpInfo() throws ApiException { /** * List indexes (asynchronously) * List all indexes in a project. + * @param xPineconeApiVersion Required date-based version header (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 @@ -2354,15 +2562,16 @@ public ApiResponse listIndexesWithHttpInfo() throws ApiException { 500 Internal server error. - */ - public okhttp3.Call listIndexesAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listIndexesAsync(String xPineconeApiVersion, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listIndexesValidateBeforeCall(_callback); + okhttp3.Call localVarCall = listIndexesValidateBeforeCall(xPineconeApiVersion, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listProjectBackups + * @param xPineconeApiVersion Required date-based version header (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 @@ -2376,7 +2585,7 @@ public okhttp3.Call listIndexesAsync(final ApiCallback _callback) thr 500 Internal server error. - */ - public okhttp3.Call listProjectBackupsCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listProjectBackupsCall(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2409,6 +2618,10 @@ public okhttp3.Call listProjectBackupsCall(Integer limit, String paginationToken localVarQueryParams.addAll(localVarApiClient.parameterToPair("paginationToken", paginationToken)); } + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -2429,14 +2642,20 @@ public okhttp3.Call listProjectBackupsCall(Integer limit, String paginationToken } @SuppressWarnings("rawtypes") - private okhttp3.Call listProjectBackupsValidateBeforeCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - return listProjectBackupsCall(limit, paginationToken, _callback); + private okhttp3.Call listProjectBackupsValidateBeforeCall(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listProjectBackups(Async)"); + } + + return listProjectBackupsCall(xPineconeApiVersion, limit, paginationToken, _callback); } /** * List backups for all indexes in a project * List all backups for a project. + * @param xPineconeApiVersion Required date-based version header (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 @@ -2449,14 +2668,15 @@ private okhttp3.Call listProjectBackupsValidateBeforeCall(Integer limit, String 500 Internal server error. - */ - public BackupList listProjectBackups(Integer limit, String paginationToken) throws ApiException { - ApiResponse localVarResp = listProjectBackupsWithHttpInfo(limit, paginationToken); + public BackupList listProjectBackups(String xPineconeApiVersion, Integer limit, String paginationToken) throws ApiException { + ApiResponse localVarResp = listProjectBackupsWithHttpInfo(xPineconeApiVersion, limit, paginationToken); return localVarResp.getData(); } /** * List backups for all indexes in a project * List all backups for a project. + * @param xPineconeApiVersion Required date-based version header (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> @@ -2469,8 +2689,8 @@ public BackupList listProjectBackups(Integer limit, String paginationToken) thro 500 Internal server error. - */ - public ApiResponse listProjectBackupsWithHttpInfo(Integer limit, String paginationToken) throws ApiException { - okhttp3.Call localVarCall = listProjectBackupsValidateBeforeCall(limit, paginationToken, null); + public ApiResponse listProjectBackupsWithHttpInfo(String xPineconeApiVersion, Integer limit, String paginationToken) throws ApiException { + okhttp3.Call localVarCall = listProjectBackupsValidateBeforeCall(xPineconeApiVersion, limit, paginationToken, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2478,6 +2698,7 @@ public ApiResponse listProjectBackupsWithHttpInfo(Integer limit, Str /** * List backups for all indexes in a project (asynchronously) * List all backups for a project. + * @param xPineconeApiVersion Required date-based version header (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 @@ -2491,15 +2712,16 @@ public ApiResponse listProjectBackupsWithHttpInfo(Integer limit, Str 500 Internal server error. - */ - public okhttp3.Call listProjectBackupsAsync(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listProjectBackupsAsync(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listProjectBackupsValidateBeforeCall(limit, paginationToken, _callback); + okhttp3.Call localVarCall = listProjectBackupsValidateBeforeCall(xPineconeApiVersion, limit, paginationToken, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listRestoreJobs + * @param xPineconeApiVersion Required date-based version header (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 @@ -2513,7 +2735,7 @@ public okhttp3.Call listProjectBackupsAsync(Integer limit, String paginationToke 500 Internal server error. - */ - public okhttp3.Call listRestoreJobsCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listRestoreJobsCall(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2546,6 +2768,10 @@ public okhttp3.Call listRestoreJobsCall(Integer limit, String paginationToken, f localVarQueryParams.addAll(localVarApiClient.parameterToPair("paginationToken", paginationToken)); } + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -2566,14 +2792,20 @@ public okhttp3.Call listRestoreJobsCall(Integer limit, String paginationToken, f } @SuppressWarnings("rawtypes") - private okhttp3.Call listRestoreJobsValidateBeforeCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - return listRestoreJobsCall(limit, paginationToken, _callback); + private okhttp3.Call listRestoreJobsValidateBeforeCall(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listRestoreJobs(Async)"); + } + + return listRestoreJobsCall(xPineconeApiVersion, limit, paginationToken, _callback); } /** * List restore jobs * List all restore jobs for a project. + * @param xPineconeApiVersion Required date-based version header (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 RestoreJobList @@ -2586,14 +2818,15 @@ private okhttp3.Call listRestoreJobsValidateBeforeCall(Integer limit, String pag 500 Internal server error. - */ - public RestoreJobList listRestoreJobs(Integer limit, String paginationToken) throws ApiException { - ApiResponse localVarResp = listRestoreJobsWithHttpInfo(limit, paginationToken); + public RestoreJobList listRestoreJobs(String xPineconeApiVersion, Integer limit, String paginationToken) throws ApiException { + ApiResponse localVarResp = listRestoreJobsWithHttpInfo(xPineconeApiVersion, limit, paginationToken); return localVarResp.getData(); } /** * List restore jobs * List all restore jobs for a project. + * @param xPineconeApiVersion Required date-based version header (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<RestoreJobList> @@ -2606,8 +2839,8 @@ public RestoreJobList listRestoreJobs(Integer limit, String paginationToken) thr 500 Internal server error. - */ - public ApiResponse listRestoreJobsWithHttpInfo(Integer limit, String paginationToken) throws ApiException { - okhttp3.Call localVarCall = listRestoreJobsValidateBeforeCall(limit, paginationToken, null); + public ApiResponse listRestoreJobsWithHttpInfo(String xPineconeApiVersion, Integer limit, String paginationToken) throws ApiException { + okhttp3.Call localVarCall = listRestoreJobsValidateBeforeCall(xPineconeApiVersion, limit, paginationToken, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2615,6 +2848,7 @@ public ApiResponse listRestoreJobsWithHttpInfo(Integer limit, St /** * List restore jobs (asynchronously) * List all restore jobs for a project. + * @param xPineconeApiVersion Required date-based version header (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 @@ -2628,9 +2862,9 @@ public ApiResponse listRestoreJobsWithHttpInfo(Integer limit, St 500 Internal server error. - */ - public okhttp3.Call listRestoreJobsAsync(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listRestoreJobsAsync(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listRestoreJobsValidateBeforeCall(limit, paginationToken, _callback); + okhttp3.Call localVarCall = listRestoreJobsValidateBeforeCall(xPineconeApiVersion, 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 ecc29384..cf3c424f 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 948f1dd8..7c50a624 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-04 + * The version of the OpenAPI document: 2025-10 * 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 0edd7e4a..e247e077 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-04 + * The version of the OpenAPI document: 2025-10 * 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 6a74235e..30ca4551 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 632d203a..9003692c 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 index 7b85d129..69cfd824 100644 --- a/src/main/java/org/openapitools/db_control/client/model/BackupList.java +++ b/src/main/java/org/openapitools/db_control/client/model/BackupList.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * The list of backups that exist in the project. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class BackupList { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -81,7 +81,7 @@ public BackupList addDataItem(BackupModel dataItem) { } /** - * Get data + * List of backup objects * @return data **/ @javax.annotation.Nullable 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 index da016430..c2364cb1 100644 --- a/src/main/java/org/openapitools/db_control/client/model/BackupModel.java +++ b/src/main/java/org/openapitools/db_control/client/model/BackupModel.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import org.openapitools.db_control.client.model.BackupModelSchema; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,7 +52,7 @@ /** * The BackupModel describes the configuration and status of a Pinecone backup. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class BackupModel { public static final String SERIALIZED_NAME_BACKUP_ID = "backup_id"; @SerializedName(SERIALIZED_NAME_BACKUP_ID) @@ -89,58 +90,13 @@ public class BackupModel { @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; + private String metric; + + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + private BackupModelSchema schema; public static final String SERIALIZED_NAME_RECORD_COUNT = "record_count"; @SerializedName(SERIALIZED_NAME_RECORD_COUNT) @@ -356,27 +312,48 @@ public void setDimension(Integer dimension) { } - public BackupModel metric(MetricEnum metric) { + public BackupModel metric(String 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'. + * 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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. * @return metric **/ @javax.annotation.Nullable - public MetricEnum getMetric() { + public String getMetric() { return metric; } - public void setMetric(MetricEnum metric) { + public void setMetric(String metric) { this.metric = metric; } + public BackupModel schema(BackupModelSchema schema) { + + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + **/ + @javax.annotation.Nullable + public BackupModelSchema getSchema() { + return schema; + } + + + public void setSchema(BackupModelSchema schema) { + this.schema = schema; + } + + public BackupModel recordCount(Integer recordCount) { this.recordCount = recordCount; @@ -554,6 +531,7 @@ public boolean equals(Object o) { Objects.equals(this.region, backupModel.region) && Objects.equals(this.dimension, backupModel.dimension) && Objects.equals(this.metric, backupModel.metric) && + Objects.equals(this.schema, backupModel.schema) && Objects.equals(this.recordCount, backupModel.recordCount) && Objects.equals(this.namespaceCount, backupModel.namespaceCount) && Objects.equals(this.sizeBytes, backupModel.sizeBytes) && @@ -564,7 +542,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(backupId, sourceIndexName, sourceIndexId, name, description, status, cloud, region, dimension, metric, recordCount, namespaceCount, sizeBytes, tags, createdAt, additionalProperties); + return Objects.hash(backupId, sourceIndexName, sourceIndexId, name, description, status, cloud, region, dimension, metric, schema, recordCount, namespaceCount, sizeBytes, tags, createdAt, additionalProperties); } @Override @@ -581,6 +559,7 @@ public String toString() { 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(" schema: ").append(toIndentedString(schema)).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"); @@ -619,6 +598,7 @@ private String toIndentedString(Object o) { openapiFields.add("region"); openapiFields.add("dimension"); openapiFields.add("metric"); + openapiFields.add("schema"); openapiFields.add("record_count"); openapiFields.add("namespace_count"); openapiFields.add("size_bytes"); @@ -682,6 +662,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } + // validate the optional field `schema` + if (jsonObj.get("schema") != null && !jsonObj.get("schema").isJsonNull()) { + BackupModelSchema.validateJsonElement(jsonObj.get("schema")); + } 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())); } diff --git a/src/main/java/org/openapitools/db_control/client/model/BackupModelSchema.java b/src/main/java/org/openapitools/db_control/client/model/BackupModelSchema.java new file mode 100644 index 00000000..482adbf3 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/BackupModelSchema.java @@ -0,0 +1,300 @@ +/* + * 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-10 + * 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.BackupModelSchemaFieldsValue; + +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; + +/** + * Schema for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `schema` is present, only fields which are present in the `fields` object with a `filterable: true` are indexed. Note that `filterable: false` is not currently supported. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class BackupModelSchema { + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + private Map fields = new HashMap<>(); + + public BackupModelSchema() { + } + + public BackupModelSchema fields(Map fields) { + + this.fields = fields; + return this; + } + + public BackupModelSchema putFieldsItem(String key, BackupModelSchemaFieldsValue fieldsItem) { + if (this.fields == null) { + this.fields = new HashMap<>(); + } + this.fields.put(key, fieldsItem); + return this; + } + + /** + * A map of metadata field names to their configuration. The field name must be a valid metadata field name. The field name must be unique. + * @return fields + **/ + @javax.annotation.Nonnull + public Map getFields() { + return fields; + } + + + public void setFields(Map fields) { + this.fields = fields; + } + + /** + * 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 BackupModelSchema instance itself + */ + public BackupModelSchema 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; + } + BackupModelSchema backupModelSchema = (BackupModelSchema) o; + return Objects.equals(this.fields, backupModelSchema.fields)&& + Objects.equals(this.additionalProperties, backupModelSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BackupModelSchema {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).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("fields"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fields"); + } + + /** + * 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 BackupModelSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BackupModelSchema.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BackupModelSchema is not found in the empty JSON string", BackupModelSchema.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BackupModelSchema.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BackupModelSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BackupModelSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BackupModelSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BackupModelSchema 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 BackupModelSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BackupModelSchema 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 BackupModelSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of BackupModelSchema + * @throws IOException if the JSON string is invalid with respect to BackupModelSchema + */ + public static BackupModelSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BackupModelSchema.class); + } + + /** + * Convert an instance of BackupModelSchema 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/BackupModelSchemaFieldsValue.java b/src/main/java/org/openapitools/db_control/client/model/BackupModelSchemaFieldsValue.java new file mode 100644 index 00000000..1da4732b --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/BackupModelSchemaFieldsValue.java @@ -0,0 +1,281 @@ +/* + * 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-10 + * 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; + +/** + * BackupModelSchemaFieldsValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class BackupModelSchemaFieldsValue { + public static final String SERIALIZED_NAME_FILTERABLE = "filterable"; + @SerializedName(SERIALIZED_NAME_FILTERABLE) + private Boolean filterable; + + public BackupModelSchemaFieldsValue() { + } + + public BackupModelSchemaFieldsValue filterable(Boolean filterable) { + + this.filterable = filterable; + return this; + } + + /** + * Whether the field is filterable. If true, the field is indexed and can be used in filters. Only true values are allowed. + * @return filterable + **/ + @javax.annotation.Nullable + public Boolean getFilterable() { + return filterable; + } + + + public void setFilterable(Boolean filterable) { + this.filterable = filterable; + } + + /** + * 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 BackupModelSchemaFieldsValue instance itself + */ + public BackupModelSchemaFieldsValue 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; + } + BackupModelSchemaFieldsValue backupModelSchemaFieldsValue = (BackupModelSchemaFieldsValue) o; + return Objects.equals(this.filterable, backupModelSchemaFieldsValue.filterable)&& + Objects.equals(this.additionalProperties, backupModelSchemaFieldsValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(filterable, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BackupModelSchemaFieldsValue {\n"); + sb.append(" filterable: ").append(toIndentedString(filterable)).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("filterable"); + + // 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 BackupModelSchemaFieldsValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BackupModelSchemaFieldsValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BackupModelSchemaFieldsValue is not found in the empty JSON string", BackupModelSchemaFieldsValue.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BackupModelSchemaFieldsValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BackupModelSchemaFieldsValue' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BackupModelSchemaFieldsValue.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BackupModelSchemaFieldsValue 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 BackupModelSchemaFieldsValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BackupModelSchemaFieldsValue 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 BackupModelSchemaFieldsValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of BackupModelSchemaFieldsValue + * @throws IOException if the JSON string is invalid with respect to BackupModelSchemaFieldsValue + */ + public static BackupModelSchemaFieldsValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BackupModelSchemaFieldsValue.class); + } + + /** + * Convert an instance of BackupModelSchemaFieldsValue 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 index 0f27c99d..8c3f1305 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ByocSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/ByocSpec.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-04 + * The version of the OpenAPI document: 2025-10 * 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.BackupModelSchema; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -49,12 +50,16 @@ /** * Configuration needed to deploy an index in a BYOC environment. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class ByocSpec { public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT) private String environment; + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + private BackupModelSchema schema; + public ByocSpec() { } @@ -78,6 +83,27 @@ public void setEnvironment(String environment) { this.environment = environment; } + + public ByocSpec schema(BackupModelSchema schema) { + + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + **/ + @javax.annotation.Nullable + public BackupModelSchema getSchema() { + return schema; + } + + + public void setSchema(BackupModelSchema schema) { + this.schema = schema; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -133,13 +159,14 @@ public boolean equals(Object o) { return false; } ByocSpec byocSpec = (ByocSpec) o; - return Objects.equals(this.environment, byocSpec.environment)&& + return Objects.equals(this.environment, byocSpec.environment) && + Objects.equals(this.schema, byocSpec.schema)&& Objects.equals(this.additionalProperties, byocSpec.additionalProperties); } @Override public int hashCode() { - return Objects.hash(environment, additionalProperties); + return Objects.hash(environment, schema, additionalProperties); } @Override @@ -147,6 +174,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ByocSpec {\n"); sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -171,6 +199,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("environment"); + openapiFields.add("schema"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -200,6 +229,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } + // validate the optional field `schema` + if (jsonObj.get("schema") != null && !jsonObj.get("schema").isJsonNull()) { + BackupModelSchema.validateJsonElement(jsonObj.get("schema")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 5f3ab79c..bb5f8d06 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class CollectionList { public static final String SERIALIZED_NAME_COLLECTIONS = "collections"; @SerializedName(SERIALIZED_NAME_COLLECTIONS) @@ -76,7 +76,7 @@ public CollectionList addCollectionsItem(CollectionModel collectionsItem) { } /** - * Get collections + * List of collections in the project * @return collections **/ @javax.annotation.Nullable 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 f5e5232d..3aad537c 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class CollectionModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -59,58 +59,9 @@ public class CollectionModel { @SerializedName(SERIALIZED_NAME_SIZE) private Long size; - /** - * The status of the collection. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - INITIALIZING("Initializing"), - - READY("Ready"), - - TERMINATING("Terminating"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + private String status; public static final String SERIALIZED_NAME_DIMENSION = "dimension"; @SerializedName(SERIALIZED_NAME_DIMENSION) @@ -169,23 +120,23 @@ public void setSize(Long size) { } - public CollectionModel status(StatusEnum status) { + public CollectionModel status(String status) { this.status = status; return this; } /** - * The status of the collection. + * The status of the collection. Possible values: `Initializing`, `Ready`, or `Terminating`. * @return status **/ @javax.annotation.Nonnull - public StatusEnum getStatus() { + public String getStatus() { return status; } - public void setStatus(StatusEnum status) { + public void setStatus(String status) { this.status = status; } 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 9cd983b5..f2bdb366 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,7 +25,6 @@ import java.util.Map; import org.openapitools.db_control.client.model.ConfigureIndexRequestEmbed; import org.openapitools.db_control.client.model.ConfigureIndexRequestSpec; -import org.openapitools.db_control.client.model.DeletionProtection; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -54,7 +53,7 @@ /** * Configuration used to scale an index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class ConfigureIndexRequest { public static final String SERIALIZED_NAME_SPEC = "spec"; @SerializedName(SERIALIZED_NAME_SPEC) @@ -62,7 +61,7 @@ public class ConfigureIndexRequest { public static final String SERIALIZED_NAME_DELETION_PROTECTION = "deletion_protection"; @SerializedName(SERIALIZED_NAME_DELETION_PROTECTION) - private DeletionProtection deletionProtection = DeletionProtection.DISABLED; + private String deletionProtection = "disabled"; public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -96,23 +95,23 @@ public void setSpec(ConfigureIndexRequestSpec spec) { } - public ConfigureIndexRequest deletionProtection(DeletionProtection deletionProtection) { + public ConfigureIndexRequest deletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; return this; } /** - * Get deletionProtection + * Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. * @return deletionProtection **/ @javax.annotation.Nullable - public DeletionProtection getDeletionProtection() { + public String getDeletionProtection() { return deletionProtection; } - public void setDeletionProtection(DeletionProtection deletionProtection) { + public void setDeletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; } @@ -290,6 +289,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("spec") != null && !jsonObj.get("spec").isJsonNull()) { ConfigureIndexRequestSpec.validateJsonElement(jsonObj.get("spec")); } + if ((jsonObj.get("deletion_protection") != null && !jsonObj.get("deletion_protection").isJsonNull()) && !jsonObj.get("deletion_protection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deletion_protection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletion_protection").toString())); + } // validate the optional field `embed` if (jsonObj.get("embed") != null && !jsonObj.get("embed").isJsonNull()) { ConfigureIndexRequestEmbed.validateJsonElement(jsonObj.get("embed")); 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 16c0f26e..161dfe07 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-04 + * The version of the OpenAPI document: 2025-10 * 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/index-data/create-an-index#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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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/ConfigureIndexRequestPodBased.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestPodBased.java new file mode 100644 index 00000000..5c9cf674 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestPodBased.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ConfigureIndexRequestPodBasedConfig; + +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; + +/** + * ConfigureIndexRequestPodBased + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ConfigureIndexRequestPodBased { + public static final String SERIALIZED_NAME_POD = "pod"; + @SerializedName(SERIALIZED_NAME_POD) + private ConfigureIndexRequestPodBasedConfig pod; + + public ConfigureIndexRequestPodBased() { + } + + public ConfigureIndexRequestPodBased pod(ConfigureIndexRequestPodBasedConfig pod) { + + this.pod = pod; + return this; + } + + /** + * Get pod + * @return pod + **/ + @javax.annotation.Nonnull + public ConfigureIndexRequestPodBasedConfig getPod() { + return pod; + } + + + public void setPod(ConfigureIndexRequestPodBasedConfig pod) { + this.pod = pod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigureIndexRequestPodBased configureIndexRequestPodBased = (ConfigureIndexRequestPodBased) o; + return Objects.equals(this.pod, configureIndexRequestPodBased.pod); + } + + @Override + public int hashCode() { + return Objects.hash(pod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigureIndexRequestPodBased {\n"); + sb.append(" pod: ").append(toIndentedString(pod)).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("pod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pod"); + } + + /** + * 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 ConfigureIndexRequestPodBased + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConfigureIndexRequestPodBased.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigureIndexRequestPodBased is not found in the empty JSON string", ConfigureIndexRequestPodBased.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConfigureIndexRequestPodBased.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfigureIndexRequestPodBased` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigureIndexRequestPodBased.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(); + // validate the required field `pod` + ConfigureIndexRequestPodBasedConfig.validateJsonElement(jsonObj.get("pod")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigureIndexRequestPodBased.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigureIndexRequestPodBased' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigureIndexRequestPodBased.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigureIndexRequestPodBased value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConfigureIndexRequestPodBased read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConfigureIndexRequestPodBased given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConfigureIndexRequestPodBased + * @throws IOException if the JSON string is invalid with respect to ConfigureIndexRequestPodBased + */ + public static ConfigureIndexRequestPodBased fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigureIndexRequestPodBased.class); + } + + /** + * Convert an instance of ConfigureIndexRequestPodBased 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/ConfigureIndexRequestSpecPod.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestPodBasedConfig.java similarity index 81% rename from src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java rename to src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestPodBasedConfig.java index 00a99dd7..d3ee5c65 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestPodBasedConfig.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -47,10 +47,10 @@ import org.openapitools.db_control.client.JSON; /** - * ConfigureIndexRequestSpecPod + * Updated configuration for pod-based indexes */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") -public class ConfigureIndexRequestSpecPod { +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ConfigureIndexRequestPodBasedConfig { public static final String SERIALIZED_NAME_REPLICAS = "replicas"; @SerializedName(SERIALIZED_NAME_REPLICAS) private Integer replicas = 1; @@ -59,10 +59,10 @@ public class ConfigureIndexRequestSpecPod { @SerializedName(SERIALIZED_NAME_POD_TYPE) private String podType = "p1.x1"; - public ConfigureIndexRequestSpecPod() { + public ConfigureIndexRequestPodBasedConfig() { } - public ConfigureIndexRequestSpecPod replicas(Integer replicas) { + public ConfigureIndexRequestPodBasedConfig replicas(Integer replicas) { this.replicas = replicas; return this; @@ -84,7 +84,7 @@ public void setReplicas(Integer replicas) { } - public ConfigureIndexRequestSpecPod podType(String podType) { + public ConfigureIndexRequestPodBasedConfig podType(String podType) { this.podType = podType; return this; @@ -117,9 +117,9 @@ public void setPodType(String podType) { * * @param key name of the property * @param value value of the property - * @return the ConfigureIndexRequestSpecPod instance itself + * @return the ConfigureIndexRequestPodBasedConfig instance itself */ - public ConfigureIndexRequestSpecPod putAdditionalProperty(String key, Object value) { + public ConfigureIndexRequestPodBasedConfig putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -158,10 +158,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ConfigureIndexRequestSpecPod configureIndexRequestSpecPod = (ConfigureIndexRequestSpecPod) o; - return Objects.equals(this.replicas, configureIndexRequestSpecPod.replicas) && - Objects.equals(this.podType, configureIndexRequestSpecPod.podType)&& - Objects.equals(this.additionalProperties, configureIndexRequestSpecPod.additionalProperties); + ConfigureIndexRequestPodBasedConfig configureIndexRequestPodBasedConfig = (ConfigureIndexRequestPodBasedConfig) o; + return Objects.equals(this.replicas, configureIndexRequestPodBasedConfig.replicas) && + Objects.equals(this.podType, configureIndexRequestPodBasedConfig.podType)&& + Objects.equals(this.additionalProperties, configureIndexRequestPodBasedConfig.additionalProperties); } @Override @@ -172,7 +172,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ConfigureIndexRequestSpecPod {\n"); + sb.append("class ConfigureIndexRequestPodBasedConfig {\n"); sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); sb.append(" podType: ").append(toIndentedString(podType)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -209,12 +209,12 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConfigureIndexRequestSpecPod + * @throws IOException if the JSON Element is invalid with respect to ConfigureIndexRequestPodBasedConfig */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ConfigureIndexRequestSpecPod.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigureIndexRequestSpecPod is not found in the empty JSON string", ConfigureIndexRequestSpecPod.openapiRequiredFields.toString())); + if (!ConfigureIndexRequestPodBasedConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigureIndexRequestPodBasedConfig is not found in the empty JSON string", ConfigureIndexRequestPodBasedConfig.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -227,16 +227,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConfigureIndexRequestSpecPod.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConfigureIndexRequestSpecPod' and its subtypes + if (!ConfigureIndexRequestPodBasedConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigureIndexRequestPodBasedConfig' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConfigureIndexRequestSpecPod.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigureIndexRequestPodBasedConfig.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ConfigureIndexRequestSpecPod value) throws IOException { + public void write(JsonWriter out, ConfigureIndexRequestPodBasedConfig value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -259,12 +259,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ConfigureIndexRequestSpecPod read(JsonReader in) throws IOException { + public ConfigureIndexRequestPodBasedConfig read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ConfigureIndexRequestSpecPod instance = thisAdapter.fromJsonTree(jsonObj); + ConfigureIndexRequestPodBasedConfig instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -291,18 +291,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ConfigureIndexRequestSpecPod given an JSON string + * Create an instance of ConfigureIndexRequestPodBasedConfig given an JSON string * * @param jsonString JSON string - * @return An instance of ConfigureIndexRequestSpecPod - * @throws IOException if the JSON string is invalid with respect to ConfigureIndexRequestSpecPod + * @return An instance of ConfigureIndexRequestPodBasedConfig + * @throws IOException if the JSON string is invalid with respect to ConfigureIndexRequestPodBasedConfig */ - public static ConfigureIndexRequestSpecPod fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConfigureIndexRequestSpecPod.class); + public static ConfigureIndexRequestPodBasedConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigureIndexRequestPodBasedConfig.class); } /** - * Convert an instance of ConfigureIndexRequestSpecPod to an JSON string + * Convert an instance of ConfigureIndexRequestPodBasedConfig to an JSON string * * @return JSON string */ diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestServerless.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestServerless.java new file mode 100644 index 00000000..f45636dc --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestServerless.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ConfigureIndexRequestServerlessConfig; + +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; + +/** + * ConfigureIndexRequestServerless + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ConfigureIndexRequestServerless { + public static final String SERIALIZED_NAME_SERVERLESS = "serverless"; + @SerializedName(SERIALIZED_NAME_SERVERLESS) + private ConfigureIndexRequestServerlessConfig serverless; + + public ConfigureIndexRequestServerless() { + } + + public ConfigureIndexRequestServerless serverless(ConfigureIndexRequestServerlessConfig serverless) { + + this.serverless = serverless; + return this; + } + + /** + * Get serverless + * @return serverless + **/ + @javax.annotation.Nonnull + public ConfigureIndexRequestServerlessConfig getServerless() { + return serverless; + } + + + public void setServerless(ConfigureIndexRequestServerlessConfig serverless) { + this.serverless = serverless; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigureIndexRequestServerless configureIndexRequestServerless = (ConfigureIndexRequestServerless) o; + return Objects.equals(this.serverless, configureIndexRequestServerless.serverless); + } + + @Override + public int hashCode() { + return Objects.hash(serverless); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigureIndexRequestServerless {\n"); + sb.append(" serverless: ").append(toIndentedString(serverless)).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("serverless"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("serverless"); + } + + /** + * 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 ConfigureIndexRequestServerless + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConfigureIndexRequestServerless.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigureIndexRequestServerless is not found in the empty JSON string", ConfigureIndexRequestServerless.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConfigureIndexRequestServerless.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfigureIndexRequestServerless` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConfigureIndexRequestServerless.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(); + // validate the required field `serverless` + ConfigureIndexRequestServerlessConfig.validateJsonElement(jsonObj.get("serverless")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigureIndexRequestServerless.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigureIndexRequestServerless' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigureIndexRequestServerless.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigureIndexRequestServerless value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConfigureIndexRequestServerless read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConfigureIndexRequestServerless given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConfigureIndexRequestServerless + * @throws IOException if the JSON string is invalid with respect to ConfigureIndexRequestServerless + */ + public static ConfigureIndexRequestServerless fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigureIndexRequestServerless.class); + } + + /** + * Convert an instance of ConfigureIndexRequestServerless 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/ConfigureIndexRequestServerlessConfig.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestServerlessConfig.java new file mode 100644 index 00000000..3b6480d7 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestServerlessConfig.java @@ -0,0 +1,286 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ReadCapacity; + +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; + +/** + * Updated configuration for serverless indexes + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ConfigureIndexRequestServerlessConfig { + public static final String SERIALIZED_NAME_READ_CAPACITY = "read_capacity"; + @SerializedName(SERIALIZED_NAME_READ_CAPACITY) + private ReadCapacity readCapacity; + + public ConfigureIndexRequestServerlessConfig() { + } + + public ConfigureIndexRequestServerlessConfig readCapacity(ReadCapacity readCapacity) { + + this.readCapacity = readCapacity; + return this; + } + + /** + * Get readCapacity + * @return readCapacity + **/ + @javax.annotation.Nullable + public ReadCapacity getReadCapacity() { + return readCapacity; + } + + + public void setReadCapacity(ReadCapacity readCapacity) { + this.readCapacity = readCapacity; + } + + /** + * 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 ConfigureIndexRequestServerlessConfig instance itself + */ + public ConfigureIndexRequestServerlessConfig 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; + } + ConfigureIndexRequestServerlessConfig configureIndexRequestServerlessConfig = (ConfigureIndexRequestServerlessConfig) o; + return Objects.equals(this.readCapacity, configureIndexRequestServerlessConfig.readCapacity)&& + Objects.equals(this.additionalProperties, configureIndexRequestServerlessConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(readCapacity, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConfigureIndexRequestServerlessConfig {\n"); + sb.append(" readCapacity: ").append(toIndentedString(readCapacity)).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("read_capacity"); + + // 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 ConfigureIndexRequestServerlessConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConfigureIndexRequestServerlessConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigureIndexRequestServerlessConfig is not found in the empty JSON string", ConfigureIndexRequestServerlessConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `read_capacity` + if (jsonObj.get("read_capacity") != null && !jsonObj.get("read_capacity").isJsonNull()) { + ReadCapacity.validateJsonElement(jsonObj.get("read_capacity")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigureIndexRequestServerlessConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigureIndexRequestServerlessConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConfigureIndexRequestServerlessConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigureIndexRequestServerlessConfig 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 ConfigureIndexRequestServerlessConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConfigureIndexRequestServerlessConfig 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 ConfigureIndexRequestServerlessConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConfigureIndexRequestServerlessConfig + * @throws IOException if the JSON string is invalid with respect to ConfigureIndexRequestServerlessConfig + */ + public static ConfigureIndexRequestServerlessConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConfigureIndexRequestServerlessConfig.class); + } + + /** + * Convert an instance of ConfigureIndexRequestServerlessConfig 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/ConfigureIndexRequestSpec.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java index 8c0ad7e7..30b7a68d 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,162 +21,210 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.db_control.client.model.ConfigureIndexRequestSpecPod; +import org.openapitools.db_control.client.model.ConfigureIndexRequestPodBased; +import org.openapitools.db_control.client.model.ConfigureIndexRequestPodBasedConfig; +import org.openapitools.db_control.client.model.ConfigureIndexRequestServerless; +import org.openapitools.db_control.client.model.ConfigureIndexRequestServerlessConfig; + + + +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.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.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; +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 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 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.db_control.client.JSON; -/** - * ConfigureIndexRequestSpec - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") -public class ConfigureIndexRequestSpec { - public static final String SERIALIZED_NAME_POD = "pod"; - @SerializedName(SERIALIZED_NAME_POD) - private ConfigureIndexRequestSpecPod pod; - - public ConfigureIndexRequestSpec() { - } - - public ConfigureIndexRequestSpec pod(ConfigureIndexRequestSpecPod pod) { - - this.pod = pod; - return this; - } - - /** - * Get pod - * @return pod - **/ - @javax.annotation.Nonnull - public ConfigureIndexRequestSpecPod getPod() { - return pod; - } +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ConfigureIndexRequestSpec extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ConfigureIndexRequestSpec.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConfigureIndexRequestSpec.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConfigureIndexRequestSpec' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterConfigureIndexRequestServerless = gson.getDelegateAdapter(this, TypeToken.get(ConfigureIndexRequestServerless.class)); + final TypeAdapter adapterConfigureIndexRequestPodBased = gson.getDelegateAdapter(this, TypeToken.get(ConfigureIndexRequestPodBased.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConfigureIndexRequestSpec value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ConfigureIndexRequestServerless` + if (value.getActualInstance() instanceof ConfigureIndexRequestServerless) { + JsonElement element = adapterConfigureIndexRequestServerless.toJsonTree((ConfigureIndexRequestServerless)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ConfigureIndexRequestPodBased` + if (value.getActualInstance() instanceof ConfigureIndexRequestPodBased) { + JsonElement element = adapterConfigureIndexRequestPodBased.toJsonTree((ConfigureIndexRequestPodBased)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ConfigureIndexRequestPodBased, ConfigureIndexRequestServerless"); + } + + @Override + public ConfigureIndexRequestSpec read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ConfigureIndexRequestServerless + try { + // validate the JSON object to see if any exception is thrown + ConfigureIndexRequestServerless.validateJsonElement(jsonElement); + actualAdapter = adapterConfigureIndexRequestServerless; + match++; + log.log(Level.FINER, "Input data matches schema 'ConfigureIndexRequestServerless'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ConfigureIndexRequestServerless failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ConfigureIndexRequestServerless'", e); + } + // deserialize ConfigureIndexRequestPodBased + try { + // validate the JSON object to see if any exception is thrown + ConfigureIndexRequestPodBased.validateJsonElement(jsonElement); + actualAdapter = adapterConfigureIndexRequestPodBased; + match++; + log.log(Level.FINER, "Input data matches schema 'ConfigureIndexRequestPodBased'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ConfigureIndexRequestPodBased failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ConfigureIndexRequestPodBased'", e); + } + + if (match == 1) { + ConfigureIndexRequestSpec ret = new ConfigureIndexRequestSpec(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for ConfigureIndexRequestSpec: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); - public void setPod(ConfigureIndexRequestSpecPod pod) { - this.pod = pod; - } - - /** - * 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 ConfigureIndexRequestSpec instance itself - */ - public ConfigureIndexRequestSpec putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + public ConfigureIndexRequestSpec() { + super("oneOf", Boolean.FALSE); } - 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; + public ConfigureIndexRequestSpec(ConfigureIndexRequestPodBased o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); } - return this.additionalProperties.get(key); - } + public ConfigureIndexRequestSpec(ConfigureIndexRequestServerless o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + static { + schemas.put("ConfigureIndexRequestServerless", ConfigureIndexRequestServerless.class); + schemas.put("ConfigureIndexRequestPodBased", ConfigureIndexRequestPodBased.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public Map> getSchemas() { + return ConfigureIndexRequestSpec.schemas; } - ConfigureIndexRequestSpec configureIndexRequestSpec = (ConfigureIndexRequestSpec) o; - return Objects.equals(this.pod, configureIndexRequestSpec.pod)&& - Objects.equals(this.additionalProperties, configureIndexRequestSpec.additionalProperties); - } - @Override - public int hashCode() { - return Objects.hash(pod, additionalProperties); - } + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ConfigureIndexRequestPodBased, ConfigureIndexRequestServerless + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ConfigureIndexRequestServerless) { + super.setActualInstance(instance); + return; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConfigureIndexRequestSpec {\n"); - sb.append(" pod: ").append(toIndentedString(pod)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } + if (instance instanceof ConfigureIndexRequestPodBased) { + super.setActualInstance(instance); + return; + } - /** - * 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"; + throw new RuntimeException("Invalid instance type. Must be ConfigureIndexRequestPodBased, ConfigureIndexRequestServerless"); } - 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("pod"); + /** + * Get the actual instance, which can be the following: + * ConfigureIndexRequestPodBased, ConfigureIndexRequestServerless + * + * @return The actual instance (ConfigureIndexRequestPodBased, ConfigureIndexRequestServerless) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("pod"); - } + /** + * Get the actual instance of `ConfigureIndexRequestServerless`. If the actual instance is not `ConfigureIndexRequestServerless`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ConfigureIndexRequestServerless` + * @throws ClassCastException if the instance is not `ConfigureIndexRequestServerless` + */ + public ConfigureIndexRequestServerless getConfigureIndexRequestServerless() throws ClassCastException { + return (ConfigureIndexRequestServerless)super.getActualInstance(); + } + /** + * Get the actual instance of `ConfigureIndexRequestPodBased`. If the actual instance is not `ConfigureIndexRequestPodBased`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ConfigureIndexRequestPodBased` + * @throws ClassCastException if the instance is not `ConfigureIndexRequestPodBased` + */ + public ConfigureIndexRequestPodBased getConfigureIndexRequestPodBased() throws ClassCastException { + return (ConfigureIndexRequestPodBased)super.getActualInstance(); + } /** * Validates the JSON Element and throws an exception if issues found @@ -185,87 +233,27 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to ConfigureIndexRequestSpec */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConfigureIndexRequestSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ConfigureIndexRequestSpec is not found in the empty JSON string", ConfigureIndexRequestSpec.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ConfigureIndexRequestSpec.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(); - // validate the required field `pod` - ConfigureIndexRequestSpecPod.validateJsonElement(jsonObj.get("pod")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConfigureIndexRequestSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConfigureIndexRequestSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ConfigureIndexRequestSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ConfigureIndexRequestSpec 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 ConfigureIndexRequestSpec read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - ConfigureIndexRequestSpec 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(); + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ConfigureIndexRequestServerless + try { + ConfigureIndexRequestServerless.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ConfigureIndexRequestServerless failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ConfigureIndexRequestPodBased + try { + ConfigureIndexRequestPodBased.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ConfigureIndexRequestPodBased failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ConfigureIndexRequestSpec with oneOf schemas: ConfigureIndexRequestPodBased, ConfigureIndexRequestServerless. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } 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 index fc626925..dc37ea4a 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.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-04 + * The version of the OpenAPI document: 2025-10 * 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 backup of an index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class CreateBackupRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) 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 fdd0671a..17efac9b 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 255d9d62..716feea6 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,8 +23,9 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import org.openapitools.db_control.client.model.BackupModelSchema; import org.openapitools.db_control.client.model.CreateIndexForModelRequestEmbed; -import org.openapitools.db_control.client.model.DeletionProtection; +import org.openapitools.db_control.client.model.ReadCapacity; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,64 +54,15 @@ /** * The desired configuration for the index and associated embedding model. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class CreateIndexForModelRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; - /** - * The public cloud where you would like your index hosted. - */ - @JsonAdapter(CloudEnum.Adapter.class) - public enum CloudEnum { - GCP("gcp"), - - AWS("aws"), - - AZURE("azure"); - - private String value; - - CloudEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CloudEnum fromValue(String value) { - for (CloudEnum b : CloudEnum.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 CloudEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CloudEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CloudEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_CLOUD = "cloud"; @SerializedName(SERIALIZED_NAME_CLOUD) - private CloudEnum cloud; + private String cloud; public static final String SERIALIZED_NAME_REGION = "region"; @SerializedName(SERIALIZED_NAME_REGION) @@ -118,12 +70,20 @@ public CloudEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_DELETION_PROTECTION = "deletion_protection"; @SerializedName(SERIALIZED_NAME_DELETION_PROTECTION) - private DeletionProtection deletionProtection = DeletionProtection.DISABLED; + private String deletionProtection = "disabled"; public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) private Map tags = new HashMap<>(); + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + private BackupModelSchema schema; + + public static final String SERIALIZED_NAME_READ_CAPACITY = "read_capacity"; + @SerializedName(SERIALIZED_NAME_READ_CAPACITY) + private ReadCapacity readCapacity; + public static final String SERIALIZED_NAME_EMBED = "embed"; @SerializedName(SERIALIZED_NAME_EMBED) private CreateIndexForModelRequestEmbed embed; @@ -152,23 +112,23 @@ public void setName(String name) { } - public CreateIndexForModelRequest cloud(CloudEnum cloud) { + public CreateIndexForModelRequest cloud(String cloud) { this.cloud = cloud; return this; } /** - * The public cloud where you would like your index hosted. + * The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. * @return cloud **/ @javax.annotation.Nonnull - public CloudEnum getCloud() { + public String getCloud() { return cloud; } - public void setCloud(CloudEnum cloud) { + public void setCloud(String cloud) { this.cloud = cloud; } @@ -194,23 +154,23 @@ public void setRegion(String region) { } - public CreateIndexForModelRequest deletionProtection(DeletionProtection deletionProtection) { + public CreateIndexForModelRequest deletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; return this; } /** - * Get deletionProtection + * Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. * @return deletionProtection **/ @javax.annotation.Nullable - public DeletionProtection getDeletionProtection() { + public String getDeletionProtection() { return deletionProtection; } - public void setDeletionProtection(DeletionProtection deletionProtection) { + public void setDeletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; } @@ -244,6 +204,48 @@ public void setTags(Map tags) { } + public CreateIndexForModelRequest schema(BackupModelSchema schema) { + + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + **/ + @javax.annotation.Nullable + public BackupModelSchema getSchema() { + return schema; + } + + + public void setSchema(BackupModelSchema schema) { + this.schema = schema; + } + + + public CreateIndexForModelRequest readCapacity(ReadCapacity readCapacity) { + + this.readCapacity = readCapacity; + return this; + } + + /** + * Get readCapacity + * @return readCapacity + **/ + @javax.annotation.Nullable + public ReadCapacity getReadCapacity() { + return readCapacity; + } + + + public void setReadCapacity(ReadCapacity readCapacity) { + this.readCapacity = readCapacity; + } + + public CreateIndexForModelRequest embed(CreateIndexForModelRequestEmbed embed) { this.embed = embed; @@ -324,13 +326,15 @@ public boolean equals(Object o) { Objects.equals(this.region, createIndexForModelRequest.region) && Objects.equals(this.deletionProtection, createIndexForModelRequest.deletionProtection) && Objects.equals(this.tags, createIndexForModelRequest.tags) && + Objects.equals(this.schema, createIndexForModelRequest.schema) && + Objects.equals(this.readCapacity, createIndexForModelRequest.readCapacity) && Objects.equals(this.embed, createIndexForModelRequest.embed)&& Objects.equals(this.additionalProperties, createIndexForModelRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, cloud, region, deletionProtection, tags, embed, additionalProperties); + return Objects.hash(name, cloud, region, deletionProtection, tags, schema, readCapacity, embed, additionalProperties); } @Override @@ -342,6 +346,8 @@ public String toString() { sb.append(" region: ").append(toIndentedString(region)).append("\n"); sb.append(" deletionProtection: ").append(toIndentedString(deletionProtection)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" readCapacity: ").append(toIndentedString(readCapacity)).append("\n"); sb.append(" embed: ").append(toIndentedString(embed)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -371,6 +377,8 @@ private String toIndentedString(Object o) { openapiFields.add("region"); openapiFields.add("deletion_protection"); openapiFields.add("tags"); + openapiFields.add("schema"); + openapiFields.add("read_capacity"); openapiFields.add("embed"); // a set of required properties/fields (JSON key names) @@ -410,6 +418,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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("deletion_protection") != null && !jsonObj.get("deletion_protection").isJsonNull()) && !jsonObj.get("deletion_protection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deletion_protection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletion_protection").toString())); + } + // validate the optional field `schema` + if (jsonObj.get("schema") != null && !jsonObj.get("schema").isJsonNull()) { + BackupModelSchema.validateJsonElement(jsonObj.get("schema")); + } + // validate the optional field `read_capacity` + if (jsonObj.get("read_capacity") != null && !jsonObj.get("read_capacity").isJsonNull()) { + ReadCapacity.validateJsonElement(jsonObj.get("read_capacity")); + } // validate the required field `embed` CreateIndexForModelRequestEmbed.validateJsonElement(jsonObj.get("embed")); } 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 8efae735..61a73a49 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,64 +49,15 @@ /** * 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/index-data/create-an-index#embedding-models) for available models and model details. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class CreateIndexForModelRequestEmbed { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) private String model; - /** - * The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If not specified, the metric will be defaulted according to the model. Cannot be updated once set. - */ - @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; + private String metric; public static final String SERIALIZED_NAME_FIELD_MAP = "field_map"; @SerializedName(SERIALIZED_NAME_FIELD_MAP) @@ -148,23 +99,23 @@ public void setModel(String model) { } - public CreateIndexForModelRequestEmbed metric(MetricEnum metric) { + public CreateIndexForModelRequestEmbed metric(String metric) { this.metric = metric; return this; } /** - * The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If not specified, the metric will be defaulted according to the model. Cannot be updated once set. + * The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If not specified, the metric will be defaulted according to the model. Cannot be updated once set. Possible values: `cosine`, `euclidean`, or `dotproduct`. * @return metric **/ @javax.annotation.Nullable - public MetricEnum getMetric() { + public String getMetric() { return metric; } - public void setMetric(MetricEnum metric) { + public void setMetric(String metric) { this.metric = metric; } 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 index 4427cb68..8adb2fd7 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,7 +23,6 @@ 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; @@ -52,7 +51,7 @@ /** * The configuration needed to create a Pinecone index from a backup. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class CreateIndexFromBackupRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -64,7 +63,7 @@ public class CreateIndexFromBackupRequest { public static final String SERIALIZED_NAME_DELETION_PROTECTION = "deletion_protection"; @SerializedName(SERIALIZED_NAME_DELETION_PROTECTION) - private DeletionProtection deletionProtection = DeletionProtection.DISABLED; + private String deletionProtection = "disabled"; public CreateIndexFromBackupRequest() { } @@ -119,23 +118,23 @@ public void setTags(Map tags) { } - public CreateIndexFromBackupRequest deletionProtection(DeletionProtection deletionProtection) { + public CreateIndexFromBackupRequest deletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; return this; } /** - * Get deletionProtection + * Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. * @return deletionProtection **/ @javax.annotation.Nullable - public DeletionProtection getDeletionProtection() { + public String getDeletionProtection() { return deletionProtection; } - public void setDeletionProtection(DeletionProtection deletionProtection) { + public void setDeletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; } @@ -267,6 +266,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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("deletion_protection") != null && !jsonObj.get("deletion_protection").isJsonNull()) && !jsonObj.get("deletion_protection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deletion_protection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletion_protection").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupResponse.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupResponse.java index 2afa2964..fdfff174 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupResponse.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupResponse.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The response for creating an index from a backup. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class CreateIndexFromBackupResponse { public static final String SERIALIZED_NAME_RESTORE_JOB_ID = "restore_job_id"; @SerializedName(SERIALIZED_NAME_RESTORE_JOB_ID) 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 7966cb51..e5efa798 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import org.openapitools.db_control.client.model.DeletionProtection; import org.openapitools.db_control.client.model.IndexSpec; import com.google.gson.Gson; @@ -53,7 +52,7 @@ /** * The configuration needed to create a Pinecone index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class CreateIndexRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -63,62 +62,13 @@ public class CreateIndexRequest { @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; + private String metric; public static final String SERIALIZED_NAME_DELETION_PROTECTION = "deletion_protection"; @SerializedName(SERIALIZED_NAME_DELETION_PROTECTION) - private DeletionProtection deletionProtection = DeletionProtection.DISABLED; + private String deletionProtection = "disabled"; public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -179,44 +129,44 @@ public void setDimension(Integer dimension) { } - public CreateIndexRequest metric(MetricEnum metric) { + public CreateIndexRequest metric(String 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'. + * 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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. * @return metric **/ @javax.annotation.Nullable - public MetricEnum getMetric() { + public String getMetric() { return metric; } - public void setMetric(MetricEnum metric) { + public void setMetric(String metric) { this.metric = metric; } - public CreateIndexRequest deletionProtection(DeletionProtection deletionProtection) { + public CreateIndexRequest deletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; return this; } /** - * Get deletionProtection + * Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. * @return deletionProtection **/ @javax.annotation.Nullable - public DeletionProtection getDeletionProtection() { + public String getDeletionProtection() { return deletionProtection; } - public void setDeletionProtection(DeletionProtection deletionProtection) { + public void setDeletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; } @@ -260,7 +210,7 @@ public CreateIndexRequest spec(IndexSpec spec) { * Get spec * @return spec **/ - @javax.annotation.Nullable + @javax.annotation.Nonnull public IndexSpec getSpec() { return spec; } @@ -435,6 +385,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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("deletion_protection") != null && !jsonObj.get("deletion_protection").isJsonNull()) && !jsonObj.get("deletion_protection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deletion_protection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletion_protection").toString())); + } // validate the required field `spec` IndexSpec.validateJsonElement(jsonObj.get("spec")); if ((jsonObj.get("vector_type") != null && !jsonObj.get("vector_type").isJsonNull()) && !jsonObj.get("vector_type").isJsonPrimitive()) { 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 deleted file mode 100644 index cc619816..00000000 --- a/src/main/java/org/openapitools/db_control/client/model/DeletionProtection.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.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; - -/** - * Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. - */ -@JsonAdapter(DeletionProtection.Adapter.class) -public enum DeletionProtection { - - DISABLED("disabled"), - - ENABLED("enabled"); - - private String value; - - DeletionProtection(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static DeletionProtection fromValue(String value) { - for (DeletionProtection b : DeletionProtection.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 DeletionProtection enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DeletionProtection read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return DeletionProtection.fromValue(value); - } - } -} - 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 6df0386b..e465ab39 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 05d5722a..a6a61884 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,94 +49,11 @@ /** * Detailed information about the error that occurred. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class ErrorResponseError { - /** - * Gets or Sets code - */ - @JsonAdapter(CodeEnum.Adapter.class) - public enum CodeEnum { - OK("OK"), - - UNKNOWN("UNKNOWN"), - - INVALID_ARGUMENT("INVALID_ARGUMENT"), - - DEADLINE_EXCEEDED("DEADLINE_EXCEEDED"), - - QUOTA_EXCEEDED("QUOTA_EXCEEDED"), - - NOT_FOUND("NOT_FOUND"), - - ALREADY_EXISTS("ALREADY_EXISTS"), - - PERMISSION_DENIED("PERMISSION_DENIED"), - - UNAUTHENTICATED("UNAUTHENTICATED"), - - RESOURCE_EXHAUSTED("RESOURCE_EXHAUSTED"), - - FAILED_PRECONDITION("FAILED_PRECONDITION"), - - ABORTED("ABORTED"), - - OUT_OF_RANGE("OUT_OF_RANGE"), - - UNIMPLEMENTED("UNIMPLEMENTED"), - - INTERNAL("INTERNAL"), - - UNAVAILABLE("UNAVAILABLE"), - - DATA_LOSS("DATA_LOSS"), - - FORBIDDEN("FORBIDDEN"), - - UNPROCESSABLE_ENTITY("UNPROCESSABLE_ENTITY"), - - PAYMENT_REQUIRED("PAYMENT_REQUIRED"); - - private String value; - - CodeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CodeEnum fromValue(String value) { - for (CodeEnum b : CodeEnum.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 CodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CodeEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) - private CodeEnum code; + private String code; public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @@ -149,23 +66,23 @@ public CodeEnum read(final JsonReader jsonReader) throws IOException { public ErrorResponseError() { } - public ErrorResponseError code(CodeEnum code) { + public ErrorResponseError code(String code) { this.code = code; return this; } /** - * Get code + * The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, `UNPROCESSABLE_ENTITY`, or `PAYMENT_REQUIRED`. * @return code **/ @javax.annotation.Nonnull - public CodeEnum getCode() { + public String getCode() { return code; } - public void setCode(CodeEnum code) { + public void setCode(String code) { this.code = code; } @@ -177,7 +94,7 @@ public ErrorResponseError message(String message) { } /** - * Get message + * A human-readable description of the error * @return message **/ @javax.annotation.Nonnull 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 c215f30d..30a78c1e 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class IndexList { public static final String SERIALIZED_NAME_INDEXES = "indexes"; @SerializedName(SERIALIZED_NAME_INDEXES) @@ -76,7 +76,7 @@ public IndexList addIndexesItem(IndexModel indexesItem) { } /** - * Get indexes + * List of indexes in the project * @return indexes **/ @javax.annotation.Nullable 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 33c61d51..81ff7596 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import org.openapitools.db_control.client.model.DeletionProtection; import org.openapitools.db_control.client.model.IndexModelSpec; import org.openapitools.db_control.client.model.IndexModelStatus; import org.openapitools.db_control.client.model.ModelIndexEmbed; @@ -55,7 +54,7 @@ /** * The IndexModel describes the configuration and status of a Pinecone index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class IndexModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -65,66 +64,21 @@ public class IndexModel { @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; + private String metric; public static final String SERIALIZED_NAME_HOST = "host"; @SerializedName(SERIALIZED_NAME_HOST) private String host; + public static final String SERIALIZED_NAME_PRIVATE_HOST = "private_host"; + @SerializedName(SERIALIZED_NAME_PRIVATE_HOST) + private String privateHost; + public static final String SERIALIZED_NAME_DELETION_PROTECTION = "deletion_protection"; @SerializedName(SERIALIZED_NAME_DELETION_PROTECTION) - private DeletionProtection deletionProtection = DeletionProtection.DISABLED; + private String deletionProtection = "disabled"; public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -193,23 +147,23 @@ public void setDimension(Integer dimension) { } - public IndexModel metric(MetricEnum metric) { + public IndexModel metric(String 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'. + * 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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. * @return metric **/ @javax.annotation.Nonnull - public MetricEnum getMetric() { + public String getMetric() { return metric; } - public void setMetric(MetricEnum metric) { + public void setMetric(String metric) { this.metric = metric; } @@ -235,23 +189,44 @@ public void setHost(String host) { } - public IndexModel deletionProtection(DeletionProtection deletionProtection) { + public IndexModel privateHost(String privateHost) { + + this.privateHost = privateHost; + return this; + } + + /** + * The private endpoint URL of an index. + * @return privateHost + **/ + @javax.annotation.Nullable + public String getPrivateHost() { + return privateHost; + } + + + public void setPrivateHost(String privateHost) { + this.privateHost = privateHost; + } + + + public IndexModel deletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; return this; } /** - * Get deletionProtection + * Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. * @return deletionProtection **/ @javax.annotation.Nullable - public DeletionProtection getDeletionProtection() { + public String getDeletionProtection() { return deletionProtection; } - public void setDeletionProtection(DeletionProtection deletionProtection) { + public void setDeletionProtection(String deletionProtection) { this.deletionProtection = deletionProtection; } @@ -427,6 +402,7 @@ public boolean equals(Object o) { Objects.equals(this.dimension, indexModel.dimension) && Objects.equals(this.metric, indexModel.metric) && Objects.equals(this.host, indexModel.host) && + Objects.equals(this.privateHost, indexModel.privateHost) && Objects.equals(this.deletionProtection, indexModel.deletionProtection) && Objects.equals(this.tags, indexModel.tags) && Objects.equals(this.embed, indexModel.embed) && @@ -438,7 +414,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(name, dimension, metric, host, deletionProtection, tags, embed, spec, status, vectorType, additionalProperties); + return Objects.hash(name, dimension, metric, host, privateHost, deletionProtection, tags, embed, spec, status, vectorType, additionalProperties); } @Override @@ -449,6 +425,7 @@ public String toString() { sb.append(" dimension: ").append(toIndentedString(dimension)).append("\n"); sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" privateHost: ").append(toIndentedString(privateHost)).append("\n"); sb.append(" deletionProtection: ").append(toIndentedString(deletionProtection)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" embed: ").append(toIndentedString(embed)).append("\n"); @@ -482,6 +459,7 @@ private String toIndentedString(Object o) { openapiFields.add("dimension"); openapiFields.add("metric"); openapiFields.add("host"); + openapiFields.add("private_host"); openapiFields.add("deletion_protection"); openapiFields.add("tags"); openapiFields.add("embed"); @@ -528,6 +506,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("host").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); } + if ((jsonObj.get("private_host") != null && !jsonObj.get("private_host").isJsonNull()) && !jsonObj.get("private_host").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `private_host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("private_host").toString())); + } + if ((jsonObj.get("deletion_protection") != null && !jsonObj.get("deletion_protection").isJsonNull()) && !jsonObj.get("deletion_protection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deletion_protection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deletion_protection").toString())); + } // validate the optional field `embed` if (jsonObj.get("embed") != null && !jsonObj.get("embed").isJsonNull()) { ModelIndexEmbed.validateJsonElement(jsonObj.get("embed")); diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexModelBYOC.java b/src/main/java/org/openapitools/db_control/client/model/IndexModelBYOC.java new file mode 100644 index 00000000..9e8dec64 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModelBYOC.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ByocSpec; + +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; + +/** + * IndexModelBYOC + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class IndexModelBYOC { + public static final String SERIALIZED_NAME_BYOC = "byoc"; + @SerializedName(SERIALIZED_NAME_BYOC) + private ByocSpec byoc; + + public IndexModelBYOC() { + } + + public IndexModelBYOC byoc(ByocSpec byoc) { + + this.byoc = byoc; + return this; + } + + /** + * Get byoc + * @return byoc + **/ + @javax.annotation.Nonnull + public ByocSpec getByoc() { + return byoc; + } + + + public void setByoc(ByocSpec byoc) { + this.byoc = byoc; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexModelBYOC indexModelBYOC = (IndexModelBYOC) o; + return Objects.equals(this.byoc, indexModelBYOC.byoc); + } + + @Override + public int hashCode() { + return Objects.hash(byoc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexModelBYOC {\n"); + sb.append(" byoc: ").append(toIndentedString(byoc)).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("byoc"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("byoc"); + } + + /** + * 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 IndexModelBYOC + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndexModelBYOC.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IndexModelBYOC is not found in the empty JSON string", IndexModelBYOC.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IndexModelBYOC.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IndexModelBYOC` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IndexModelBYOC.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(); + // validate the required field `byoc` + ByocSpec.validateJsonElement(jsonObj.get("byoc")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexModelBYOC.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexModelBYOC' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IndexModelBYOC.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexModelBYOC value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndexModelBYOC read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IndexModelBYOC given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndexModelBYOC + * @throws IOException if the JSON string is invalid with respect to IndexModelBYOC + */ + public static IndexModelBYOC fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexModelBYOC.class); + } + + /** + * Convert an instance of IndexModelBYOC 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/IndexModelPodBased.java b/src/main/java/org/openapitools/db_control/client/model/IndexModelPodBased.java new file mode 100644 index 00000000..7f0c8e72 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModelPodBased.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.PodSpec; + +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; + +/** + * IndexModelPodBased + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class IndexModelPodBased { + public static final String SERIALIZED_NAME_POD = "pod"; + @SerializedName(SERIALIZED_NAME_POD) + private PodSpec pod; + + public IndexModelPodBased() { + } + + public IndexModelPodBased pod(PodSpec pod) { + + this.pod = pod; + return this; + } + + /** + * Get pod + * @return pod + **/ + @javax.annotation.Nonnull + public PodSpec getPod() { + return pod; + } + + + public void setPod(PodSpec pod) { + this.pod = pod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexModelPodBased indexModelPodBased = (IndexModelPodBased) o; + return Objects.equals(this.pod, indexModelPodBased.pod); + } + + @Override + public int hashCode() { + return Objects.hash(pod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexModelPodBased {\n"); + sb.append(" pod: ").append(toIndentedString(pod)).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("pod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pod"); + } + + /** + * 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 IndexModelPodBased + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndexModelPodBased.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IndexModelPodBased is not found in the empty JSON string", IndexModelPodBased.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IndexModelPodBased.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IndexModelPodBased` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IndexModelPodBased.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(); + // validate the required field `pod` + PodSpec.validateJsonElement(jsonObj.get("pod")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexModelPodBased.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexModelPodBased' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IndexModelPodBased.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexModelPodBased value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndexModelPodBased read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IndexModelPodBased given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndexModelPodBased + * @throws IOException if the JSON string is invalid with respect to IndexModelPodBased + */ + public static IndexModelPodBased fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexModelPodBased.class); + } + + /** + * Convert an instance of IndexModelPodBased 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/IndexModelServerless.java b/src/main/java/org/openapitools/db_control/client/model/IndexModelServerless.java new file mode 100644 index 00000000..51280924 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModelServerless.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ServerlessSpecResponse; + +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; + +/** + * IndexModelServerless + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class IndexModelServerless { + public static final String SERIALIZED_NAME_SERVERLESS = "serverless"; + @SerializedName(SERIALIZED_NAME_SERVERLESS) + private ServerlessSpecResponse serverless; + + public IndexModelServerless() { + } + + public IndexModelServerless serverless(ServerlessSpecResponse serverless) { + + this.serverless = serverless; + return this; + } + + /** + * Get serverless + * @return serverless + **/ + @javax.annotation.Nonnull + public ServerlessSpecResponse getServerless() { + return serverless; + } + + + public void setServerless(ServerlessSpecResponse serverless) { + this.serverless = serverless; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexModelServerless indexModelServerless = (IndexModelServerless) o; + return Objects.equals(this.serverless, indexModelServerless.serverless); + } + + @Override + public int hashCode() { + return Objects.hash(serverless); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexModelServerless {\n"); + sb.append(" serverless: ").append(toIndentedString(serverless)).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("serverless"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("serverless"); + } + + /** + * 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 IndexModelServerless + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndexModelServerless.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IndexModelServerless is not found in the empty JSON string", IndexModelServerless.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IndexModelServerless.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IndexModelServerless` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IndexModelServerless.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(); + // validate the required field `serverless` + ServerlessSpecResponse.validateJsonElement(jsonObj.get("serverless")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexModelServerless.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexModelServerless' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IndexModelServerless.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexModelServerless value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndexModelServerless read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IndexModelServerless given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndexModelServerless + * @throws IOException if the JSON string is invalid with respect to IndexModelServerless + */ + public static IndexModelServerless fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexModelServerless.class); + } + + /** + * Convert an instance of IndexModelServerless 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/IndexModelSpec.java b/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java index ce2ec32a..a175d141 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,218 +22,251 @@ import java.io.IOException; import java.util.Arrays; import org.openapitools.db_control.client.model.ByocSpec; +import org.openapitools.db_control.client.model.IndexModelBYOC; +import org.openapitools.db_control.client.model.IndexModelPodBased; +import org.openapitools.db_control.client.model.IndexModelServerless; import org.openapitools.db_control.client.model.PodSpec; -import org.openapitools.db_control.client.model.ServerlessSpec; +import org.openapitools.db_control.client.model.ServerlessSpecResponse; + + + +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.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.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; +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 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 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.db_control.client.JSON; -/** - * IndexModelSpec - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[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; - - public static final String SERIALIZED_NAME_SERVERLESS = "serverless"; - @SerializedName(SERIALIZED_NAME_SERVERLESS) - private ServerlessSpec serverless; - - 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; - } +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class IndexModelSpec extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(IndexModelSpec.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexModelSpec.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexModelSpec' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIndexModelServerless = gson.getDelegateAdapter(this, TypeToken.get(IndexModelServerless.class)); + final TypeAdapter adapterIndexModelPodBased = gson.getDelegateAdapter(this, TypeToken.get(IndexModelPodBased.class)); + final TypeAdapter adapterIndexModelBYOC = gson.getDelegateAdapter(this, TypeToken.get(IndexModelBYOC.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexModelSpec value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IndexModelServerless` + if (value.getActualInstance() instanceof IndexModelServerless) { + JsonElement element = adapterIndexModelServerless.toJsonTree((IndexModelServerless)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `IndexModelPodBased` + if (value.getActualInstance() instanceof IndexModelPodBased) { + JsonElement element = adapterIndexModelPodBased.toJsonTree((IndexModelPodBased)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `IndexModelBYOC` + if (value.getActualInstance() instanceof IndexModelBYOC) { + JsonElement element = adapterIndexModelBYOC.toJsonTree((IndexModelBYOC)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IndexModelBYOC, IndexModelPodBased, IndexModelServerless"); + } + + @Override + public IndexModelSpec read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IndexModelServerless + try { + // validate the JSON object to see if any exception is thrown + IndexModelServerless.validateJsonElement(jsonElement); + actualAdapter = adapterIndexModelServerless; + match++; + log.log(Level.FINER, "Input data matches schema 'IndexModelServerless'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IndexModelServerless failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IndexModelServerless'", e); + } + // deserialize IndexModelPodBased + try { + // validate the JSON object to see if any exception is thrown + IndexModelPodBased.validateJsonElement(jsonElement); + actualAdapter = adapterIndexModelPodBased; + match++; + log.log(Level.FINER, "Input data matches schema 'IndexModelPodBased'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IndexModelPodBased failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IndexModelPodBased'", e); + } + // deserialize IndexModelBYOC + try { + // validate the JSON object to see if any exception is thrown + IndexModelBYOC.validateJsonElement(jsonElement); + actualAdapter = adapterIndexModelBYOC; + match++; + log.log(Level.FINER, "Input data matches schema 'IndexModelBYOC'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IndexModelBYOC failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IndexModelBYOC'", e); + } + + if (match == 1) { + IndexModelSpec ret = new IndexModelSpec(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for IndexModelSpec: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); - public IndexModelSpec pod(PodSpec pod) { - - this.pod = pod; - return this; - } + public IndexModelSpec() { + super("oneOf", Boolean.FALSE); + } - /** - * Get pod - * @return pod - **/ - @javax.annotation.Nullable - public PodSpec getPod() { - return pod; - } + public IndexModelSpec(IndexModelBYOC o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public IndexModelSpec(IndexModelPodBased o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } - public void setPod(PodSpec pod) { - this.pod = pod; - } + public IndexModelSpec(IndexModelServerless o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { + schemas.put("IndexModelServerless", IndexModelServerless.class); + schemas.put("IndexModelPodBased", IndexModelPodBased.class); + schemas.put("IndexModelBYOC", IndexModelBYOC.class); + } - public IndexModelSpec serverless(ServerlessSpec serverless) { - - this.serverless = serverless; - return this; - } + @Override + public Map> getSchemas() { + return IndexModelSpec.schemas; + } - /** - * Get serverless - * @return serverless - **/ - @javax.annotation.Nullable - public ServerlessSpec getServerless() { - return serverless; - } + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * IndexModelBYOC, IndexModelPodBased, IndexModelServerless + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IndexModelServerless) { + super.setActualInstance(instance); + return; + } + if (instance instanceof IndexModelPodBased) { + super.setActualInstance(instance); + return; + } - public void setServerless(ServerlessSpec serverless) { - this.serverless = serverless; - } + if (instance instanceof IndexModelBYOC) { + super.setActualInstance(instance); + return; + } - /** - * 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 IndexModelSpec instance itself - */ - public IndexModelSpec putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + throw new RuntimeException("Invalid instance type. Must be IndexModelBYOC, IndexModelPodBased, IndexModelServerless"); } - 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; + /** + * Get the actual instance, which can be the following: + * IndexModelBYOC, IndexModelPodBased, IndexModelServerless + * + * @return The actual instance (IndexModelBYOC, IndexModelPodBased, IndexModelServerless) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); } - return this.additionalProperties.get(key); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * Get the actual instance of `IndexModelServerless`. If the actual instance is not `IndexModelServerless`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IndexModelServerless` + * @throws ClassCastException if the instance is not `IndexModelServerless` + */ + public IndexModelServerless getIndexModelServerless() throws ClassCastException { + return (IndexModelServerless)super.getActualInstance(); } - if (o == null || getClass() != o.getClass()) { - return false; + /** + * Get the actual instance of `IndexModelPodBased`. If the actual instance is not `IndexModelPodBased`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IndexModelPodBased` + * @throws ClassCastException if the instance is not `IndexModelPodBased` + */ + public IndexModelPodBased getIndexModelPodBased() throws ClassCastException { + return (IndexModelPodBased)super.getActualInstance(); } - IndexModelSpec indexModelSpec = (IndexModelSpec) o; - 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(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"); - 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"; + /** + * Get the actual instance of `IndexModelBYOC`. If the actual instance is not `IndexModelBYOC`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IndexModelBYOC` + * @throws ClassCastException if the instance is not `IndexModelBYOC` + */ + public IndexModelBYOC getIndexModelBYOC() throws ClassCastException { + return (IndexModelBYOC)super.getActualInstance(); } - 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("byoc"); - openapiFields.add("pod"); - openapiFields.add("serverless"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } /** * Validates the JSON Element and throws an exception if issues found @@ -242,90 +275,35 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to IndexModelSpec */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexModelSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IndexModelSpec is not found in the empty JSON string", IndexModelSpec.openapiRequiredFields.toString())); - } - } - 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")); - } - // validate the optional field `serverless` - if (jsonObj.get("serverless") != null && !jsonObj.get("serverless").isJsonNull()) { - ServerlessSpec.validateJsonElement(jsonObj.get("serverless")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexModelSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IndexModelSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IndexModelSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IndexModelSpec 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 IndexModelSpec read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - IndexModelSpec 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(); + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with IndexModelServerless + try { + IndexModelServerless.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IndexModelServerless failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IndexModelPodBased + try { + IndexModelPodBased.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IndexModelPodBased failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IndexModelBYOC + try { + IndexModelBYOC.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IndexModelBYOC failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for IndexModelSpec with oneOf schemas: IndexModelBYOC, IndexModelPodBased, IndexModelServerless. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } 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 f8088146..512f3746 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -47,78 +47,17 @@ import org.openapitools.db_control.client.JSON; /** - * IndexModelStatus + * The current status of the index */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class IndexModelStatus { public static final String SERIALIZED_NAME_READY = "ready"; @SerializedName(SERIALIZED_NAME_READY) private Boolean ready; - /** - * Gets or Sets state - */ - @JsonAdapter(StateEnum.Adapter.class) - public enum StateEnum { - INITIALIZING("Initializing"), - - INITIALIZATIONFAILED("InitializationFailed"), - - SCALINGUP("ScalingUp"), - - SCALINGDOWN("ScalingDown"), - - SCALINGUPPODSIZE("ScalingUpPodSize"), - - SCALINGDOWNPODSIZE("ScalingDownPodSize"), - - TERMINATING("Terminating"), - - READY("Ready"), - - DISABLED("Disabled"); - - private String value; - - StateEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StateEnum fromValue(String value) { - for (StateEnum b : StateEnum.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 StateEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StateEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StateEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_STATE = "state"; @SerializedName(SERIALIZED_NAME_STATE) - private StateEnum state; + private String state; public IndexModelStatus() { } @@ -130,7 +69,7 @@ public IndexModelStatus ready(Boolean ready) { } /** - * Get ready + * Whether the index is ready for use * @return ready **/ @javax.annotation.Nonnull @@ -144,23 +83,23 @@ public void setReady(Boolean ready) { } - public IndexModelStatus state(StateEnum state) { + public IndexModelStatus state(String state) { this.state = state; return this; } /** - * Get state + * The state of the index. Possible values: `Initializing`, `InitializationFailed`, `ScalingUp`, `ScalingDown`, `ScalingUpPodSize`, `ScalingDownPodSize`, `Terminating`, `Ready`, or `Disabled`. * @return state **/ @javax.annotation.Nonnull - public StateEnum getState() { + public String getState() { return state; } - public void setState(StateEnum state) { + public void setState(String state) { this.state = state; } 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 69f5efb9..674abe71 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,169 +22,251 @@ import java.io.IOException; import java.util.Arrays; import org.openapitools.db_control.client.model.ByocSpec; +import org.openapitools.db_control.client.model.IndexSpecBYOC; +import org.openapitools.db_control.client.model.IndexSpecPodBased; +import org.openapitools.db_control.client.model.IndexSpecServerless; import org.openapitools.db_control.client.model.PodSpec; import org.openapitools.db_control.client.model.ServerlessSpec; + + +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.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.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; +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 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 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.db_control.client.JSON; -/** - * 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/index-data/create-an-index#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/production/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-05-22T16:07:13.211110Z[Etc/UTC]") -public class IndexSpec { - public static final String SERIALIZED_NAME_SERVERLESS = "serverless"; - @SerializedName(SERIALIZED_NAME_SERVERLESS) - private ServerlessSpec serverless; - - public static final String SERIALIZED_NAME_POD = "pod"; - @SerializedName(SERIALIZED_NAME_POD) - private PodSpec pod; - - public static final String SERIALIZED_NAME_BYOC = "byoc"; - @SerializedName(SERIALIZED_NAME_BYOC) - private ByocSpec byoc; - - public IndexSpec() { - } - - public IndexSpec serverless(ServerlessSpec serverless) { - - this.serverless = serverless; - return this; - } - - /** - * Get serverless - * @return serverless - **/ - @javax.annotation.Nullable - public ServerlessSpec getServerless() { - return serverless; - } - - - public void setServerless(ServerlessSpec serverless) { - this.serverless = serverless; - } +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class IndexSpec extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(IndexSpec.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexSpec.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexSpec' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIndexSpecServerless = gson.getDelegateAdapter(this, TypeToken.get(IndexSpecServerless.class)); + final TypeAdapter adapterIndexSpecPodBased = gson.getDelegateAdapter(this, TypeToken.get(IndexSpecPodBased.class)); + final TypeAdapter adapterIndexSpecBYOC = gson.getDelegateAdapter(this, TypeToken.get(IndexSpecBYOC.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexSpec value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IndexSpecServerless` + if (value.getActualInstance() instanceof IndexSpecServerless) { + JsonElement element = adapterIndexSpecServerless.toJsonTree((IndexSpecServerless)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `IndexSpecPodBased` + if (value.getActualInstance() instanceof IndexSpecPodBased) { + JsonElement element = adapterIndexSpecPodBased.toJsonTree((IndexSpecPodBased)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `IndexSpecBYOC` + if (value.getActualInstance() instanceof IndexSpecBYOC) { + JsonElement element = adapterIndexSpecBYOC.toJsonTree((IndexSpecBYOC)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IndexSpecBYOC, IndexSpecPodBased, IndexSpecServerless"); + } + + @Override + public IndexSpec read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IndexSpecServerless + try { + // validate the JSON object to see if any exception is thrown + IndexSpecServerless.validateJsonElement(jsonElement); + actualAdapter = adapterIndexSpecServerless; + match++; + log.log(Level.FINER, "Input data matches schema 'IndexSpecServerless'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IndexSpecServerless failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IndexSpecServerless'", e); + } + // deserialize IndexSpecPodBased + try { + // validate the JSON object to see if any exception is thrown + IndexSpecPodBased.validateJsonElement(jsonElement); + actualAdapter = adapterIndexSpecPodBased; + match++; + log.log(Level.FINER, "Input data matches schema 'IndexSpecPodBased'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IndexSpecPodBased failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IndexSpecPodBased'", e); + } + // deserialize IndexSpecBYOC + try { + // validate the JSON object to see if any exception is thrown + IndexSpecBYOC.validateJsonElement(jsonElement); + actualAdapter = adapterIndexSpecBYOC; + match++; + log.log(Level.FINER, "Input data matches schema 'IndexSpecBYOC'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IndexSpecBYOC failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IndexSpecBYOC'", e); + } + + if (match == 1) { + IndexSpec ret = new IndexSpec(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for IndexSpec: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); - public IndexSpec pod(PodSpec pod) { - - this.pod = pod; - return this; - } + public IndexSpec() { + super("oneOf", Boolean.FALSE); + } - /** - * Get pod - * @return pod - **/ - @javax.annotation.Nullable - public PodSpec getPod() { - return pod; - } + public IndexSpec(IndexSpecBYOC o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public IndexSpec(IndexSpecPodBased o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } - public void setPod(PodSpec pod) { - this.pod = pod; - } + public IndexSpec(IndexSpecServerless o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { + schemas.put("IndexSpecServerless", IndexSpecServerless.class); + schemas.put("IndexSpecPodBased", IndexSpecPodBased.class); + schemas.put("IndexSpecBYOC", IndexSpecBYOC.class); + } - public IndexSpec byoc(ByocSpec byoc) { - - this.byoc = byoc; - return this; - } + @Override + public Map> getSchemas() { + return IndexSpec.schemas; + } - /** - * Get byoc - * @return byoc - **/ - @javax.annotation.Nullable - public ByocSpec getByoc() { - return byoc; - } + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * IndexSpecBYOC, IndexSpecPodBased, IndexSpecServerless + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IndexSpecServerless) { + super.setActualInstance(instance); + return; + } + if (instance instanceof IndexSpecPodBased) { + super.setActualInstance(instance); + return; + } - public void setByoc(ByocSpec byoc) { - this.byoc = byoc; - } + if (instance instanceof IndexSpecBYOC) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be IndexSpecBYOC, IndexSpecPodBased, IndexSpecServerless"); + } + /** + * Get the actual instance, which can be the following: + * IndexSpecBYOC, IndexSpecPodBased, IndexSpecServerless + * + * @return The actual instance (IndexSpecBYOC, IndexSpecPodBased, IndexSpecServerless) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * Get the actual instance of `IndexSpecServerless`. If the actual instance is not `IndexSpecServerless`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IndexSpecServerless` + * @throws ClassCastException if the instance is not `IndexSpecServerless` + */ + public IndexSpecServerless getIndexSpecServerless() throws ClassCastException { + return (IndexSpecServerless)super.getActualInstance(); } - if (o == null || getClass() != o.getClass()) { - return false; + /** + * Get the actual instance of `IndexSpecPodBased`. If the actual instance is not `IndexSpecPodBased`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IndexSpecPodBased` + * @throws ClassCastException if the instance is not `IndexSpecPodBased` + */ + public IndexSpecPodBased getIndexSpecPodBased() throws ClassCastException { + return (IndexSpecPodBased)super.getActualInstance(); } - IndexSpec indexSpec = (IndexSpec) o; - return Objects.equals(this.serverless, indexSpec.serverless) && - Objects.equals(this.pod, indexSpec.pod) && - Objects.equals(this.byoc, indexSpec.byoc); - } - - @Override - public int hashCode() { - return Objects.hash(serverless, pod, byoc); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - 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(); - } - - /** - * 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"; + /** + * Get the actual instance of `IndexSpecBYOC`. If the actual instance is not `IndexSpecBYOC`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IndexSpecBYOC` + * @throws ClassCastException if the instance is not `IndexSpecBYOC` + */ + public IndexSpecBYOC getIndexSpecBYOC() throws ClassCastException { + return (IndexSpecBYOC)super.getActualInstance(); } - 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(); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } /** * Validates the JSON Element and throws an exception if issues found @@ -193,60 +275,35 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to IndexSpec */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IndexSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IndexSpec is not found in the empty JSON string", IndexSpec.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexSpec.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IndexSpec` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `serverless` - if (jsonObj.get("serverless") != null && !jsonObj.get("serverless").isJsonNull()) { - ServerlessSpec.validateJsonElement(jsonObj.get("serverless")); - } - // validate the optional field `pod` - 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 { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexSpec.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IndexSpec' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IndexSpec.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IndexSpec value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IndexSpec read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with IndexSpecServerless + try { + IndexSpecServerless.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IndexSpecServerless failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IndexSpecPodBased + try { + IndexSpecPodBased.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IndexSpecPodBased failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IndexSpecBYOC + try { + IndexSpecBYOC.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IndexSpecBYOC failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for IndexSpec with oneOf schemas: IndexSpecBYOC, IndexSpecPodBased, IndexSpecServerless. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexSpecBYOC.java b/src/main/java/org/openapitools/db_control/client/model/IndexSpecBYOC.java new file mode 100644 index 00000000..927b85cc --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/IndexSpecBYOC.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ByocSpec; + +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; + +/** + * IndexSpecBYOC + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class IndexSpecBYOC { + public static final String SERIALIZED_NAME_BYOC = "byoc"; + @SerializedName(SERIALIZED_NAME_BYOC) + private ByocSpec byoc; + + public IndexSpecBYOC() { + } + + public IndexSpecBYOC byoc(ByocSpec byoc) { + + this.byoc = byoc; + return this; + } + + /** + * Get byoc + * @return byoc + **/ + @javax.annotation.Nonnull + public ByocSpec getByoc() { + return byoc; + } + + + public void setByoc(ByocSpec byoc) { + this.byoc = byoc; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexSpecBYOC indexSpecBYOC = (IndexSpecBYOC) o; + return Objects.equals(this.byoc, indexSpecBYOC.byoc); + } + + @Override + public int hashCode() { + return Objects.hash(byoc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexSpecBYOC {\n"); + sb.append(" byoc: ").append(toIndentedString(byoc)).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("byoc"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("byoc"); + } + + /** + * 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 IndexSpecBYOC + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndexSpecBYOC.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IndexSpecBYOC is not found in the empty JSON string", IndexSpecBYOC.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IndexSpecBYOC.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IndexSpecBYOC` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IndexSpecBYOC.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(); + // validate the required field `byoc` + ByocSpec.validateJsonElement(jsonObj.get("byoc")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexSpecBYOC.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexSpecBYOC' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IndexSpecBYOC.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexSpecBYOC value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndexSpecBYOC read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IndexSpecBYOC given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndexSpecBYOC + * @throws IOException if the JSON string is invalid with respect to IndexSpecBYOC + */ + public static IndexSpecBYOC fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexSpecBYOC.class); + } + + /** + * Convert an instance of IndexSpecBYOC 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/IndexSpecPodBased.java b/src/main/java/org/openapitools/db_control/client/model/IndexSpecPodBased.java new file mode 100644 index 00000000..15c1943d --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/IndexSpecPodBased.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.PodSpec; + +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; + +/** + * IndexSpecPodBased + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class IndexSpecPodBased { + public static final String SERIALIZED_NAME_POD = "pod"; + @SerializedName(SERIALIZED_NAME_POD) + private PodSpec pod; + + public IndexSpecPodBased() { + } + + public IndexSpecPodBased pod(PodSpec pod) { + + this.pod = pod; + return this; + } + + /** + * Get pod + * @return pod + **/ + @javax.annotation.Nonnull + public PodSpec getPod() { + return pod; + } + + + public void setPod(PodSpec pod) { + this.pod = pod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexSpecPodBased indexSpecPodBased = (IndexSpecPodBased) o; + return Objects.equals(this.pod, indexSpecPodBased.pod); + } + + @Override + public int hashCode() { + return Objects.hash(pod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexSpecPodBased {\n"); + sb.append(" pod: ").append(toIndentedString(pod)).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("pod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pod"); + } + + /** + * 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 IndexSpecPodBased + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndexSpecPodBased.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IndexSpecPodBased is not found in the empty JSON string", IndexSpecPodBased.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IndexSpecPodBased.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IndexSpecPodBased` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IndexSpecPodBased.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(); + // validate the required field `pod` + PodSpec.validateJsonElement(jsonObj.get("pod")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexSpecPodBased.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexSpecPodBased' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IndexSpecPodBased.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexSpecPodBased value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndexSpecPodBased read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IndexSpecPodBased given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndexSpecPodBased + * @throws IOException if the JSON string is invalid with respect to IndexSpecPodBased + */ + public static IndexSpecPodBased fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexSpecPodBased.class); + } + + /** + * Convert an instance of IndexSpecPodBased 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/IndexSpecServerless.java b/src/main/java/org/openapitools/db_control/client/model/IndexSpecServerless.java new file mode 100644 index 00000000..ecf275d0 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/IndexSpecServerless.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ServerlessSpec; + +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; + +/** + * IndexSpecServerless + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class IndexSpecServerless { + public static final String SERIALIZED_NAME_SERVERLESS = "serverless"; + @SerializedName(SERIALIZED_NAME_SERVERLESS) + private ServerlessSpec serverless; + + public IndexSpecServerless() { + } + + public IndexSpecServerless serverless(ServerlessSpec serverless) { + + this.serverless = serverless; + return this; + } + + /** + * Get serverless + * @return serverless + **/ + @javax.annotation.Nonnull + public ServerlessSpec getServerless() { + return serverless; + } + + + public void setServerless(ServerlessSpec serverless) { + this.serverless = serverless; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexSpecServerless indexSpecServerless = (IndexSpecServerless) o; + return Objects.equals(this.serverless, indexSpecServerless.serverless); + } + + @Override + public int hashCode() { + return Objects.hash(serverless); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexSpecServerless {\n"); + sb.append(" serverless: ").append(toIndentedString(serverless)).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("serverless"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("serverless"); + } + + /** + * 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 IndexSpecServerless + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndexSpecServerless.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IndexSpecServerless is not found in the empty JSON string", IndexSpecServerless.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IndexSpecServerless.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IndexSpecServerless` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IndexSpecServerless.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(); + // validate the required field `serverless` + ServerlessSpec.validateJsonElement(jsonObj.get("serverless")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexSpecServerless.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexSpecServerless' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IndexSpecServerless.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexSpecServerless value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndexSpecServerless read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IndexSpecServerless given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndexSpecServerless + * @throws IOException if the JSON string is invalid with respect to IndexSpecServerless + */ + public static IndexSpecServerless fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexSpecServerless.class); + } + + /** + * Convert an instance of IndexSpecServerless 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/ModelIndexEmbed.java b/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java index 42aa67ec..92141063 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,64 +49,15 @@ /** * The embedding model and document fields mapped to embedding inputs. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class ModelIndexEmbed { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) private String model; - /** - * The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If not specified, the metric will be defaulted according to the model. Cannot be updated once set. - */ - @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; + private String metric; public static final String SERIALIZED_NAME_DIMENSION = "dimension"; @SerializedName(SERIALIZED_NAME_DIMENSION) @@ -152,23 +103,23 @@ public void setModel(String model) { } - public ModelIndexEmbed metric(MetricEnum metric) { + public ModelIndexEmbed metric(String metric) { this.metric = metric; return this; } /** - * The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If not specified, the metric will be defaulted according to the model. Cannot be updated once set. + * The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If not specified, the metric will be defaulted according to the model. Cannot be updated once set. Possible values: `cosine`, `euclidean`, or `dotproduct`. * @return metric **/ @javax.annotation.Nullable - public MetricEnum getMetric() { + public String getMetric() { return metric; } - public void setMetric(MetricEnum metric) { + public void setMetric(String metric) { this.metric = metric; } 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 index 8d85c7c7..5892f2d9 100644 --- a/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.java +++ b/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * The pagination object that is returned with paginated responses. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class PaginationResponse { public static final String SERIALIZED_NAME_NEXT = "next"; @SerializedName(SERIALIZED_NAME_NEXT) 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 87c8414b..f752c5fb 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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 45f9956f..bedb59b9 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[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/ReadCapacity.java b/src/main/java/org/openapitools/db_control/client/model/ReadCapacity.java new file mode 100644 index 00000000..e374e426 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ReadCapacity.java @@ -0,0 +1,279 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ReadCapacityDedicatedConfig; +import org.openapitools.db_control.client.model.ReadCapacityDedicatedSpec; +import org.openapitools.db_control.client.model.ReadCapacityOnDemandSpec; + + + +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.db_control.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ReadCapacity extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ReadCapacity.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadCapacity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadCapacity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterReadCapacityOnDemandSpec = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityOnDemandSpec.class)); + final TypeAdapter adapterReadCapacityDedicatedSpec = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityDedicatedSpec.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadCapacity value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ReadCapacityOnDemandSpec` + if (value.getActualInstance() instanceof ReadCapacityOnDemandSpec) { + JsonElement element = adapterReadCapacityOnDemandSpec.toJsonTree((ReadCapacityOnDemandSpec)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ReadCapacityDedicatedSpec` + if (value.getActualInstance() instanceof ReadCapacityDedicatedSpec) { + JsonElement element = adapterReadCapacityDedicatedSpec.toJsonTree((ReadCapacityDedicatedSpec)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ReadCapacityDedicatedSpec, ReadCapacityOnDemandSpec"); + } + + @Override + public ReadCapacity read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ReadCapacityOnDemandSpec + try { + // validate the JSON object to see if any exception is thrown + ReadCapacityOnDemandSpec.validateJsonElement(jsonElement); + actualAdapter = adapterReadCapacityOnDemandSpec; + match++; + log.log(Level.FINER, "Input data matches schema 'ReadCapacityOnDemandSpec'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ReadCapacityOnDemandSpec failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ReadCapacityOnDemandSpec'", e); + } + // deserialize ReadCapacityDedicatedSpec + try { + // validate the JSON object to see if any exception is thrown + ReadCapacityDedicatedSpec.validateJsonElement(jsonElement); + actualAdapter = adapterReadCapacityDedicatedSpec; + match++; + log.log(Level.FINER, "Input data matches schema 'ReadCapacityDedicatedSpec'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ReadCapacityDedicatedSpec failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ReadCapacityDedicatedSpec'", e); + } + + if (match == 1) { + ReadCapacity ret = new ReadCapacity(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for ReadCapacity: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public ReadCapacity() { + super("oneOf", Boolean.FALSE); + } + + public ReadCapacity(ReadCapacityDedicatedSpec o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ReadCapacity(ReadCapacityOnDemandSpec o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ReadCapacityOnDemandSpec", ReadCapacityOnDemandSpec.class); + schemas.put("ReadCapacityDedicatedSpec", ReadCapacityDedicatedSpec.class); + } + + @Override + public Map> getSchemas() { + return ReadCapacity.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ReadCapacityDedicatedSpec, ReadCapacityOnDemandSpec + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ReadCapacityOnDemandSpec) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReadCapacityDedicatedSpec) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ReadCapacityDedicatedSpec, ReadCapacityOnDemandSpec"); + } + + /** + * Get the actual instance, which can be the following: + * ReadCapacityDedicatedSpec, ReadCapacityOnDemandSpec + * + * @return The actual instance (ReadCapacityDedicatedSpec, ReadCapacityOnDemandSpec) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ReadCapacityOnDemandSpec`. If the actual instance is not `ReadCapacityOnDemandSpec`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ReadCapacityOnDemandSpec` + * @throws ClassCastException if the instance is not `ReadCapacityOnDemandSpec` + */ + public ReadCapacityOnDemandSpec getReadCapacityOnDemandSpec() throws ClassCastException { + return (ReadCapacityOnDemandSpec)super.getActualInstance(); + } + /** + * Get the actual instance of `ReadCapacityDedicatedSpec`. If the actual instance is not `ReadCapacityDedicatedSpec`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ReadCapacityDedicatedSpec` + * @throws ClassCastException if the instance is not `ReadCapacityDedicatedSpec` + */ + public ReadCapacityDedicatedSpec getReadCapacityDedicatedSpec() throws ClassCastException { + return (ReadCapacityDedicatedSpec)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 ReadCapacity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReadCapacityOnDemandSpec + try { + ReadCapacityOnDemandSpec.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ReadCapacityOnDemandSpec failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ReadCapacityDedicatedSpec + try { + ReadCapacityDedicatedSpec.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ReadCapacityDedicatedSpec failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ReadCapacity with oneOf schemas: ReadCapacityDedicatedSpec, ReadCapacityOnDemandSpec. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of ReadCapacity given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadCapacity + * @throws IOException if the JSON string is invalid with respect to ReadCapacity + */ + public static ReadCapacity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadCapacity.class); + } + + /** + * Convert an instance of ReadCapacity 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/ReadCapacityDedicatedConfig.java b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityDedicatedConfig.java new file mode 100644 index 00000000..0a9499c7 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityDedicatedConfig.java @@ -0,0 +1,357 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ScalingConfigManual; + +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 for dedicated read capacity. See [this guide](https://docs.pinecone.io/guides/index-data/dedicated-read-nodes) for more details on how to configure dedicated read capacity. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ReadCapacityDedicatedConfig { + public static final String SERIALIZED_NAME_NODE_TYPE = "node_type"; + @SerializedName(SERIALIZED_NAME_NODE_TYPE) + private String nodeType; + + public static final String SERIALIZED_NAME_SCALING = "scaling"; + @SerializedName(SERIALIZED_NAME_SCALING) + private String scaling; + + public static final String SERIALIZED_NAME_MANUAL = "manual"; + @SerializedName(SERIALIZED_NAME_MANUAL) + private ScalingConfigManual manual; + + public ReadCapacityDedicatedConfig() { + } + + public ReadCapacityDedicatedConfig nodeType(String nodeType) { + + this.nodeType = nodeType; + return this; + } + + /** + * The type of machines to use. Available options: `b1` and `t1`. `t1` includes increased processing power and memory. + * @return nodeType + **/ + @javax.annotation.Nonnull + public String getNodeType() { + return nodeType; + } + + + public void setNodeType(String nodeType) { + this.nodeType = nodeType; + } + + + public ReadCapacityDedicatedConfig scaling(String scaling) { + + this.scaling = scaling; + return this; + } + + /** + * The type of scaling strategy to use. + * @return scaling + **/ + @javax.annotation.Nonnull + public String getScaling() { + return scaling; + } + + + public void setScaling(String scaling) { + this.scaling = scaling; + } + + + public ReadCapacityDedicatedConfig manual(ScalingConfigManual manual) { + + this.manual = manual; + return this; + } + + /** + * Get manual + * @return manual + **/ + @javax.annotation.Nullable + public ScalingConfigManual getManual() { + return manual; + } + + + public void setManual(ScalingConfigManual manual) { + this.manual = manual; + } + + /** + * 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 ReadCapacityDedicatedConfig instance itself + */ + public ReadCapacityDedicatedConfig 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; + } + ReadCapacityDedicatedConfig readCapacityDedicatedConfig = (ReadCapacityDedicatedConfig) o; + return Objects.equals(this.nodeType, readCapacityDedicatedConfig.nodeType) && + Objects.equals(this.scaling, readCapacityDedicatedConfig.scaling) && + Objects.equals(this.manual, readCapacityDedicatedConfig.manual)&& + Objects.equals(this.additionalProperties, readCapacityDedicatedConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(nodeType, scaling, manual, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadCapacityDedicatedConfig {\n"); + sb.append(" nodeType: ").append(toIndentedString(nodeType)).append("\n"); + sb.append(" scaling: ").append(toIndentedString(scaling)).append("\n"); + sb.append(" manual: ").append(toIndentedString(manual)).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("node_type"); + openapiFields.add("scaling"); + openapiFields.add("manual"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("node_type"); + openapiRequiredFields.add("scaling"); + } + + /** + * 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 ReadCapacityDedicatedConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadCapacityDedicatedConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadCapacityDedicatedConfig is not found in the empty JSON string", ReadCapacityDedicatedConfig.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadCapacityDedicatedConfig.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("node_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `node_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("node_type").toString())); + } + if (!jsonObj.get("scaling").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scaling` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaling").toString())); + } + // validate the optional field `manual` + if (jsonObj.get("manual") != null && !jsonObj.get("manual").isJsonNull()) { + ScalingConfigManual.validateJsonElement(jsonObj.get("manual")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadCapacityDedicatedConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadCapacityDedicatedConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityDedicatedConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadCapacityDedicatedConfig 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 ReadCapacityDedicatedConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReadCapacityDedicatedConfig 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 ReadCapacityDedicatedConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadCapacityDedicatedConfig + * @throws IOException if the JSON string is invalid with respect to ReadCapacityDedicatedConfig + */ + public static ReadCapacityDedicatedConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadCapacityDedicatedConfig.class); + } + + /** + * Convert an instance of ReadCapacityDedicatedConfig 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/ReadCapacityDedicatedSpec.java b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityDedicatedSpec.java new file mode 100644 index 00000000..f94430a8 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityDedicatedSpec.java @@ -0,0 +1,324 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ReadCapacityDedicatedConfig; + +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; + +/** + * ReadCapacityDedicatedSpec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ReadCapacityDedicatedSpec { + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private String mode; + + public static final String SERIALIZED_NAME_DEDICATED = "dedicated"; + @SerializedName(SERIALIZED_NAME_DEDICATED) + private ReadCapacityDedicatedConfig dedicated; + + public ReadCapacityDedicatedSpec() { + } + + public ReadCapacityDedicatedSpec mode(String mode) { + + this.mode = mode; + return this; + } + + /** + * The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + * @return mode + **/ + @javax.annotation.Nonnull + public String getMode() { + return mode; + } + + + public void setMode(String mode) { + this.mode = mode; + } + + + public ReadCapacityDedicatedSpec dedicated(ReadCapacityDedicatedConfig dedicated) { + + this.dedicated = dedicated; + return this; + } + + /** + * Get dedicated + * @return dedicated + **/ + @javax.annotation.Nonnull + public ReadCapacityDedicatedConfig getDedicated() { + return dedicated; + } + + + public void setDedicated(ReadCapacityDedicatedConfig dedicated) { + this.dedicated = dedicated; + } + + /** + * 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 ReadCapacityDedicatedSpec instance itself + */ + public ReadCapacityDedicatedSpec 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; + } + ReadCapacityDedicatedSpec readCapacityDedicatedSpec = (ReadCapacityDedicatedSpec) o; + return Objects.equals(this.mode, readCapacityDedicatedSpec.mode) && + Objects.equals(this.dedicated, readCapacityDedicatedSpec.dedicated)&& + Objects.equals(this.additionalProperties, readCapacityDedicatedSpec.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(mode, dedicated, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadCapacityDedicatedSpec {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" dedicated: ").append(toIndentedString(dedicated)).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("mode"); + openapiFields.add("dedicated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("mode"); + openapiRequiredFields.add("dedicated"); + } + + /** + * 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 ReadCapacityDedicatedSpec + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadCapacityDedicatedSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadCapacityDedicatedSpec is not found in the empty JSON string", ReadCapacityDedicatedSpec.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadCapacityDedicatedSpec.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("mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mode").toString())); + } + // validate the required field `dedicated` + ReadCapacityDedicatedConfig.validateJsonElement(jsonObj.get("dedicated")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadCapacityDedicatedSpec.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadCapacityDedicatedSpec' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityDedicatedSpec.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadCapacityDedicatedSpec 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 ReadCapacityDedicatedSpec read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReadCapacityDedicatedSpec 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 ReadCapacityDedicatedSpec given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadCapacityDedicatedSpec + * @throws IOException if the JSON string is invalid with respect to ReadCapacityDedicatedSpec + */ + public static ReadCapacityDedicatedSpec fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadCapacityDedicatedSpec.class); + } + + /** + * Convert an instance of ReadCapacityDedicatedSpec 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/ReadCapacityDedicatedSpecResponse.java b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityDedicatedSpecResponse.java new file mode 100644 index 00000000..978fc991 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityDedicatedSpecResponse.java @@ -0,0 +1,280 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ReadCapacityDedicatedConfig; +import org.openapitools.db_control.client.model.ReadCapacityStatus; + +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; + +/** + * ReadCapacityDedicatedSpecResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ReadCapacityDedicatedSpecResponse { + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private String mode; + + public static final String SERIALIZED_NAME_DEDICATED = "dedicated"; + @SerializedName(SERIALIZED_NAME_DEDICATED) + private ReadCapacityDedicatedConfig dedicated; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private ReadCapacityStatus status; + + public ReadCapacityDedicatedSpecResponse() { + } + + public ReadCapacityDedicatedSpecResponse mode(String mode) { + + this.mode = mode; + return this; + } + + /** + * The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + * @return mode + **/ + @javax.annotation.Nonnull + public String getMode() { + return mode; + } + + + public void setMode(String mode) { + this.mode = mode; + } + + + public ReadCapacityDedicatedSpecResponse dedicated(ReadCapacityDedicatedConfig dedicated) { + + this.dedicated = dedicated; + return this; + } + + /** + * Get dedicated + * @return dedicated + **/ + @javax.annotation.Nonnull + public ReadCapacityDedicatedConfig getDedicated() { + return dedicated; + } + + + public void setDedicated(ReadCapacityDedicatedConfig dedicated) { + this.dedicated = dedicated; + } + + + public ReadCapacityDedicatedSpecResponse status(ReadCapacityStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public ReadCapacityStatus getStatus() { + return status; + } + + + public void setStatus(ReadCapacityStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadCapacityDedicatedSpecResponse readCapacityDedicatedSpecResponse = (ReadCapacityDedicatedSpecResponse) o; + return Objects.equals(this.mode, readCapacityDedicatedSpecResponse.mode) && + Objects.equals(this.dedicated, readCapacityDedicatedSpecResponse.dedicated) && + Objects.equals(this.status, readCapacityDedicatedSpecResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(mode, dedicated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadCapacityDedicatedSpecResponse {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" dedicated: ").append(toIndentedString(dedicated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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("mode"); + openapiFields.add("dedicated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("mode"); + openapiRequiredFields.add("dedicated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReadCapacityDedicatedSpecResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadCapacityDedicatedSpecResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadCapacityDedicatedSpecResponse is not found in the empty JSON string", ReadCapacityDedicatedSpecResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReadCapacityDedicatedSpecResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadCapacityDedicatedSpecResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadCapacityDedicatedSpecResponse.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("mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mode").toString())); + } + // validate the required field `dedicated` + ReadCapacityDedicatedConfig.validateJsonElement(jsonObj.get("dedicated")); + // validate the required field `status` + ReadCapacityStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadCapacityDedicatedSpecResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadCapacityDedicatedSpecResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityDedicatedSpecResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadCapacityDedicatedSpecResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadCapacityDedicatedSpecResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReadCapacityDedicatedSpecResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadCapacityDedicatedSpecResponse + * @throws IOException if the JSON string is invalid with respect to ReadCapacityDedicatedSpecResponse + */ + public static ReadCapacityDedicatedSpecResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadCapacityDedicatedSpecResponse.class); + } + + /** + * Convert an instance of ReadCapacityDedicatedSpecResponse 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/ReadCapacityOnDemandSpec.java b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityOnDemandSpec.java new file mode 100644 index 00000000..901f37fc --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityOnDemandSpec.java @@ -0,0 +1,216 @@ +/* + * 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-10 + * 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; + +/** + * ReadCapacityOnDemandSpec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ReadCapacityOnDemandSpec { + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private String mode; + + public ReadCapacityOnDemandSpec() { + } + + public ReadCapacityOnDemandSpec mode(String mode) { + + this.mode = mode; + return this; + } + + /** + * The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + * @return mode + **/ + @javax.annotation.Nonnull + public String getMode() { + return mode; + } + + + public void setMode(String mode) { + this.mode = mode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadCapacityOnDemandSpec readCapacityOnDemandSpec = (ReadCapacityOnDemandSpec) o; + return Objects.equals(this.mode, readCapacityOnDemandSpec.mode); + } + + @Override + public int hashCode() { + return Objects.hash(mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadCapacityOnDemandSpec {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).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("mode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("mode"); + } + + /** + * 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 ReadCapacityOnDemandSpec + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadCapacityOnDemandSpec.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadCapacityOnDemandSpec is not found in the empty JSON string", ReadCapacityOnDemandSpec.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReadCapacityOnDemandSpec.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadCapacityOnDemandSpec` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadCapacityOnDemandSpec.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("mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadCapacityOnDemandSpec.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadCapacityOnDemandSpec' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityOnDemandSpec.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadCapacityOnDemandSpec value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadCapacityOnDemandSpec read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReadCapacityOnDemandSpec given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadCapacityOnDemandSpec + * @throws IOException if the JSON string is invalid with respect to ReadCapacityOnDemandSpec + */ + public static ReadCapacityOnDemandSpec fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadCapacityOnDemandSpec.class); + } + + /** + * Convert an instance of ReadCapacityOnDemandSpec 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/ReadCapacityOnDemandSpecResponse.java b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityOnDemandSpecResponse.java new file mode 100644 index 00000000..071dd835 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityOnDemandSpecResponse.java @@ -0,0 +1,248 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ReadCapacityStatus; + +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; + +/** + * ReadCapacityOnDemandSpecResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ReadCapacityOnDemandSpecResponse { + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private String mode; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private ReadCapacityStatus status; + + public ReadCapacityOnDemandSpecResponse() { + } + + public ReadCapacityOnDemandSpecResponse mode(String mode) { + + this.mode = mode; + return this; + } + + /** + * The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + * @return mode + **/ + @javax.annotation.Nonnull + public String getMode() { + return mode; + } + + + public void setMode(String mode) { + this.mode = mode; + } + + + public ReadCapacityOnDemandSpecResponse status(ReadCapacityStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public ReadCapacityStatus getStatus() { + return status; + } + + + public void setStatus(ReadCapacityStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadCapacityOnDemandSpecResponse readCapacityOnDemandSpecResponse = (ReadCapacityOnDemandSpecResponse) o; + return Objects.equals(this.mode, readCapacityOnDemandSpecResponse.mode) && + Objects.equals(this.status, readCapacityOnDemandSpecResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(mode, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadCapacityOnDemandSpecResponse {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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("mode"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("mode"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReadCapacityOnDemandSpecResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadCapacityOnDemandSpecResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadCapacityOnDemandSpecResponse is not found in the empty JSON string", ReadCapacityOnDemandSpecResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReadCapacityOnDemandSpecResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadCapacityOnDemandSpecResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadCapacityOnDemandSpecResponse.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("mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mode").toString())); + } + // validate the required field `status` + ReadCapacityStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadCapacityOnDemandSpecResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadCapacityOnDemandSpecResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityOnDemandSpecResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadCapacityOnDemandSpecResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadCapacityOnDemandSpecResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReadCapacityOnDemandSpecResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadCapacityOnDemandSpecResponse + * @throws IOException if the JSON string is invalid with respect to ReadCapacityOnDemandSpecResponse + */ + public static ReadCapacityOnDemandSpecResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadCapacityOnDemandSpecResponse.class); + } + + /** + * Convert an instance of ReadCapacityOnDemandSpecResponse 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/ReadCapacityResponse.java b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityResponse.java new file mode 100644 index 00000000..245c67a2 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityResponse.java @@ -0,0 +1,280 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.ReadCapacityDedicatedConfig; +import org.openapitools.db_control.client.model.ReadCapacityDedicatedSpecResponse; +import org.openapitools.db_control.client.model.ReadCapacityOnDemandSpecResponse; +import org.openapitools.db_control.client.model.ReadCapacityStatus; + + + +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.db_control.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ReadCapacityResponse extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ReadCapacityResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadCapacityResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadCapacityResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterReadCapacityOnDemandSpecResponse = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityOnDemandSpecResponse.class)); + final TypeAdapter adapterReadCapacityDedicatedSpecResponse = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityDedicatedSpecResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadCapacityResponse value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ReadCapacityOnDemandSpecResponse` + if (value.getActualInstance() instanceof ReadCapacityOnDemandSpecResponse) { + JsonElement element = adapterReadCapacityOnDemandSpecResponse.toJsonTree((ReadCapacityOnDemandSpecResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ReadCapacityDedicatedSpecResponse` + if (value.getActualInstance() instanceof ReadCapacityDedicatedSpecResponse) { + JsonElement element = adapterReadCapacityDedicatedSpecResponse.toJsonTree((ReadCapacityDedicatedSpecResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ReadCapacityDedicatedSpecResponse, ReadCapacityOnDemandSpecResponse"); + } + + @Override + public ReadCapacityResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ReadCapacityOnDemandSpecResponse + try { + // validate the JSON object to see if any exception is thrown + ReadCapacityOnDemandSpecResponse.validateJsonElement(jsonElement); + actualAdapter = adapterReadCapacityOnDemandSpecResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'ReadCapacityOnDemandSpecResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ReadCapacityOnDemandSpecResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ReadCapacityOnDemandSpecResponse'", e); + } + // deserialize ReadCapacityDedicatedSpecResponse + try { + // validate the JSON object to see if any exception is thrown + ReadCapacityDedicatedSpecResponse.validateJsonElement(jsonElement); + actualAdapter = adapterReadCapacityDedicatedSpecResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'ReadCapacityDedicatedSpecResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ReadCapacityDedicatedSpecResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ReadCapacityDedicatedSpecResponse'", e); + } + + if (match == 1) { + ReadCapacityResponse ret = new ReadCapacityResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for ReadCapacityResponse: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public ReadCapacityResponse() { + super("oneOf", Boolean.FALSE); + } + + public ReadCapacityResponse(ReadCapacityDedicatedSpecResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ReadCapacityResponse(ReadCapacityOnDemandSpecResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ReadCapacityOnDemandSpecResponse", ReadCapacityOnDemandSpecResponse.class); + schemas.put("ReadCapacityDedicatedSpecResponse", ReadCapacityDedicatedSpecResponse.class); + } + + @Override + public Map> getSchemas() { + return ReadCapacityResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ReadCapacityDedicatedSpecResponse, ReadCapacityOnDemandSpecResponse + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ReadCapacityOnDemandSpecResponse) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReadCapacityDedicatedSpecResponse) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ReadCapacityDedicatedSpecResponse, ReadCapacityOnDemandSpecResponse"); + } + + /** + * Get the actual instance, which can be the following: + * ReadCapacityDedicatedSpecResponse, ReadCapacityOnDemandSpecResponse + * + * @return The actual instance (ReadCapacityDedicatedSpecResponse, ReadCapacityOnDemandSpecResponse) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ReadCapacityOnDemandSpecResponse`. If the actual instance is not `ReadCapacityOnDemandSpecResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ReadCapacityOnDemandSpecResponse` + * @throws ClassCastException if the instance is not `ReadCapacityOnDemandSpecResponse` + */ + public ReadCapacityOnDemandSpecResponse getReadCapacityOnDemandSpecResponse() throws ClassCastException { + return (ReadCapacityOnDemandSpecResponse)super.getActualInstance(); + } + /** + * Get the actual instance of `ReadCapacityDedicatedSpecResponse`. If the actual instance is not `ReadCapacityDedicatedSpecResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ReadCapacityDedicatedSpecResponse` + * @throws ClassCastException if the instance is not `ReadCapacityDedicatedSpecResponse` + */ + public ReadCapacityDedicatedSpecResponse getReadCapacityDedicatedSpecResponse() throws ClassCastException { + return (ReadCapacityDedicatedSpecResponse)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 ReadCapacityResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReadCapacityOnDemandSpecResponse + try { + ReadCapacityOnDemandSpecResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ReadCapacityOnDemandSpecResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ReadCapacityDedicatedSpecResponse + try { + ReadCapacityDedicatedSpecResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ReadCapacityDedicatedSpecResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ReadCapacityResponse with oneOf schemas: ReadCapacityDedicatedSpecResponse, ReadCapacityOnDemandSpecResponse. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of ReadCapacityResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadCapacityResponse + * @throws IOException if the JSON string is invalid with respect to ReadCapacityResponse + */ + public static ReadCapacityResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadCapacityResponse.class); + } + + /** + * Convert an instance of ReadCapacityResponse 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/ReadCapacityStatus.java b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityStatus.java new file mode 100644 index 00000000..20f4eae1 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ReadCapacityStatus.java @@ -0,0 +1,379 @@ +/* + * 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-10 + * 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 current status of factors affecting the read capacity of a serverless index + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ReadCapacityStatus { + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_CURRENT_REPLICAS = "current_replicas"; + @SerializedName(SERIALIZED_NAME_CURRENT_REPLICAS) + private Integer currentReplicas; + + public static final String SERIALIZED_NAME_CURRENT_SHARDS = "current_shards"; + @SerializedName(SERIALIZED_NAME_CURRENT_SHARDS) + private Integer currentShards; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "error_message"; + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + private String errorMessage; + + public ReadCapacityStatus() { + } + + public ReadCapacityStatus state(String state) { + + this.state = state; + return this; + } + + /** + * The `state` describes the overall status of factors relating to the read capacity of an index. Available values: - `Ready` is the state most of the time - `Scaling` if the number of replicas or shards has been recently updated by calling the [configure index endpoint](https://docs.pinecone.io/reference/api/2025-10/control-plane/configure_index) - `Migrating` if the index is being migrated to a new `node_type` - `Error` if there is an error with the read capacity configuration. In that case, see `error_message` for more details. + * @return state + **/ + @javax.annotation.Nonnull + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public ReadCapacityStatus currentReplicas(Integer currentReplicas) { + + this.currentReplicas = currentReplicas; + return this; + } + + /** + * The number of replicas. Each replica has dedicated compute resources and data storage. Increasing this number will increase the total throughput of the index. + * @return currentReplicas + **/ + @javax.annotation.Nullable + public Integer getCurrentReplicas() { + return currentReplicas; + } + + + public void setCurrentReplicas(Integer currentReplicas) { + this.currentReplicas = currentReplicas; + } + + + public ReadCapacityStatus currentShards(Integer currentShards) { + + this.currentShards = currentShards; + return this; + } + + /** + * The number of shards. Each shard has dedicated storage. Increasing shards alleiviates index fullness. + * @return currentShards + **/ + @javax.annotation.Nullable + public Integer getCurrentShards() { + return currentShards; + } + + + public void setCurrentShards(Integer currentShards) { + this.currentShards = currentShards; + } + + + public ReadCapacityStatus errorMessage(String errorMessage) { + + this.errorMessage = errorMessage; + return this; + } + + /** + * An optional error message indicating any issues with your read capacity configuration + * @return errorMessage + **/ + @javax.annotation.Nullable + public String getErrorMessage() { + return errorMessage; + } + + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReadCapacityStatus instance itself + */ + public ReadCapacityStatus 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; + } + ReadCapacityStatus readCapacityStatus = (ReadCapacityStatus) o; + return Objects.equals(this.state, readCapacityStatus.state) && + Objects.equals(this.currentReplicas, readCapacityStatus.currentReplicas) && + Objects.equals(this.currentShards, readCapacityStatus.currentShards) && + Objects.equals(this.errorMessage, readCapacityStatus.errorMessage)&& + Objects.equals(this.additionalProperties, readCapacityStatus.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(state, currentReplicas, currentShards, errorMessage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadCapacityStatus {\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" currentReplicas: ").append(toIndentedString(currentReplicas)).append("\n"); + sb.append(" currentShards: ").append(toIndentedString(currentShards)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + 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("state"); + openapiFields.add("current_replicas"); + openapiFields.add("current_shards"); + openapiFields.add("error_message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("state"); + } + + /** + * 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 ReadCapacityStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadCapacityStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadCapacityStatus is not found in the empty JSON string", ReadCapacityStatus.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadCapacityStatus.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("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("error_message") != null && !jsonObj.get("error_message").isJsonNull()) && !jsonObj.get("error_message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadCapacityStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadCapacityStatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadCapacityStatus.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadCapacityStatus 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 ReadCapacityStatus read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReadCapacityStatus 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 ReadCapacityStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadCapacityStatus + * @throws IOException if the JSON string is invalid with respect to ReadCapacityStatus + */ + public static ReadCapacityStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadCapacityStatus.class); + } + + /** + * Convert an instance of ReadCapacityStatus 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/RestoreJobList.java b/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java index 6ae2a72f..cce513ee 100644 --- a/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java +++ b/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * The list of restore jobs that exist in the project. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class RestoreJobList { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -81,7 +81,7 @@ public RestoreJobList addDataItem(RestoreJobModel dataItem) { } /** - * Get data + * List of restore job objects * @return data **/ @javax.annotation.Nonnull 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 index d2822de9..2c97028c 100644 --- a/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.java +++ b/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * The RestoreJobModel describes the status of a restore job. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class RestoreJobModel { public static final String SERIALIZED_NAME_RESTORE_JOB_ID = "restore_job_id"; @SerializedName(SERIALIZED_NAME_RESTORE_JOB_ID) diff --git a/src/main/java/org/openapitools/db_control/client/model/ScalingConfigManual.java b/src/main/java/org/openapitools/db_control/client/model/ScalingConfigManual.java new file mode 100644 index 00000000..7e4835cd --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ScalingConfigManual.java @@ -0,0 +1,320 @@ +/* + * 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-10 + * 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 config to use for manual read capacity scaling. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ScalingConfigManual { + public static final String SERIALIZED_NAME_REPLICAS = "replicas"; + @SerializedName(SERIALIZED_NAME_REPLICAS) + private Integer replicas; + + public static final String SERIALIZED_NAME_SHARDS = "shards"; + @SerializedName(SERIALIZED_NAME_SHARDS) + private Integer shards; + + public ScalingConfigManual() { + } + + public ScalingConfigManual replicas(Integer replicas) { + + this.replicas = replicas; + return this; + } + + /** + * The number of replicas to use. Replicas duplicate the compute resources and data of an index, allowing higher query throughput and availability. Setting replicas to 0 disables the index but can be used to reduce costs while usage is paused. + * minimum: 0 + * @return replicas + **/ + @javax.annotation.Nonnull + public Integer getReplicas() { + return replicas; + } + + + public void setReplicas(Integer replicas) { + this.replicas = replicas; + } + + + public ScalingConfigManual shards(Integer shards) { + + this.shards = shards; + return this; + } + + /** + * The number of shards to use. Shards determine the storage capacity of an index, with each shard providing 250 GB of storage. + * minimum: 1 + * @return shards + **/ + @javax.annotation.Nonnull + public Integer getShards() { + return shards; + } + + + public void setShards(Integer shards) { + this.shards = shards; + } + + /** + * 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 ScalingConfigManual instance itself + */ + public ScalingConfigManual 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; + } + ScalingConfigManual scalingConfigManual = (ScalingConfigManual) o; + return Objects.equals(this.replicas, scalingConfigManual.replicas) && + Objects.equals(this.shards, scalingConfigManual.shards)&& + Objects.equals(this.additionalProperties, scalingConfigManual.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(replicas, shards, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScalingConfigManual {\n"); + sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n"); + sb.append(" shards: ").append(toIndentedString(shards)).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("replicas"); + openapiFields.add("shards"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("replicas"); + openapiRequiredFields.add("shards"); + } + + /** + * 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 ScalingConfigManual + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ScalingConfigManual.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ScalingConfigManual is not found in the empty JSON string", ScalingConfigManual.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ScalingConfigManual.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScalingConfigManual.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScalingConfigManual' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ScalingConfigManual.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ScalingConfigManual 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 ScalingConfigManual read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ScalingConfigManual 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 ScalingConfigManual given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScalingConfigManual + * @throws IOException if the JSON string is invalid with respect to ScalingConfigManual + */ + public static ScalingConfigManual fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScalingConfigManual.class); + } + + /** + * Convert an instance of ScalingConfigManual 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 3eca9021..a156ce27 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,6 +21,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; +import org.openapitools.db_control.client.model.BackupModelSchema; +import org.openapitools.db_control.client.model.ReadCapacity; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -49,85 +51,48 @@ /** * Configuration needed to deploy a serverless index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") public class ServerlessSpec { - /** - * The public cloud where you would like your index hosted. - */ - @JsonAdapter(CloudEnum.Adapter.class) - public enum CloudEnum { - GCP("gcp"), - - AWS("aws"), - - AZURE("azure"); - - private String value; - - CloudEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CloudEnum fromValue(String value) { - for (CloudEnum b : CloudEnum.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 CloudEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CloudEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CloudEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_CLOUD = "cloud"; @SerializedName(SERIALIZED_NAME_CLOUD) - private CloudEnum 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_READ_CAPACITY = "read_capacity"; + @SerializedName(SERIALIZED_NAME_READ_CAPACITY) + private ReadCapacity readCapacity; + + public static final String SERIALIZED_NAME_SOURCE_COLLECTION = "source_collection"; + @SerializedName(SERIALIZED_NAME_SOURCE_COLLECTION) + private String sourceCollection; + + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + private BackupModelSchema schema; + public ServerlessSpec() { } - public ServerlessSpec cloud(CloudEnum cloud) { + public ServerlessSpec cloud(String cloud) { this.cloud = cloud; return this; } /** - * The public cloud where you would like your index hosted. + * The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. * @return cloud **/ @javax.annotation.Nonnull - public CloudEnum getCloud() { + public String getCloud() { return cloud; } - public void setCloud(CloudEnum cloud) { + public void setCloud(String cloud) { this.cloud = cloud; } @@ -152,6 +117,69 @@ public void setRegion(String region) { this.region = region; } + + public ServerlessSpec readCapacity(ReadCapacity readCapacity) { + + this.readCapacity = readCapacity; + return this; + } + + /** + * Get readCapacity + * @return readCapacity + **/ + @javax.annotation.Nullable + public ReadCapacity getReadCapacity() { + return readCapacity; + } + + + public void setReadCapacity(ReadCapacity readCapacity) { + this.readCapacity = readCapacity; + } + + + public ServerlessSpec sourceCollection(String sourceCollection) { + + this.sourceCollection = sourceCollection; + return this; + } + + /** + * The name of the collection to be used as the source for the index. + * @return sourceCollection + **/ + @javax.annotation.Nullable + public String getSourceCollection() { + return sourceCollection; + } + + + public void setSourceCollection(String sourceCollection) { + this.sourceCollection = sourceCollection; + } + + + public ServerlessSpec schema(BackupModelSchema schema) { + + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + **/ + @javax.annotation.Nullable + public BackupModelSchema getSchema() { + return schema; + } + + + public void setSchema(BackupModelSchema schema) { + this.schema = schema; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -208,13 +236,16 @@ public boolean equals(Object o) { } ServerlessSpec serverlessSpec = (ServerlessSpec) o; return Objects.equals(this.cloud, serverlessSpec.cloud) && - Objects.equals(this.region, serverlessSpec.region)&& + Objects.equals(this.region, serverlessSpec.region) && + Objects.equals(this.readCapacity, serverlessSpec.readCapacity) && + Objects.equals(this.sourceCollection, serverlessSpec.sourceCollection) && + Objects.equals(this.schema, serverlessSpec.schema)&& Objects.equals(this.additionalProperties, serverlessSpec.additionalProperties); } @Override public int hashCode() { - return Objects.hash(cloud, region, additionalProperties); + return Objects.hash(cloud, region, readCapacity, sourceCollection, schema, additionalProperties); } @Override @@ -223,6 +254,9 @@ public String toString() { sb.append("class ServerlessSpec {\n"); sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" readCapacity: ").append(toIndentedString(readCapacity)).append("\n"); + sb.append(" sourceCollection: ").append(toIndentedString(sourceCollection)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -248,6 +282,9 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("cloud"); openapiFields.add("region"); + openapiFields.add("read_capacity"); + openapiFields.add("source_collection"); + openapiFields.add("schema"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -281,6 +318,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } + // validate the optional field `read_capacity` + if (jsonObj.get("read_capacity") != null && !jsonObj.get("read_capacity").isJsonNull()) { + ReadCapacity.validateJsonElement(jsonObj.get("read_capacity")); + } + if ((jsonObj.get("source_collection") != null && !jsonObj.get("source_collection").isJsonNull()) && !jsonObj.get("source_collection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source_collection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_collection").toString())); + } + // validate the optional field `schema` + if (jsonObj.get("schema") != null && !jsonObj.get("schema").isJsonNull()) { + BackupModelSchema.validateJsonElement(jsonObj.get("schema")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/org/openapitools/db_control/client/model/ServerlessSpecResponse.java b/src/main/java/org/openapitools/db_control/client/model/ServerlessSpecResponse.java new file mode 100644 index 00000000..cbd7b860 --- /dev/null +++ b/src/main/java/org/openapitools/db_control/client/model/ServerlessSpecResponse.java @@ -0,0 +1,420 @@ +/* + * 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-10 + * 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 org.openapitools.db_control.client.model.BackupModelSchema; +import org.openapitools.db_control.client.model.ReadCapacityResponse; + +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 a serverless index. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:29.716713Z[Etc/UTC]") +public class ServerlessSpecResponse { + 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_READ_CAPACITY = "read_capacity"; + @SerializedName(SERIALIZED_NAME_READ_CAPACITY) + private ReadCapacityResponse readCapacity; + + public static final String SERIALIZED_NAME_SOURCE_COLLECTION = "source_collection"; + @SerializedName(SERIALIZED_NAME_SOURCE_COLLECTION) + private String sourceCollection; + + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + private BackupModelSchema schema; + + public ServerlessSpecResponse() { + } + + public ServerlessSpecResponse cloud(String cloud) { + + this.cloud = cloud; + return this; + } + + /** + * The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. + * @return cloud + **/ + @javax.annotation.Nonnull + public String getCloud() { + return cloud; + } + + + public void setCloud(String cloud) { + this.cloud = cloud; + } + + + public ServerlessSpecResponse region(String region) { + + this.region = region; + return this; + } + + /** + * The region where you would like your index to be created. + * @return region + **/ + @javax.annotation.Nonnull + public String getRegion() { + return region; + } + + + public void setRegion(String region) { + this.region = region; + } + + + public ServerlessSpecResponse readCapacity(ReadCapacityResponse readCapacity) { + + this.readCapacity = readCapacity; + return this; + } + + /** + * Get readCapacity + * @return readCapacity + **/ + @javax.annotation.Nonnull + public ReadCapacityResponse getReadCapacity() { + return readCapacity; + } + + + public void setReadCapacity(ReadCapacityResponse readCapacity) { + this.readCapacity = readCapacity; + } + + + public ServerlessSpecResponse sourceCollection(String sourceCollection) { + + this.sourceCollection = sourceCollection; + return this; + } + + /** + * The name of the collection to be used as the source for the index. + * @return sourceCollection + **/ + @javax.annotation.Nullable + public String getSourceCollection() { + return sourceCollection; + } + + + public void setSourceCollection(String sourceCollection) { + this.sourceCollection = sourceCollection; + } + + + public ServerlessSpecResponse schema(BackupModelSchema schema) { + + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + **/ + @javax.annotation.Nullable + public BackupModelSchema getSchema() { + return schema; + } + + + public void setSchema(BackupModelSchema schema) { + this.schema = schema; + } + + /** + * 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 ServerlessSpecResponse instance itself + */ + public ServerlessSpecResponse 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; + } + ServerlessSpecResponse serverlessSpecResponse = (ServerlessSpecResponse) o; + return Objects.equals(this.cloud, serverlessSpecResponse.cloud) && + Objects.equals(this.region, serverlessSpecResponse.region) && + Objects.equals(this.readCapacity, serverlessSpecResponse.readCapacity) && + Objects.equals(this.sourceCollection, serverlessSpecResponse.sourceCollection) && + Objects.equals(this.schema, serverlessSpecResponse.schema)&& + Objects.equals(this.additionalProperties, serverlessSpecResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cloud, region, readCapacity, sourceCollection, schema, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerlessSpecResponse {\n"); + sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" readCapacity: ").append(toIndentedString(readCapacity)).append("\n"); + sb.append(" sourceCollection: ").append(toIndentedString(sourceCollection)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).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("cloud"); + openapiFields.add("region"); + openapiFields.add("read_capacity"); + openapiFields.add("source_collection"); + openapiFields.add("schema"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cloud"); + openapiRequiredFields.add("region"); + openapiRequiredFields.add("read_capacity"); + } + + /** + * 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 ServerlessSpecResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ServerlessSpecResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ServerlessSpecResponse is not found in the empty JSON string", ServerlessSpecResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ServerlessSpecResponse.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("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())); + } + // validate the required field `read_capacity` + ReadCapacityResponse.validateJsonElement(jsonObj.get("read_capacity")); + if ((jsonObj.get("source_collection") != null && !jsonObj.get("source_collection").isJsonNull()) && !jsonObj.get("source_collection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source_collection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_collection").toString())); + } + // validate the optional field `schema` + if (jsonObj.get("schema") != null && !jsonObj.get("schema").isJsonNull()) { + BackupModelSchema.validateJsonElement(jsonObj.get("schema")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServerlessSpecResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServerlessSpecResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ServerlessSpecResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ServerlessSpecResponse 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 ServerlessSpecResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ServerlessSpecResponse 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 ServerlessSpecResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServerlessSpecResponse + * @throws IOException if the JSON string is invalid with respect to ServerlessSpecResponse + */ + public static ServerlessSpecResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServerlessSpecResponse.class); + } + + /** + * Convert an instance of ServerlessSpecResponse 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/ApiCallback.java b/src/main/java/org/openapitools/db_data/client/ApiCallback.java index 05886e4f..cd004fbc 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-04 + * The version of the OpenAPI document: 2025-10 * 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 040ef065..f14f615d 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-04 + * The version of the OpenAPI document: 2025-10 * 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-04/java"); + setUserAgent("OpenAPI-Generator/2025-10/java"); authentications = new HashMap(); } 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 58a6e069..1b826d82 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 c1afedb0..e0b73f52 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-04 + * The version of the OpenAPI document: 2025-10 * 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 39f15c8e..4a8c95ed 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class Configuration { - public static final String VERSION = "2025-04"; + public static final String VERSION = "2025-10"; 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 e6e440fe..4be6e59e 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-04 + * The version of the OpenAPI document: 2025-10 * 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 87ed6597..cdba8f72 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,8 +93,13 @@ 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_data.client.model.CreateNamespaceRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.CreateNamespaceRequestSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.CreateNamespaceRequestSchemaFieldsValue.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.DeleteRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.DescribeIndexStatsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.FetchByMetadataRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.FetchByMetadataResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.FetchResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.Hit.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.ImportErrorMode.CustomTypeAdapterFactory()); @@ -105,6 +110,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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.NamespaceDescriptionIndexedFields.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()); @@ -113,6 +119,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.QueryVector.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.RpcStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.ScoredVector.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SearchMatchTerms.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SearchRecordsRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SearchRecordsRequestQuery.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SearchRecordsRequestRerank.CustomTypeAdapterFactory()); @@ -120,12 +127,12 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SearchRecordsResponseResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SearchRecordsVector.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SearchUsage.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SearchVector.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SingleQueryResults.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.SparseValues.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.StartImportRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.StartImportResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.UpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.UpdateResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.UpsertRecord.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.UpsertRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_data.client.model.UpsertResponse.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 5745c844..b369e8aa 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 31235827..1e59780e 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-04 + * The version of the OpenAPI document: 2025-10 * 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 968e13ec..4409969a 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-04 + * The version of the OpenAPI document: 2025-10 * 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 ccebcb9a..f67c026d 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 e0b0dcad..6516f38d 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -78,6 +78,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for cancelBulkImport + * @param xPineconeApiVersion Required date-based version header (required) * @param id Unique identifier for the import operation. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -91,7 +92,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 5XX An unexpected error response. - */ - public okhttp3.Call cancelBulkImportCall(String id, final ApiCallback _callback) throws ApiException { + public okhttp3.Call cancelBulkImportCall(String xPineconeApiVersion, String id, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -117,6 +118,10 @@ public okhttp3.Call cancelBulkImportCall(String id, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -137,19 +142,25 @@ public okhttp3.Call cancelBulkImportCall(String id, final ApiCallback _callback) } @SuppressWarnings("rawtypes") - private okhttp3.Call cancelBulkImportValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException { + private okhttp3.Call cancelBulkImportValidateBeforeCall(String xPineconeApiVersion, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling cancelBulkImport(Async)"); + } + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling cancelBulkImport(Async)"); } - return cancelBulkImportCall(id, _callback); + return cancelBulkImportCall(xPineconeApiVersion, id, _callback); } /** * Cancel an import * Cancel an import operation if it is not yet finished. It has no effect if the operation is already finished. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param id Unique identifier for the import operation. (required) * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -162,14 +173,15 @@ private okhttp3.Call cancelBulkImportValidateBeforeCall(String id, final ApiCall 5XX An unexpected error response. - */ - public Object cancelBulkImport(String id) throws ApiException { - ApiResponse localVarResp = cancelBulkImportWithHttpInfo(id); + public Object cancelBulkImport(String xPineconeApiVersion, String id) throws ApiException { + ApiResponse localVarResp = cancelBulkImportWithHttpInfo(xPineconeApiVersion, id); return localVarResp.getData(); } /** * Cancel an import * Cancel an import operation if it is not yet finished. It has no effect if the operation is already finished. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param id Unique identifier for the import operation. (required) * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -182,8 +194,8 @@ public Object cancelBulkImport(String id) throws ApiException { 5XX An unexpected error response. - */ - public ApiResponse cancelBulkImportWithHttpInfo(String id) throws ApiException { - okhttp3.Call localVarCall = cancelBulkImportValidateBeforeCall(id, null); + public ApiResponse cancelBulkImportWithHttpInfo(String xPineconeApiVersion, String id) throws ApiException { + okhttp3.Call localVarCall = cancelBulkImportValidateBeforeCall(xPineconeApiVersion, id, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -191,6 +203,7 @@ public ApiResponse cancelBulkImportWithHttpInfo(String id) throws ApiExc /** * Cancel an import (asynchronously) * Cancel an import operation if it is not yet finished. It has no effect if the operation is already finished. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param id Unique identifier for the import operation. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -204,15 +217,16 @@ public ApiResponse cancelBulkImportWithHttpInfo(String id) throws ApiExc 5XX An unexpected error response. - */ - public okhttp3.Call cancelBulkImportAsync(String id, final ApiCallback _callback) throws ApiException { + public okhttp3.Call cancelBulkImportAsync(String xPineconeApiVersion, String id, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = cancelBulkImportValidateBeforeCall(id, _callback); + okhttp3.Call localVarCall = cancelBulkImportValidateBeforeCall(xPineconeApiVersion, id, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for describeBulkImport + * @param xPineconeApiVersion Required date-based version header (required) * @param id Unique identifier for the import operation. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -226,7 +240,7 @@ public okhttp3.Call cancelBulkImportAsync(String id, final ApiCallback _ 5XX An unexpected error response. - */ - public okhttp3.Call describeBulkImportCall(String id, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeBulkImportCall(String xPineconeApiVersion, String id, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -252,6 +266,10 @@ public okhttp3.Call describeBulkImportCall(String id, final ApiCallback _callbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -272,19 +290,25 @@ public okhttp3.Call describeBulkImportCall(String id, final ApiCallback _callbac } @SuppressWarnings("rawtypes") - private okhttp3.Call describeBulkImportValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException { + private okhttp3.Call describeBulkImportValidateBeforeCall(String xPineconeApiVersion, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling describeBulkImport(Async)"); + } + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling describeBulkImport(Async)"); } - return describeBulkImportCall(id, _callback); + return describeBulkImportCall(xPineconeApiVersion, id, _callback); } /** * Describe an import * Return details of a specific import operation. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param id Unique identifier for the import operation. (required) * @return ImportModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -297,14 +321,15 @@ private okhttp3.Call describeBulkImportValidateBeforeCall(String id, final ApiCa 5XX An unexpected error response. - */ - public ImportModel describeBulkImport(String id) throws ApiException { - ApiResponse localVarResp = describeBulkImportWithHttpInfo(id); + public ImportModel describeBulkImport(String xPineconeApiVersion, String id) throws ApiException { + ApiResponse localVarResp = describeBulkImportWithHttpInfo(xPineconeApiVersion, id); return localVarResp.getData(); } /** * Describe an import * Return details of a specific import operation. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param id Unique identifier for the import operation. (required) * @return ApiResponse<ImportModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -317,8 +342,8 @@ public ImportModel describeBulkImport(String id) throws ApiException { 5XX An unexpected error response. - */ - public ApiResponse describeBulkImportWithHttpInfo(String id) throws ApiException { - okhttp3.Call localVarCall = describeBulkImportValidateBeforeCall(id, null); + public ApiResponse describeBulkImportWithHttpInfo(String xPineconeApiVersion, String id) throws ApiException { + okhttp3.Call localVarCall = describeBulkImportValidateBeforeCall(xPineconeApiVersion, id, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -326,6 +351,7 @@ public ApiResponse describeBulkImportWithHttpInfo(String id) throws /** * Describe an import (asynchronously) * Return details of a specific import operation. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param id Unique identifier for the import operation. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -339,16 +365,17 @@ public ApiResponse describeBulkImportWithHttpInfo(String id) throws 5XX An unexpected error response. - */ - public okhttp3.Call describeBulkImportAsync(String id, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeBulkImportAsync(String xPineconeApiVersion, String id, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = describeBulkImportValidateBeforeCall(id, _callback); + okhttp3.Call localVarCall = describeBulkImportValidateBeforeCall(xPineconeApiVersion, id, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listBulkImports - * @param limit Max number of operations to return per page. (optional) + * @param xPineconeApiVersion Required date-based version header (required) + * @param limit Max number of operations to return per page. (optional, default to 100) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @param _callback Callback for upload/download progress * @return Call to execute @@ -362,7 +389,7 @@ public okhttp3.Call describeBulkImportAsync(String id, final ApiCallback 5XX An unexpected error response. - */ - public okhttp3.Call listBulkImportsCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listBulkImportsCall(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -395,6 +422,10 @@ public okhttp3.Call listBulkImportsCall(Integer limit, String paginationToken, f localVarQueryParams.addAll(localVarApiClient.parameterToPair("paginationToken", paginationToken)); } + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -415,15 +446,21 @@ public okhttp3.Call listBulkImportsCall(Integer limit, String paginationToken, f } @SuppressWarnings("rawtypes") - private okhttp3.Call listBulkImportsValidateBeforeCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - return listBulkImportsCall(limit, paginationToken, _callback); + private okhttp3.Call listBulkImportsValidateBeforeCall(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listBulkImports(Async)"); + } + + return listBulkImportsCall(xPineconeApiVersion, limit, paginationToken, _callback); } /** * List imports * 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/index-data/import-data). - * @param limit Max number of operations to return per page. (optional) + * @param xPineconeApiVersion Required date-based version header (required) + * @param limit Max number of operations to return per page. (optional, default to 100) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @return ListImportsResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -436,15 +473,16 @@ private okhttp3.Call listBulkImportsValidateBeforeCall(Integer limit, String pag 5XX An unexpected error response. - */ - public ListImportsResponse listBulkImports(Integer limit, String paginationToken) throws ApiException { - ApiResponse localVarResp = listBulkImportsWithHttpInfo(limit, paginationToken); + public ListImportsResponse listBulkImports(String xPineconeApiVersion, Integer limit, String paginationToken) throws ApiException { + ApiResponse localVarResp = listBulkImportsWithHttpInfo(xPineconeApiVersion, limit, paginationToken); return localVarResp.getData(); } /** * List imports * 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/index-data/import-data). - * @param limit Max number of operations to return per page. (optional) + * @param xPineconeApiVersion Required date-based version header (required) + * @param limit Max number of operations to return per page. (optional, default to 100) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @return ApiResponse<ListImportsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -457,8 +495,8 @@ public ListImportsResponse listBulkImports(Integer limit, String paginationToken 5XX An unexpected error response. - */ - public ApiResponse listBulkImportsWithHttpInfo(Integer limit, String paginationToken) throws ApiException { - okhttp3.Call localVarCall = listBulkImportsValidateBeforeCall(limit, paginationToken, null); + public ApiResponse listBulkImportsWithHttpInfo(String xPineconeApiVersion, Integer limit, String paginationToken) throws ApiException { + okhttp3.Call localVarCall = listBulkImportsValidateBeforeCall(xPineconeApiVersion, limit, paginationToken, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -466,7 +504,8 @@ public ApiResponse listBulkImportsWithHttpInfo(Integer limi /** * List imports (asynchronously) * 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/index-data/import-data). - * @param limit Max number of operations to return per page. (optional) + * @param xPineconeApiVersion Required date-based version header (required) + * @param limit Max number of operations to return per page. (optional, default to 100) * @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 @@ -480,15 +519,16 @@ public ApiResponse listBulkImportsWithHttpInfo(Integer limi 5XX An unexpected error response. - */ - public okhttp3.Call listBulkImportsAsync(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listBulkImportsAsync(String xPineconeApiVersion, Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listBulkImportsValidateBeforeCall(limit, paginationToken, _callback); + okhttp3.Call localVarCall = listBulkImportsValidateBeforeCall(xPineconeApiVersion, limit, paginationToken, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for startBulkImport + * @param xPineconeApiVersion Required date-based version header (required) * @param startImportRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -502,7 +542,7 @@ public okhttp3.Call listBulkImportsAsync(Integer limit, String paginationToken, 5XX An unexpected error response. - */ - public okhttp3.Call startBulkImportCall(StartImportRequest startImportRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call startBulkImportCall(String xPineconeApiVersion, StartImportRequest startImportRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -527,6 +567,10 @@ public okhttp3.Call startBulkImportCall(StartImportRequest startImportRequest, f Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -548,19 +592,25 @@ public okhttp3.Call startBulkImportCall(StartImportRequest startImportRequest, f } @SuppressWarnings("rawtypes") - private okhttp3.Call startBulkImportValidateBeforeCall(StartImportRequest startImportRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call startBulkImportValidateBeforeCall(String xPineconeApiVersion, StartImportRequest startImportRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling startBulkImport(Async)"); + } + // verify the required parameter 'startImportRequest' is set if (startImportRequest == null) { throw new ApiException("Missing the required parameter 'startImportRequest' when calling startBulkImport(Async)"); } - return startBulkImportCall(startImportRequest, _callback); + return startBulkImportCall(xPineconeApiVersion, startImportRequest, _callback); } /** * Start import * Start an asynchronous import of vectors from object storage into an index. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param startImportRequest (required) * @return StartImportResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -573,14 +623,15 @@ private okhttp3.Call startBulkImportValidateBeforeCall(StartImportRequest startI 5XX An unexpected error response. - */ - public StartImportResponse startBulkImport(StartImportRequest startImportRequest) throws ApiException { - ApiResponse localVarResp = startBulkImportWithHttpInfo(startImportRequest); + public StartImportResponse startBulkImport(String xPineconeApiVersion, StartImportRequest startImportRequest) throws ApiException { + ApiResponse localVarResp = startBulkImportWithHttpInfo(xPineconeApiVersion, startImportRequest); return localVarResp.getData(); } /** * Start import * Start an asynchronous import of vectors from object storage into an index. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param startImportRequest (required) * @return ApiResponse<StartImportResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -593,8 +644,8 @@ public StartImportResponse startBulkImport(StartImportRequest startImportRequest 5XX An unexpected error response. - */ - public ApiResponse startBulkImportWithHttpInfo(StartImportRequest startImportRequest) throws ApiException { - okhttp3.Call localVarCall = startBulkImportValidateBeforeCall(startImportRequest, null); + public ApiResponse startBulkImportWithHttpInfo(String xPineconeApiVersion, StartImportRequest startImportRequest) throws ApiException { + okhttp3.Call localVarCall = startBulkImportValidateBeforeCall(xPineconeApiVersion, startImportRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -602,6 +653,7 @@ public ApiResponse startBulkImportWithHttpInfo(StartImportR /** * Start import (asynchronously) * Start an asynchronous import of vectors from object storage into an index. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param startImportRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -615,9 +667,9 @@ public ApiResponse startBulkImportWithHttpInfo(StartImportR 5XX An unexpected error response. - */ - public okhttp3.Call startBulkImportAsync(StartImportRequest startImportRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call startBulkImportAsync(String xPineconeApiVersion, StartImportRequest startImportRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = startBulkImportValidateBeforeCall(startImportRequest, _callback); + okhttp3.Call localVarCall = startBulkImportValidateBeforeCall(xPineconeApiVersion, startImportRequest, _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/NamespaceOperationsApi.java b/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java index ed2d1f81..3b75756b 100644 --- a/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java +++ b/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,6 +27,7 @@ import java.io.IOException; +import org.openapitools.db_data.client.model.CreateNamespaceRequest; import org.openapitools.db_data.client.model.ListNamespacesResponse; import org.openapitools.db_data.client.model.NamespaceDescription; import org.openapitools.db_data.client.model.RpcStatus; @@ -74,22 +75,175 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for createNamespace + * @param xPineconeApiVersion Required date-based version header (required) + * @param createNamespaceRequest (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. -
409 Namespace of the given name already exists on the index. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public okhttp3.Call createNamespaceCall(String xPineconeApiVersion, CreateNamespaceRequest createNamespaceRequest, 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 = createNamespaceRequest; + + // 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 (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + + 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 createNamespaceValidateBeforeCall(String xPineconeApiVersion, CreateNamespaceRequest createNamespaceRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling createNamespace(Async)"); + } + + // verify the required parameter 'createNamespaceRequest' is set + if (createNamespaceRequest == null) { + throw new ApiException("Missing the required parameter 'createNamespaceRequest' when calling createNamespace(Async)"); + } + + return createNamespaceCall(xPineconeApiVersion, createNamespaceRequest, _callback); + + } + + /** + * Create a namespace + * Create a namespace in a serverless index. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @param createNamespaceRequest (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 successful response. -
400 Bad request. The request body included invalid request parameters. -
409 Namespace of the given name already exists on the index. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public NamespaceDescription createNamespace(String xPineconeApiVersion, CreateNamespaceRequest createNamespaceRequest) throws ApiException { + ApiResponse localVarResp = createNamespaceWithHttpInfo(xPineconeApiVersion, createNamespaceRequest); + return localVarResp.getData(); + } + + /** + * Create a namespace + * Create a namespace in a serverless index. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @param createNamespaceRequest (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 successful response. -
400 Bad request. The request body included invalid request parameters. -
409 Namespace of the given name already exists on the index. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public ApiResponse createNamespaceWithHttpInfo(String xPineconeApiVersion, CreateNamespaceRequest createNamespaceRequest) throws ApiException { + okhttp3.Call localVarCall = createNamespaceValidateBeforeCall(xPineconeApiVersion, createNamespaceRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a namespace (asynchronously) + * Create a namespace in a serverless index. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @param createNamespaceRequest (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. -
409 Namespace of the given name already exists on the index. -
4XX An unexpected error response. -
5XX An unexpected error response. -
+ */ + public okhttp3.Call createNamespaceAsync(String xPineconeApiVersion, CreateNamespaceRequest createNamespaceRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createNamespaceValidateBeforeCall(xPineconeApiVersion, createNamespaceRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for deleteNamespace - * @param namespace The namespace to delete (required) + * @param xPineconeApiVersion Required date-based version header (required) + * @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 -
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 { + public okhttp3.Call deleteNamespaceCall(String xPineconeApiVersion, String namespace, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -115,6 +269,10 @@ public okhttp3.Call deleteNamespaceCall(String namespace, final ApiCallback _cal Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -135,83 +293,92 @@ public okhttp3.Call deleteNamespaceCall(String namespace, final ApiCallback _cal } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteNamespaceValidateBeforeCall(String namespace, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteNamespaceValidateBeforeCall(String xPineconeApiVersion, String namespace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling deleteNamespace(Async)"); + } + // 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); + return deleteNamespaceCall(xPineconeApiVersion, namespace, _callback); } /** * Delete a namespace - * Delete a namespace from an index. - * @param namespace The namespace to delete (required) + * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @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 -
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); + public Object deleteNamespace(String xPineconeApiVersion, String namespace) throws ApiException { + ApiResponse localVarResp = deleteNamespaceWithHttpInfo(xPineconeApiVersion, namespace); return localVarResp.getData(); } /** * Delete a namespace - * Delete a namespace from an index. - * @param namespace The namespace to delete (required) + * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @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 -
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); + public ApiResponse deleteNamespaceWithHttpInfo(String xPineconeApiVersion, String namespace) throws ApiException { + okhttp3.Call localVarCall = deleteNamespaceValidateBeforeCall(xPineconeApiVersion, 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) + * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @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 -
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 { + public okhttp3.Call deleteNamespaceAsync(String xPineconeApiVersion, String namespace, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteNamespaceValidateBeforeCall(namespace, _callback); + okhttp3.Call localVarCall = deleteNamespaceValidateBeforeCall(xPineconeApiVersion, 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 xPineconeApiVersion Required date-based version header (required) + * @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 @@ -224,7 +391,7 @@ public okhttp3.Call deleteNamespaceAsync(String namespace, final ApiCallback 5XX An unexpected error response. - */ - public okhttp3.Call describeNamespaceCall(String namespace, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeNamespaceCall(String xPineconeApiVersion, String namespace, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -250,6 +417,10 @@ public okhttp3.Call describeNamespaceCall(String namespace, final ApiCallback _c Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -270,20 +441,26 @@ public okhttp3.Call describeNamespaceCall(String namespace, final ApiCallback _c } @SuppressWarnings("rawtypes") - private okhttp3.Call describeNamespaceValidateBeforeCall(String namespace, final ApiCallback _callback) throws ApiException { + private okhttp3.Call describeNamespaceValidateBeforeCall(String xPineconeApiVersion, String namespace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling describeNamespace(Async)"); + } + // 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); + return describeNamespaceCall(xPineconeApiVersion, namespace, _callback); } /** * Describe a namespace - * Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. - * @param namespace The namespace to describe (required) + * Describe a namespace in a serverless index, including the total number of vectors in the namespace. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @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 @@ -295,15 +472,16 @@ private okhttp3.Call describeNamespaceValidateBeforeCall(String namespace, final 5XX An unexpected error response. - */ - public NamespaceDescription describeNamespace(String namespace) throws ApiException { - ApiResponse localVarResp = describeNamespaceWithHttpInfo(namespace); + public NamespaceDescription describeNamespace(String xPineconeApiVersion, String namespace) throws ApiException { + ApiResponse localVarResp = describeNamespaceWithHttpInfo(xPineconeApiVersion, namespace); return localVarResp.getData(); } /** * Describe a namespace - * Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. - * @param namespace The namespace to describe (required) + * Describe a namespace in a serverless index, including the total number of vectors in the namespace. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @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 @@ -315,16 +493,17 @@ public NamespaceDescription describeNamespace(String namespace) throws ApiExcept 5XX An unexpected error response. - */ - public ApiResponse describeNamespaceWithHttpInfo(String namespace) throws ApiException { - okhttp3.Call localVarCall = describeNamespaceValidateBeforeCall(namespace, null); + public ApiResponse describeNamespaceWithHttpInfo(String xPineconeApiVersion, String namespace) throws ApiException { + okhttp3.Call localVarCall = describeNamespaceValidateBeforeCall(xPineconeApiVersion, namespace, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Describe a namespace (asynchronously) - * Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. - * @param namespace The namespace to describe (required) + * Describe a namespace in a serverless index, including the total number of vectors in the namespace. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) + * @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 @@ -337,17 +516,19 @@ public ApiResponse describeNamespaceWithHttpInfo(String na 5XX An unexpected error response. - */ - public okhttp3.Call describeNamespaceAsync(String namespace, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeNamespaceAsync(String xPineconeApiVersion, String namespace, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = describeNamespaceValidateBeforeCall(namespace, _callback); + okhttp3.Call localVarCall = describeNamespaceValidateBeforeCall(xPineconeApiVersion, namespace, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listNamespacesOperation + * @param xPineconeApiVersion Required date-based version header (required) * @param limit Max number namespaces to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) + * @param prefix Prefix of the namespaces to list. Acts as a filter to return only namespaces that start with this prefix. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -359,7 +540,7 @@ public okhttp3.Call describeNamespaceAsync(String namespace, final ApiCallback 5XX An unexpected error response. - */ - public okhttp3.Call listNamespacesOperationCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listNamespacesOperationCall(String xPineconeApiVersion, Integer limit, String paginationToken, String prefix, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -392,6 +573,14 @@ public okhttp3.Call listNamespacesOperationCall(Integer limit, String pagination localVarQueryParams.addAll(localVarApiClient.parameterToPair("paginationToken", paginationToken)); } + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -412,16 +601,23 @@ public okhttp3.Call listNamespacesOperationCall(Integer limit, String pagination } @SuppressWarnings("rawtypes") - private okhttp3.Call listNamespacesOperationValidateBeforeCall(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { - return listNamespacesOperationCall(limit, paginationToken, _callback); + private okhttp3.Call listNamespacesOperationValidateBeforeCall(String xPineconeApiVersion, Integer limit, String paginationToken, String prefix, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listNamespacesOperation(Async)"); + } + + return listNamespacesOperationCall(xPineconeApiVersion, limit, paginationToken, prefix, _callback); } /** * List namespaces - * Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. + * List all namespaces in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @param limit Max number namespaces to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) + * @param prefix Prefix of the namespaces to list. Acts as a filter to return only namespaces that start with this prefix. (optional) * @return ListNamespacesResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -432,16 +628,18 @@ private okhttp3.Call listNamespacesOperationValidateBeforeCall(Integer limit, St 5XX An unexpected error response. - */ - public ListNamespacesResponse listNamespacesOperation(Integer limit, String paginationToken) throws ApiException { - ApiResponse localVarResp = listNamespacesOperationWithHttpInfo(limit, paginationToken); + public ListNamespacesResponse listNamespacesOperation(String xPineconeApiVersion, Integer limit, String paginationToken, String prefix) throws ApiException { + ApiResponse localVarResp = listNamespacesOperationWithHttpInfo(xPineconeApiVersion, limit, paginationToken, prefix); return localVarResp.getData(); } /** * List namespaces - * Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. + * List all namespaces in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @param limit Max number namespaces to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) + * @param prefix Prefix of the namespaces to list. Acts as a filter to return only namespaces that start with this prefix. (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 @@ -452,17 +650,19 @@ public ListNamespacesResponse listNamespacesOperation(Integer limit, String pagi 5XX An unexpected error response. - */ - public ApiResponse listNamespacesOperationWithHttpInfo(Integer limit, String paginationToken) throws ApiException { - okhttp3.Call localVarCall = listNamespacesOperationValidateBeforeCall(limit, paginationToken, null); + public ApiResponse listNamespacesOperationWithHttpInfo(String xPineconeApiVersion, Integer limit, String paginationToken, String prefix) throws ApiException { + okhttp3.Call localVarCall = listNamespacesOperationValidateBeforeCall(xPineconeApiVersion, limit, paginationToken, prefix, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * List namespaces (asynchronously) - * Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. + * List all namespaces in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @param limit Max number namespaces to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) + * @param prefix Prefix of the namespaces to list. Acts as a filter to return only namespaces that start with this prefix. (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 @@ -474,9 +674,9 @@ public ApiResponse listNamespacesOperationWithHttpInfo(I 5XX An unexpected error response. - */ - public okhttp3.Call listNamespacesOperationAsync(Integer limit, String paginationToken, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listNamespacesOperationAsync(String xPineconeApiVersion, Integer limit, String paginationToken, String prefix, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listNamespacesOperationValidateBeforeCall(limit, paginationToken, _callback); + okhttp3.Call localVarCall = listNamespacesOperationValidateBeforeCall(xPineconeApiVersion, limit, paginationToken, prefix, _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 def7e958..91269280 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,6 +29,8 @@ import org.openapitools.db_data.client.model.DeleteRequest; import org.openapitools.db_data.client.model.DescribeIndexStatsRequest; +import org.openapitools.db_data.client.model.FetchByMetadataRequest; +import org.openapitools.db_data.client.model.FetchByMetadataResponse; import org.openapitools.db_data.client.model.FetchResponse; import org.openapitools.db_data.client.model.IndexDescription; import org.openapitools.db_data.client.model.ListResponse; @@ -38,6 +40,7 @@ import org.openapitools.db_data.client.model.SearchRecordsRequest; import org.openapitools.db_data.client.model.SearchRecordsResponse; import org.openapitools.db_data.client.model.UpdateRequest; +import org.openapitools.db_data.client.model.UpdateResponse; import org.openapitools.db_data.client.model.UpsertRecord; import org.openapitools.db_data.client.model.UpsertRequest; import org.openapitools.db_data.client.model.UpsertResponse; @@ -87,6 +90,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for deleteVectors + * @param xPineconeApiVersion Required date-based version header (required) * @param deleteRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -100,7 +104,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 5XX An unexpected error response. - */ - public okhttp3.Call deleteVectorsCall(DeleteRequest deleteRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteVectorsCall(String xPineconeApiVersion, DeleteRequest deleteRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -125,6 +129,10 @@ public okhttp3.Call deleteVectorsCall(DeleteRequest deleteRequest, final ApiCall Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -146,19 +154,25 @@ public okhttp3.Call deleteVectorsCall(DeleteRequest deleteRequest, final ApiCall } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteVectorsValidateBeforeCall(DeleteRequest deleteRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteVectorsValidateBeforeCall(String xPineconeApiVersion, DeleteRequest deleteRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling deleteVectors(Async)"); + } + // verify the required parameter 'deleteRequest' is set if (deleteRequest == null) { throw new ApiException("Missing the required parameter 'deleteRequest' when calling deleteVectors(Async)"); } - return deleteVectorsCall(deleteRequest, _callback); + return deleteVectorsCall(xPineconeApiVersion, deleteRequest, _callback); } /** * Delete vectors * Delete vectors by id from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param deleteRequest (required) * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -171,14 +185,15 @@ private okhttp3.Call deleteVectorsValidateBeforeCall(DeleteRequest deleteRequest 5XX An unexpected error response. - */ - public Object deleteVectors(DeleteRequest deleteRequest) throws ApiException { - ApiResponse localVarResp = deleteVectorsWithHttpInfo(deleteRequest); + public Object deleteVectors(String xPineconeApiVersion, DeleteRequest deleteRequest) throws ApiException { + ApiResponse localVarResp = deleteVectorsWithHttpInfo(xPineconeApiVersion, deleteRequest); return localVarResp.getData(); } /** * Delete vectors * Delete vectors by id from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param deleteRequest (required) * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -191,8 +206,8 @@ public Object deleteVectors(DeleteRequest deleteRequest) throws ApiException { 5XX An unexpected error response. - */ - public ApiResponse deleteVectorsWithHttpInfo(DeleteRequest deleteRequest) throws ApiException { - okhttp3.Call localVarCall = deleteVectorsValidateBeforeCall(deleteRequest, null); + public ApiResponse deleteVectorsWithHttpInfo(String xPineconeApiVersion, DeleteRequest deleteRequest) throws ApiException { + okhttp3.Call localVarCall = deleteVectorsValidateBeforeCall(xPineconeApiVersion, deleteRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -200,6 +215,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/manage-data/delete-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param deleteRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -213,15 +229,16 @@ public ApiResponse deleteVectorsWithHttpInfo(DeleteRequest deleteRequest 5XX An unexpected error response. - */ - public okhttp3.Call deleteVectorsAsync(DeleteRequest deleteRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteVectorsAsync(String xPineconeApiVersion, DeleteRequest deleteRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteVectorsValidateBeforeCall(deleteRequest, _callback); + okhttp3.Call localVarCall = deleteVectorsValidateBeforeCall(xPineconeApiVersion, deleteRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for describeIndexStats + * @param xPineconeApiVersion Required date-based version header (required) * @param describeIndexStatsRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -235,7 +252,7 @@ public okhttp3.Call deleteVectorsAsync(DeleteRequest deleteRequest, final ApiCal 5XX An unexpected error response. - */ - public okhttp3.Call describeIndexStatsCall(DescribeIndexStatsRequest describeIndexStatsRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeIndexStatsCall(String xPineconeApiVersion, DescribeIndexStatsRequest describeIndexStatsRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -260,6 +277,10 @@ public okhttp3.Call describeIndexStatsCall(DescribeIndexStatsRequest describeInd Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -281,19 +302,25 @@ public okhttp3.Call describeIndexStatsCall(DescribeIndexStatsRequest describeInd } @SuppressWarnings("rawtypes") - private okhttp3.Call describeIndexStatsValidateBeforeCall(DescribeIndexStatsRequest describeIndexStatsRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call describeIndexStatsValidateBeforeCall(String xPineconeApiVersion, DescribeIndexStatsRequest describeIndexStatsRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling describeIndexStats(Async)"); + } + // verify the required parameter 'describeIndexStatsRequest' is set if (describeIndexStatsRequest == null) { throw new ApiException("Missing the required parameter 'describeIndexStatsRequest' when calling describeIndexStats(Async)"); } - return describeIndexStatsCall(describeIndexStatsRequest, _callback); + return describeIndexStatsCall(xPineconeApiVersion, describeIndexStatsRequest, _callback); } /** * Get index stats * Return statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @param describeIndexStatsRequest (required) * @return IndexDescription * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -306,14 +333,15 @@ private okhttp3.Call describeIndexStatsValidateBeforeCall(DescribeIndexStatsRequ 5XX An unexpected error response. - */ - public IndexDescription describeIndexStats(DescribeIndexStatsRequest describeIndexStatsRequest) throws ApiException { - ApiResponse localVarResp = describeIndexStatsWithHttpInfo(describeIndexStatsRequest); + public IndexDescription describeIndexStats(String xPineconeApiVersion, DescribeIndexStatsRequest describeIndexStatsRequest) throws ApiException { + ApiResponse localVarResp = describeIndexStatsWithHttpInfo(xPineconeApiVersion, describeIndexStatsRequest); return localVarResp.getData(); } /** * Get index stats * Return statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @param describeIndexStatsRequest (required) * @return ApiResponse<IndexDescription> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -326,8 +354,8 @@ public IndexDescription describeIndexStats(DescribeIndexStatsRequest describeInd 5XX An unexpected error response. - */ - public ApiResponse describeIndexStatsWithHttpInfo(DescribeIndexStatsRequest describeIndexStatsRequest) throws ApiException { - okhttp3.Call localVarCall = describeIndexStatsValidateBeforeCall(describeIndexStatsRequest, null); + public ApiResponse describeIndexStatsWithHttpInfo(String xPineconeApiVersion, DescribeIndexStatsRequest describeIndexStatsRequest) throws ApiException { + okhttp3.Call localVarCall = describeIndexStatsValidateBeforeCall(xPineconeApiVersion, describeIndexStatsRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -335,6 +363,7 @@ public ApiResponse describeIndexStatsWithHttpInfo(DescribeInde /** * Get index stats (asynchronously) * Return statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @param describeIndexStatsRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -348,17 +377,18 @@ public ApiResponse describeIndexStatsWithHttpInfo(DescribeInde 5XX An unexpected error response. - */ - public okhttp3.Call describeIndexStatsAsync(DescribeIndexStatsRequest describeIndexStatsRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call describeIndexStatsAsync(String xPineconeApiVersion, DescribeIndexStatsRequest describeIndexStatsRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = describeIndexStatsValidateBeforeCall(describeIndexStatsRequest, _callback); + okhttp3.Call localVarCall = describeIndexStatsValidateBeforeCall(xPineconeApiVersion, describeIndexStatsRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for fetchVectors + * @param xPineconeApiVersion Required date-based version header (required) * @param ids The vector IDs to fetch. Does not accept values containing spaces. (required) - * @param namespace (optional) + * @param namespace The namespace to fetch vectors from. If not provided, the default namespace is used. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -371,7 +401,7 @@ public okhttp3.Call describeIndexStatsAsync(DescribeIndexStatsRequest describeIn 5XX An unexpected error response. - */ - public okhttp3.Call fetchVectorsCall(List ids, String namespace, final ApiCallback _callback) throws ApiException { + public okhttp3.Call fetchVectorsCall(String xPineconeApiVersion, List ids, String namespace, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -404,6 +434,10 @@ public okhttp3.Call fetchVectorsCall(List ids, String namespace, final A localVarQueryParams.addAll(localVarApiClient.parameterToPair("namespace", namespace)); } + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -424,21 +458,27 @@ public okhttp3.Call fetchVectorsCall(List ids, String namespace, final A } @SuppressWarnings("rawtypes") - private okhttp3.Call fetchVectorsValidateBeforeCall(List ids, String namespace, final ApiCallback _callback) throws ApiException { + private okhttp3.Call fetchVectorsValidateBeforeCall(String xPineconeApiVersion, List ids, String namespace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling fetchVectors(Async)"); + } + // verify the required parameter 'ids' is set if (ids == null) { throw new ApiException("Missing the required parameter 'ids' when calling fetchVectors(Async)"); } - return fetchVectorsCall(ids, namespace, _callback); + return fetchVectorsCall(xPineconeApiVersion, ids, namespace, _callback); } /** * 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/manage-data/fetch-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param ids The vector IDs to fetch. Does not accept values containing spaces. (required) - * @param namespace (optional) + * @param namespace The namespace to fetch vectors from. If not provided, the default namespace is used. (optional) * @return FetchResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -450,16 +490,17 @@ private okhttp3.Call fetchVectorsValidateBeforeCall(List ids, String nam 5XX An unexpected error response. - */ - public FetchResponse fetchVectors(List ids, String namespace) throws ApiException { - ApiResponse localVarResp = fetchVectorsWithHttpInfo(ids, namespace); + public FetchResponse fetchVectors(String xPineconeApiVersion, List ids, String namespace) throws ApiException { + ApiResponse localVarResp = fetchVectorsWithHttpInfo(xPineconeApiVersion, ids, namespace); return localVarResp.getData(); } /** * 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/manage-data/fetch-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param ids The vector IDs to fetch. Does not accept values containing spaces. (required) - * @param namespace (optional) + * @param namespace The namespace to fetch vectors from. If not provided, the default namespace is used. (optional) * @return ApiResponse<FetchResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -471,8 +512,8 @@ public FetchResponse fetchVectors(List ids, String namespace) throws Api 5XX An unexpected error response. - */ - public ApiResponse fetchVectorsWithHttpInfo(List ids, String namespace) throws ApiException { - okhttp3.Call localVarCall = fetchVectorsValidateBeforeCall(ids, namespace, null); + public ApiResponse fetchVectorsWithHttpInfo(String xPineconeApiVersion, List ids, String namespace) throws ApiException { + okhttp3.Call localVarCall = fetchVectorsValidateBeforeCall(xPineconeApiVersion, ids, namespace, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -480,8 +521,9 @@ 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/manage-data/fetch-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param ids The vector IDs to fetch. Does not accept values containing spaces. (required) - * @param namespace (optional) + * @param namespace The namespace to fetch vectors from. If not provided, the default namespace is used. (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 @@ -494,19 +536,168 @@ public ApiResponse fetchVectorsWithHttpInfo(List ids, Str 5XX An unexpected error response. - */ - public okhttp3.Call fetchVectorsAsync(List ids, String namespace, final ApiCallback _callback) throws ApiException { + public okhttp3.Call fetchVectorsAsync(String xPineconeApiVersion, List ids, String namespace, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = fetchVectorsValidateBeforeCall(ids, namespace, _callback); + okhttp3.Call localVarCall = fetchVectorsValidateBeforeCall(xPineconeApiVersion, ids, namespace, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for fetchVectorsByMetadata + * @param xPineconeApiVersion Required date-based version header (required) + * @param fetchByMetadataRequest (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 fetchVectorsByMetadataCall(String xPineconeApiVersion, FetchByMetadataRequest fetchByMetadataRequest, 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 = fetchByMetadataRequest; + + // create path and map variables + String localVarPath = "/vectors/fetch_by_metadata"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + + 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 fetchVectorsByMetadataValidateBeforeCall(String xPineconeApiVersion, FetchByMetadataRequest fetchByMetadataRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling fetchVectorsByMetadata(Async)"); + } + + // verify the required parameter 'fetchByMetadataRequest' is set + if (fetchByMetadataRequest == null) { + throw new ApiException("Missing the required parameter 'fetchByMetadataRequest' when calling fetchVectorsByMetadata(Async)"); + } + + return fetchVectorsByMetadataCall(xPineconeApiVersion, fetchByMetadataRequest, _callback); + + } + + /** + * Fetch vectors by metadata + * Look up and return vectors by metadata filter 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/manage-data/fetch-data). + * @param xPineconeApiVersion Required date-based version header (required) + * @param fetchByMetadataRequest (required) + * @return FetchByMetadataResponse + * @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 FetchByMetadataResponse fetchVectorsByMetadata(String xPineconeApiVersion, FetchByMetadataRequest fetchByMetadataRequest) throws ApiException { + ApiResponse localVarResp = fetchVectorsByMetadataWithHttpInfo(xPineconeApiVersion, fetchByMetadataRequest); + return localVarResp.getData(); + } + + /** + * Fetch vectors by metadata + * Look up and return vectors by metadata filter 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/manage-data/fetch-data). + * @param xPineconeApiVersion Required date-based version header (required) + * @param fetchByMetadataRequest (required) + * @return ApiResponse<FetchByMetadataResponse> + * @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 fetchVectorsByMetadataWithHttpInfo(String xPineconeApiVersion, FetchByMetadataRequest fetchByMetadataRequest) throws ApiException { + okhttp3.Call localVarCall = fetchVectorsByMetadataValidateBeforeCall(xPineconeApiVersion, fetchByMetadataRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Fetch vectors by metadata (asynchronously) + * Look up and return vectors by metadata filter 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/manage-data/fetch-data). + * @param xPineconeApiVersion Required date-based version header (required) + * @param fetchByMetadataRequest (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 fetchVectorsByMetadataAsync(String xPineconeApiVersion, FetchByMetadataRequest fetchByMetadataRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fetchVectorsByMetadataValidateBeforeCall(xPineconeApiVersion, fetchByMetadataRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for listVectors + * @param xPineconeApiVersion Required date-based version header (required) * @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 limit Max number of IDs to return per page. (optional, default to 100) * @param paginationToken Pagination token to continue a previous listing operation. (optional) - * @param namespace (optional) + * @param namespace The namespace to list vectors from. If not provided, the default namespace is used. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -519,7 +710,7 @@ public okhttp3.Call fetchVectorsAsync(List ids, String namespace, final 5XX An unexpected error response. - */ - public okhttp3.Call listVectorsCall(String prefix, Long limit, String paginationToken, String namespace, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listVectorsCall(String xPineconeApiVersion, String prefix, Long limit, String paginationToken, String namespace, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -560,6 +751,10 @@ public okhttp3.Call listVectorsCall(String prefix, Long limit, String pagination localVarQueryParams.addAll(localVarApiClient.parameterToPair("namespace", namespace)); } + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -580,18 +775,24 @@ public okhttp3.Call listVectorsCall(String prefix, Long limit, String pagination } @SuppressWarnings("rawtypes") - private okhttp3.Call listVectorsValidateBeforeCall(String prefix, Long limit, String paginationToken, String namespace, final ApiCallback _callback) throws ApiException { - return listVectorsCall(prefix, limit, paginationToken, namespace, _callback); + private okhttp3.Call listVectorsValidateBeforeCall(String xPineconeApiVersion, String prefix, Long limit, String paginationToken, String namespace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listVectors(Async)"); + } + + return listVectorsCall(xPineconeApiVersion, prefix, limit, paginationToken, namespace, _callback); } /** * 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. 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/manage-data/list-record-ids). **Note:** `list` is supported only for serverless indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @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 limit Max number of IDs to return per page. (optional, default to 100) * @param paginationToken Pagination token to continue a previous listing operation. (optional) - * @param namespace (optional) + * @param namespace The namespace to list vectors from. If not provided, the default namespace is used. (optional) * @return ListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -603,18 +804,19 @@ private okhttp3.Call listVectorsValidateBeforeCall(String prefix, Long limit, St 5XX An unexpected error response. - */ - public ListResponse listVectors(String prefix, Long limit, String paginationToken, String namespace) throws ApiException { - ApiResponse localVarResp = listVectorsWithHttpInfo(prefix, limit, paginationToken, namespace); + public ListResponse listVectors(String xPineconeApiVersion, String prefix, Long limit, String paginationToken, String namespace) throws ApiException { + ApiResponse localVarResp = listVectorsWithHttpInfo(xPineconeApiVersion, prefix, limit, paginationToken, namespace); return localVarResp.getData(); } /** * 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. 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/manage-data/list-record-ids). **Note:** `list` is supported only for serverless indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @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 limit Max number of IDs to return per page. (optional, default to 100) * @param paginationToken Pagination token to continue a previous listing operation. (optional) - * @param namespace (optional) + * @param namespace The namespace to list vectors from. If not provided, the default namespace is used. (optional) * @return ApiResponse<ListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -626,8 +828,8 @@ public ListResponse listVectors(String prefix, Long limit, String paginationToke 5XX An unexpected error response. - */ - public ApiResponse listVectorsWithHttpInfo(String prefix, Long limit, String paginationToken, String namespace) throws ApiException { - okhttp3.Call localVarCall = listVectorsValidateBeforeCall(prefix, limit, paginationToken, namespace, null); + public ApiResponse listVectorsWithHttpInfo(String xPineconeApiVersion, String prefix, Long limit, String paginationToken, String namespace) throws ApiException { + okhttp3.Call localVarCall = listVectorsValidateBeforeCall(xPineconeApiVersion, prefix, limit, paginationToken, namespace, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -635,10 +837,11 @@ 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. 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/manage-data/list-record-ids). **Note:** `list` is supported only for serverless indexes. + * @param xPineconeApiVersion Required date-based version header (required) * @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 limit Max number of IDs to return per page. (optional, default to 100) * @param paginationToken Pagination token to continue a previous listing operation. (optional) - * @param namespace (optional) + * @param namespace The namespace to list vectors from. If not provided, the default namespace is used. (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 @@ -651,15 +854,16 @@ public ApiResponse listVectorsWithHttpInfo(String prefix, Long lim 5XX An unexpected error response. - */ - public okhttp3.Call listVectorsAsync(String prefix, Long limit, String paginationToken, String namespace, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listVectorsAsync(String xPineconeApiVersion, String prefix, Long limit, String paginationToken, String namespace, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listVectorsValidateBeforeCall(prefix, limit, paginationToken, namespace, _callback); + okhttp3.Call localVarCall = listVectorsValidateBeforeCall(xPineconeApiVersion, prefix, limit, paginationToken, namespace, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for queryVectors + * @param xPineconeApiVersion Required date-based version header (required) * @param queryRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -673,7 +877,7 @@ public okhttp3.Call listVectorsAsync(String prefix, Long limit, String paginatio 5XX An unexpected error response. - */ - public okhttp3.Call queryVectorsCall(QueryRequest queryRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call queryVectorsCall(String xPineconeApiVersion, QueryRequest queryRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -698,6 +902,10 @@ public okhttp3.Call queryVectorsCall(QueryRequest queryRequest, final ApiCallbac Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -719,19 +927,25 @@ public okhttp3.Call queryVectorsCall(QueryRequest queryRequest, final ApiCallbac } @SuppressWarnings("rawtypes") - private okhttp3.Call queryVectorsValidateBeforeCall(QueryRequest queryRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call queryVectorsValidateBeforeCall(String xPineconeApiVersion, QueryRequest queryRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling queryVectors(Async)"); + } + // verify the required parameter 'queryRequest' is set if (queryRequest == null) { throw new ApiException("Missing the required parameter 'queryRequest' when calling queryVectors(Async)"); } - return queryVectorsCall(queryRequest, _callback); + return queryVectorsCall(xPineconeApiVersion, queryRequest, _callback); } /** * 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 [Search](https://docs.pinecone.io/guides/search/semantic-search). + * 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, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). + * @param xPineconeApiVersion Required date-based version header (required) * @param queryRequest (required) * @return QueryResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -744,14 +958,15 @@ private okhttp3.Call queryVectorsValidateBeforeCall(QueryRequest queryRequest, f 5XX An unexpected error response. - */ - public QueryResponse queryVectors(QueryRequest queryRequest) throws ApiException { - ApiResponse localVarResp = queryVectorsWithHttpInfo(queryRequest); + public QueryResponse queryVectors(String xPineconeApiVersion, QueryRequest queryRequest) throws ApiException { + ApiResponse localVarResp = queryVectorsWithHttpInfo(xPineconeApiVersion, queryRequest); return localVarResp.getData(); } /** * 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 [Search](https://docs.pinecone.io/guides/search/semantic-search). + * 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, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). + * @param xPineconeApiVersion Required date-based version header (required) * @param queryRequest (required) * @return ApiResponse<QueryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -764,15 +979,16 @@ public QueryResponse queryVectors(QueryRequest queryRequest) throws ApiException 5XX An unexpected error response. - */ - public ApiResponse queryVectorsWithHttpInfo(QueryRequest queryRequest) throws ApiException { - okhttp3.Call localVarCall = queryVectorsValidateBeforeCall(queryRequest, null); + public ApiResponse queryVectorsWithHttpInfo(String xPineconeApiVersion, QueryRequest queryRequest) throws ApiException { + okhttp3.Call localVarCall = queryVectorsValidateBeforeCall(xPineconeApiVersion, queryRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * 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 [Search](https://docs.pinecone.io/guides/search/semantic-search). + * 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, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). + * @param xPineconeApiVersion Required date-based version header (required) * @param queryRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -786,15 +1002,16 @@ public ApiResponse queryVectorsWithHttpInfo(QueryRequest queryReq 5XX An unexpected error response. - */ - public okhttp3.Call queryVectorsAsync(QueryRequest queryRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call queryVectorsAsync(String xPineconeApiVersion, QueryRequest queryRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = queryVectorsValidateBeforeCall(queryRequest, _callback); + okhttp3.Call localVarCall = queryVectorsValidateBeforeCall(xPineconeApiVersion, queryRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for searchRecordsNamespace + * @param xPineconeApiVersion Required date-based version header (required) * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @param _callback Callback for upload/download progress @@ -809,7 +1026,7 @@ public okhttp3.Call queryVectorsAsync(QueryRequest queryRequest, final ApiCallba 5XX An unexpected error response. - */ - public okhttp3.Call searchRecordsNamespaceCall(String namespace, SearchRecordsRequest searchRecordsRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call searchRecordsNamespaceCall(String xPineconeApiVersion, String namespace, SearchRecordsRequest searchRecordsRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -835,6 +1052,10 @@ public okhttp3.Call searchRecordsNamespaceCall(String namespace, SearchRecordsRe Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -856,7 +1077,12 @@ public okhttp3.Call searchRecordsNamespaceCall(String namespace, SearchRecordsRe } @SuppressWarnings("rawtypes") - private okhttp3.Call searchRecordsNamespaceValidateBeforeCall(String namespace, SearchRecordsRequest searchRecordsRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call searchRecordsNamespaceValidateBeforeCall(String xPineconeApiVersion, String namespace, SearchRecordsRequest searchRecordsRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling searchRecordsNamespace(Async)"); + } + // verify the required parameter 'namespace' is set if (namespace == null) { throw new ApiException("Missing the required parameter 'namespace' when calling searchRecordsNamespace(Async)"); @@ -867,13 +1093,14 @@ private okhttp3.Call searchRecordsNamespaceValidateBeforeCall(String namespace, throw new ApiException("Missing the required parameter 'searchRecordsRequest' when calling searchRecordsNamespace(Async)"); } - return searchRecordsNamespaceCall(namespace, searchRecordsRequest, _callback); + return searchRecordsNamespaceCall(xPineconeApiVersion, namespace, searchRecordsRequest, _callback); } /** * 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 [Search](https://docs.pinecone.io/guides/search/semantic-search). + * 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/index-data/indexing-overview#vector-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/search-overview). + * @param xPineconeApiVersion Required date-based version header (required) * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @return SearchRecordsResponse @@ -887,14 +1114,15 @@ private okhttp3.Call searchRecordsNamespaceValidateBeforeCall(String namespace, 5XX An unexpected error response. - */ - public SearchRecordsResponse searchRecordsNamespace(String namespace, SearchRecordsRequest searchRecordsRequest) throws ApiException { - ApiResponse localVarResp = searchRecordsNamespaceWithHttpInfo(namespace, searchRecordsRequest); + public SearchRecordsResponse searchRecordsNamespace(String xPineconeApiVersion, String namespace, SearchRecordsRequest searchRecordsRequest) throws ApiException { + ApiResponse localVarResp = searchRecordsNamespaceWithHttpInfo(xPineconeApiVersion, namespace, searchRecordsRequest); return localVarResp.getData(); } /** * 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 [Search](https://docs.pinecone.io/guides/search/semantic-search). + * 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/index-data/indexing-overview#vector-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/search-overview). + * @param xPineconeApiVersion Required date-based version header (required) * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @return ApiResponse<SearchRecordsResponse> @@ -908,15 +1136,16 @@ public SearchRecordsResponse searchRecordsNamespace(String namespace, SearchReco 5XX An unexpected error response. - */ - public ApiResponse searchRecordsNamespaceWithHttpInfo(String namespace, SearchRecordsRequest searchRecordsRequest) throws ApiException { - okhttp3.Call localVarCall = searchRecordsNamespaceValidateBeforeCall(namespace, searchRecordsRequest, null); + public ApiResponse searchRecordsNamespaceWithHttpInfo(String xPineconeApiVersion, String namespace, SearchRecordsRequest searchRecordsRequest) throws ApiException { + okhttp3.Call localVarCall = searchRecordsNamespaceValidateBeforeCall(xPineconeApiVersion, namespace, searchRecordsRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * 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 [Search](https://docs.pinecone.io/guides/search/semantic-search). + * 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/index-data/indexing-overview#vector-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/search-overview). + * @param xPineconeApiVersion Required date-based version header (required) * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @param _callback The callback to be executed when the API call finishes @@ -931,15 +1160,16 @@ public ApiResponse searchRecordsNamespaceWithHttpInfo(Str 5XX An unexpected error response. - */ - public okhttp3.Call searchRecordsNamespaceAsync(String namespace, SearchRecordsRequest searchRecordsRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call searchRecordsNamespaceAsync(String xPineconeApiVersion, String namespace, SearchRecordsRequest searchRecordsRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = searchRecordsNamespaceValidateBeforeCall(namespace, searchRecordsRequest, _callback); + okhttp3.Call localVarCall = searchRecordsNamespaceValidateBeforeCall(xPineconeApiVersion, namespace, searchRecordsRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateVector + * @param xPineconeApiVersion Required date-based version header (required) * @param updateRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -953,7 +1183,7 @@ public okhttp3.Call searchRecordsNamespaceAsync(String namespace, SearchRecordsR 5XX An unexpected error response. - */ - public okhttp3.Call updateVectorCall(UpdateRequest updateRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateVectorCall(String xPineconeApiVersion, UpdateRequest updateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -978,6 +1208,10 @@ public okhttp3.Call updateVectorCall(UpdateRequest updateRequest, final ApiCallb Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -999,21 +1233,27 @@ public okhttp3.Call updateVectorCall(UpdateRequest updateRequest, final ApiCallb } @SuppressWarnings("rawtypes") - private okhttp3.Call updateVectorValidateBeforeCall(UpdateRequest updateRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateVectorValidateBeforeCall(String xPineconeApiVersion, UpdateRequest updateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling updateVector(Async)"); + } + // verify the required parameter 'updateRequest' is set if (updateRequest == null) { throw new ApiException("Missing the required parameter 'updateRequest' when calling updateVector(Async)"); } - return updateVectorCall(updateRequest, _callback); + return updateVectorCall(xPineconeApiVersion, updateRequest, _callback); } /** * Update a vector * Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value. For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param updateRequest (required) - * @return Object + * @return UpdateResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1024,16 +1264,17 @@ private okhttp3.Call updateVectorValidateBeforeCall(UpdateRequest updateRequest,
5XX An unexpected error response. -
*/ - public Object updateVector(UpdateRequest updateRequest) throws ApiException { - ApiResponse localVarResp = updateVectorWithHttpInfo(updateRequest); + public UpdateResponse updateVector(String xPineconeApiVersion, UpdateRequest updateRequest) throws ApiException { + ApiResponse localVarResp = updateVectorWithHttpInfo(xPineconeApiVersion, updateRequest); return localVarResp.getData(); } /** * Update a vector * Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value. For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param updateRequest (required) - * @return ApiResponse<Object> + * @return ApiResponse<UpdateResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1044,15 +1285,16 @@ public Object updateVector(UpdateRequest updateRequest) throws ApiException {
5XX An unexpected error response. -
*/ - public ApiResponse updateVectorWithHttpInfo(UpdateRequest updateRequest) throws ApiException { - okhttp3.Call localVarCall = updateVectorValidateBeforeCall(updateRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateVectorWithHttpInfo(String xPineconeApiVersion, UpdateRequest updateRequest) throws ApiException { + okhttp3.Call localVarCall = updateVectorValidateBeforeCall(xPineconeApiVersion, updateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Update a vector (asynchronously) * Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value. For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param updateRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -1066,15 +1308,16 @@ public ApiResponse updateVectorWithHttpInfo(UpdateRequest updateRequest) 5XX An unexpected error response. - */ - public okhttp3.Call updateVectorAsync(UpdateRequest updateRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateVectorAsync(String xPineconeApiVersion, UpdateRequest updateRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateVectorValidateBeforeCall(updateRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateVectorValidateBeforeCall(xPineconeApiVersion, updateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for upsertRecordsNamespace + * @param xPineconeApiVersion Required date-based version header (required) * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @param _callback Callback for upload/download progress @@ -1089,7 +1332,7 @@ public okhttp3.Call updateVectorAsync(UpdateRequest updateRequest, final ApiCall 5XX An unexpected error response. - */ - public okhttp3.Call upsertRecordsNamespaceCall(String namespace, List upsertRecord, final ApiCallback _callback) throws ApiException { + public okhttp3.Call upsertRecordsNamespaceCall(String xPineconeApiVersion, String namespace, List upsertRecord, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1115,6 +1358,10 @@ public okhttp3.Call upsertRecordsNamespaceCall(String namespace, List localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1136,7 +1383,12 @@ public okhttp3.Call upsertRecordsNamespaceCall(String namespace, List upsertRecord, final ApiCallback _callback) throws ApiException { + private okhttp3.Call upsertRecordsNamespaceValidateBeforeCall(String xPineconeApiVersion, String namespace, List upsertRecord, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling upsertRecordsNamespace(Async)"); + } + // verify the required parameter 'namespace' is set if (namespace == null) { throw new ApiException("Missing the required parameter 'namespace' when calling upsertRecordsNamespace(Async)"); @@ -1147,13 +1399,14 @@ private okhttp3.Call upsertRecordsNamespaceValidateBeforeCall(String namespace, throw new ApiException("Missing the required parameter 'upsertRecord' when calling upsertRecordsNamespace(Async)"); } - return upsertRecordsNamespaceCall(namespace, upsertRecord, _callback); + return upsertRecordsNamespaceCall(xPineconeApiVersion, namespace, upsertRecord, _callback); } /** * 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/index-data/upsert-data#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, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -1166,13 +1419,14 @@ private okhttp3.Call upsertRecordsNamespaceValidateBeforeCall(String namespace, 5XX An unexpected error response. - */ - public void upsertRecordsNamespace(String namespace, List upsertRecord) throws ApiException { - upsertRecordsNamespaceWithHttpInfo(namespace, upsertRecord); + public void upsertRecordsNamespace(String xPineconeApiVersion, String namespace, List upsertRecord) throws ApiException { + upsertRecordsNamespaceWithHttpInfo(xPineconeApiVersion, namespace, upsertRecord); } /** * 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/index-data/upsert-data#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, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @return ApiResponse<Void> @@ -1186,14 +1440,15 @@ public void upsertRecordsNamespace(String namespace, List upsertRe 5XX An unexpected error response. - */ - public ApiResponse upsertRecordsNamespaceWithHttpInfo(String namespace, List upsertRecord) throws ApiException { - okhttp3.Call localVarCall = upsertRecordsNamespaceValidateBeforeCall(namespace, upsertRecord, null); + public ApiResponse upsertRecordsNamespaceWithHttpInfo(String xPineconeApiVersion, String namespace, List upsertRecord) throws ApiException { + okhttp3.Call localVarCall = upsertRecordsNamespaceValidateBeforeCall(xPineconeApiVersion, namespace, upsertRecord, null); return localVarApiClient.execute(localVarCall); } /** * 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/index-data/upsert-data#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, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @param _callback The callback to be executed when the API call finishes @@ -1208,14 +1463,15 @@ public ApiResponse upsertRecordsNamespaceWithHttpInfo(String namespace, Li 5XX An unexpected error response. - */ - public okhttp3.Call upsertRecordsNamespaceAsync(String namespace, List upsertRecord, final ApiCallback _callback) throws ApiException { + public okhttp3.Call upsertRecordsNamespaceAsync(String xPineconeApiVersion, String namespace, List upsertRecord, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = upsertRecordsNamespaceValidateBeforeCall(namespace, upsertRecord, _callback); + okhttp3.Call localVarCall = upsertRecordsNamespaceValidateBeforeCall(xPineconeApiVersion, namespace, upsertRecord, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for upsertVectors + * @param xPineconeApiVersion Required date-based version header (required) * @param upsertRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1229,7 +1485,7 @@ public okhttp3.Call upsertRecordsNamespaceAsync(String namespace, List 5XX An unexpected error response. - */ - public okhttp3.Call upsertVectorsCall(UpsertRequest upsertRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call upsertVectorsCall(String xPineconeApiVersion, UpsertRequest upsertRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1254,6 +1510,10 @@ public okhttp3.Call upsertVectorsCall(UpsertRequest upsertRequest, final ApiCall Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -1275,19 +1535,25 @@ public okhttp3.Call upsertVectorsCall(UpsertRequest upsertRequest, final ApiCall } @SuppressWarnings("rawtypes") - private okhttp3.Call upsertVectorsValidateBeforeCall(UpsertRequest upsertRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call upsertVectorsValidateBeforeCall(String xPineconeApiVersion, UpsertRequest upsertRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling upsertVectors(Async)"); + } + // verify the required parameter 'upsertRequest' is set if (upsertRequest == null) { throw new ApiException("Missing the required parameter 'upsertRequest' when calling upsertVectors(Async)"); } - return upsertVectorsCall(upsertRequest, _callback); + return upsertVectorsCall(xPineconeApiVersion, upsertRequest, _callback); } /** * Upsert vectors - * 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/index-data/upsert-data#upsert-vectors). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param upsertRequest (required) * @return UpsertResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1300,14 +1566,15 @@ private okhttp3.Call upsertVectorsValidateBeforeCall(UpsertRequest upsertRequest 5XX An unexpected error response. - */ - public UpsertResponse upsertVectors(UpsertRequest upsertRequest) throws ApiException { - ApiResponse localVarResp = upsertVectorsWithHttpInfo(upsertRequest); + public UpsertResponse upsertVectors(String xPineconeApiVersion, UpsertRequest upsertRequest) throws ApiException { + ApiResponse localVarResp = upsertVectorsWithHttpInfo(xPineconeApiVersion, upsertRequest); return localVarResp.getData(); } /** * Upsert vectors - * 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/index-data/upsert-data#upsert-vectors). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param upsertRequest (required) * @return ApiResponse<UpsertResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1320,15 +1587,16 @@ public UpsertResponse upsertVectors(UpsertRequest upsertRequest) throws ApiExcep 5XX An unexpected error response. - */ - public ApiResponse upsertVectorsWithHttpInfo(UpsertRequest upsertRequest) throws ApiException { - okhttp3.Call localVarCall = upsertVectorsValidateBeforeCall(upsertRequest, null); + public ApiResponse upsertVectorsWithHttpInfo(String xPineconeApiVersion, UpsertRequest upsertRequest) throws ApiException { + okhttp3.Call localVarCall = upsertVectorsValidateBeforeCall(xPineconeApiVersion, upsertRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Upsert vectors (asynchronously) - * 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/index-data/upsert-data#upsert-vectors). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). + * @param xPineconeApiVersion Required date-based version header (required) * @param upsertRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -1342,9 +1610,9 @@ public ApiResponse upsertVectorsWithHttpInfo(UpsertRequest upser 5XX An unexpected error response. - */ - public okhttp3.Call upsertVectorsAsync(UpsertRequest upsertRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call upsertVectorsAsync(String xPineconeApiVersion, UpsertRequest upsertRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = upsertVectorsValidateBeforeCall(upsertRequest, _callback); + okhttp3.Call localVarCall = upsertVectorsValidateBeforeCall(xPineconeApiVersion, upsertRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; 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 21b0a552..153decbd 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 5de0e4a0..ef40bede 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-04 + * The version of the OpenAPI document: 2025-10 * 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 c167dfc0..32af0ef6 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-04 + * The version of the OpenAPI document: 2025-10 * 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 0b8f4a8f..ff924461 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 7a64b0cc..b58c7fd6 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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/CreateNamespaceRequest.java b/src/main/java/org/openapitools/db_data/client/model/CreateNamespaceRequest.java new file mode 100644 index 00000000..c3583482 --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/CreateNamespaceRequest.java @@ -0,0 +1,325 @@ +/* + * 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-10 + * 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 org.openapitools.db_data.client.model.CreateNamespaceRequestSchema; + +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 request for creating a namespace with the specified namespace name. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") +public class CreateNamespaceRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + private CreateNamespaceRequestSchema schema; + + public CreateNamespaceRequest() { + } + + public CreateNamespaceRequest name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the namespace. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateNamespaceRequest schema(CreateNamespaceRequestSchema schema) { + + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + **/ + @javax.annotation.Nullable + public CreateNamespaceRequestSchema getSchema() { + return schema; + } + + + public void setSchema(CreateNamespaceRequestSchema schema) { + this.schema = schema; + } + + /** + * 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 CreateNamespaceRequest instance itself + */ + public CreateNamespaceRequest 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; + } + CreateNamespaceRequest createNamespaceRequest = (CreateNamespaceRequest) o; + return Objects.equals(this.name, createNamespaceRequest.name) && + Objects.equals(this.schema, createNamespaceRequest.schema)&& + Objects.equals(this.additionalProperties, createNamespaceRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, schema, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNamespaceRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).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("schema"); + + // 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 CreateNamespaceRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNamespaceRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateNamespaceRequest is not found in the empty JSON string", CreateNamespaceRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateNamespaceRequest.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())); + } + // validate the optional field `schema` + if (jsonObj.get("schema") != null && !jsonObj.get("schema").isJsonNull()) { + CreateNamespaceRequestSchema.validateJsonElement(jsonObj.get("schema")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNamespaceRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNamespaceRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateNamespaceRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNamespaceRequest 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 CreateNamespaceRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNamespaceRequest 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 CreateNamespaceRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNamespaceRequest + * @throws IOException if the JSON string is invalid with respect to CreateNamespaceRequest + */ + public static CreateNamespaceRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNamespaceRequest.class); + } + + /** + * Convert an instance of CreateNamespaceRequest 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/CreateNamespaceRequestSchema.java b/src/main/java/org/openapitools/db_data/client/model/CreateNamespaceRequestSchema.java new file mode 100644 index 00000000..92428f37 --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/CreateNamespaceRequestSchema.java @@ -0,0 +1,300 @@ +/* + * 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-10 + * 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 java.util.HashMap; +import java.util.Map; +import org.openapitools.db_data.client.model.CreateNamespaceRequestSchemaFieldsValue; + +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; + +/** + * Schema for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `schema` is present, only fields which are present in the `fields` object with a `filterable: true` are indexed. Note that `filterable: false` is not currently supported. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") +public class CreateNamespaceRequestSchema { + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + private Map fields = new HashMap<>(); + + public CreateNamespaceRequestSchema() { + } + + public CreateNamespaceRequestSchema fields(Map fields) { + + this.fields = fields; + return this; + } + + public CreateNamespaceRequestSchema putFieldsItem(String key, CreateNamespaceRequestSchemaFieldsValue fieldsItem) { + if (this.fields == null) { + this.fields = new HashMap<>(); + } + this.fields.put(key, fieldsItem); + return this; + } + + /** + * A map of metadata field names to their configuration. The field name must be a valid metadata field name. The field name must be unique. + * @return fields + **/ + @javax.annotation.Nonnull + public Map getFields() { + return fields; + } + + + public void setFields(Map fields) { + this.fields = fields; + } + + /** + * 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 CreateNamespaceRequestSchema instance itself + */ + public CreateNamespaceRequestSchema 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; + } + CreateNamespaceRequestSchema createNamespaceRequestSchema = (CreateNamespaceRequestSchema) o; + return Objects.equals(this.fields, createNamespaceRequestSchema.fields)&& + Objects.equals(this.additionalProperties, createNamespaceRequestSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNamespaceRequestSchema {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).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("fields"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fields"); + } + + /** + * 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 CreateNamespaceRequestSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNamespaceRequestSchema.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateNamespaceRequestSchema is not found in the empty JSON string", CreateNamespaceRequestSchema.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateNamespaceRequestSchema.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNamespaceRequestSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNamespaceRequestSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateNamespaceRequestSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNamespaceRequestSchema 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 CreateNamespaceRequestSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNamespaceRequestSchema 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 CreateNamespaceRequestSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNamespaceRequestSchema + * @throws IOException if the JSON string is invalid with respect to CreateNamespaceRequestSchema + */ + public static CreateNamespaceRequestSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNamespaceRequestSchema.class); + } + + /** + * Convert an instance of CreateNamespaceRequestSchema 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/CreateNamespaceRequestSchemaFieldsValue.java b/src/main/java/org/openapitools/db_data/client/model/CreateNamespaceRequestSchemaFieldsValue.java new file mode 100644 index 00000000..323a70d7 --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/CreateNamespaceRequestSchemaFieldsValue.java @@ -0,0 +1,281 @@ +/* + * 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-10 + * 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; + +/** + * CreateNamespaceRequestSchemaFieldsValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") +public class CreateNamespaceRequestSchemaFieldsValue { + public static final String SERIALIZED_NAME_FILTERABLE = "filterable"; + @SerializedName(SERIALIZED_NAME_FILTERABLE) + private Boolean filterable; + + public CreateNamespaceRequestSchemaFieldsValue() { + } + + public CreateNamespaceRequestSchemaFieldsValue filterable(Boolean filterable) { + + this.filterable = filterable; + return this; + } + + /** + * Whether the field is filterable. If true, the field is indexed and can be used in filters. Only true values are allowed. + * @return filterable + **/ + @javax.annotation.Nullable + public Boolean getFilterable() { + return filterable; + } + + + public void setFilterable(Boolean filterable) { + this.filterable = filterable; + } + + /** + * 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 CreateNamespaceRequestSchemaFieldsValue instance itself + */ + public CreateNamespaceRequestSchemaFieldsValue 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; + } + CreateNamespaceRequestSchemaFieldsValue createNamespaceRequestSchemaFieldsValue = (CreateNamespaceRequestSchemaFieldsValue) o; + return Objects.equals(this.filterable, createNamespaceRequestSchemaFieldsValue.filterable)&& + Objects.equals(this.additionalProperties, createNamespaceRequestSchemaFieldsValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(filterable, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNamespaceRequestSchemaFieldsValue {\n"); + sb.append(" filterable: ").append(toIndentedString(filterable)).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("filterable"); + + // 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 CreateNamespaceRequestSchemaFieldsValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNamespaceRequestSchemaFieldsValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateNamespaceRequestSchemaFieldsValue is not found in the empty JSON string", CreateNamespaceRequestSchemaFieldsValue.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNamespaceRequestSchemaFieldsValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNamespaceRequestSchemaFieldsValue' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateNamespaceRequestSchemaFieldsValue.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNamespaceRequestSchemaFieldsValue 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 CreateNamespaceRequestSchemaFieldsValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNamespaceRequestSchemaFieldsValue 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 CreateNamespaceRequestSchemaFieldsValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNamespaceRequestSchemaFieldsValue + * @throws IOException if the JSON string is invalid with respect to CreateNamespaceRequestSchemaFieldsValue + */ + public static CreateNamespaceRequestSchemaFieldsValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNamespaceRequestSchemaFieldsValue.class); + } + + /** + * Convert an instance of CreateNamespaceRequestSchemaFieldsValue 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/DeleteRequest.java b/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java index 1bfde9b4..8721057d 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class DeleteRequest { public static final String SERIALIZED_NAME_IDS = "ids"; @SerializedName(SERIALIZED_NAME_IDS) @@ -150,7 +150,7 @@ public DeleteRequest filter(Object filter) { } /** - * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID. + * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata). * @return filter **/ @javax.annotation.Nullable 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 7db02ffd..b85f0c20 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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/FetchByMetadataRequest.java b/src/main/java/org/openapitools/db_data/client/model/FetchByMetadataRequest.java new file mode 100644 index 00000000..ccd3f4cf --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/FetchByMetadataRequest.java @@ -0,0 +1,372 @@ +/* + * 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-10 + * 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; + +/** + * The request for the `fetch_by_metadata` operation. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") +public class FetchByMetadataRequest { + public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; + @SerializedName(SERIALIZED_NAME_NAMESPACE) + private String namespace; + + public static final String SERIALIZED_NAME_FILTER = "filter"; + @SerializedName(SERIALIZED_NAME_FILTER) + private Object filter; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + @SerializedName(SERIALIZED_NAME_LIMIT) + private Long limit = 100l; + + public static final String SERIALIZED_NAME_PAGINATION_TOKEN = "paginationToken"; + @SerializedName(SERIALIZED_NAME_PAGINATION_TOKEN) + private String paginationToken; + + public FetchByMetadataRequest() { + } + + public FetchByMetadataRequest namespace(String namespace) { + + this.namespace = namespace; + return this; + } + + /** + * The namespace to fetch vectors from. + * @return namespace + **/ + @javax.annotation.Nullable + public String getNamespace() { + return namespace; + } + + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + + public FetchByMetadataRequest filter(Object filter) { + + this.filter = filter; + return this; + } + + /** + * Metadata filter expression to select vectors. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). + * @return filter + **/ + @javax.annotation.Nullable + public Object getFilter() { + return filter; + } + + + public void setFilter(Object filter) { + this.filter = filter; + } + + + public FetchByMetadataRequest limit(Long limit) { + + this.limit = limit; + return this; + } + + /** + * Max number of vectors to return. + * minimum: 1 + * @return limit + **/ + @javax.annotation.Nullable + public Long getLimit() { + return limit; + } + + + public void setLimit(Long limit) { + this.limit = limit; + } + + + public FetchByMetadataRequest paginationToken(String paginationToken) { + + this.paginationToken = paginationToken; + return this; + } + + /** + * Pagination token to continue a previous listing operation. + * @return paginationToken + **/ + @javax.annotation.Nullable + public String getPaginationToken() { + return paginationToken; + } + + + public void setPaginationToken(String paginationToken) { + this.paginationToken = paginationToken; + } + + /** + * 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 FetchByMetadataRequest instance itself + */ + public FetchByMetadataRequest 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; + } + FetchByMetadataRequest fetchByMetadataRequest = (FetchByMetadataRequest) o; + return Objects.equals(this.namespace, fetchByMetadataRequest.namespace) && + Objects.equals(this.filter, fetchByMetadataRequest.filter) && + Objects.equals(this.limit, fetchByMetadataRequest.limit) && + Objects.equals(this.paginationToken, fetchByMetadataRequest.paginationToken)&& + Objects.equals(this.additionalProperties, fetchByMetadataRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(namespace, filter, limit, paginationToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FetchByMetadataRequest {\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" paginationToken: ").append(toIndentedString(paginationToken)).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("namespace"); + openapiFields.add("filter"); + openapiFields.add("limit"); + openapiFields.add("paginationToken"); + + // 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 FetchByMetadataRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FetchByMetadataRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FetchByMetadataRequest is not found in the empty JSON string", FetchByMetadataRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); + } + if ((jsonObj.get("paginationToken") != null && !jsonObj.get("paginationToken").isJsonNull()) && !jsonObj.get("paginationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `paginationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paginationToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FetchByMetadataRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FetchByMetadataRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FetchByMetadataRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FetchByMetadataRequest 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 FetchByMetadataRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FetchByMetadataRequest 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 FetchByMetadataRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FetchByMetadataRequest + * @throws IOException if the JSON string is invalid with respect to FetchByMetadataRequest + */ + public static FetchByMetadataRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FetchByMetadataRequest.class); + } + + /** + * Convert an instance of FetchByMetadataRequest 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/FetchByMetadataResponse.java b/src/main/java/org/openapitools/db_data/client/model/FetchByMetadataResponse.java new file mode 100644 index 00000000..71e27bc1 --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/FetchByMetadataResponse.java @@ -0,0 +1,389 @@ +/* + * 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-10 + * 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 java.util.HashMap; +import java.util.Map; +import org.openapitools.db_data.client.model.Pagination; +import org.openapitools.db_data.client.model.Usage; +import org.openapitools.db_data.client.model.Vector; + +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; + +/** + * The response for the `fetch_by_metadata` operation. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") +public class FetchByMetadataResponse { + public static final String SERIALIZED_NAME_VECTORS = "vectors"; + @SerializedName(SERIALIZED_NAME_VECTORS) + private Map vectors = new HashMap<>(); + + public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; + @SerializedName(SERIALIZED_NAME_NAMESPACE) + private String namespace = ""; + + public static final String SERIALIZED_NAME_USAGE = "usage"; + @SerializedName(SERIALIZED_NAME_USAGE) + private Usage usage; + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public FetchByMetadataResponse() { + } + + public FetchByMetadataResponse vectors(Map vectors) { + + this.vectors = vectors; + return this; + } + + public FetchByMetadataResponse putVectorsItem(String key, Vector vectorsItem) { + if (this.vectors == null) { + this.vectors = new HashMap<>(); + } + this.vectors.put(key, vectorsItem); + return this; + } + + /** + * The fetched vectors, in the form of a map between the fetched ids and the fetched vectors + * @return vectors + **/ + @javax.annotation.Nullable + public Map getVectors() { + return vectors; + } + + + public void setVectors(Map vectors) { + this.vectors = vectors; + } + + + public FetchByMetadataResponse namespace(String namespace) { + + this.namespace = namespace; + return this; + } + + /** + * The namespace of the vectors. + * @return namespace + **/ + @javax.annotation.Nullable + public String getNamespace() { + return namespace; + } + + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + + public FetchByMetadataResponse usage(Usage usage) { + + this.usage = usage; + return this; + } + + /** + * Get usage + * @return usage + **/ + @javax.annotation.Nullable + public Usage getUsage() { + return usage; + } + + + public void setUsage(Usage usage) { + this.usage = usage; + } + + + public FetchByMetadataResponse 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 FetchByMetadataResponse instance itself + */ + public FetchByMetadataResponse 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; + } + FetchByMetadataResponse fetchByMetadataResponse = (FetchByMetadataResponse) o; + return Objects.equals(this.vectors, fetchByMetadataResponse.vectors) && + Objects.equals(this.namespace, fetchByMetadataResponse.namespace) && + Objects.equals(this.usage, fetchByMetadataResponse.usage) && + Objects.equals(this.pagination, fetchByMetadataResponse.pagination)&& + Objects.equals(this.additionalProperties, fetchByMetadataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(vectors, namespace, usage, pagination, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FetchByMetadataResponse {\n"); + sb.append(" vectors: ").append(toIndentedString(vectors)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).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("vectors"); + openapiFields.add("namespace"); + openapiFields.add("usage"); + 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 FetchByMetadataResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FetchByMetadataResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FetchByMetadataResponse is not found in the empty JSON string", FetchByMetadataResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); + } + // validate the optional field `usage` + if (jsonObj.get("usage") != null && !jsonObj.get("usage").isJsonNull()) { + Usage.validateJsonElement(jsonObj.get("usage")); + } + // 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 (!FetchByMetadataResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FetchByMetadataResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FetchByMetadataResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FetchByMetadataResponse 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 FetchByMetadataResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FetchByMetadataResponse 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 FetchByMetadataResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FetchByMetadataResponse + * @throws IOException if the JSON string is invalid with respect to FetchByMetadataResponse + */ + public static FetchByMetadataResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FetchByMetadataResponse.class); + } + + /** + * Convert an instance of FetchByMetadataResponse 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/FetchResponse.java b/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java index 2a3e1a05..d07033c0 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 7b8d01b3..39389c30 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 6fb8f885..eedacf90 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,79 +49,32 @@ /** * Indicates how to respond to errors during the import process. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class ImportErrorMode { - /** - * Indicates how to respond to errors during the import process. - */ - @JsonAdapter(OnErrorEnum.Adapter.class) - public enum OnErrorEnum { - ABORT("abort"), - - CONTINUE("continue"); - - private String value; - - OnErrorEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static OnErrorEnum fromValue(String value) { - for (OnErrorEnum b : OnErrorEnum.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 OnErrorEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public OnErrorEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return OnErrorEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_ON_ERROR = "onError"; @SerializedName(SERIALIZED_NAME_ON_ERROR) - private OnErrorEnum onError; + private String onError; public ImportErrorMode() { } - public ImportErrorMode onError(OnErrorEnum onError) { + public ImportErrorMode onError(String onError) { this.onError = onError; return this; } /** - * Indicates how to respond to errors during the import process. + * Indicates how to respond to errors during the import process. Possible values: `abort` or `continue`. * @return onError **/ @javax.annotation.Nullable - public OnErrorEnum getOnError() { + public String getOnError() { return onError; } - public void setOnError(OnErrorEnum onError) { + public void setOnError(String onError) { this.onError = onError; } 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 a3eb13c5..33a8e56d 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class ImportModel { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -60,62 +60,9 @@ public class ImportModel { @SerializedName(SERIALIZED_NAME_URI) private String uri; - /** - * The status of the operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PENDING("Pending"), - - INPROGRESS("InProgress"), - - FAILED("Failed"), - - COMPLETED("Completed"), - - CANCELLED("Cancelled"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + private String status; public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @SerializedName(SERIALIZED_NAME_CREATED_AT) @@ -182,23 +129,23 @@ public void setUri(String uri) { } - public ImportModel status(StatusEnum status) { + public ImportModel status(String status) { this.status = status; return this; } /** - * The status of the operation. + * The status of the operation. Possible values: `Pending`, `InProgress`, `Failed`, `Completed`, or `Cancelled`. * @return status **/ @javax.annotation.Nullable - public StatusEnum getStatus() { + public String getStatus() { return status; } - public void setStatus(StatusEnum status) { + public void setStatus(String status) { this.status = status; } 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 d824cf86..420652a4 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class IndexDescription { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) @@ -78,6 +78,14 @@ public class IndexDescription { @SerializedName(SERIALIZED_NAME_VECTOR_TYPE) private String vectorType; + public static final String SERIALIZED_NAME_MEMORY_FULLNESS = "memory_fullness"; + @SerializedName(SERIALIZED_NAME_MEMORY_FULLNESS) + private Float memoryFullness; + + public static final String SERIALIZED_NAME_STORAGE_FULLNESS = "storage_fullness"; + @SerializedName(SERIALIZED_NAME_STORAGE_FULLNESS) + private Float storageFullness; + public IndexDescription() { } @@ -214,6 +222,48 @@ public void setVectorType(String vectorType) { this.vectorType = vectorType; } + + public IndexDescription memoryFullness(Float memoryFullness) { + + this.memoryFullness = memoryFullness; + return this; + } + + /** + * The amount of memory used by a dedicated index + * @return memoryFullness + **/ + @javax.annotation.Nullable + public Float getMemoryFullness() { + return memoryFullness; + } + + + public void setMemoryFullness(Float memoryFullness) { + this.memoryFullness = memoryFullness; + } + + + public IndexDescription storageFullness(Float storageFullness) { + + this.storageFullness = storageFullness; + return this; + } + + /** + * The amount of storage used by a dedicated index + * @return storageFullness + **/ + @javax.annotation.Nullable + public Float getStorageFullness() { + return storageFullness; + } + + + public void setStorageFullness(Float storageFullness) { + this.storageFullness = storageFullness; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -274,13 +324,15 @@ public boolean equals(Object o) { Objects.equals(this.indexFullness, indexDescription.indexFullness) && Objects.equals(this.totalVectorCount, indexDescription.totalVectorCount) && Objects.equals(this.metric, indexDescription.metric) && - Objects.equals(this.vectorType, indexDescription.vectorType)&& + Objects.equals(this.vectorType, indexDescription.vectorType) && + Objects.equals(this.memoryFullness, indexDescription.memoryFullness) && + Objects.equals(this.storageFullness, indexDescription.storageFullness)&& Objects.equals(this.additionalProperties, indexDescription.additionalProperties); } @Override public int hashCode() { - return Objects.hash(namespaces, dimension, indexFullness, totalVectorCount, metric, vectorType, additionalProperties); + return Objects.hash(namespaces, dimension, indexFullness, totalVectorCount, metric, vectorType, memoryFullness, storageFullness, additionalProperties); } @Override @@ -293,6 +345,8 @@ public String toString() { sb.append(" totalVectorCount: ").append(toIndentedString(totalVectorCount)).append("\n"); sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); sb.append(" vectorType: ").append(toIndentedString(vectorType)).append("\n"); + sb.append(" memoryFullness: ").append(toIndentedString(memoryFullness)).append("\n"); + sb.append(" storageFullness: ").append(toIndentedString(storageFullness)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -322,6 +376,8 @@ private String toIndentedString(Object o) { openapiFields.add("totalVectorCount"); openapiFields.add("metric"); openapiFields.add("vectorType"); + openapiFields.add("memory_fullness"); + openapiFields.add("storage_fullness"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); 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 11839919..df4dbe98 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 43a85af4..98b46be8 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 index 3585e335..a770cbbb 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,7 +53,7 @@ /** * ListNamespacesResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class ListNamespacesResponse { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) @@ -63,6 +63,10 @@ public class ListNamespacesResponse { @SerializedName(SERIALIZED_NAME_PAGINATION) private Pagination pagination; + public static final String SERIALIZED_NAME_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + private Integer totalCount; + public ListNamespacesResponse() { } @@ -115,6 +119,27 @@ public void setPagination(Pagination pagination) { this.pagination = pagination; } + + public ListNamespacesResponse totalCount(Integer totalCount) { + + this.totalCount = totalCount; + return this; + } + + /** + * The total number of namespaces in the index matching the prefix + * @return totalCount + **/ + @javax.annotation.Nullable + public Integer getTotalCount() { + return totalCount; + } + + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -171,13 +196,14 @@ public boolean equals(Object o) { } ListNamespacesResponse listNamespacesResponse = (ListNamespacesResponse) o; return Objects.equals(this.namespaces, listNamespacesResponse.namespaces) && - Objects.equals(this.pagination, listNamespacesResponse.pagination)&& + Objects.equals(this.pagination, listNamespacesResponse.pagination) && + Objects.equals(this.totalCount, listNamespacesResponse.totalCount)&& Objects.equals(this.additionalProperties, listNamespacesResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(namespaces, pagination, additionalProperties); + return Objects.hash(namespaces, pagination, totalCount, additionalProperties); } @Override @@ -186,6 +212,7 @@ public String toString() { sb.append("class ListNamespacesResponse {\n"); sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -211,6 +238,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("namespaces"); openapiFields.add("pagination"); + openapiFields.add("total_count"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); 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 5d3b65aa..1acea374 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 index f3c9b464..e607a924 100644 --- a/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.java +++ b/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,6 +21,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; +import org.openapitools.db_data.client.model.CreateNamespaceRequestSchema; +import org.openapitools.db_data.client.model.NamespaceDescriptionIndexedFields; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -49,7 +51,7 @@ /** * A description of a namespace, including the name and record count. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class NamespaceDescription { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -59,6 +61,14 @@ public class NamespaceDescription { @SerializedName(SERIALIZED_NAME_RECORD_COUNT) private Long recordCount; + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + private CreateNamespaceRequestSchema schema; + + public static final String SERIALIZED_NAME_INDEXED_FIELDS = "indexed_fields"; + @SerializedName(SERIALIZED_NAME_INDEXED_FIELDS) + private NamespaceDescriptionIndexedFields indexedFields; + public NamespaceDescription() { } @@ -103,6 +113,48 @@ public void setRecordCount(Long recordCount) { this.recordCount = recordCount; } + + public NamespaceDescription schema(CreateNamespaceRequestSchema schema) { + + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + **/ + @javax.annotation.Nullable + public CreateNamespaceRequestSchema getSchema() { + return schema; + } + + + public void setSchema(CreateNamespaceRequestSchema schema) { + this.schema = schema; + } + + + public NamespaceDescription indexedFields(NamespaceDescriptionIndexedFields indexedFields) { + + this.indexedFields = indexedFields; + return this; + } + + /** + * Get indexedFields + * @return indexedFields + **/ + @javax.annotation.Nullable + public NamespaceDescriptionIndexedFields getIndexedFields() { + return indexedFields; + } + + + public void setIndexedFields(NamespaceDescriptionIndexedFields indexedFields) { + this.indexedFields = indexedFields; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -159,13 +211,15 @@ public boolean equals(Object o) { } NamespaceDescription namespaceDescription = (NamespaceDescription) o; return Objects.equals(this.name, namespaceDescription.name) && - Objects.equals(this.recordCount, namespaceDescription.recordCount)&& + Objects.equals(this.recordCount, namespaceDescription.recordCount) && + Objects.equals(this.schema, namespaceDescription.schema) && + Objects.equals(this.indexedFields, namespaceDescription.indexedFields)&& Objects.equals(this.additionalProperties, namespaceDescription.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, recordCount, additionalProperties); + return Objects.hash(name, recordCount, schema, indexedFields, additionalProperties); } @Override @@ -174,6 +228,8 @@ public String toString() { sb.append("class NamespaceDescription {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" recordCount: ").append(toIndentedString(recordCount)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" indexedFields: ").append(toIndentedString(indexedFields)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -199,6 +255,8 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("name"); openapiFields.add("record_count"); + openapiFields.add("schema"); + openapiFields.add("indexed_fields"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -220,6 +278,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } + // validate the optional field `schema` + if (jsonObj.get("schema") != null && !jsonObj.get("schema").isJsonNull()) { + CreateNamespaceRequestSchema.validateJsonElement(jsonObj.get("schema")); + } + // validate the optional field `indexed_fields` + if (jsonObj.get("indexed_fields") != null && !jsonObj.get("indexed_fields").isJsonNull()) { + NamespaceDescriptionIndexedFields.validateJsonElement(jsonObj.get("indexed_fields")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/org/openapitools/db_data/client/model/NamespaceDescriptionIndexedFields.java b/src/main/java/org/openapitools/db_data/client/model/NamespaceDescriptionIndexedFields.java new file mode 100644 index 00000000..13b8d501 --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/NamespaceDescriptionIndexedFields.java @@ -0,0 +1,295 @@ +/* + * 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-10 + * 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 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 list of all indexed metatadata fields in the namespace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") +public class NamespaceDescriptionIndexedFields { + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + private List fields; + + public NamespaceDescriptionIndexedFields() { + } + + public NamespaceDescriptionIndexedFields fields(List fields) { + + this.fields = fields; + return this; + } + + public NamespaceDescriptionIndexedFields addFieldsItem(String fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Get fields + * @return fields + **/ + @javax.annotation.Nullable + public List getFields() { + return fields; + } + + + public void setFields(List fields) { + this.fields = fields; + } + + /** + * 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 NamespaceDescriptionIndexedFields instance itself + */ + public NamespaceDescriptionIndexedFields 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; + } + NamespaceDescriptionIndexedFields namespaceDescriptionIndexedFields = (NamespaceDescriptionIndexedFields) o; + return Objects.equals(this.fields, namespaceDescriptionIndexedFields.fields)&& + Objects.equals(this.additionalProperties, namespaceDescriptionIndexedFields.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NamespaceDescriptionIndexedFields {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).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("fields"); + + // 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 NamespaceDescriptionIndexedFields + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NamespaceDescriptionIndexedFields.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NamespaceDescriptionIndexedFields is not found in the empty JSON string", NamespaceDescriptionIndexedFields.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("fields") != null && !jsonObj.get("fields").isJsonNull() && !jsonObj.get("fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fields` to be an array in the JSON string but got `%s`", jsonObj.get("fields").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NamespaceDescriptionIndexedFields.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NamespaceDescriptionIndexedFields' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NamespaceDescriptionIndexedFields.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NamespaceDescriptionIndexedFields 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 NamespaceDescriptionIndexedFields read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NamespaceDescriptionIndexedFields 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 NamespaceDescriptionIndexedFields given an JSON string + * + * @param jsonString JSON string + * @return An instance of NamespaceDescriptionIndexedFields + * @throws IOException if the JSON string is invalid with respect to NamespaceDescriptionIndexedFields + */ + public static NamespaceDescriptionIndexedFields fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NamespaceDescriptionIndexedFields.class); + } + + /** + * Convert an instance of NamespaceDescriptionIndexedFields 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 87b1852a..d3749315 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 2ec3efb4..86437a5a 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 4d3467fa..9bf09a2d 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 deleted file mode 100644 index 3e810728..00000000 --- a/src/main/java/org/openapitools/db_data/client/model/ProtobufNullValue.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.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; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - */ -@JsonAdapter(ProtobufNullValue.Adapter.class) -public enum ProtobufNullValue { - - NULL_VALUE("NULL_VALUE"); - - private String value; - - ProtobufNullValue(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ProtobufNullValue fromValue(String value) { - for (ProtobufNullValue b : ProtobufNullValue.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 ProtobufNullValue enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ProtobufNullValue read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ProtobufNullValue.fromValue(value); - } - } -} - 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 441fec35..55a01498 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class QueryRequest { public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) 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 22436c96..9b96bae2 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 6773fa7e..fe9ba07a 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 20bb1dfe..b860df2e 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 5410bb08..e9d2f95a 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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/SearchMatchTerms.java b/src/main/java/org/openapitools/db_data/client/model/SearchMatchTerms.java new file mode 100644 index 00000000..cfbc53ab --- /dev/null +++ b/src/main/java/org/openapitools/db_data/client/model/SearchMatchTerms.java @@ -0,0 +1,326 @@ +/* + * 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-10 + * 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 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; + +/** + * Specifies which terms must be present in the text of each search hit based on the specified strategy. The match is performed against the text field specified in the integrated index `field_map` configuration. Terms are normalized and tokenized into single tokens before matching, and order does not matter. Example: `\"match_terms\": {\"terms\": [\"animal\", \"CHARACTER\", \"donald Duck\"], \"strategy\": \"all\"}` will tokenize to `[\"animal\", \"character\", \"donald\", \"duck\"]`, and would match `\"Donald F. Duck is a funny animal character\"` but would not match `\"A duck is a funny animal\"`. Match terms filtering is supported only for sparse indexes with [integrated embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) configured to use the [pinecone-sparse-english-v0](https://docs.pinecone.io/models/pinecone-sparse-english-v0) model. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") +public class SearchMatchTerms { + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + @SerializedName(SERIALIZED_NAME_STRATEGY) + private String strategy; + + public static final String SERIALIZED_NAME_TERMS = "terms"; + @SerializedName(SERIALIZED_NAME_TERMS) + private List terms; + + public SearchMatchTerms() { + } + + public SearchMatchTerms strategy(String strategy) { + + this.strategy = strategy; + return this; + } + + /** + * The strategy for matching terms in the text. Currently, only `all` is supported, which means all specified terms must be present. + * @return strategy + **/ + @javax.annotation.Nullable + public String getStrategy() { + return strategy; + } + + + public void setStrategy(String strategy) { + this.strategy = strategy; + } + + + public SearchMatchTerms terms(List terms) { + + this.terms = terms; + return this; + } + + public SearchMatchTerms addTermsItem(String termsItem) { + if (this.terms == null) { + this.terms = new ArrayList<>(); + } + this.terms.add(termsItem); + return this; + } + + /** + * A list of terms that must be present in the text of each search hit based on the specified strategy. + * @return terms + **/ + @javax.annotation.Nullable + public List getTerms() { + return terms; + } + + + public void setTerms(List terms) { + this.terms = terms; + } + + /** + * 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 SearchMatchTerms instance itself + */ + public SearchMatchTerms 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; + } + SearchMatchTerms searchMatchTerms = (SearchMatchTerms) o; + return Objects.equals(this.strategy, searchMatchTerms.strategy) && + Objects.equals(this.terms, searchMatchTerms.terms)&& + Objects.equals(this.additionalProperties, searchMatchTerms.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(strategy, terms, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchMatchTerms {\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" terms: ").append(toIndentedString(terms)).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("strategy"); + openapiFields.add("terms"); + + // 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 SearchMatchTerms + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SearchMatchTerms.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SearchMatchTerms is not found in the empty JSON string", SearchMatchTerms.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("strategy") != null && !jsonObj.get("strategy").isJsonNull()) && !jsonObj.get("strategy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `strategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strategy").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("terms") != null && !jsonObj.get("terms").isJsonNull() && !jsonObj.get("terms").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `terms` to be an array in the JSON string but got `%s`", jsonObj.get("terms").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SearchMatchTerms.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SearchMatchTerms' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SearchMatchTerms.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SearchMatchTerms 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 SearchMatchTerms read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SearchMatchTerms 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 SearchMatchTerms given an JSON string + * + * @param jsonString JSON string + * @return An instance of SearchMatchTerms + * @throws IOException if the JSON string is invalid with respect to SearchMatchTerms + */ + public static SearchMatchTerms fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SearchMatchTerms.class); + } + + /** + * Convert an instance of SearchMatchTerms 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/SearchRecordsRequest.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java index 8c8e6562..d3259adf 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class SearchRecordsRequest { public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) 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 2a65d9d6..1504a5a7 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-04 + * The version of the OpenAPI document: 2025-10 * 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_data.client.model.SearchMatchTerms; import org.openapitools.db_data.client.model.SearchRecordsVector; import com.google.gson.Gson; @@ -50,7 +51,7 @@ /** * . */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class SearchRecordsRequestQuery { public static final String SERIALIZED_NAME_TOP_K = "top_k"; @SerializedName(SERIALIZED_NAME_TOP_K) @@ -72,6 +73,10 @@ public class SearchRecordsRequestQuery { @SerializedName(SERIALIZED_NAME_ID) private String id; + public static final String SERIALIZED_NAME_MATCH_TERMS = "match_terms"; + @SerializedName(SERIALIZED_NAME_MATCH_TERMS) + private SearchMatchTerms matchTerms; + public SearchRecordsRequestQuery() { } @@ -179,6 +184,27 @@ public void setId(String id) { this.id = id; } + + public SearchRecordsRequestQuery matchTerms(SearchMatchTerms matchTerms) { + + this.matchTerms = matchTerms; + return this; + } + + /** + * Get matchTerms + * @return matchTerms + **/ + @javax.annotation.Nullable + public SearchMatchTerms getMatchTerms() { + return matchTerms; + } + + + public void setMatchTerms(SearchMatchTerms matchTerms) { + this.matchTerms = matchTerms; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -238,13 +264,14 @@ public boolean equals(Object o) { Objects.equals(this.filter, searchRecordsRequestQuery.filter) && Objects.equals(this.inputs, searchRecordsRequestQuery.inputs) && Objects.equals(this.vector, searchRecordsRequestQuery.vector) && - Objects.equals(this.id, searchRecordsRequestQuery.id)&& + Objects.equals(this.id, searchRecordsRequestQuery.id) && + Objects.equals(this.matchTerms, searchRecordsRequestQuery.matchTerms)&& Objects.equals(this.additionalProperties, searchRecordsRequestQuery.additionalProperties); } @Override public int hashCode() { - return Objects.hash(topK, filter, inputs, vector, id, additionalProperties); + return Objects.hash(topK, filter, inputs, vector, id, matchTerms, additionalProperties); } @Override @@ -256,6 +283,7 @@ public String toString() { sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); sb.append(" vector: ").append(toIndentedString(vector)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" matchTerms: ").append(toIndentedString(matchTerms)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -284,6 +312,7 @@ private String toIndentedString(Object o) { openapiFields.add("inputs"); openapiFields.add("vector"); openapiFields.add("id"); + openapiFields.add("match_terms"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -317,6 +346,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !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())); } + // validate the optional field `match_terms` + if (jsonObj.get("match_terms") != null && !jsonObj.get("match_terms").isJsonNull()) { + SearchMatchTerms.validateJsonElement(jsonObj.get("match_terms")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 08388bd5..7d23cceb 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class SearchRecordsRequestRerank { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) 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 1afe35ef..c4da2051 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 7d1642f6..ed8fe30e 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 43f169d2..d0c2b2c5 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 49250b12..822fa892 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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/SingleQueryResults.java b/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java index bf6684af..12bec596 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 67a87bb2..aceef0ad 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 3170abb1..abf77991 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class StartImportRequest { public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) @@ -95,7 +95,7 @@ public StartImportRequest uri(String uri) { } /** - * The [URI prefix](https://docs.pinecone.io/guides/index-data/import-data#prepare-your-data) under which the data to import is available. All data within this prefix will be listed then imported into the target index. Currently only `s3://` URIs are supported. + * The URI of the bucket (or container) and import directory containing the namespaces and Parquet files you want to import. For example, `s3://BUCKET_NAME/IMPORT_DIR` for Amazon S3, `gs://BUCKET_NAME/IMPORT_DIR` for Google Cloud Storage, or `https://STORAGE_ACCOUNT.blob.core.windows.net/CONTAINER_NAME/IMPORT_DIR` for Azure Blob Storage. For more information, see [Import records](https://docs.pinecone.io/guides/index-data/import-data#prepare-your-data). * @return uri **/ @javax.annotation.Nonnull 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 2519ee44..030d41bf 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 2769225b..c2099125 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class UpdateRequest { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -74,6 +74,14 @@ public class UpdateRequest { @SerializedName(SERIALIZED_NAME_NAMESPACE) private String namespace; + public static final String SERIALIZED_NAME_FILTER = "filter"; + @SerializedName(SERIALIZED_NAME_FILTER) + private Object filter; + + public static final String SERIALIZED_NAME_DRY_RUN = "dryRun"; + @SerializedName(SERIALIZED_NAME_DRY_RUN) + private Boolean dryRun = false; + public UpdateRequest() { } @@ -87,7 +95,7 @@ public UpdateRequest id(String id) { * Vector's unique id. * @return id **/ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getId() { return id; } @@ -189,6 +197,48 @@ public void setNamespace(String namespace) { this.namespace = namespace; } + + public UpdateRequest filter(Object filter) { + + this.filter = filter; + return this; + } + + /** + * A metadata filter expression. When updating metadata across records in a namespace, the update is applied to all records that match the filter. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). + * @return filter + **/ + @javax.annotation.Nullable + public Object getFilter() { + return filter; + } + + + public void setFilter(Object filter) { + this.filter = filter; + } + + + public UpdateRequest dryRun(Boolean dryRun) { + + this.dryRun = dryRun; + return this; + } + + /** + * If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`. + * @return dryRun + **/ + @javax.annotation.Nullable + public Boolean getDryRun() { + return dryRun; + } + + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -248,13 +298,15 @@ public boolean equals(Object o) { Objects.equals(this.values, updateRequest.values) && Objects.equals(this.sparseValues, updateRequest.sparseValues) && Objects.equals(this.setMetadata, updateRequest.setMetadata) && - Objects.equals(this.namespace, updateRequest.namespace)&& + Objects.equals(this.namespace, updateRequest.namespace) && + Objects.equals(this.filter, updateRequest.filter) && + Objects.equals(this.dryRun, updateRequest.dryRun)&& Objects.equals(this.additionalProperties, updateRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, values, sparseValues, setMetadata, namespace, additionalProperties); + return Objects.hash(id, values, sparseValues, setMetadata, namespace, filter, dryRun, additionalProperties); } @Override @@ -266,6 +318,8 @@ public String toString() { sb.append(" sparseValues: ").append(toIndentedString(sparseValues)).append("\n"); sb.append(" setMetadata: ").append(toIndentedString(setMetadata)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -294,10 +348,11 @@ private String toIndentedString(Object o) { openapiFields.add("sparseValues"); openapiFields.add("setMetadata"); openapiFields.add("namespace"); + openapiFields.add("filter"); + openapiFields.add("dryRun"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); } /** @@ -312,15 +367,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateRequest is not found in the empty JSON string", UpdateRequest.openapiRequiredFields.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateRequest.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("id").isJsonPrimitive()) { + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !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 optional json data is an array if present diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchVector.java b/src/main/java/org/openapitools/db_data/client/model/UpdateResponse.java similarity index 73% rename from src/main/java/org/openapitools/db_data/client/model/SearchVector.java rename to src/main/java/org/openapitools/db_data/client/model/UpdateResponse.java index fb9f8b68..33aeebb6 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpdateResponse.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,9 +20,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -49,43 +47,35 @@ import org.openapitools.db_data.client.JSON; /** - * SearchVector + * The response for the `update` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") -public class SearchVector { - public static final String SERIALIZED_NAME_VALUES = "values"; - @SerializedName(SERIALIZED_NAME_VALUES) - private List values; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") +public class UpdateResponse { + public static final String SERIALIZED_NAME_MATCHED_RECORDS = "matchedRecords"; + @SerializedName(SERIALIZED_NAME_MATCHED_RECORDS) + private Integer matchedRecords; - public SearchVector() { + public UpdateResponse() { } - public SearchVector values(List values) { + public UpdateResponse matchedRecords(Integer matchedRecords) { - this.values = values; - return this; - } - - public SearchVector addValuesItem(Float valuesItem) { - if (this.values == null) { - this.values = new ArrayList<>(); - } - this.values.add(valuesItem); + this.matchedRecords = matchedRecords; return this; } /** - * This is the vector data included in the request. - * @return values + * The number of records that matched the filter (if a filter was provided). + * @return matchedRecords **/ @javax.annotation.Nullable - public List getValues() { - return values; + public Integer getMatchedRecords() { + return matchedRecords; } - public void setValues(List values) { - this.values = values; + public void setMatchedRecords(Integer matchedRecords) { + this.matchedRecords = matchedRecords; } /** @@ -101,9 +91,9 @@ public void setValues(List values) { * * @param key name of the property * @param value value of the property - * @return the SearchVector instance itself + * @return the UpdateResponse instance itself */ - public SearchVector putAdditionalProperty(String key, Object value) { + public UpdateResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -142,21 +132,21 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SearchVector searchVector = (SearchVector) o; - return Objects.equals(this.values, searchVector.values)&& - Objects.equals(this.additionalProperties, searchVector.additionalProperties); + UpdateResponse updateResponse = (UpdateResponse) o; + return Objects.equals(this.matchedRecords, updateResponse.matchedRecords)&& + Objects.equals(this.additionalProperties, updateResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(values, additionalProperties); + return Objects.hash(matchedRecords, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SearchVector {\n"); - sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append("class UpdateResponse {\n"); + sb.append(" matchedRecords: ").append(toIndentedString(matchedRecords)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -180,7 +170,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("values"); + openapiFields.add("matchedRecords"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -190,35 +180,31 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SearchVector + * @throws IOException if the JSON Element is invalid with respect to UpdateResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!SearchVector.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SearchVector is not found in the empty JSON string", SearchVector.openapiRequiredFields.toString())); + if (!UpdateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateResponse is not found in the empty JSON string", UpdateResponse.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // 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())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!SearchVector.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SearchVector' and its subtypes + if (!UpdateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SearchVector.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateResponse.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, SearchVector value) throws IOException { + public void write(JsonWriter out, UpdateResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -241,12 +227,12 @@ else if (entry.getValue() instanceof Character) } @Override - public SearchVector read(JsonReader in) throws IOException { + public UpdateResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - SearchVector instance = thisAdapter.fromJsonTree(jsonObj); + UpdateResponse instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -273,18 +259,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of SearchVector given an JSON string + * Create an instance of UpdateResponse given an JSON string * * @param jsonString JSON string - * @return An instance of SearchVector - * @throws IOException if the JSON string is invalid with respect to SearchVector + * @return An instance of UpdateResponse + * @throws IOException if the JSON string is invalid with respect to UpdateResponse */ - public static SearchVector fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SearchVector.class); + public static UpdateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateResponse.class); } /** - * Convert an instance of SearchVector to an JSON string + * Convert an instance of UpdateResponse to an JSON string * * @return JSON string */ 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 05833302..099aaf35 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 64e8da4f..a4f7303c 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class UpsertRequest { public static final String SERIALIZED_NAME_VECTORS = "vectors"; @SerializedName(SERIALIZED_NAME_VECTORS) @@ -80,7 +80,7 @@ public UpsertRequest addVectorsItem(Vector vectorsItem) { } /** - * An array containing the vectors to upsert. Recommended batch limit is 100 vectors. + * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors. * @return vectors **/ @javax.annotation.Nonnull 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 318cc107..3c8065f6 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 3d09eed8..e4c994bb 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[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 23ea788e..2052de58 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:31.689858Z[Etc/UTC]") public class Vector { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/inference/client/ApiCallback.java b/src/main/java/org/openapitools/inference/client/ApiCallback.java index 1297aa26..4b11a6e6 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-04 + * The version of the OpenAPI document: 2025-10 * 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 f35034cf..370c760c 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-04 + * The version of the OpenAPI document: 2025-10 * 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-04/java"); + setUserAgent("OpenAPI-Generator/2025-10/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 97224a48..76d7643c 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 c531c930..87a11d91 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-04 + * The version of the OpenAPI document: 2025-10 * 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 0803810f..6fe9ceab 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class Configuration { - public static final String VERSION = "2025-04"; + public static final String VERSION = "2025-10"; 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 b8a2017b..72fd9037 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-04 + * The version of the OpenAPI document: 2025-10 * 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 ade99b19..f3fef999 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-04 + * The version of the OpenAPI document: 2025-10 * 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/Pair.java b/src/main/java/org/openapitools/inference/client/Pair.java index 60e5aad0..aeb00477 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 d333e526..cdeffe7d 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-04 + * The version of the OpenAPI document: 2025-10 * 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 0a854805..24582c74 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-04 + * The version of the OpenAPI document: 2025-10 * 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 5abe3ae4..f5e3c8a6 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 b179f3b8..3b40f1af 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -80,6 +80,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for embed + * @param xPineconeApiVersion Required date-based version header (required) * @param embedRequest Generate embeddings for inputs. (optional) * @param _callback Callback for upload/download progress * @return Call to execute @@ -93,7 +94,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 500 Internal server error. - */ - public okhttp3.Call embedCall(EmbedRequest embedRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call embedCall(String xPineconeApiVersion, EmbedRequest embedRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -118,6 +119,10 @@ public okhttp3.Call embedCall(EmbedRequest embedRequest, final ApiCallback _call Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -139,14 +144,20 @@ public okhttp3.Call embedCall(EmbedRequest embedRequest, final ApiCallback _call } @SuppressWarnings("rawtypes") - private okhttp3.Call embedValidateBeforeCall(EmbedRequest embedRequest, final ApiCallback _callback) throws ApiException { - return embedCall(embedRequest, _callback); + private okhttp3.Call embedValidateBeforeCall(String xPineconeApiVersion, EmbedRequest embedRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling embed(Async)"); + } + + return embedCall(xPineconeApiVersion, embedRequest, _callback); } /** * Generate vectors * Generate vector embeddings for input data. This endpoint uses Pinecone's [hosted embedding models](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -159,14 +170,15 @@ private okhttp3.Call embedValidateBeforeCall(EmbedRequest embedRequest, final Ap 500 Internal server error. - */ - public EmbeddingsList embed(EmbedRequest embedRequest) throws ApiException { - ApiResponse localVarResp = embedWithHttpInfo(embedRequest); + public EmbeddingsList embed(String xPineconeApiVersion, EmbedRequest embedRequest) throws ApiException { + ApiResponse localVarResp = embedWithHttpInfo(xPineconeApiVersion, embedRequest); return localVarResp.getData(); } /** * Generate vectors * Generate vector embeddings for input data. This endpoint uses Pinecone's [hosted embedding models](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -179,8 +191,8 @@ public EmbeddingsList embed(EmbedRequest embedRequest) throws ApiException { 500 Internal server error. - */ - public ApiResponse embedWithHttpInfo(EmbedRequest embedRequest) throws ApiException { - okhttp3.Call localVarCall = embedValidateBeforeCall(embedRequest, null); + public ApiResponse embedWithHttpInfo(String xPineconeApiVersion, EmbedRequest embedRequest) throws ApiException { + okhttp3.Call localVarCall = embedValidateBeforeCall(xPineconeApiVersion, embedRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -188,6 +200,7 @@ public ApiResponse embedWithHttpInfo(EmbedRequest embedRequest) /** * Generate vectors (asynchronously) * Generate vector embeddings for input data. This endpoint uses Pinecone's [hosted embedding models](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models). + * @param xPineconeApiVersion Required date-based version header (required) * @param embedRequest Generate embeddings for inputs. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -201,15 +214,16 @@ public ApiResponse embedWithHttpInfo(EmbedRequest embedRequest) 500 Internal server error. - */ - public okhttp3.Call embedAsync(EmbedRequest embedRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call embedAsync(String xPineconeApiVersion, EmbedRequest embedRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = embedValidateBeforeCall(embedRequest, _callback); + okhttp3.Call localVarCall = embedValidateBeforeCall(xPineconeApiVersion, embedRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getModel + * @param xPineconeApiVersion Required date-based version header (required) * @param modelName The name of the model to look up. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -223,7 +237,7 @@ public okhttp3.Call embedAsync(EmbedRequest embedRequest, final ApiCallback 500 Internal server error. - */ - public okhttp3.Call getModelCall(String modelName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getModelCall(String xPineconeApiVersion, String modelName, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -249,6 +263,10 @@ public okhttp3.Call getModelCall(String modelName, final ApiCallback _callback) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -269,19 +287,25 @@ public okhttp3.Call getModelCall(String modelName, final ApiCallback _callback) } @SuppressWarnings("rawtypes") - private okhttp3.Call getModelValidateBeforeCall(String modelName, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getModelValidateBeforeCall(String xPineconeApiVersion, String modelName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling getModel(Async)"); + } + // 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); + return getModelCall(xPineconeApiVersion, modelName, _callback); } /** * Describe a model * Get a description of a model hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -294,14 +318,15 @@ private okhttp3.Call getModelValidateBeforeCall(String modelName, final ApiCallb 500 Internal server error. - */ - public ModelInfo getModel(String modelName) throws ApiException { - ApiResponse localVarResp = getModelWithHttpInfo(modelName); + public ModelInfo getModel(String xPineconeApiVersion, String modelName) throws ApiException { + ApiResponse localVarResp = getModelWithHttpInfo(xPineconeApiVersion, modelName); return localVarResp.getData(); } /** * Describe a model * Get a description of a model hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -314,8 +339,8 @@ public ModelInfo getModel(String modelName) throws ApiException { 500 Internal server error. - */ - public ApiResponse getModelWithHttpInfo(String modelName) throws ApiException { - okhttp3.Call localVarCall = getModelValidateBeforeCall(modelName, null); + public ApiResponse getModelWithHttpInfo(String xPineconeApiVersion, String modelName) throws ApiException { + okhttp3.Call localVarCall = getModelValidateBeforeCall(xPineconeApiVersion, modelName, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -323,6 +348,7 @@ public ApiResponse getModelWithHttpInfo(String modelName) throws ApiE /** * Describe a model (asynchronously) * Get a description of a model hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -336,15 +362,16 @@ public ApiResponse getModelWithHttpInfo(String modelName) throws ApiE 500 Internal server error. - */ - public okhttp3.Call getModelAsync(String modelName, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getModelAsync(String xPineconeApiVersion, String modelName, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getModelValidateBeforeCall(modelName, _callback); + okhttp3.Call localVarCall = getModelValidateBeforeCall(xPineconeApiVersion, modelName, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listModels + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -359,7 +386,7 @@ public okhttp3.Call getModelAsync(String modelName, final ApiCallback 500 Internal server error. - */ - public okhttp3.Call listModelsCall(String type, String vectorType, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listModelsCall(String xPineconeApiVersion, String type, String vectorType, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -392,6 +419,10 @@ public okhttp3.Call listModelsCall(String type, String vectorType, final ApiCall localVarQueryParams.addAll(localVarApiClient.parameterToPair("vector_type", vectorType)); } + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -412,14 +443,20 @@ public okhttp3.Call listModelsCall(String type, String vectorType, final ApiCall } @SuppressWarnings("rawtypes") - private okhttp3.Call listModelsValidateBeforeCall(String type, String vectorType, final ApiCallback _callback) throws ApiException { - return listModelsCall(type, vectorType, _callback); + private okhttp3.Call listModelsValidateBeforeCall(String xPineconeApiVersion, String type, String vectorType, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling listModels(Async)"); + } + + return listModelsCall(xPineconeApiVersion, type, vectorType, _callback); } /** * List available models * List the embedding and reranking models hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -433,14 +470,15 @@ private okhttp3.Call listModelsValidateBeforeCall(String type, String vectorType 500 Internal server error. - */ - public ModelInfoList listModels(String type, String vectorType) throws ApiException { - ApiResponse localVarResp = listModelsWithHttpInfo(type, vectorType); + public ModelInfoList listModels(String xPineconeApiVersion, String type, String vectorType) throws ApiException { + ApiResponse localVarResp = listModelsWithHttpInfo(xPineconeApiVersion, type, vectorType); return localVarResp.getData(); } /** * List available models * List the embedding and reranking models hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @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> @@ -454,8 +492,8 @@ public ModelInfoList listModels(String type, String vectorType) throws ApiExcept 500 Internal server error. - */ - public ApiResponse listModelsWithHttpInfo(String type, String vectorType) throws ApiException { - okhttp3.Call localVarCall = listModelsValidateBeforeCall(type, vectorType, null); + public ApiResponse listModelsWithHttpInfo(String xPineconeApiVersion, String type, String vectorType) throws ApiException { + okhttp3.Call localVarCall = listModelsValidateBeforeCall(xPineconeApiVersion, type, vectorType, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -463,6 +501,7 @@ public ApiResponse listModelsWithHttpInfo(String type, String vec /** * List available models (asynchronously) * List the embedding and reranking models hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @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 @@ -477,15 +516,16 @@ public ApiResponse listModelsWithHttpInfo(String type, String vec 500 Internal server error. - */ - public okhttp3.Call listModelsAsync(String type, String vectorType, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listModelsAsync(String xPineconeApiVersion, String type, String vectorType, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listModelsValidateBeforeCall(type, vectorType, _callback); + okhttp3.Call localVarCall = listModelsValidateBeforeCall(xPineconeApiVersion, type, vectorType, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for rerank + * @param xPineconeApiVersion Required date-based version header (required) * @param rerankRequest Rerank documents for the given query (optional) * @param _callback Callback for upload/download progress * @return Call to execute @@ -499,7 +539,7 @@ public okhttp3.Call listModelsAsync(String type, String vectorType, final ApiCal 500 Internal server error. - */ - public okhttp3.Call rerankCall(RerankRequest rerankRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call rerankCall(String xPineconeApiVersion, RerankRequest rerankRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -524,6 +564,10 @@ public okhttp3.Call rerankCall(RerankRequest rerankRequest, final ApiCallback _c Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (xPineconeApiVersion != null) { + localVarHeaderParams.put("X-Pinecone-Api-Version", localVarApiClient.parameterToString(xPineconeApiVersion)); + } + final String[] localVarAccepts = { "application/json" }; @@ -545,14 +589,20 @@ public okhttp3.Call rerankCall(RerankRequest rerankRequest, final ApiCallback _c } @SuppressWarnings("rawtypes") - private okhttp3.Call rerankValidateBeforeCall(RerankRequest rerankRequest, final ApiCallback _callback) throws ApiException { - return rerankCall(rerankRequest, _callback); + private okhttp3.Call rerankValidateBeforeCall(String xPineconeApiVersion, RerankRequest rerankRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xPineconeApiVersion' is set + if (xPineconeApiVersion == null) { + throw new ApiException("Missing the required parameter 'xPineconeApiVersion' when calling rerank(Async)"); + } + + return rerankCall(xPineconeApiVersion, rerankRequest, _callback); } /** - * Rerank documents + * Rerank results * Rerank results according to their relevance to a query. For guidance and examples, see [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @param rerankRequest Rerank documents for the given query (optional) * @return RerankResult * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -565,14 +615,15 @@ private okhttp3.Call rerankValidateBeforeCall(RerankRequest rerankRequest, final 500 Internal server error. - */ - public RerankResult rerank(RerankRequest rerankRequest) throws ApiException { - ApiResponse localVarResp = rerankWithHttpInfo(rerankRequest); + public RerankResult rerank(String xPineconeApiVersion, RerankRequest rerankRequest) throws ApiException { + ApiResponse localVarResp = rerankWithHttpInfo(xPineconeApiVersion, rerankRequest); return localVarResp.getData(); } /** - * Rerank documents + * Rerank results * Rerank results according to their relevance to a query. For guidance and examples, see [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @param rerankRequest Rerank documents for the given query (optional) * @return ApiResponse<RerankResult> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -585,15 +636,16 @@ public RerankResult rerank(RerankRequest rerankRequest) throws ApiException { 500 Internal server error. - */ - public ApiResponse rerankWithHttpInfo(RerankRequest rerankRequest) throws ApiException { - okhttp3.Call localVarCall = rerankValidateBeforeCall(rerankRequest, null); + public ApiResponse rerankWithHttpInfo(String xPineconeApiVersion, RerankRequest rerankRequest) throws ApiException { + okhttp3.Call localVarCall = rerankValidateBeforeCall(xPineconeApiVersion, rerankRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Rerank documents (asynchronously) + * Rerank results (asynchronously) * Rerank results according to their relevance to a query. For guidance and examples, see [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). + * @param xPineconeApiVersion Required date-based version header (required) * @param rerankRequest Rerank documents for the given query (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -607,9 +659,9 @@ public ApiResponse rerankWithHttpInfo(RerankRequest rerankRequest) 500 Internal server error. - */ - public okhttp3.Call rerankAsync(RerankRequest rerankRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call rerankAsync(String xPineconeApiVersion, RerankRequest rerankRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = rerankValidateBeforeCall(rerankRequest, _callback); + okhttp3.Call localVarCall = rerankValidateBeforeCall(xPineconeApiVersion, rerankRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; 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 8478956a..348a7f7c 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 1c577033..7c3dc782 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-04 + * The version of the OpenAPI document: 2025-10 * 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 f6ae5e99..13568246 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-04 + * The version of the OpenAPI document: 2025-10 * 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 9ce5e372..8e248dfb 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 aeed339c..8eb6e5a1 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 e020495d..22341baa 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * A dense embedding of a single input */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 2593c714..a45716ae 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 4fbd7e7f..dfe517a8 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class EmbedRequestInputsInner { public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) @@ -65,7 +65,7 @@ public EmbedRequestInputsInner text(String text) { } /** - * Get text + * The text input to generate embeddings for. * @return text **/ @javax.annotation.Nullable 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 84529d3d..ce9da455 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -61,7 +61,7 @@ import org.openapitools.inference.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 e2575f00..ef6cfdd9 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 f8e16f57..5f3ecdd4 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 cc0b33af..70577e2f 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 35a1be2b..db5d45d1 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,90 +49,11 @@ /** * Detailed information about the error that occurred. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class ErrorResponseError { - /** - * Gets or Sets code - */ - @JsonAdapter(CodeEnum.Adapter.class) - public enum CodeEnum { - OK("OK"), - - UNKNOWN("UNKNOWN"), - - INVALID_ARGUMENT("INVALID_ARGUMENT"), - - DEADLINE_EXCEEDED("DEADLINE_EXCEEDED"), - - QUOTA_EXCEEDED("QUOTA_EXCEEDED"), - - NOT_FOUND("NOT_FOUND"), - - ALREADY_EXISTS("ALREADY_EXISTS"), - - PERMISSION_DENIED("PERMISSION_DENIED"), - - UNAUTHENTICATED("UNAUTHENTICATED"), - - RESOURCE_EXHAUSTED("RESOURCE_EXHAUSTED"), - - FAILED_PRECONDITION("FAILED_PRECONDITION"), - - ABORTED("ABORTED"), - - OUT_OF_RANGE("OUT_OF_RANGE"), - - UNIMPLEMENTED("UNIMPLEMENTED"), - - INTERNAL("INTERNAL"), - - UNAVAILABLE("UNAVAILABLE"), - - DATA_LOSS("DATA_LOSS"), - - FORBIDDEN("FORBIDDEN"); - - private String value; - - CodeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CodeEnum fromValue(String value) { - for (CodeEnum b : CodeEnum.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 CodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CodeEnum.fromValue(value); - } - } - } - public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) - private CodeEnum code; + private String code; public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @@ -145,23 +66,23 @@ public CodeEnum read(final JsonReader jsonReader) throws IOException { public ErrorResponseError() { } - public ErrorResponseError code(CodeEnum code) { + public ErrorResponseError code(String code) { this.code = code; return this; } /** - * Get code + * The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, or `FORBIDDEN`. * @return code **/ @javax.annotation.Nonnull - public CodeEnum getCode() { + public String getCode() { return code; } - public void setCode(CodeEnum code) { + public void setCode(String code) { this.code = code; } @@ -173,7 +94,7 @@ public ErrorResponseError message(String message) { } /** - * Get message + * A human-readable error message describing the error. * @return message **/ @javax.annotation.Nonnull diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfo.java b/src/main/java/org/openapitools/inference/client/model/ModelInfo.java index 15bfd0a8..f88f23d2 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfo.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfo.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,7 +23,6 @@ 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; @@ -53,7 +52,7 @@ /** * Represents the model configuration including model type, supported parameters, and other model details. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class ModelInfo { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) @@ -97,7 +96,7 @@ public class ModelInfo { public static final String SERIALIZED_NAME_SUPPORTED_METRICS = "supported_metrics"; @SerializedName(SERIALIZED_NAME_SUPPORTED_METRICS) - private List supportedMetrics; + private List supportedMetrics; public static final String SERIALIZED_NAME_SUPPORTED_PARAMETERS = "supported_parameters"; @SerializedName(SERIALIZED_NAME_SUPPORTED_PARAMETERS) @@ -328,13 +327,13 @@ public void setSupportedDimensions(List supportedDimensions) { } - public ModelInfo supportedMetrics(List supportedMetrics) { + public ModelInfo supportedMetrics(List supportedMetrics) { this.supportedMetrics = supportedMetrics; return this; } - public ModelInfo addSupportedMetricsItem(ModelInfoMetric supportedMetricsItem) { + public ModelInfo addSupportedMetricsItem(String supportedMetricsItem) { if (this.supportedMetrics == null) { this.supportedMetrics = new ArrayList<>(); } @@ -347,12 +346,12 @@ public ModelInfo addSupportedMetricsItem(ModelInfoMetric supportedMetricsItem) { * @return supportedMetrics **/ @javax.annotation.Nullable - public List getSupportedMetrics() { + public List getSupportedMetrics() { return supportedMetrics; } - public void setSupportedMetrics(List supportedMetrics) { + public void setSupportedMetrics(List supportedMetrics) { this.supportedMetrics = supportedMetrics; } @@ -372,7 +371,7 @@ public ModelInfo addSupportedParametersItem(ModelInfoSupportedParameter supporte } /** - * Get supportedParameters + * List of parameters supported by the model. * @return supportedParameters **/ @javax.annotation.Nonnull diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java index 13167360..621bf34e 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoList.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * The list of available models. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class ModelInfoList { public static final String SERIALIZED_NAME_MODELS = "models"; @SerializedName(SERIALIZED_NAME_MODELS) @@ -76,7 +76,7 @@ public ModelInfoList addModelsItem(ModelInfo modelsItem) { } /** - * Get models + * List of available models. * @return models **/ @javax.annotation.Nullable diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoMetric.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoMetric.java deleted file mode 100644 index 8c9d84e9..00000000 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoMetric.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 index a6283480..c296cbe7 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -54,7 +54,7 @@ /** * Describes a parameter supported by the model, including parameter value constraints. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class ModelInfoSupportedParameter { public static final String SERIALIZED_NAME_PARAMETER = "parameter"; @SerializedName(SERIALIZED_NAME_PARAMETER) diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java index 258ebfd3..6774caf0 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ import org.openapitools.inference.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class ModelInfoSupportedParameterAllowedValuesInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ModelInfoSupportedParameterAllowedValuesInner.class.getName()); diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java index f97259c0..11981e39 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ import org.openapitools.inference.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class ModelInfoSupportedParameterDefault extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ModelInfoSupportedParameterDefault.class.getName()); 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 e5be95d1..a64d76fc 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 ff83ac28..c9c1e7e7 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class RerankRequest { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) 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 84c42e9c..1a658c5e 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 7e2e99ee..22043879 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-04 + * The version of the OpenAPI document: 2025-10 * 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-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[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 b280fe88..fd7ee669 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-04 + * The version of the OpenAPI document: 2025-10 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * A sparse embedding of a single input */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-12T17:52:33.807920Z[Etc/UTC]") public class SparseEmbedding { public static final String SERIALIZED_NAME_SPARSE_VALUES = "sparse_values"; @SerializedName(SERIALIZED_NAME_SPARSE_VALUES) diff --git a/src/test/java/io/pinecone/PineconeBuilderTest.java b/src/test/java/io/pinecone/PineconeBuilderTest.java index b5a13f83..9557f973 100644 --- a/src/test/java/io/pinecone/PineconeBuilderTest.java +++ b/src/test/java/io/pinecone/PineconeBuilderTest.java @@ -6,7 +6,6 @@ import org.openapitools.db_control.client.model.*; import okhttp3.*; import org.junit.jupiter.api.Test; -import com.google.gson.Gson; import java.io.IOException; import java.nio.file.Files; @@ -18,7 +17,6 @@ import static org.mockito.Mockito.*; public class PineconeBuilderTest { - private static final Gson gson = new Gson(); private static AbstractMap.SimpleEntry buildMockCallAndClient(ResponseBody response) throws IOException { Response mockResponse = new Response.Builder() @@ -40,29 +38,24 @@ private static AbstractMap.SimpleEntry buildMockCallAndClien @Test public void PineconeWithNullApiKey() { - try { + PineconeConfigurationException exception = assertThrows(PineconeConfigurationException.class, () -> { new Pinecone.Builder(null).build(); - } - catch(PineconeConfigurationException expected) { - assertTrue(expected.getLocalizedMessage().contains("The API key is required and must not be empty or null")); - } + }); + assertTrue(exception.getLocalizedMessage().contains("The API key is required and must not be empty or null")); } @Test public void PineconeWithEmptyApiKey() { - try { + PineconeConfigurationException exception = assertThrows(PineconeConfigurationException.class, () -> { new Pinecone.Builder("").build(); - } - catch(PineconeConfigurationException expected) { - assertTrue(expected.getLocalizedMessage().contains("The API key is required and must not be empty or null")); - } + }); + assertTrue(exception.getLocalizedMessage().contains("The API key is required and must not be empty or null")); } @Test public void PineconeWithOkHttpClientAndUserAgent() throws IOException { String filePath = "src/test/resources/serverlessIndexJsonString.json"; String indexJsonStringServerless = new String(Files.readAllBytes(Paths.get(filePath))); - IndexModel expectedIndex = gson.fromJson(indexJsonStringServerless, IndexModel.class); AbstractMap.SimpleEntry mockCallAndClient = buildMockCallAndClient(ResponseBody.create( @@ -74,6 +67,8 @@ public void PineconeWithOkHttpClientAndUserAgent() throws IOException { Pinecone client = new Pinecone.Builder("testAPiKey") .withOkHttpClient(mockClient) .build(); + // Create expected index after client creation to ensure JSON class is initialized + IndexModel expectedIndex = IndexModel.fromJson(indexJsonStringServerless); IndexModel index = client.describeIndex("testIndex"); ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Request.class); @@ -87,7 +82,6 @@ public void PineconeWithOkHttpClientAndUserAgent() throws IOException { public void PineconeWithSourceTag() throws IOException { String filePath = "src/test/resources/serverlessIndexJsonString.json"; String indexJsonStringServerless = new String(Files.readAllBytes(Paths.get(filePath))); - IndexModel expectedIndex = gson.fromJson(indexJsonStringServerless, IndexModel.class); AbstractMap.SimpleEntry mockCallAndClient = buildMockCallAndClient(ResponseBody.create( @@ -100,6 +94,8 @@ public void PineconeWithSourceTag() throws IOException { .withSourceTag("testSourceTag") .withOkHttpClient(mockClient) .build(); + // Create expected index after client creation to ensure JSON class is initialized + IndexModel expectedIndex = IndexModel.fromJson(indexJsonStringServerless); IndexModel index = client.describeIndex("testIndex"); ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Request.class); diff --git a/src/test/java/io/pinecone/PineconeIndexOperationsTest.java b/src/test/java/io/pinecone/PineconeIndexOperationsTest.java index b3932ec0..cc433192 100644 --- a/src/test/java/io/pinecone/PineconeIndexOperationsTest.java +++ b/src/test/java/io/pinecone/PineconeIndexOperationsTest.java @@ -1,6 +1,5 @@ package io.pinecone; -import com.google.gson.Gson; import io.pinecone.clients.Pinecone; import io.pinecone.exceptions.PineconeValidationException; import okhttp3.*; @@ -11,8 +10,6 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.Arrays; -import java.util.Collections; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -20,8 +17,6 @@ import static org.mockito.Mockito.*; public class PineconeIndexOperationsTest { - private static final Gson gson = new Gson(); - @Test public void testDeleteIndex() throws IOException { Call mockCall = mock(Call.class); @@ -46,64 +41,6 @@ public void testDeleteIndex() throws IOException { assertEquals(requestCaptor.getValue().url().toString(), "https://api.pinecone.io/indexes/testIndex"); } - @Test - public void testCreateServerlessIndex() throws IOException { - String filePath = "src/test/resources/serverlessIndexJsonString.json"; - String indexJsonStringServerless = new String(Files.readAllBytes(Paths.get(filePath))); - - Call mockCall = mock(Call.class); - when(mockCall.execute()).thenReturn(new Response.Builder() - .request(new Request.Builder().url("http://localhost").build()) - .protocol(Protocol.HTTP_1_1) - .code(201) - .message("OK") - .body(ResponseBody.create(indexJsonStringServerless, MediaType.parse("application/json"))) - .build()); - - OkHttpClient mockClient = mock(OkHttpClient.class); - when(mockClient.newCall(any(Request.class))).thenReturn(mockCall); - - Pinecone client = new Pinecone.Builder("testAPiKey").withOkHttpClient(mockClient).build(); - - client.createServerlessIndex("testServerlessIndex", "cosine", 3, "aws", "us-west-2", DeletionProtection.DISABLED, Collections.EMPTY_MAP); - verify(mockCall, times(1)).execute(); - - PineconeValidationException thrownEmptyIndexName = assertThrows(PineconeValidationException.class, - () -> client.createServerlessIndex("", "cosine", 3, "aws", "us-west-2", DeletionProtection.DISABLED, Collections.EMPTY_MAP)); - assertEquals("Index name cannot be null or empty", thrownEmptyIndexName.getMessage()); - - PineconeValidationException thrownNullIndexName = assertThrows(PineconeValidationException.class, - () -> client.createServerlessIndex(null, "cosine", 3, "aws", "us-west-2", DeletionProtection.DISABLED, Collections.EMPTY_MAP)); - assertEquals("Index name cannot be null or empty", thrownNullIndexName.getMessage()); - - PineconeValidationException thrownNegativeDimension = assertThrows(PineconeValidationException.class, - () -> client.createServerlessIndex("testServerlessIndex", "cosine", -3, "aws", "us-west-2", DeletionProtection.DISABLED, Collections.EMPTY_MAP)); - assertEquals("Dimension must be greater than 0. See limits for more info: https://docs.pinecone.io/reference/limits", thrownNegativeDimension.getMessage()); - - PineconeValidationException thrownEmptyCloud = assertThrows(PineconeValidationException.class, - () -> client.createServerlessIndex("testServerlessIndex", "cosine", 3, "", "us-west-2", DeletionProtection.DISABLED, Collections.EMPTY_MAP)); - assertEquals("Cloud cannot be null or empty. Must be one of " + Arrays.toString(ServerlessSpec.CloudEnum.values()), - thrownEmptyCloud.getMessage()); - - PineconeValidationException thrownNullCloud = assertThrows(PineconeValidationException.class, - () -> client.createServerlessIndex("testServerlessIndex", "cosine", 3, null, "us-west-2", DeletionProtection.DISABLED, Collections.EMPTY_MAP)); - assertEquals("Cloud cannot be null or empty. Must be one of " + Arrays.toString(ServerlessSpec.CloudEnum.values()), - thrownNullCloud.getMessage()); - - PineconeValidationException thrownInvalidCloud = assertThrows(PineconeValidationException.class, - () -> client.createServerlessIndex("testServerlessIndex", "cosine", 3, "wooooo", "us-west-2", DeletionProtection.DISABLED, Collections.EMPTY_MAP)); - assertEquals("Cloud cannot be null or empty. Must be one of " + Arrays.toString(ServerlessSpec.CloudEnum.values()), - thrownInvalidCloud.getMessage()); - - PineconeValidationException thrownEmptyRegion = assertThrows(PineconeValidationException.class, - () -> client.createServerlessIndex("testServerlessIndex", "cosine", 3, "aws", "", DeletionProtection.DISABLED, Collections.EMPTY_MAP)); - assertEquals("Region cannot be null or empty", thrownEmptyRegion.getMessage()); - - PineconeValidationException thrownNullRegion = assertThrows(PineconeValidationException.class, - () -> client.createServerlessIndex("testServerlessIndex", "cosine", 3, "aws", null, DeletionProtection.DISABLED, Collections.EMPTY_MAP)); - assertEquals("Region cannot be null or empty", thrownNullRegion.getMessage()); - } - @Test public void testCreatePodsIndex() throws IOException { String filePath = "src/test/resources/podIndexJsonString.json"; @@ -133,7 +70,7 @@ public void testCreatePodsIndex() throws IOException { 2, new PodSpecMetadataConfig(), "some-source-collection", - DeletionProtection.DISABLED, + "disabled", null); ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Request.class); @@ -203,7 +140,7 @@ public void testValidatePodIndexParams() { () -> Pinecone.validatePodIndexParams("test-index", 3, "some-environment", "p1.x1", "", null, null, null)); - assertEquals("Metric cannot be null or empty. Must be one of " + Arrays.toString(IndexModel.MetricEnum.values()), thrownEmptyMetric.getMessage()); + assertEquals("Metric cannot be null or empty. Must be cosine, euclidean, or dotproduct.", thrownEmptyMetric.getMessage()); // Replicas PineconeValidationException thrownNegativeReplicas = assertThrows(PineconeValidationException.class, @@ -239,7 +176,6 @@ public void testValidatePodIndexParams() { public void testDescribeIndex() throws IOException { String filePath = "src/test/resources/serverlessIndexJsonString.json"; String indexJsonStringServerless = new String(Files.readAllBytes(Paths.get(filePath))); - IndexModel expectedIndex = gson.fromJson(indexJsonStringServerless, IndexModel.class); Call mockCall = mock(Call.class); Response mockResponse = new Response.Builder() @@ -257,6 +193,8 @@ public void testDescribeIndex() throws IOException { when(mockCall.execute()).thenReturn(mockResponse); Pinecone client = new Pinecone.Builder("testAPiKey").withOkHttpClient(mockClient).build(); + // Create expected index after client creation to ensure JSON class is initialized + IndexModel expectedIndex = IndexModel.fromJson(indexJsonStringServerless); IndexModel index = client.describeIndex("testIndex"); ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(Request.class); @@ -272,7 +210,7 @@ public void testDescribeIndex() throws IOException { public void testListIndexes() throws IOException { String filePath = "src/test/resources/indexListJsonString.json"; String indexListJsonString = new String(Files.readAllBytes(Paths.get(filePath))); - IndexList expectedIndexList = gson.fromJson(indexListJsonString, IndexList.class); + IndexList expectedIndexList = IndexList.fromJson(indexListJsonString); Call mockCall = mock(Call.class); @@ -304,7 +242,7 @@ public void testListIndexes() throws IOException { public void testConfigureIndex() throws IOException { String filePath = "src/test/resources/podIndexJsonString.json"; String podIndexJsonString = new String(Files.readAllBytes(Paths.get(filePath))); - IndexModel expectedConfiguredIndex = gson.fromJson(podIndexJsonString, IndexModel.class); + IndexModel expectedConfiguredIndex = IndexModel.fromJson(podIndexJsonString); Call mockCall = mock(Call.class); when(mockCall.execute()).thenReturn(new Response.Builder() @@ -318,7 +256,7 @@ public void testConfigureIndex() throws IOException { OkHttpClient mockClient = mock(OkHttpClient.class); when(mockClient.newCall(any(Request.class))).thenReturn(mockCall); Pinecone client = new Pinecone.Builder("testAPiKey").withOkHttpClient(mockClient).build(); - IndexModel configuredIndex = client.configurePodsIndex("testPodIndex", 3, DeletionProtection.DISABLED); + IndexModel configuredIndex = client.configurePodsIndex("testPodIndex", 3, "disabled"); verify(mockCall, times(1)).execute(); assertEquals(expectedConfiguredIndex, configuredIndex); @@ -326,17 +264,17 @@ public void testConfigureIndex() throws IOException { // Test for empty string for index name PineconeValidationException thrownEmptyIndexName = assertThrows(PineconeValidationException.class, () -> client.configurePodsIndex("", - 3, DeletionProtection.DISABLED)); + 3, "disabled")); assertEquals("indexName cannot be null or empty", thrownEmptyIndexName.getMessage()); // Test for null as index name PineconeValidationException thrownNullIndexName = assertThrows(PineconeValidationException.class, () -> client.configurePodsIndex(null, - 3, DeletionProtection.DISABLED)); + 3, "disabled")); assertEquals("indexName cannot be null or empty", thrownNullIndexName.getMessage()); // Test for invalid number of replicas PineconeValidationException thrownZeroReplicas = assertThrows(PineconeValidationException.class, - () -> client.configurePodsIndex("testPodIndex", 0, DeletionProtection.DISABLED)); + () -> client.configurePodsIndex("testPodIndex", 0, "disabled")); assertEquals("Number of replicas must be >= 1", thrownZeroReplicas.getMessage()); } @@ -344,7 +282,7 @@ public void testConfigureIndex() throws IOException { public void testCreateCollection() throws IOException { String filePath = "src/test/resources/collectionCreation.json"; String JsonStringCollection = new String(Files.readAllBytes(Paths.get(filePath))); - CollectionModel expectedCollection = gson.fromJson(JsonStringCollection, CollectionModel.class); + CollectionModel expectedCollection = CollectionModel.fromJson(JsonStringCollection); Call mockCall = mock(Call.class); Response mockResponse = new Response.Builder() diff --git a/src/test/java/io/pinecone/clients/ConnectionsMapTest.java b/src/test/java/io/pinecone/clients/ConnectionsMapTest.java index 2d34854b..37e34380 100644 --- a/src/test/java/io/pinecone/clients/ConnectionsMapTest.java +++ b/src/test/java/io/pinecone/clients/ConnectionsMapTest.java @@ -5,6 +5,7 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.openapitools.db_control.client.ApiException; +import org.openapitools.db_control.client.Configuration; import org.openapitools.db_control.client.api.ManageIndexesApi; import org.openapitools.db_control.client.model.IndexModel; @@ -113,7 +114,7 @@ public void testConnectionRemovedOnIndexClose() throws ApiException { config.setHost(host); Pinecone pinecone = new Pinecone(config, manageIndexesApi); - when(manageIndexesApi.describeIndex(indexName)).thenReturn(indexModel); + when(manageIndexesApi.describeIndex(Configuration.VERSION, indexName)).thenReturn(indexModel); Index index = pinecone.getIndexConnection(indexName); @@ -142,7 +143,7 @@ public void testConnectionRemovedOnAsyncIndexClose() throws ApiException { config.setHost(host); Pinecone pinecone = new Pinecone(config, manageIndexesApi); - when(manageIndexesApi.describeIndex(indexName)).thenReturn(indexModel); + when(manageIndexesApi.describeIndex(Configuration.VERSION, indexName)).thenReturn(indexModel); AsyncIndex asyncIndex = pinecone.getAsyncIndexConnection(indexName); diff --git a/src/test/java/io/pinecone/clients/ImportsTest.java b/src/test/java/io/pinecone/clients/ImportsTest.java index 7779f713..be69f8b6 100644 --- a/src/test/java/io/pinecone/clients/ImportsTest.java +++ b/src/test/java/io/pinecone/clients/ImportsTest.java @@ -8,6 +8,7 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.openapitools.db_data.client.ApiException; +import org.openapitools.db_data.client.Configuration; import org.openapitools.db_data.client.api.BulkOperationsApi; import org.openapitools.db_data.client.model.*; @@ -17,6 +18,7 @@ import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; +import static org.mockito.ArgumentMatchers.eq; public class ImportsTest { @@ -46,7 +48,7 @@ public void testStartImportMinimal() throws ApiException { StartImportResponse mockResponse = new StartImportResponse(); mockResponse.setId("1"); - when(bulkOperationsApiMock.startBulkImport(any(StartImportRequest.class))) + when(bulkOperationsApiMock.startBulkImport(eq(Configuration.VERSION), any(StartImportRequest.class))) .thenReturn(mockResponse); StartImportResponse response = asyncIndex.startImport("s3://path/to/file.parquet", null, null); @@ -59,7 +61,7 @@ public void testStartImportWithIntegrationId() throws ApiException { StartImportResponse mockResponse = new StartImportResponse(); mockResponse.setId("1"); - when(bulkOperationsApiMock.startBulkImport(any(StartImportRequest.class))) + when(bulkOperationsApiMock.startBulkImport(eq(Configuration.VERSION), any(StartImportRequest.class))) .thenReturn(mockResponse); StartImportResponse response = asyncIndex.startImport("s3://path/to/file.parquet", "integration-123", null); @@ -67,7 +69,7 @@ public void testStartImportWithIntegrationId() throws ApiException { assertEquals("1", response.getId()); ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(StartImportRequest.class); - verify(bulkOperationsApiMock).startBulkImport(requestCaptor.capture()); + verify(bulkOperationsApiMock).startBulkImport(eq(Configuration.VERSION), requestCaptor.capture()); StartImportRequest capturedRequest = requestCaptor.getValue(); assertEquals("s3://path/to/file.parquet", capturedRequest.getUri()); @@ -79,24 +81,24 @@ public void testStartImportWithErrorMode() throws ApiException { StartImportResponse mockResponse = new StartImportResponse(); mockResponse.setId("1"); - when(bulkOperationsApiMock.startBulkImport(any(StartImportRequest.class))) + when(bulkOperationsApiMock.startBulkImport(eq(Configuration.VERSION), any(StartImportRequest.class))) .thenReturn(mockResponse); - StartImportResponse response = asyncIndex.startImport("s3://path/to/file.parquet", null, ImportErrorMode.OnErrorEnum.CONTINUE); + StartImportResponse response = asyncIndex.startImport("s3://path/to/file.parquet", null, "continue"); assertEquals("1", response.getId()); ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(StartImportRequest.class); - verify(bulkOperationsApiMock).startBulkImport(requestCaptor.capture()); + verify(bulkOperationsApiMock).startBulkImport(eq(Configuration.VERSION), requestCaptor.capture()); StartImportRequest capturedRequest = requestCaptor.getValue(); - assertEquals(ImportErrorMode.OnErrorEnum.CONTINUE, capturedRequest.getErrorMode().getOnError()); + assertEquals("continue", capturedRequest.getErrorMode().getOnError()); } @Test public void testStartImportWithInvalidUri() throws ApiException { ApiException exception = new ApiException(400, "Invalid URI"); - when(bulkOperationsApiMock.startBulkImport(any(StartImportRequest.class))) + when(bulkOperationsApiMock.startBulkImport(eq(Configuration.VERSION), any(StartImportRequest.class))) .thenThrow(exception); ApiException thrownException = assertThrows(ApiException.class, () -> { @@ -119,27 +121,28 @@ public void testDescribeImport() throws ApiException { mockResponse.setId("1"); mockResponse.setRecordsImported(1000L); mockResponse.setUri(uri); - mockResponse.setStatus(ImportModel.StatusEnum.INPROGRESS); + //The status of the operation. Possible values: `Pending`, `InProgress`, `Failed`, `Completed`, or `Cancelled`. + mockResponse.setStatus("InProgress"); mockResponse.setError(errorMode); mockResponse.setCreatedAt(createdAt); mockResponse.setFinishedAt(finishedAt); mockResponse.setPercentComplete(43.2f); - when(bulkOperationsApiMock.describeBulkImport("1")).thenReturn(mockResponse); + when(bulkOperationsApiMock.describeBulkImport(Configuration.VERSION,"1")).thenReturn(mockResponse); ImportModel response = asyncIndex.describeImport("1"); assertEquals("1", response.getId()); assertEquals(1000, response.getRecordsImported()); assertEquals(uri, response.getUri()); - assertEquals("InProgress", response.getStatus().getValue()); + assertEquals("InProgress", response.getStatus()); assertEquals(errorMode, response.getError()); assertEquals(createdAt, response.getCreatedAt()); assertEquals(finishedAt, response.getFinishedAt()); assertEquals(percentComplete, response.getPercentComplete()); // Verify that the describeBulkImport method was called once - verify(bulkOperationsApiMock, times(1)).describeBulkImport("1"); + verify(bulkOperationsApiMock, times(1)).describeBulkImport(eq(Configuration.VERSION), eq("1")); } @Test @@ -148,7 +151,7 @@ void testListImports() throws ApiException { mockResponse.setData(Collections.singletonList(new ImportModel())); mockResponse.setPagination(new Pagination()); - when(bulkOperationsApiMock.listBulkImports(anyInt(), anyString())).thenReturn(mockResponse); + when(bulkOperationsApiMock.listBulkImports(eq(Configuration.VERSION), anyInt(), anyString())).thenReturn(mockResponse); ListImportsResponse response = asyncIndex.listImports(10, "next-token"); @@ -156,6 +159,6 @@ void testListImports() throws ApiException { assertEquals(1, response.getData().size()); assertNotNull(response.getPagination()); verify(bulkOperationsApiMock, times(1)) - .listBulkImports(10, "next-token"); + .listBulkImports(eq(Configuration.VERSION), eq(10), eq("next-token")); } } diff --git a/src/test/java/org/openapitools/client/JsonParsingTest.java b/src/test/java/org/openapitools/client/JsonParsingTest.java index dbe9fde1..be7b7548 100644 --- a/src/test/java/org/openapitools/client/JsonParsingTest.java +++ b/src/test/java/org/openapitools/client/JsonParsingTest.java @@ -6,9 +6,9 @@ import org.openapitools.db_control.client.api.ManageIndexesApi; import org.openapitools.db_control.client.model.*; import org.openapitools.db_control.client.ApiClient; +import org.openapitools.db_control.client.Configuration; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; @@ -53,12 +53,12 @@ public void test_describeIndex_happyPath() throws Exception { String jsonResponse = readJsonFromFile("src/test/resources/describeIndexResponse.valid.json"); setupMockResponse(jsonResponse); - IndexModel indexModel = api.describeIndex("test-index"); + IndexModel indexModel = api.describeIndex(Configuration.VERSION, "test-index"); // Don't need a ton of assertions here. The point is the code didn't blow up // due to parsing the JSON response. assertEquals("test-index", indexModel.getName()); - assertEquals("Ready", indexModel.getStatus().getState().getValue()); + assertEquals("Ready", indexModel.getStatus().getState()); } @Test @@ -66,10 +66,10 @@ public void test_describeIndex_extraProperties() throws Exception { String jsonResponse = readJsonFromFile("src/test/resources/describeIndexResponse.withUnknownProperties.json"); setupMockResponse(jsonResponse); - IndexModel indexModel = api.describeIndex("test-index"); + IndexModel indexModel = api.describeIndex(Configuration.VERSION, "test-index"); assertEquals("test-index", indexModel.getName()); - assertEquals("Ready", indexModel.getStatus().getState().getValue()); + assertEquals("Ready", indexModel.getStatus().getState()); } @Test @@ -80,12 +80,12 @@ public void test_createIndex_happyPath() throws Exception { CreateIndexRequest createIndexRequest = new CreateIndexRequest(); createIndexRequest.setName("test-index"); createIndexRequest.setDimension(1536); - createIndexRequest.setMetric(CreateIndexRequest.MetricEnum.COSINE); + createIndexRequest.setMetric("cosine"); createIndexRequest.setSpec(new IndexSpec()); - IndexModel indexModel = api.createIndex(createIndexRequest); + IndexModel indexModel = api.createIndex(Configuration.VERSION, createIndexRequest); assertEquals("serverless-index", indexModel.getName()); - assertEquals("Ready", indexModel.getStatus().getState().getValue()); + assertEquals("Ready", indexModel.getStatus().getState()); } @Test @@ -96,12 +96,12 @@ public void test_createIndex_extraProperties() throws Exception { CreateIndexRequest createIndexRequest = new CreateIndexRequest(); createIndexRequest.setName("test-index"); createIndexRequest.setDimension(1536); - createIndexRequest.setMetric(CreateIndexRequest.MetricEnum.COSINE); + createIndexRequest.setMetric("cosine"); createIndexRequest.setSpec(new IndexSpec()); - IndexModel indexModel = api.createIndex(createIndexRequest); + IndexModel indexModel = api.createIndex(Configuration.VERSION, createIndexRequest); assertEquals("serverless-index", indexModel.getName()); - assertEquals("Ready", indexModel.getStatus().getState().getValue()); + assertEquals("Ready", indexModel.getStatus().getState()); } @Test @@ -109,9 +109,9 @@ public void test_describeCollection_happyPath() throws Exception { String jsonResponse = readJsonFromFile("src/test/resources/describeCollection.valid.json"); setupMockResponse(jsonResponse); - CollectionModel collectionModel = api.describeCollection("tiny-collection"); + CollectionModel collectionModel = api.describeCollection(Configuration.VERSION, "tiny-collection"); assertEquals("tiny-collection", collectionModel.getName()); - assertEquals("Ready", collectionModel.getStatus().getValue()); + assertEquals("Ready", collectionModel.getStatus()); } } diff --git a/src/test/resources/createIndexResponse.valid.json b/src/test/resources/createIndexResponse.valid.json index d61a83ae..ff6571cc 100644 --- a/src/test/resources/createIndexResponse.valid.json +++ b/src/test/resources/createIndexResponse.valid.json @@ -10,7 +10,13 @@ "spec": { "serverless": { "region": "us-west-2", - "cloud": "aws" + "cloud": "aws", + "read_capacity": { + "mode": "OnDemand", + "status": { + "state": "Ready" + } + } } }, "vector_type": "dense" diff --git a/src/test/resources/createIndexResponse.withUnknownProperties.json b/src/test/resources/createIndexResponse.withUnknownProperties.json index a79d6f70..109d776b 100644 --- a/src/test/resources/createIndexResponse.withUnknownProperties.json +++ b/src/test/resources/createIndexResponse.withUnknownProperties.json @@ -13,6 +13,12 @@ "serverless": { "region": "us-west-2", "cloud": "aws", + "read_capacity": { + "mode": "OnDemand", + "status": { + "state": "Ready" + } + }, "weather_forecast": "partly sunny" } }, diff --git a/src/test/resources/describeIndexResponse.valid.json b/src/test/resources/describeIndexResponse.valid.json index b3d3868b..5345cd08 100644 --- a/src/test/resources/describeIndexResponse.valid.json +++ b/src/test/resources/describeIndexResponse.valid.json @@ -10,7 +10,13 @@ "spec": { "serverless": { "cloud": "aws", - "region": "us-east2-gcp" + "region": "us-east2-gcp", + "read_capacity": { + "mode": "OnDemand", + "status": { + "state": "Ready" + } + } } }, "vector_type": "dense" diff --git a/src/test/resources/describeIndexResponse.withUnknownProperties.json b/src/test/resources/describeIndexResponse.withUnknownProperties.json index b9f745d1..70cead54 100644 --- a/src/test/resources/describeIndexResponse.withUnknownProperties.json +++ b/src/test/resources/describeIndexResponse.withUnknownProperties.json @@ -10,14 +10,15 @@ }, "host": "https://index-host.com", "spec": { - "future_pod_type": { - "who_knows": true, - "what_props": false, - "may": "exist" - }, "serverless": { "cloud": "aws", "region": "us-east2-gcp", + "read_capacity": { + "mode": "OnDemand", + "status": { + "state": "Ready" + } + }, "hotness": "extra-spicy" } }, diff --git a/src/test/resources/indexListJsonString.json b/src/test/resources/indexListJsonString.json index 3641b243..d8956bda 100644 --- a/src/test/resources/indexListJsonString.json +++ b/src/test/resources/indexListJsonString.json @@ -7,7 +7,13 @@ "spec": { "serverless": { "cloud": "aws", - "region": "us-west-2" + "region": "us-west-2", + "read_capacity": { + "mode": "OnDemand", + "status": { + "state": "Ready" + } + } } }, "status": { diff --git a/src/test/resources/serverlessIndexJsonString.json b/src/test/resources/serverlessIndexJsonString.json index 9fa8d8a6..c96c40a6 100644 --- a/src/test/resources/serverlessIndexJsonString.json +++ b/src/test/resources/serverlessIndexJsonString.json @@ -6,7 +6,18 @@ "spec": { "serverless": { "cloud": "aws", - "region": "us-west-2" + "region": "us-west-2", + "read_capacity": { + "mode": "OnDemand", + "status": { + "state": "Ready", + "current_replicas": null, + "current_shards": null, + "error_message": null + } + }, + "source_collection": null, + "schema": null } }, "status": {