diff --git a/README.md b/README.md index ba9829ea..44e74176 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 @@ -797,7 +973,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 +985,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..bbad89bd 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit a91585819b21bcd355fd76dab94546bb7908a008 +Subproject commit bbad89bd51d792534a9ba06a44ed1f2259f7f89f 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/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..3b221a70 100644 --- a/src/main/java/io/pinecone/clients/AsyncIndex.java +++ b/src/main/java/io/pinecone/clients/AsyncIndex.java @@ -18,6 +18,7 @@ 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; @@ -1170,17 +1171,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 +1192,7 @@ public StartImportResponse startImport(String uri, String integrationId, ImportE importRequest.setErrorMode(importErrorMode); } - return bulkOperations.startBulkImport(importRequest); + return bulkOperations.startBulkImport(Configuration.VERSION, importRequest); } /** @@ -1270,7 +1271,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 +1297,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 +1320,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..c62ab93f 100644 --- a/src/main/java/io/pinecone/clients/Index.java +++ b/src/main/java/io/pinecone/clients/Index.java @@ -14,6 +14,7 @@ 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; @@ -1107,7 +1108,7 @@ public void upsertRecords(String namespace, List> upsertReco records.add(upsertRecord); } - vectorOperations.upsertRecordsNamespace(namespace, records); + vectorOperations.upsertRecordsNamespace(Configuration.VERSION, namespace, records); } /** @@ -1154,7 +1155,7 @@ public SearchRecordsResponse searchRecords(String namespace, .fields(fields) .rerank(rerank); - return vectorOperations.searchRecordsNamespace(namespace, request); + return vectorOperations.searchRecordsNamespace(Configuration.VERSION, namespace, request); } /** @@ -1208,7 +1209,7 @@ public SearchRecordsResponse searchRecordsById(String id, .fields(fields) .rerank(rerank); - return vectorOperations.searchRecordsNamespace(namespace, request); + return vectorOperations.searchRecordsNamespace(Configuration.VERSION, namespace, request); } /** @@ -1270,7 +1271,7 @@ public SearchRecordsResponse searchRecordsByVector(SearchRecordsVector vector, .fields(fields) .rerank(rerank); - return vectorOperations.searchRecordsNamespace(namespace, request); + return vectorOperations.searchRecordsNamespace(Configuration.VERSION, namespace, request); } /** @@ -1324,7 +1325,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(); } 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..61e47593 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-03T18:50:11.354821Z[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..ffafc277 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-03T18:50:11.354821Z[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..8cadd57b 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-03T18:50:11.354821Z[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..82de2e74 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-03T18:50:11.354821Z[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..78a6b8bf 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-03T18:50:11.354821Z[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..13aa368b 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-03T18:50:11.354821Z[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..9a5c845a 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-03T18:50:11.354821Z[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..7fb7e740 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-03T18:50:11.354821Z[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..a497587b 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-03T18:50:11.354821Z[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..10ae33f3 --- /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-03T18:50:11.354821Z[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..7186115b --- /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-03T18:50:11.354821Z[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..1593d862 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-03T18:50:11.354821Z[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..7762c6b7 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-03T18:50:11.354821Z[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..dcd5616a 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-03T18:50:11.354821Z[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..cdcf86aa 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-03T18:50:11.354821Z[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..19eed9ff 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-03T18:50:11.354821Z[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..9c4254ce --- /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-03T18:50:11.354821Z[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..3f70f4e3 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-03T18:50:11.354821Z[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..2f9d8ea4 --- /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-03T18:50:11.354821Z[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..a69864a4 --- /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-03T18:50:11.354821Z[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..16630ebc 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-03T18:50:11.354821Z[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..145211df 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-03T18:50:11.354821Z[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..b3e7376b 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-03T18:50:11.354821Z[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..301da9f7 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-03T18:50:11.354821Z[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..bb7991a6 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-03T18:50:11.354821Z[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..5c608fc6 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-03T18:50:11.354821Z[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..148d9e89 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-03T18:50:11.354821Z[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..cab8b34d 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-03T18:50:11.354821Z[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..abab6dca 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-03T18:50:11.354821Z[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..af871054 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-03T18:50:11.354821Z[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..2972bac5 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-03T18:50:11.354821Z[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..2b0c9caa 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-03T18:50:11.354821Z[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..27fa9b55 --- /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-03T18:50:11.354821Z[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..bcb59058 --- /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-03T18:50:11.354821Z[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..84b05f1d --- /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-03T18:50:11.354821Z[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..3f4372c2 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-03T18:50:11.354821Z[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..78d95b17 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-03T18:50:11.354821Z[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..f748df63 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-03T18:50:11.354821Z[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..a0472323 --- /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-03T18:50:11.354821Z[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..aae46a52 --- /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-03T18:50:11.354821Z[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..4f7a9741 --- /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-03T18:50:11.354821Z[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..26464039 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-03T18:50:11.354821Z[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..31d076d8 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-03T18:50:11.354821Z[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..4bd45838 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-03T18:50:11.354821Z[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..aa9d0c98 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-03T18:50:11.354821Z[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..79b5b856 --- /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-03T18:50:11.354821Z[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..d2693e55 --- /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-03T18:50:11.354821Z[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..5f17a9ca --- /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-03T18:50:11.354821Z[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..ee19dbbc --- /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-03T18:50:11.354821Z[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..7116d31f --- /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-03T18:50:11.354821Z[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..d9591b44 --- /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-03T18:50:11.354821Z[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..f0a6617f --- /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-03T18:50:11.354821Z[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..00b2935d --- /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-03T18:50:11.354821Z[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..bade464a 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-03T18:50:11.354821Z[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..9b4d83fd 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-03T18:50:11.354821Z[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..2d8e33f9 --- /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-03T18:50:11.354821Z[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..deca69c1 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-03T18:50:11.354821Z[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..3797272c --- /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-03T18:50:11.354821Z[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..29867f7a 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-03T18:50:13.248007Z[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..d5af5871 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-03T18:50:13.248007Z[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..eb9b3372 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()); @@ -113,6 +118,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 +126,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..4fb1696d 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-03T18:50:13.248007Z[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..00c7f324 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-03T18:50:13.248007Z[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..122c684e 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-03T18:50:13.248007Z[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..a3ad55eb 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-03T18:50:13.248007Z[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..11cb3c0d 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-03T18:50:13.248007Z[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..6d296ad9 --- /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-03T18:50:13.248007Z[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..0870e852 --- /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-03T18:50:13.248007Z[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..f2862fd7 --- /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-03T18:50:13.248007Z[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..70da8408 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-03T18:50:13.248007Z[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..6ea71430 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-03T18:50:13.248007Z[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..0e702815 --- /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-03T18:50:13.248007Z[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..2618cd9f --- /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-03T18:50:13.248007Z[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..b28031c3 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-03T18:50:13.248007Z[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..427b603c 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-03T18:50:13.248007Z[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..b3380c7f 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-03T18:50:13.248007Z[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..04d31865 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-03T18:50:13.248007Z[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..2378a114 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-03T18:50:13.248007Z[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..7ba72b42 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-03T18:50:13.248007Z[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..e998b316 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-03T18:50:13.248007Z[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..36d1d32d 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-03T18:50:13.248007Z[Etc/UTC]") public class ListNamespacesResponse { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) 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..ef726940 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-03T18:50:13.248007Z[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..1b92ba11 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,7 @@ 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; @@ -49,7 +50,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-03T18:50:13.248007Z[Etc/UTC]") public class NamespaceDescription { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -59,6 +60,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_TOTAL_COUNT = "total_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + private Integer totalCount; + public NamespaceDescription() { } @@ -103,6 +112,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 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 @@ -159,13 +210,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.totalCount, namespaceDescription.totalCount)&& Objects.equals(this.additionalProperties, namespaceDescription.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, recordCount, additionalProperties); + return Objects.hash(name, recordCount, schema, totalCount, additionalProperties); } @Override @@ -174,6 +227,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(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -199,6 +254,8 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("name"); openapiFields.add("record_count"); + openapiFields.add("schema"); + openapiFields.add("total_count"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -220,6 +277,10 @@ 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")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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..29222802 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-03T18:50:13.248007Z[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..3e904295 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-03T18:50:13.248007Z[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..deab17e3 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-03T18:50:13.248007Z[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..e14f3f4c 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-03T18:50:13.248007Z[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..e0ec4a44 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-03T18:50:13.248007Z[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..03f110c8 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-03T18:50:13.248007Z[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..e299b502 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-03T18:50:13.248007Z[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..98e1c223 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-03T18:50:13.248007Z[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..dce0bc6b --- /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-03T18:50:13.248007Z[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..14f8b6b6 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-03T18:50:13.248007Z[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..349c39a5 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-03T18:50:13.248007Z[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..023c43c6 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-03T18:50:13.248007Z[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..96f8be10 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-03T18:50:13.248007Z[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..0636b8c6 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-03T18:50:13.248007Z[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..89b75818 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-03T18:50:13.248007Z[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..fcd8b96c 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-03T18:50:13.248007Z[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..553fd998 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-03T18:50:13.248007Z[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..06c73e05 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-03T18:50:13.248007Z[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..c4237afe 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-03T18:50:13.248007Z[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..d4f2b253 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-03T18:50:13.248007Z[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..0fde2cc7 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-03T18:50:13.248007Z[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..9610cc18 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-03T18:50:13.248007Z[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..d1bd6260 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-03T18:50:13.248007Z[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..7a43cd8a 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-03T18:50:13.248007Z[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..099c4ecc 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-03T18:50:13.248007Z[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..eeb1433d 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-03T18:50:13.248007Z[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..68102cfa 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-03T18:50:13.248007Z[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..93a1c137 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-03T18:50:15.202691Z[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..6691be04 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-03T18:50:15.202691Z[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..b26c59f6 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-03T18:50:15.202691Z[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..b78f5024 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-03T18:50:15.202691Z[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..970a9584 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-03T18:50:15.202691Z[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..b204696d 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-03T18:50:15.202691Z[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..0c2188cd 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-03T18:50:15.202691Z[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..84d91672 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-03T18:50:15.202691Z[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..9a665fc1 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-03T18:50:15.202691Z[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..aa8b04d7 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-03T18:50:15.202691Z[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..477f62fc 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-03T18:50:15.202691Z[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..df54caa9 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-03T18:50:15.202691Z[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..cb93b546 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-03T18:50:15.202691Z[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..936468a6 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-03T18:50:15.202691Z[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..17e2ac0e 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-03T18:50:15.202691Z[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..12b8b683 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-03T18:50:15.202691Z[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..827194dd 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-03T18:50:15.202691Z[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..241c34bc 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-03T18:50:15.202691Z[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..2179d06c 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-03T18:50:15.202691Z[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..a1b4fb81 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-03T18:50:15.202691Z[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..a65972e3 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-03T18:50:15.202691Z[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..3b17ba93 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-03T18:50:15.202691Z[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..fe7c806e 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-03T18:50:15.202691Z[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..2a6f53d3 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-03T18:50:15.202691Z[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..b401ffa1 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-03T18:50:15.202691Z[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": {