From 55785432257adbdae1e3824bfdead20d45b62bf2 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Thu, 14 Nov 2024 11:23:39 -0500 Subject: [PATCH 1/6] Non-generated changes needed for regen --- codegen/build-oas.sh | 34 +- pinecone/config/config.py | 2 +- pinecone/config/openapi.py | 2 +- pinecone/control/index_host_store.py | 4 +- pinecone/control/pinecone.py | 8 +- pinecone/control/repr_overrides.py | 2 +- .../core_ea/openapi/db_control/__init__.py | 28 - .../openapi/db_control/api/__init__.py | 3 - .../db_control/api/manage_indexes_api.py | 818 ----------------- .../openapi/db_control/apis/__init__.py | 16 - .../openapi/db_control/model/__init__.py | 5 - .../db_control/model/collection_list.py | 276 ------ .../db_control/model/collection_model.py | 309 ------- .../model/configure_index_request.py | 282 ------ .../model/configure_index_request_spec.py | 282 ------ .../model/configure_index_request_spec_pod.py | 276 ------ .../model/create_collection_request.py | 285 ------ .../db_control/model/create_index_request.py | 319 ------- .../db_control/model/deletion_protection.py | 291 ------ .../db_control/model/error_response.py | 288 ------ .../db_control/model/error_response_error.py | 306 ------- .../openapi/db_control/model/index_list.py | 276 ------ .../openapi/db_control/model/index_model.py | 337 ------- .../db_control/model/index_model_spec.py | 282 ------ .../db_control/model/index_model_status.py | 291 ------ .../openapi/db_control/model/index_spec.py | 267 ------ .../openapi/db_control/model/pod_spec.py | 332 ------- .../model/pod_spec_metadata_config.py | 268 ------ .../db_control/model/serverless_spec.py | 286 ------ .../openapi/db_control/models/__init__.py | 29 - pinecone/core_ea/openapi/db_data/__init__.py | 28 - .../core_ea/openapi/db_data/api/__init__.py | 3 - .../db_data/api/bulk_operations_api.py | 422 --------- .../db_data/api/vector_operations_api.py | 848 ------------------ .../core_ea/openapi/db_data/apis/__init__.py | 17 - .../core_ea/openapi/db_data/model/__init__.py | 5 - .../openapi/db_data/model/delete_request.py | 282 ------ .../model/describe_index_stats_request.py | 268 ------ .../model/describe_index_stats_response.py | 288 ------ .../openapi/db_data/model/fetch_response.py | 286 ------ .../db_data/model/import_error_mode.py | 273 ------ .../db_data/model/import_list_response.py | 282 ------ .../openapi/db_data/model/import_model.py | 313 ------- .../openapi/db_data/model/list_item.py | 268 ------ .../openapi/db_data/model/list_response.py | 292 ------ .../db_data/model/namespace_summary.py | 268 ------ .../openapi/db_data/model/pagination.py | 268 ------ .../openapi/db_data/model/protobuf_any.py | 272 ------ .../db_data/model/protobuf_null_value.py | 290 ------ .../openapi/db_data/model/query_request.py | 326 ------- .../openapi/db_data/model/query_response.py | 292 ------ .../openapi/db_data/model/query_vector.py | 304 ------- .../openapi/db_data/model/rpc_status.py | 284 ------ .../openapi/db_data/model/scored_vector.py | 303 ------- .../db_data/model/single_query_results.py | 280 ------ .../openapi/db_data/model/sparse_values.py | 283 ------ .../db_data/model/start_import_request.py | 292 ------ .../db_data/model/start_import_response.py | 273 ------ .../openapi/db_data/model/update_request.py | 304 ------- .../openapi/db_data/model/upsert_request.py | 288 ------ .../openapi/db_data/model/upsert_response.py | 268 ------ .../core_ea/openapi/db_data/model/usage.py | 268 ------ .../core_ea/openapi/db_data/model/vector.py | 302 ------- .../openapi/db_data/models/__init__.py | 38 - pinecone/core_ea/openapi/shared/__init__.py | 1 - pinecone/data/features/bulk_import.py | 20 +- pinecone/data/index.py | 26 +- pinecone/data/sparse_vector_factory.py | 2 +- pinecone/data/vector_factory.py | 2 +- pinecone/exceptions/__init__.py | 2 +- pinecone/exceptions/exceptions.py | 2 +- pinecone/grpc/index_grpc.py | 4 +- pinecone/grpc/utils.py | 4 +- pinecone/models/collection_list.py | 2 +- pinecone/models/index_list.py | 2 +- pinecone/models/index_model.py | 2 +- pinecone/openapi_support/__init__.py | 39 + .../shared => openapi_support}/api_client.py | 401 +++------ .../configuration.py | 23 +- pinecone/openapi_support/endpoint.py | 244 +++++ .../shared => openapi_support}/exceptions.py | 5 - .../shared => openapi_support}/model_utils.py | 131 ++- .../shared => openapi_support}/rest.py | 31 +- pyproject.toml | 2 + tests/unit/data/test_bulk_import.py | 7 +- .../unit/data/test_import_datetime_parsing.py | 7 +- tests/unit/models/test_collection_list.py | 2 +- tests/unit/models/test_index_list.py | 2 +- tests/unit/models/test_index_model.py | 2 +- tests/unit/openapi_support/__init__.py | 0 tests/unit/openapi_support/test_api_client.py | 159 ++++ tests/unit/test_config.py | 2 +- tests/unit/test_config_builder.py | 2 +- tests/unit/test_control.py | 4 +- tests/unit/test_index.py | 100 ++- tests/unit/utils/test_setup_openapi_client.py | 4 +- 96 files changed, 803 insertions(+), 15715 deletions(-) delete mode 100644 pinecone/core_ea/openapi/db_control/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_control/api/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_control/api/manage_indexes_api.py delete mode 100644 pinecone/core_ea/openapi/db_control/apis/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/collection_list.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/collection_model.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/configure_index_request.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/configure_index_request_spec.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/configure_index_request_spec_pod.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/create_collection_request.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/create_index_request.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/deletion_protection.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/error_response.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/error_response_error.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/index_list.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/index_model.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/index_model_spec.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/index_model_status.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/index_spec.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/pod_spec.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/pod_spec_metadata_config.py delete mode 100644 pinecone/core_ea/openapi/db_control/model/serverless_spec.py delete mode 100644 pinecone/core_ea/openapi/db_control/models/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_data/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_data/api/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_data/api/bulk_operations_api.py delete mode 100644 pinecone/core_ea/openapi/db_data/api/vector_operations_api.py delete mode 100644 pinecone/core_ea/openapi/db_data/apis/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/__init__.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/delete_request.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/describe_index_stats_request.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/describe_index_stats_response.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/fetch_response.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/import_error_mode.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/import_list_response.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/import_model.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/list_item.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/list_response.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/namespace_summary.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/pagination.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/protobuf_any.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/protobuf_null_value.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/query_request.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/query_response.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/query_vector.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/rpc_status.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/scored_vector.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/single_query_results.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/sparse_values.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/start_import_request.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/start_import_response.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/update_request.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/upsert_request.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/upsert_response.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/usage.py delete mode 100644 pinecone/core_ea/openapi/db_data/model/vector.py delete mode 100644 pinecone/core_ea/openapi/db_data/models/__init__.py delete mode 100644 pinecone/core_ea/openapi/shared/__init__.py create mode 100644 pinecone/openapi_support/__init__.py rename pinecone/{core_ea/openapi/shared => openapi_support}/api_client.py (58%) rename pinecone/{core_ea/openapi/shared => openapi_support}/configuration.py (96%) create mode 100644 pinecone/openapi_support/endpoint.py rename pinecone/{core_ea/openapi/shared => openapi_support}/exceptions.py (99%) rename pinecone/{core_ea/openapi/shared => openapi_support}/model_utils.py (95%) rename pinecone/{core_ea/openapi/shared => openapi_support}/rest.py (94%) create mode 100644 tests/unit/openapi_support/__init__.py create mode 100644 tests/unit/openapi_support/test_api_client.py diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index 6169577b..9f966b25 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -13,7 +13,7 @@ if [ "$is_early_access" = "true" ]; then template_dir="codegen/python-oas-templates/templates5.2.0" else destination="pinecone/core/openapi" - modules=("control" "data") + modules=("db_control" "db_data") py_module_name="core" template_dir="codegen/python-oas-templates/templates5.2.0" fi @@ -83,7 +83,7 @@ generate_client() { docker run --rm -v $(pwd):/workspace openapitools/openapi-generator-cli:v5.2.0 generate \ --input-spec "/workspace/$oas_file" \ --generator-name python \ - --additional-properties=packageName=$package_name,pythonAttrNoneIfUnset=true,exceptionsPackageName=pinecone.core.openapi.shared.exceptions \ + --additional-properties=packageName=$package_name,pythonAttrNoneIfUnset=true,exceptionsPackageName=pinecone.openapi_support.exceptions \ --output "/workspace/${build_dir}" \ --template-dir "/workspace/$template_dir" @@ -97,12 +97,10 @@ generate_client() { rm -rf "${destination}/${module_name}" mkdir -p "${destination}" cp -r "build/pinecone/$py_module_name/openapi/${module_name}" "${destination}/${module_name}" + echo "API_VERSION = '${version}'" >> "${destination}/${module_name}/__init__.py" } -extract_shared_classes() { - target_directory="${destination}/shared" - mkdir -p "$target_directory" - +remove_shared_classes() { # Define the list of shared source files sharedFiles=( "api_client" @@ -114,11 +112,6 @@ extract_shared_classes() { source_directory="${destination}/${modules[0]}" - # Loop through each file we want to share and copy it to the target directory - for file in "${sharedFiles[@]}"; do - cp "${source_directory}/${file}.py" "$target_directory" - done - # Cleanup shared files in each module for module in "${modules[@]}"; do source_directory="${destination}/${module}" @@ -127,26 +120,18 @@ extract_shared_classes() { done done - # Remove the docstring headers that aren't really correct in the - # context of this new shared package structure - find "$target_directory" -name "*.py" -print0 | xargs -0 -I {} sh -c 'sed -i "" "/^\"\"\"/,/^\"\"\"/d" "{}"' - - echo "All shared files have been copied to $target_directory." - # Adjust import paths in every file find "${destination}" -name "*.py" | while IFS= read -r file; do - sed -i '' "s/from \.\.model_utils/from pinecone\.$py_module_name\.openapi\.shared\.model_utils/g" "$file" + sed -i '' "s/from \.\.model_utils/from pinecone\.openapi_support\.model_utils/g" "$file" for module in "${modules[@]}"; do - sed -i '' "s/from pinecone\.$py_module_name\.openapi\.$module import rest/from pinecone\.$py_module_name\.openapi\.shared import rest/g" "$file" + sed -i '' "s/from pinecone\.$py_module_name\.openapi\.$module import rest/from pinecone\.openapi_support import rest/g" "$file" for sharedFile in "${sharedFiles[@]}"; do - sed -i '' "s/from pinecone\.$py_module_name\.openapi\.$module\.$sharedFile/from pinecone\.$py_module_name\.openapi\.shared\.$sharedFile/g" "$file" + sed -i '' "s/from pinecone\.$py_module_name\.openapi\.$module\.$sharedFile/from pinecone\.openapi_support/g" "$file" done done done - - echo "API_VERSION = '${version}'" > "${target_directory}/__init__.py" } update_apis_repo @@ -162,8 +147,9 @@ done # Even though we want to generate multiple packages, we # don't want to duplicate every exception and utility class. -# So we do a bit of surgery to combine the shared files. -extract_shared_classes +# So we do a bit of surgery to find these shared files +# elsewhere, in the pinecone.openapi_support package. +remove_shared_classes # Format generated files poetry run ruff format "${destination}" diff --git a/pinecone/config/config.py b/pinecone/config/config.py index a3b28725..2474ccec 100644 --- a/pinecone/config/config.py +++ b/pinecone/config/config.py @@ -3,7 +3,7 @@ from pinecone.exceptions.exceptions import PineconeConfigurationError from pinecone.config.openapi import OpenApiConfigFactory -from pinecone.core.openapi.shared.configuration import Configuration as OpenApiConfiguration +from pinecone.openapi_support.configuration import Configuration as OpenApiConfiguration from pinecone.utils import normalize_host from pinecone.utils.constants import SOURCE_TAG diff --git a/pinecone/config/openapi.py b/pinecone/config/openapi.py index d48bd88c..d6bdf702 100644 --- a/pinecone/config/openapi.py +++ b/pinecone/config/openapi.py @@ -7,7 +7,7 @@ from urllib3.connection import HTTPConnection -from pinecone.core.openapi.shared.configuration import Configuration as OpenApiConfiguration +from pinecone.openapi_support.configuration import Configuration as OpenApiConfiguration TCP_KEEPINTVL = 60 # Sec TCP_KEEPIDLE = 300 # Sec diff --git a/pinecone/control/index_host_store.py b/pinecone/control/index_host_store.py index 26efd4fa..f4bf98f6 100644 --- a/pinecone/control/index_host_store.py +++ b/pinecone/control/index_host_store.py @@ -1,9 +1,9 @@ from typing import Dict from pinecone.config import Config -from pinecone.core.openapi.control.api.manage_indexes_api import ( +from pinecone.core.openapi.db_control.api.manage_indexes_api import ( ManageIndexesApi as IndexOperationsApi, ) -from pinecone.core.openapi.shared.exceptions import PineconeException +from pinecone.openapi_support.exceptions import PineconeException from pinecone.utils import normalize_host diff --git a/pinecone/control/pinecone.py b/pinecone/control/pinecone.py index 7e245ec3..823b1ef1 100644 --- a/pinecone/control/pinecone.py +++ b/pinecone/control/pinecone.py @@ -6,12 +6,12 @@ from pinecone.config import PineconeConfig, Config, ConfigBuilder -from pinecone.core.openapi.control.api.manage_indexes_api import ManageIndexesApi -from pinecone.core.openapi.shared.api_client import ApiClient +from pinecone.core.openapi.db_control.api.manage_indexes_api import ManageIndexesApi +from pinecone.openapi_support.api_client import ApiClient from pinecone.utils import normalize_host, setup_openapi_client, build_plugin_setup_client -from pinecone.core.openapi.control.models import ( +from pinecone.core.openapi.db_control.models import ( CreateCollectionRequest, CreateIndexRequest, ConfigureIndexRequest, @@ -23,7 +23,7 @@ PodSpec as PodSpecModel, PodSpecMetadataConfig, ) -from pinecone.core.openapi.shared import API_VERSION +from pinecone.core.openapi.db_control import API_VERSION from pinecone.models import ServerlessSpec, PodSpec, IndexModel, IndexList, CollectionList from .langchain_import_warnings import _build_langchain_attribute_error_message diff --git a/pinecone/control/repr_overrides.py b/pinecone/control/repr_overrides.py index 5b07135b..98e4b4d4 100644 --- a/pinecone/control/repr_overrides.py +++ b/pinecone/control/repr_overrides.py @@ -1,6 +1,6 @@ from pinecone.utils import install_json_repr_override from pinecone.models.index_model import IndexModel -from pinecone.core.openapi.control.models import CollectionModel +from pinecone.core.openapi.db_control.models import CollectionModel def install_repr_overrides(): diff --git a/pinecone/core_ea/openapi/db_control/__init__.py b/pinecone/core_ea/openapi/db_control/__init__.py deleted file mode 100644 index 42453739..00000000 --- a/pinecone/core_ea/openapi/db_control/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# flake8: noqa - -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - - -__version__ = "1.0.0" - -# import ApiClient -from pinecone.core_ea.openapi.shared.api_client import ApiClient - -# import Configuration -from pinecone.core_ea.openapi.shared.configuration import Configuration - -# import exceptions -from pinecone.core_ea.openapi.shared.exceptions import PineconeException -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiTypeError -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiValueError -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiKeyError -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiException diff --git a/pinecone/core_ea/openapi/db_control/api/__init__.py b/pinecone/core_ea/openapi/db_control/api/__init__.py deleted file mode 100644 index 7847a526..00000000 --- a/pinecone/core_ea/openapi/db_control/api/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from pinecone.core_ea.openapi.db_control.apis import ManageIndexesApi diff --git a/pinecone/core_ea/openapi/db_control/api/manage_indexes_api.py b/pinecone/core_ea/openapi/db_control/api/manage_indexes_api.py deleted file mode 100644 index 6164b0bb..00000000 --- a/pinecone/core_ea/openapi/db_control/api/manage_indexes_api.py +++ /dev/null @@ -1,818 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.api_client import ApiClient, Endpoint as _Endpoint -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types, -) -from pinecone.core_ea.openapi.db_control.model.collection_list import CollectionList -from pinecone.core_ea.openapi.db_control.model.collection_model import CollectionModel -from pinecone.core_ea.openapi.db_control.model.configure_index_request import ConfigureIndexRequest -from pinecone.core_ea.openapi.db_control.model.create_collection_request import CreateCollectionRequest -from pinecone.core_ea.openapi.db_control.model.create_index_request import CreateIndexRequest -from pinecone.core_ea.openapi.db_control.model.error_response import ErrorResponse -from pinecone.core_ea.openapi.db_control.model.index_list import IndexList -from pinecone.core_ea.openapi.db_control.model.index_model import IndexModel - - -class ManageIndexesApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __configure_index(self, index_name, configure_index_request, **kwargs): - """Configure an index # noqa: E501 - - This operation configures an existing index. For serverless indexes, you can configure only index deletion protection. For pod-based indexes, you can configure the pod size, number of replicas, 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/create-an-index#create-an-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/configure-an-index). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.configure_index(index_name, configure_index_request, async_req=True) - >>> result = thread.get() - - Args: - index_name (str): The name of the index to configure. - configure_index_request (ConfigureIndexRequest): The desired pod size and replica configuration for the index. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - IndexModel - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["index_name"] = index_name - kwargs["configure_index_request"] = configure_index_request - return self.call_with_http_info(**kwargs) - - self.configure_index = _Endpoint( - settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "configure_index", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "index_name", - "configure_index_request", - ], - "required": [ - "index_name", - "configure_index_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "index_name": (str,), - "configure_index_request": (ConfigureIndexRequest,), - }, - "attribute_map": { - "index_name": "index_name", - }, - "location_map": { - "index_name": "path", - "configure_index_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__configure_index, - ) - - def __create_collection(self, create_collection_request, **kwargs): - """Create a collection # noqa: E501 - - This operation creates a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_collection(create_collection_request, async_req=True) - >>> result = thread.get() - - Args: - create_collection_request (CreateCollectionRequest): The desired configuration for the collection. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - CollectionModel - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["create_collection_request"] = create_collection_request - return self.call_with_http_info(**kwargs) - - self.create_collection = _Endpoint( - settings={ - "response_type": (CollectionModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections", - "operation_id": "create_collection", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "create_collection_request", - ], - "required": [ - "create_collection_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "create_collection_request": (CreateCollectionRequest,), - }, - "attribute_map": {}, - "location_map": { - "create_collection_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__create_collection, - ) - - def __create_index(self, create_index_request, **kwargs): - """Create an index # noqa: E501 - - This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_index(create_index_request, async_req=True) - >>> result = thread.get() - - Args: - create_index_request (CreateIndexRequest): The desired configuration for the index. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - IndexModel - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["create_index_request"] = create_index_request - return self.call_with_http_info(**kwargs) - - self.create_index = _Endpoint( - settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes", - "operation_id": "create_index", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "create_index_request", - ], - "required": [ - "create_index_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "create_index_request": (CreateIndexRequest,), - }, - "attribute_map": {}, - "location_map": { - "create_index_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__create_index, - ) - - def __delete_collection(self, collection_name, **kwargs): - """Delete a collection # noqa: E501 - - This operation deletes an existing collection. Serverless indexes do not support collections. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_collection(collection_name, async_req=True) - >>> result = thread.get() - - Args: - collection_name (str): The name of the collection. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["collection_name"] = collection_name - return self.call_with_http_info(**kwargs) - - self.delete_collection = _Endpoint( - settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections/{collection_name}", - "operation_id": "delete_collection", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "collection_name", - ], - "required": [ - "collection_name", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "collection_name": (str,), - }, - "attribute_map": { - "collection_name": "collection_name", - }, - "location_map": { - "collection_name": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__delete_collection, - ) - - def __delete_index(self, index_name, **kwargs): - """Delete an index # noqa: E501 - - This operation deletes an existing index. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_index(index_name, async_req=True) - >>> result = thread.get() - - Args: - index_name (str): The name of the index to delete. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["index_name"] = index_name - return self.call_with_http_info(**kwargs) - - self.delete_index = _Endpoint( - settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "delete_index", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "index_name", - ], - "required": [ - "index_name", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "index_name": (str,), - }, - "attribute_map": { - "index_name": "index_name", - }, - "location_map": { - "index_name": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__delete_index, - ) - - def __describe_collection(self, collection_name, **kwargs): - """Describe a collection # noqa: E501 - - This operation gets a description of a collection. Serverless indexes do not support collections. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.describe_collection(collection_name, async_req=True) - >>> result = thread.get() - - Args: - collection_name (str): The name of the collection to be described. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - CollectionModel - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["collection_name"] = collection_name - return self.call_with_http_info(**kwargs) - - self.describe_collection = _Endpoint( - settings={ - "response_type": (CollectionModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections/{collection_name}", - "operation_id": "describe_collection", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "collection_name", - ], - "required": [ - "collection_name", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "collection_name": (str,), - }, - "attribute_map": { - "collection_name": "collection_name", - }, - "location_map": { - "collection_name": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__describe_collection, - ) - - def __describe_index(self, index_name, **kwargs): - """Describe an index # noqa: E501 - - Get a description of an index. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.describe_index(index_name, async_req=True) - >>> result = thread.get() - - Args: - index_name (str): The name of the index to be described. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - IndexModel - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["index_name"] = index_name - return self.call_with_http_info(**kwargs) - - self.describe_index = _Endpoint( - settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "describe_index", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "index_name", - ], - "required": [ - "index_name", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "index_name": (str,), - }, - "attribute_map": { - "index_name": "index_name", - }, - "location_map": { - "index_name": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__describe_index, - ) - - def __list_collections(self, **kwargs): - """List collections # noqa: E501 - - This operation returns a list of all collections in a project. Serverless indexes do not support collections. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_collections(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - CollectionList - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.list_collections = _Endpoint( - settings={ - "response_type": (CollectionList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections", - "operation_id": "list_collections", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__list_collections, - ) - - def __list_indexes(self, **kwargs): - """List indexes # noqa: E501 - - This operation returns a list of all indexes in a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_indexes(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - IndexList - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.list_indexes = _Endpoint( - settings={ - "response_type": (IndexList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes", - "operation_id": "list_indexes", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__list_indexes, - ) diff --git a/pinecone/core_ea/openapi/db_control/apis/__init__.py b/pinecone/core_ea/openapi/db_control/apis/__init__.py deleted file mode 100644 index 617decc1..00000000 --- a/pinecone/core_ea/openapi/db_control/apis/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from .api.manage_indexes_api import ManageIndexesApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from pinecone.core_ea.openapi.db_control.api.manage_indexes_api import ManageIndexesApi diff --git a/pinecone/core_ea/openapi/db_control/model/__init__.py b/pinecone/core_ea/openapi/db_control/model/__init__.py deleted file mode 100644 index cfe32b78..00000000 --- a/pinecone/core_ea/openapi/db_control/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB diff --git a/pinecone/core_ea/openapi/db_control/model/collection_list.py b/pinecone/core_ea/openapi/db_control/model/collection_list.py deleted file mode 100644 index 3da5b629..00000000 --- a/pinecone/core_ea/openapi/db_control/model/collection_list.py +++ /dev/null @@ -1,276 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.collection_model import CollectionModel - - globals()["CollectionModel"] = CollectionModel - - -class CollectionList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "collections": ([CollectionModel],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "collections": "collections", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CollectionList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - collections ([CollectionModel]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CollectionList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - collections ([CollectionModel]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/collection_model.py b/pinecone/core_ea/openapi/db_control/model/collection_model.py deleted file mode 100644 index ee93c026..00000000 --- a/pinecone/core_ea/openapi/db_control/model/collection_model.py +++ /dev/null @@ -1,309 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class CollectionModel(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("status",): { - "INITIALIZING": "Initializing", - "READY": "Ready", - "TERMINATING": "Terminating", - }, - } - - validations = { - ("dimension",): { - "inclusive_maximum": 20000, - "inclusive_minimum": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), # noqa: E501 - "status": (str,), # noqa: E501 - "environment": (str,), # noqa: E501 - "size": (int,), # noqa: E501 - "dimension": (int,), # noqa: E501 - "vector_count": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "name": "name", # noqa: E501 - "status": "status", # noqa: E501 - "environment": "environment", # noqa: E501 - "size": "size", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "vector_count": "vector_count", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, status, environment, *args, **kwargs): # noqa: E501 - """CollectionModel - a model defined in OpenAPI - - Args: - name (str): The name of the collection. - status (str): The status of the collection. - environment (str): The environment where the collection is hosted. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - size (int): The size of the collection in bytes.. [optional] # noqa: E501 - dimension (int): The dimension of the vectors stored in each record held in the collection.. [optional] # noqa: E501 - vector_count (int): The number of records stored in the collection.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.status = status - self.environment = environment - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, status, environment, *args, **kwargs): # noqa: E501 - """CollectionModel - a model defined in OpenAPI - - Args: - name (str): The name of the collection. - status (str): The status of the collection. - environment (str): The environment where the collection is hosted. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - size (int): The size of the collection in bytes.. [optional] # noqa: E501 - dimension (int): The dimension of the vectors stored in each record held in the collection.. [optional] # noqa: E501 - vector_count (int): The number of records stored in the collection.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.status = status - self.environment = environment - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/configure_index_request.py b/pinecone/core_ea/openapi/db_control/model/configure_index_request.py deleted file mode 100644 index 0f1c6612..00000000 --- a/pinecone/core_ea/openapi/db_control/model/configure_index_request.py +++ /dev/null @@ -1,282 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.configure_index_request_spec import ConfigureIndexRequestSpec - from pinecone.core_ea.openapi.db_control.model.deletion_protection import DeletionProtection - - globals()["ConfigureIndexRequestSpec"] = ConfigureIndexRequestSpec - globals()["DeletionProtection"] = DeletionProtection - - -class ConfigureIndexRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "spec": (ConfigureIndexRequestSpec,), # noqa: E501 - "deletion_protection": (DeletionProtection,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "spec": "spec", # noqa: E501 - "deletion_protection": "deletion_protection", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConfigureIndexRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - spec (ConfigureIndexRequestSpec): [optional] # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConfigureIndexRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - spec (ConfigureIndexRequestSpec): [optional] # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/configure_index_request_spec.py b/pinecone/core_ea/openapi/db_control/model/configure_index_request_spec.py deleted file mode 100644 index a1bc5d9b..00000000 --- a/pinecone/core_ea/openapi/db_control/model/configure_index_request_spec.py +++ /dev/null @@ -1,282 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.configure_index_request_spec_pod import ConfigureIndexRequestSpecPod - - globals()["ConfigureIndexRequestSpecPod"] = ConfigureIndexRequestSpecPod - - -class ConfigureIndexRequestSpec(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "pod": (ConfigureIndexRequestSpecPod,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "pod": "pod", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pod, *args, **kwargs): # noqa: E501 - """ConfigureIndexRequestSpec - a model defined in OpenAPI - - Args: - pod (ConfigureIndexRequestSpecPod): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pod = pod - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, pod, *args, **kwargs): # noqa: E501 - """ConfigureIndexRequestSpec - a model defined in OpenAPI - - Args: - pod (ConfigureIndexRequestSpecPod): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pod = pod - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/configure_index_request_spec_pod.py b/pinecone/core_ea/openapi/db_control/model/configure_index_request_spec_pod.py deleted file mode 100644 index f1807c88..00000000 --- a/pinecone/core_ea/openapi/db_control/model/configure_index_request_spec_pod.py +++ /dev/null @@ -1,276 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class ConfigureIndexRequestSpecPod(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("replicas",): { - "inclusive_minimum": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "replicas": (int,), # noqa: E501 - "pod_type": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "replicas": "replicas", # noqa: E501 - "pod_type": "pod_type", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConfigureIndexRequestSpecPod - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.. [optional] if omitted the server will use the default value of 1 # noqa: E501 - pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1" # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConfigureIndexRequestSpecPod - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.. [optional] if omitted the server will use the default value of 1 # noqa: E501 - pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1" # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/create_collection_request.py b/pinecone/core_ea/openapi/db_control/model/create_collection_request.py deleted file mode 100644 index 8c6ad857..00000000 --- a/pinecone/core_ea/openapi/db_control/model/create_collection_request.py +++ /dev/null @@ -1,285 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class CreateCollectionRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 45, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), # noqa: E501 - "source": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "name": "name", # noqa: E501 - "source": "source", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, source, *args, **kwargs): # noqa: E501 - """CreateCollectionRequest - a model defined in OpenAPI - - Args: - name (str): The name of the collection to be created. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. - source (str): The name of the index to be used as the source for the collection. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.source = source - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, source, *args, **kwargs): # noqa: E501 - """CreateCollectionRequest - a model defined in OpenAPI - - Args: - name (str): The name of the collection to be created. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. - source (str): The name of the index to be used as the source for the collection. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.source = source - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/create_index_request.py b/pinecone/core_ea/openapi/db_control/model/create_index_request.py deleted file mode 100644 index c625877b..00000000 --- a/pinecone/core_ea/openapi/db_control/model/create_index_request.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.deletion_protection import DeletionProtection - from pinecone.core_ea.openapi.db_control.model.index_spec import IndexSpec - - globals()["DeletionProtection"] = DeletionProtection - globals()["IndexSpec"] = IndexSpec - - -class CreateIndexRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("metric",): { - "COSINE": "cosine", - "EUCLIDEAN": "euclidean", - "DOTPRODUCT": "dotproduct", - }, - } - - validations = { - ("name",): { - "max_length": 45, - "min_length": 1, - }, - ("dimension",): { - "inclusive_maximum": 20000, - "inclusive_minimum": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "dimension": (int,), # noqa: E501 - "spec": (IndexSpec,), # noqa: E501 - "metric": (str,), # noqa: E501 - "deletion_protection": (DeletionProtection,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "name": "name", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "spec": "spec", # noqa: E501 - "metric": "metric", # noqa: E501 - "deletion_protection": "deletion_protection", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, dimension, spec, *args, **kwargs): # noqa: E501 - """CreateIndexRequest - a model defined in OpenAPI - - Args: - name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. - dimension (int): The dimensions of the vectors to be inserted in the index. - spec (IndexSpec): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine" # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.dimension = dimension - self.spec = spec - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, dimension, spec, *args, **kwargs): # noqa: E501 - """CreateIndexRequest - a model defined in OpenAPI - - Args: - name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. - dimension (int): The dimensions of the vectors to be inserted in the index. - spec (IndexSpec): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine" # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.dimension = dimension - self.spec = spec - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/deletion_protection.py b/pinecone/core_ea/openapi/db_control/model/deletion_protection.py deleted file mode 100644 index 09e7a7a2..00000000 --- a/pinecone/core_ea/openapi/db_control/model/deletion_protection.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class DeletionProtection(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "DISABLED": "disabled", - "ENABLED": "enabled", - }, - } - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """DeletionProtection - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): Whether [deletion protection](http://docs.pinecone.io/guides/indexes/prevent-index-deletion) is enabled/disabled for the index. . if omitted defaults to "disabled", must be one of ["disabled", "enabled", ] # noqa: E501 - - Keyword Args: - value (str): Whether [deletion protection](http://docs.pinecone.io/guides/indexes/prevent-index-deletion) is enabled/disabled for the index. . if omitted defaults to "disabled", must be one of ["disabled", "enabled", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - value = "disabled" - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """DeletionProtection - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): Whether [deletion protection](http://docs.pinecone.io/guides/indexes/prevent-index-deletion) is enabled/disabled for the index. . if omitted defaults to "disabled", must be one of ["disabled", "enabled", ] # noqa: E501 - - Keyword Args: - value (str): Whether [deletion protection](http://docs.pinecone.io/guides/indexes/prevent-index-deletion) is enabled/disabled for the index. . if omitted defaults to "disabled", must be one of ["disabled", "enabled", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - value = "disabled" - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/pinecone/core_ea/openapi/db_control/model/error_response.py b/pinecone/core_ea/openapi/db_control/model/error_response.py deleted file mode 100644 index 9c48c2b9..00000000 --- a/pinecone/core_ea/openapi/db_control/model/error_response.py +++ /dev/null @@ -1,288 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.error_response_error import ErrorResponseError - - globals()["ErrorResponseError"] = ErrorResponseError - - -class ErrorResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "status": (int,), # noqa: E501 - "error": (ErrorResponseError,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "status": "status", # noqa: E501 - "error": "error", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, status, error, *args, **kwargs): # noqa: E501 - """ErrorResponse - a model defined in OpenAPI - - Args: - status (int): The HTTP status code of the error. - error (ErrorResponseError): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.status = status - self.error = error - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, status, error, *args, **kwargs): # noqa: E501 - """ErrorResponse - a model defined in OpenAPI - - Args: - status (int): The HTTP status code of the error. - error (ErrorResponseError): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.status = status - self.error = error - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/error_response_error.py b/pinecone/core_ea/openapi/db_control/model/error_response_error.py deleted file mode 100644 index 4f9dc23c..00000000 --- a/pinecone/core_ea/openapi/db_control/model/error_response_error.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class ErrorResponseError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("code",): { - "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", - }, - } - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "code": (str,), # noqa: E501 - "message": (str,), # noqa: E501 - "details": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "code": "code", # noqa: E501 - "message": "message", # noqa: E501 - "details": "details", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, code, message, *args, **kwargs): # noqa: E501 - """ErrorResponseError - a model defined in OpenAPI - - Args: - code (str): - message (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - details ({str: (bool, dict, float, int, list, str, none_type)}): Additional information about the error. This field is not guaranteed to be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.code = code - self.message = message - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, code, message, *args, **kwargs): # noqa: E501 - """ErrorResponseError - a model defined in OpenAPI - - Args: - code (str): - message (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - details ({str: (bool, dict, float, int, list, str, none_type)}): Additional information about the error. This field is not guaranteed to be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.code = code - self.message = message - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/index_list.py b/pinecone/core_ea/openapi/db_control/model/index_list.py deleted file mode 100644 index 99e9ebba..00000000 --- a/pinecone/core_ea/openapi/db_control/model/index_list.py +++ /dev/null @@ -1,276 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.index_model import IndexModel - - globals()["IndexModel"] = IndexModel - - -class IndexList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "indexes": ([IndexModel],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "indexes": "indexes", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """IndexList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - indexes ([IndexModel]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """IndexList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - indexes ([IndexModel]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/index_model.py b/pinecone/core_ea/openapi/db_control/model/index_model.py deleted file mode 100644 index a981139f..00000000 --- a/pinecone/core_ea/openapi/db_control/model/index_model.py +++ /dev/null @@ -1,337 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.deletion_protection import DeletionProtection - from pinecone.core_ea.openapi.db_control.model.index_model_spec import IndexModelSpec - from pinecone.core_ea.openapi.db_control.model.index_model_status import IndexModelStatus - - globals()["DeletionProtection"] = DeletionProtection - globals()["IndexModelSpec"] = IndexModelSpec - globals()["IndexModelStatus"] = IndexModelStatus - - -class IndexModel(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("metric",): { - "COSINE": "cosine", - "EUCLIDEAN": "euclidean", - "DOTPRODUCT": "dotproduct", - }, - } - - validations = { - ("name",): { - "max_length": 45, - "min_length": 1, - }, - ("dimension",): { - "inclusive_maximum": 20000, - "inclusive_minimum": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "dimension": (int,), # noqa: E501 - "metric": (str,), # noqa: E501 - "host": (str,), # noqa: E501 - "spec": (IndexModelSpec,), # noqa: E501 - "status": (IndexModelStatus,), # noqa: E501 - "deletion_protection": (DeletionProtection,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "name": "name", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "metric": "metric", # noqa: E501 - "host": "host", # noqa: E501 - "spec": "spec", # noqa: E501 - "status": "status", # noqa: E501 - "deletion_protection": "deletion_protection", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, dimension, host, spec, status, *args, **kwargs): # noqa: E501 - """IndexModel - a model defined in OpenAPI - - Args: - name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. - dimension (int): The dimensions of the vectors to be inserted in the index. - host (str): The URL address where the index is hosted. - spec (IndexModelSpec): - status (IndexModelStatus): - - Keyword Args: - metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. defaults to "cosine", must be one of ["cosine", "euclidean", "dotproduct", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - deletion_protection (DeletionProtection): [optional] # noqa: E501 - """ - - metric = kwargs.get("metric", "cosine") - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.dimension = dimension - self.metric = metric - self.host = host - self.spec = spec - self.status = status - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, dimension, host, spec, status, *args, **kwargs): # noqa: E501 - """IndexModel - a model defined in OpenAPI - - Args: - name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. - dimension (int): The dimensions of the vectors to be inserted in the index. - host (str): The URL address where the index is hosted. - spec (IndexModelSpec): - status (IndexModelStatus): - - Keyword Args: - metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. defaults to "cosine", must be one of ["cosine", "euclidean", "dotproduct", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - deletion_protection (DeletionProtection): [optional] # noqa: E501 - """ - - metric = kwargs.get("metric", "cosine") - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.dimension = dimension - self.metric = metric - self.host = host - self.spec = spec - self.status = status - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/index_model_spec.py b/pinecone/core_ea/openapi/db_control/model/index_model_spec.py deleted file mode 100644 index fb6d8fa5..00000000 --- a/pinecone/core_ea/openapi/db_control/model/index_model_spec.py +++ /dev/null @@ -1,282 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.pod_spec import PodSpec - from pinecone.core_ea.openapi.db_control.model.serverless_spec import ServerlessSpec - - globals()["PodSpec"] = PodSpec - globals()["ServerlessSpec"] = ServerlessSpec - - -class IndexModelSpec(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "pod": (PodSpec,), # noqa: E501 - "serverless": (ServerlessSpec,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "pod": "pod", # noqa: E501 - "serverless": "serverless", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """IndexModelSpec - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pod (PodSpec): [optional] # noqa: E501 - serverless (ServerlessSpec): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """IndexModelSpec - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pod (PodSpec): [optional] # noqa: E501 - serverless (ServerlessSpec): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/index_model_status.py b/pinecone/core_ea/openapi/db_control/model/index_model_status.py deleted file mode 100644 index 8a57b2dd..00000000 --- a/pinecone/core_ea/openapi/db_control/model/index_model_status.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class IndexModelStatus(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("state",): { - "INITIALIZING": "Initializing", - "INITIALIZATIONFAILED": "InitializationFailed", - "SCALINGUP": "ScalingUp", - "SCALINGDOWN": "ScalingDown", - "SCALINGUPPODSIZE": "ScalingUpPodSize", - "SCALINGDOWNPODSIZE": "ScalingDownPodSize", - "TERMINATING": "Terminating", - "READY": "Ready", - }, - } - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "ready": (bool,), # noqa: E501 - "state": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "ready": "ready", # noqa: E501 - "state": "state", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, ready, state, *args, **kwargs): # noqa: E501 - """IndexModelStatus - a model defined in OpenAPI - - Args: - ready (bool): - state (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.ready = ready - self.state = state - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, ready, state, *args, **kwargs): # noqa: E501 - """IndexModelStatus - a model defined in OpenAPI - - Args: - ready (bool): - state (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.ready = ready - self.state = state - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/index_spec.py b/pinecone/core_ea/openapi/db_control/model/index_spec.py deleted file mode 100644 index a947c816..00000000 --- a/pinecone/core_ea/openapi/db_control/model/index_spec.py +++ /dev/null @@ -1,267 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.pod_spec import PodSpec - from pinecone.core_ea.openapi.db_control.model.serverless_spec import ServerlessSpec - - globals()["PodSpec"] = PodSpec - globals()["ServerlessSpec"] = ServerlessSpec - - -class IndexSpec(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "serverless": (ServerlessSpec,), # noqa: E501 - "pod": (PodSpec,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "serverless": "serverless", # noqa: E501 - "pod": "pod", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """IndexSpec - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - serverless (ServerlessSpec): [optional] # noqa: E501 - pod (PodSpec): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """IndexSpec - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - serverless (ServerlessSpec): [optional] # noqa: E501 - pod (PodSpec): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/pod_spec.py b/pinecone/core_ea/openapi/db_control/model/pod_spec.py deleted file mode 100644 index df985fe9..00000000 --- a/pinecone/core_ea/openapi/db_control/model/pod_spec.py +++ /dev/null @@ -1,332 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig - - globals()["PodSpecMetadataConfig"] = PodSpecMetadataConfig - - -class PodSpec(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("replicas",): { - "inclusive_minimum": 1, - }, - ("shards",): { - "inclusive_minimum": 1, - }, - ("pods",): { - "inclusive_minimum": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "environment": (str,), # noqa: E501 - "replicas": (int,), # noqa: E501 - "shards": (int,), # noqa: E501 - "pod_type": (str,), # noqa: E501 - "pods": (int,), # noqa: E501 - "metadata_config": (PodSpecMetadataConfig,), # noqa: E501 - "source_collection": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "environment": "environment", # noqa: E501 - "replicas": "replicas", # noqa: E501 - "shards": "shards", # noqa: E501 - "pod_type": "pod_type", # noqa: E501 - "pods": "pods", # noqa: E501 - "metadata_config": "metadata_config", # noqa: E501 - "source_collection": "source_collection", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, environment, *args, **kwargs): # noqa: E501 - """PodSpec - a model defined in OpenAPI - - Args: - environment (str): The environment where the index is hosted. - - Keyword Args: - replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.. defaults to 1 # noqa: E501 - shards (int): The number of shards. Shards split your data across multiple pods so you can fit more data into an index.. defaults to 1 # noqa: E501 - pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. defaults to "p1.x1" # noqa: E501 - pods (int): The number of pods to be used in the index. This should be equal to `shards` x `replicas`.'. defaults to 1 # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - metadata_config (PodSpecMetadataConfig): [optional] # noqa: E501 - source_collection (str): The name of the collection to be used as the source for the index.. [optional] # noqa: E501 - """ - - replicas = kwargs.get("replicas", 1) - shards = kwargs.get("shards", 1) - pod_type = kwargs.get("pod_type", "p1.x1") - pods = kwargs.get("pods", 1) - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.environment = environment - self.replicas = replicas - self.shards = shards - self.pod_type = pod_type - self.pods = pods - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, environment, *args, **kwargs): # noqa: E501 - """PodSpec - a model defined in OpenAPI - - Args: - environment (str): The environment where the index is hosted. - - Keyword Args: - replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.. defaults to 1 # noqa: E501 - shards (int): The number of shards. Shards split your data across multiple pods so you can fit more data into an index.. defaults to 1 # noqa: E501 - pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. defaults to "p1.x1" # noqa: E501 - pods (int): The number of pods to be used in the index. This should be equal to `shards` x `replicas`.'. defaults to 1 # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - metadata_config (PodSpecMetadataConfig): [optional] # noqa: E501 - source_collection (str): The name of the collection to be used as the source for the index.. [optional] # noqa: E501 - """ - - replicas = kwargs.get("replicas", 1) - shards = kwargs.get("shards", 1) - pod_type = kwargs.get("pod_type", "p1.x1") - pods = kwargs.get("pods", 1) - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.environment = environment - self.replicas = replicas - self.shards = shards - self.pod_type = pod_type - self.pods = pods - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/pod_spec_metadata_config.py b/pinecone/core_ea/openapi/db_control/model/pod_spec_metadata_config.py deleted file mode 100644 index 991739d0..00000000 --- a/pinecone/core_ea/openapi/db_control/model/pod_spec_metadata_config.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class PodSpecMetadataConfig(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "indexed": ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "indexed": "indexed", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PodSpecMetadataConfig - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - indexed ([str]): By default, all metadata is indexed; to change this behavior, use this property to specify an array of metadata fields that should be indexed.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PodSpecMetadataConfig - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - indexed ([str]): By default, all metadata is indexed; to change this behavior, use this property to specify an array of metadata fields that should be indexed.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/model/serverless_spec.py b/pinecone/core_ea/openapi/db_control/model/serverless_spec.py deleted file mode 100644 index 03070398..00000000 --- a/pinecone/core_ea/openapi/db_control/model/serverless_spec.py +++ /dev/null @@ -1,286 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class ServerlessSpec(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("cloud",): { - "GCP": "gcp", - "AWS": "aws", - "AZURE": "azure", - }, - } - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "cloud": (str,), # noqa: E501 - "region": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "cloud": "cloud", # noqa: E501 - "region": "region", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cloud, region, *args, **kwargs): # noqa: E501 - """ServerlessSpec - a model defined in OpenAPI - - Args: - cloud (str): The public cloud where you would like your index hosted. - region (str): The region where you would like your index to be created. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cloud = cloud - self.region = region - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, cloud, region, *args, **kwargs): # noqa: E501 - """ServerlessSpec - a model defined in OpenAPI - - Args: - cloud (str): The public cloud where you would like your index hosted. - region (str): The region where you would like your index to be created. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cloud = cloud - self.region = region - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_control/models/__init__.py b/pinecone/core_ea/openapi/db_control/models/__init__.py deleted file mode 100644 index 6665dfc3..00000000 --- a/pinecone/core_ea/openapi/db_control/models/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from pinecone.core_ea.openapi.db_control.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from pinecone.core_ea.openapi.db_control.model.collection_list import CollectionList -from pinecone.core_ea.openapi.db_control.model.collection_model import CollectionModel -from pinecone.core_ea.openapi.db_control.model.configure_index_request import ConfigureIndexRequest -from pinecone.core_ea.openapi.db_control.model.configure_index_request_spec import ConfigureIndexRequestSpec -from pinecone.core_ea.openapi.db_control.model.configure_index_request_spec_pod import ConfigureIndexRequestSpecPod -from pinecone.core_ea.openapi.db_control.model.create_collection_request import CreateCollectionRequest -from pinecone.core_ea.openapi.db_control.model.create_index_request import CreateIndexRequest -from pinecone.core_ea.openapi.db_control.model.deletion_protection import DeletionProtection -from pinecone.core_ea.openapi.db_control.model.error_response import ErrorResponse -from pinecone.core_ea.openapi.db_control.model.error_response_error import ErrorResponseError -from pinecone.core_ea.openapi.db_control.model.index_list import IndexList -from pinecone.core_ea.openapi.db_control.model.index_model import IndexModel -from pinecone.core_ea.openapi.db_control.model.index_model_spec import IndexModelSpec -from pinecone.core_ea.openapi.db_control.model.index_model_status import IndexModelStatus -from pinecone.core_ea.openapi.db_control.model.index_spec import IndexSpec -from pinecone.core_ea.openapi.db_control.model.pod_spec import PodSpec -from pinecone.core_ea.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig -from pinecone.core_ea.openapi.db_control.model.serverless_spec import ServerlessSpec diff --git a/pinecone/core_ea/openapi/db_data/__init__.py b/pinecone/core_ea/openapi/db_data/__init__.py deleted file mode 100644 index d03ab6f8..00000000 --- a/pinecone/core_ea/openapi/db_data/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# flake8: noqa - -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - - -__version__ = "1.0.0" - -# import ApiClient -from pinecone.core_ea.openapi.shared.api_client import ApiClient - -# import Configuration -from pinecone.core_ea.openapi.shared.configuration import Configuration - -# import exceptions -from pinecone.core_ea.openapi.shared.exceptions import PineconeException -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiTypeError -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiValueError -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiKeyError -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiException diff --git a/pinecone/core_ea/openapi/db_data/api/__init__.py b/pinecone/core_ea/openapi/db_data/api/__init__.py deleted file mode 100644 index e1a28d6b..00000000 --- a/pinecone/core_ea/openapi/db_data/api/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from pinecone.core_ea.openapi.db_data.apis import BulkOperationsApi diff --git a/pinecone/core_ea/openapi/db_data/api/bulk_operations_api.py b/pinecone/core_ea/openapi/db_data/api/bulk_operations_api.py deleted file mode 100644 index 01dfbfd8..00000000 --- a/pinecone/core_ea/openapi/db_data/api/bulk_operations_api.py +++ /dev/null @@ -1,422 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.api_client import ApiClient, Endpoint as _Endpoint -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types, -) -from pinecone.core_ea.openapi.db_data.model.import_list_response import ImportListResponse -from pinecone.core_ea.openapi.db_data.model.import_model import ImportModel -from pinecone.core_ea.openapi.db_data.model.rpc_status import RpcStatus -from pinecone.core_ea.openapi.db_data.model.start_import_request import StartImportRequest -from pinecone.core_ea.openapi.db_data.model.start_import_response import StartImportResponse - - -class BulkOperationsApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __cancel_import(self, id, **kwargs): - """Cancel an import # noqa: E501 - - The `cancel_import` operation cancels 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/data/import-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.cancel_import(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["id"] = id - return self.call_with_http_info(**kwargs) - - self.cancel_import = _Endpoint( - settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports/{id}", - "operation_id": "cancel_import", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [ - "id", - ], - }, - root_map={ - "validations": { - ("id",): { - "max_length": 1000, - "min_length": 1, - }, - }, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__cancel_import, - ) - - def __describe_import(self, id, **kwargs): - """Describe an import # noqa: E501 - - The `describe_import` operation returns details of a specific import operation. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.describe_import(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ImportModel - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["id"] = id - return self.call_with_http_info(**kwargs) - - self.describe_import = _Endpoint( - settings={ - "response_type": (ImportModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports/{id}", - "operation_id": "describe_import", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [ - "id", - ], - }, - root_map={ - "validations": { - ("id",): { - "max_length": 1000, - "min_length": 1, - }, - }, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__describe_import, - ) - - def __list_imports(self, **kwargs): - """List imports # noqa: E501 - - The `list_imports` operation lists all recent and ongoing import operations. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_imports(async_req=True) - >>> result = thread.get() - - - Keyword Args: - limit (int): Max number of operations to return per page.. [optional] - pagination_token (str): Pagination token to continue a previous listing operation.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ImportListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.list_imports = _Endpoint( - settings={ - "response_type": (ImportListResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports", - "operation_id": "list_imports", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "limit", - "pagination_token", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [ - "limit", - ], - }, - root_map={ - "validations": { - ("limit",): { - "inclusive_maximum": 100, - "inclusive_minimum": 1, - }, - }, - "allowed_values": {}, - "openapi_types": { - "limit": (int,), - "pagination_token": (str,), - }, - "attribute_map": { - "limit": "limit", - "pagination_token": "paginationToken", - }, - "location_map": { - "limit": "query", - "pagination_token": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__list_imports, - ) - - def __start_import(self, start_import_request, **kwargs): - """Start import # noqa: E501 - - The `start_import` operation starts an asynchronous import of vectors from object storage into an index. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.start_import(start_import_request, async_req=True) - >>> result = thread.get() - - Args: - start_import_request (StartImportRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - StartImportResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["start_import_request"] = start_import_request - return self.call_with_http_info(**kwargs) - - self.start_import = _Endpoint( - settings={ - "response_type": (StartImportResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports", - "operation_id": "start_import", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "start_import_request", - ], - "required": [ - "start_import_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "start_import_request": (StartImportRequest,), - }, - "attribute_map": {}, - "location_map": { - "start_import_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__start_import, - ) diff --git a/pinecone/core_ea/openapi/db_data/api/vector_operations_api.py b/pinecone/core_ea/openapi/db_data/api/vector_operations_api.py deleted file mode 100644 index 3ded07d0..00000000 --- a/pinecone/core_ea/openapi/db_data/api/vector_operations_api.py +++ /dev/null @@ -1,848 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.api_client import ApiClient, Endpoint as _Endpoint -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types, -) -from pinecone.core_ea.openapi.db_data.model.delete_request import DeleteRequest -from pinecone.core_ea.openapi.db_data.model.describe_index_stats_request import DescribeIndexStatsRequest -from pinecone.core_ea.openapi.db_data.model.describe_index_stats_response import DescribeIndexStatsResponse -from pinecone.core_ea.openapi.db_data.model.fetch_response import FetchResponse -from pinecone.core_ea.openapi.db_data.model.list_response import ListResponse -from pinecone.core_ea.openapi.db_data.model.query_request import QueryRequest -from pinecone.core_ea.openapi.db_data.model.query_response import QueryResponse -from pinecone.core_ea.openapi.db_data.model.rpc_status import RpcStatus -from pinecone.core_ea.openapi.db_data.model.update_request import UpdateRequest -from pinecone.core_ea.openapi.db_data.model.upsert_request import UpsertRequest -from pinecone.core_ea.openapi.db_data.model.upsert_response import UpsertResponse - - -class VectorOperationsApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __alt_delete(self, **kwargs): - """Delete vectors # noqa: E501 - - DEPRECATED. Use [`POST /delete`](https://docs.pinecone.io/reference/api/data-plane/delete) instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.alt_delete(async_req=True) - >>> result = thread.get() - - - Keyword Args: - ids ([str]): Vectors to delete.. [optional] - delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] if omitted the server will use the default value of False - namespace (str): The namespace to delete vectors from, if applicable.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.alt_delete = _Endpoint( - settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/delete", - "operation_id": "alt_delete", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "ids", - "delete_all", - "namespace", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "ids": ([str],), - "delete_all": (bool,), - "namespace": (str,), - }, - "attribute_map": { - "ids": "ids", - "delete_all": "deleteAll", - "namespace": "namespace", - }, - "location_map": { - "ids": "query", - "delete_all": "query", - "namespace": "query", - }, - "collection_format_map": { - "ids": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__alt_delete, - ) - - def __alt_describe_index_stats(self, **kwargs): - """Get index stats # noqa: E501 - - DEPRECATED. Use [`POST /describe_index_stats`](https://docs.pinecone.io/reference/api/data-plane/describeindexstats) instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.alt_describe_index_stats(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - DescribeIndexStatsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.alt_describe_index_stats = _Endpoint( - settings={ - "response_type": (DescribeIndexStatsResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/describe_index_stats", - "operation_id": "alt_describe_index_stats", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__alt_describe_index_stats, - ) - - def __delete(self, delete_request, **kwargs): - """Delete vectors # noqa: E501 - - The `delete` operation deletes vectors, by id, from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete(delete_request, async_req=True) - >>> result = thread.get() - - Args: - delete_request (DeleteRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["delete_request"] = delete_request - return self.call_with_http_info(**kwargs) - - self.delete = _Endpoint( - settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/delete", - "operation_id": "delete", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "delete_request", - ], - "required": [ - "delete_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "delete_request": (DeleteRequest,), - }, - "attribute_map": {}, - "location_map": { - "delete_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__delete, - ) - - def __describe_index_stats(self, describe_index_stats_request, **kwargs): - """Get index stats # noqa: E501 - - The `describe_index_stats` operation returns 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. For pod-based indexes, the index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.describe_index_stats(describe_index_stats_request, async_req=True) - >>> result = thread.get() - - Args: - describe_index_stats_request (DescribeIndexStatsRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - DescribeIndexStatsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["describe_index_stats_request"] = describe_index_stats_request - return self.call_with_http_info(**kwargs) - - self.describe_index_stats = _Endpoint( - settings={ - "response_type": (DescribeIndexStatsResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/describe_index_stats", - "operation_id": "describe_index_stats", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "describe_index_stats_request", - ], - "required": [ - "describe_index_stats_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "describe_index_stats_request": (DescribeIndexStatsRequest,), - }, - "attribute_map": {}, - "location_map": { - "describe_index_stats_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__describe_index_stats, - ) - - def __fetch(self, ids, **kwargs): - """Fetch vectors # noqa: E501 - - The `fetch` operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fetch(ids, async_req=True) - >>> result = thread.get() - - Args: - ids ([str]): The vector IDs to fetch. Does not accept values containing spaces. - - Keyword Args: - namespace (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FetchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["ids"] = ids - return self.call_with_http_info(**kwargs) - - self.fetch = _Endpoint( - settings={ - "response_type": (FetchResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/fetch", - "operation_id": "fetch", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "ids", - "namespace", - ], - "required": [ - "ids", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "ids": ([str],), - "namespace": (str,), - }, - "attribute_map": { - "ids": "ids", - "namespace": "namespace", - }, - "location_map": { - "ids": "query", - "namespace": "query", - }, - "collection_format_map": { - "ids": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__fetch, - ) - - def __list(self, **kwargs): - """List vector IDs # noqa: E501 - - The `list` operation lists 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. `list` returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - prefix (str): The vector IDs to fetch. Does not accept values containing spaces.. [optional] - limit (int): Max number of IDs to return per page.. [optional] - pagination_token (str): Pagination token to continue a previous listing operation.. [optional] - namespace (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.list = _Endpoint( - settings={ - "response_type": (ListResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/list", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "prefix", - "limit", - "pagination_token", - "namespace", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "prefix": (str,), - "limit": (int,), - "pagination_token": (str,), - "namespace": (str,), - }, - "attribute_map": { - "prefix": "prefix", - "limit": "limit", - "pagination_token": "paginationToken", - "namespace": "namespace", - }, - "location_map": { - "prefix": "query", - "limit": "query", - "pagination_token": "query", - "namespace": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__list, - ) - - def __query(self, query_request, **kwargs): - """Query vectors # noqa: E501 - - The `query` operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.query(query_request, async_req=True) - >>> result = thread.get() - - Args: - query_request (QueryRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - QueryResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["query_request"] = query_request - return self.call_with_http_info(**kwargs) - - self.query = _Endpoint( - settings={ - "response_type": (QueryResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/query", - "operation_id": "query", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "query_request", - ], - "required": [ - "query_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "query_request": (QueryRequest,), - }, - "attribute_map": {}, - "location_map": { - "query_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__query, - ) - - def __update(self, update_request, **kwargs): - """Update a vector # noqa: E501 - - The `update` operation updates a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value. For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update(update_request, async_req=True) - >>> result = thread.get() - - Args: - update_request (UpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["update_request"] = update_request - return self.call_with_http_info(**kwargs) - - self.update = _Endpoint( - settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/update", - "operation_id": "update", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "update_request", - ], - "required": [ - "update_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "update_request": (UpdateRequest,), - }, - "attribute_map": {}, - "location_map": { - "update_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__update, - ) - - def __upsert(self, upsert_request, **kwargs): - """Upsert vectors # noqa: E501 - - The `upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upsert(upsert_request, async_req=True) - >>> result = thread.get() - - Args: - upsert_request (UpsertRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UpsertResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["upsert_request"] = upsert_request - return self.call_with_http_info(**kwargs) - - self.upsert = _Endpoint( - settings={ - "response_type": (UpsertResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/upsert", - "operation_id": "upsert", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "upsert_request", - ], - "required": [ - "upsert_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "upsert_request": (UpsertRequest,), - }, - "attribute_map": {}, - "location_map": { - "upsert_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__upsert, - ) diff --git a/pinecone/core_ea/openapi/db_data/apis/__init__.py b/pinecone/core_ea/openapi/db_data/apis/__init__.py deleted file mode 100644 index ec0e72b3..00000000 --- a/pinecone/core_ea/openapi/db_data/apis/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from .api.bulk_operations_api import BulkOperationsApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from pinecone.core_ea.openapi.db_data.api.bulk_operations_api import BulkOperationsApi -from pinecone.core_ea.openapi.db_data.api.vector_operations_api import VectorOperationsApi diff --git a/pinecone/core_ea/openapi/db_data/model/__init__.py b/pinecone/core_ea/openapi/db_data/model/__init__.py deleted file mode 100644 index cfe32b78..00000000 --- a/pinecone/core_ea/openapi/db_data/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB diff --git a/pinecone/core_ea/openapi/db_data/model/delete_request.py b/pinecone/core_ea/openapi/db_data/model/delete_request.py deleted file mode 100644 index f53abe70..00000000 --- a/pinecone/core_ea/openapi/db_data/model/delete_request.py +++ /dev/null @@ -1,282 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class DeleteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("ids",): {}, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "ids": ([str],), # noqa: E501 - "delete_all": (bool,), # noqa: E501 - "namespace": (str,), # noqa: E501 - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "ids": "ids", # noqa: E501 - "delete_all": "deleteAll", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "filter": "filter", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DeleteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - ids ([str]): Vectors to delete.. [optional] # noqa: E501 - delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] if omitted the server will use the default value of False # noqa: E501 - namespace (str): The namespace to delete vectors from, if applicable.. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): 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 [Filter with metadata](https://docs.pinecone.io/guides/data/filter-with-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.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DeleteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - ids ([str]): Vectors to delete.. [optional] # noqa: E501 - delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] if omitted the server will use the default value of False # noqa: E501 - namespace (str): The namespace to delete vectors from, if applicable.. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): 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 [Filter with metadata](https://docs.pinecone.io/guides/data/filter-with-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.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/describe_index_stats_request.py b/pinecone/core_ea/openapi/db_data/model/describe_index_stats_request.py deleted file mode 100644 index 91767423..00000000 --- a/pinecone/core_ea/openapi/db_data/model/describe_index_stats_request.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class DescribeIndexStatsRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "filter": "filter", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DescribeIndexStatsRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - filter ({str: (bool, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See [Filter with metadata](https://docs.pinecone.io/guides/data/filter-with-metadata). Serverless indexes do not support filtering `describe_index_stats` by metadata.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DescribeIndexStatsRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - filter ({str: (bool, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See [Filter with metadata](https://docs.pinecone.io/guides/data/filter-with-metadata). Serverless indexes do not support filtering `describe_index_stats` by metadata.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/describe_index_stats_response.py b/pinecone/core_ea/openapi/db_data/model/describe_index_stats_response.py deleted file mode 100644 index a0d44556..00000000 --- a/pinecone/core_ea/openapi/db_data/model/describe_index_stats_response.py +++ /dev/null @@ -1,288 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.namespace_summary import NamespaceSummary - - globals()["NamespaceSummary"] = NamespaceSummary - - -class DescribeIndexStatsResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "namespaces": ({str: (NamespaceSummary,)},), # noqa: E501 - "dimension": (int,), # noqa: E501 - "index_fullness": (float,), # noqa: E501 - "total_vector_count": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "namespaces": "namespaces", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "index_fullness": "indexFullness", # noqa: E501 - "total_vector_count": "totalVectorCount", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DescribeIndexStatsResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - namespaces ({str: (NamespaceSummary,)}): A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.. [optional] # noqa: E501 - dimension (int): The dimension of the indexed vectors.. [optional] # noqa: E501 - index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index).. [optional] # noqa: E501 - total_vector_count (int): The total number of vectors in the index, regardless of whether a metadata filter expression was passed. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DescribeIndexStatsResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - namespaces ({str: (NamespaceSummary,)}): A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.. [optional] # noqa: E501 - dimension (int): The dimension of the indexed vectors.. [optional] # noqa: E501 - index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index).. [optional] # noqa: E501 - total_vector_count (int): The total number of vectors in the index, regardless of whether a metadata filter expression was passed. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/fetch_response.py b/pinecone/core_ea/openapi/db_data/model/fetch_response.py deleted file mode 100644 index 230f6c61..00000000 --- a/pinecone/core_ea/openapi/db_data/model/fetch_response.py +++ /dev/null @@ -1,286 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.usage import Usage - from pinecone.core_ea.openapi.db_data.model.vector import Vector - - globals()["Usage"] = Usage - globals()["Vector"] = Vector - - -class FetchResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "vectors": ({str: (Vector,)},), # noqa: E501 - "namespace": (str,), # noqa: E501 - "usage": (Usage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "vectors": "vectors", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "usage": "usage", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FetchResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - vectors ({str: (Vector,)}): [optional] # noqa: E501 - namespace (str): The namespace of the vectors.. [optional] # noqa: E501 - usage (Usage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FetchResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - vectors ({str: (Vector,)}): [optional] # noqa: E501 - namespace (str): The namespace of the vectors.. [optional] # noqa: E501 - usage (Usage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/import_error_mode.py b/pinecone/core_ea/openapi/db_data/model/import_error_mode.py deleted file mode 100644 index 99201020..00000000 --- a/pinecone/core_ea/openapi/db_data/model/import_error_mode.py +++ /dev/null @@ -1,273 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class ImportErrorMode(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("on_error",): { - "ABORT": "abort", - "CONTINUE": "continue", - }, - } - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "on_error": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "on_error": "onError", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ImportErrorMode - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - on_error (str): Indicates how to respond to errors during the import process.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ImportErrorMode - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - on_error (str): Indicates how to respond to errors during the import process.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/import_list_response.py b/pinecone/core_ea/openapi/db_data/model/import_list_response.py deleted file mode 100644 index ab03c1e6..00000000 --- a/pinecone/core_ea/openapi/db_data/model/import_list_response.py +++ /dev/null @@ -1,282 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.import_model import ImportModel - from pinecone.core_ea.openapi.db_data.model.pagination import Pagination - - globals()["ImportModel"] = ImportModel - globals()["Pagination"] = Pagination - - -class ImportListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "data": ([ImportModel],), # noqa: E501 - "pagination": (Pagination,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "data": "data", # noqa: E501 - "pagination": "pagination", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ImportListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - data ([ImportModel]): [optional] # noqa: E501 - pagination (Pagination): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ImportListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - data ([ImportModel]): [optional] # noqa: E501 - pagination (Pagination): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/import_model.py b/pinecone/core_ea/openapi/db_data/model/import_model.py deleted file mode 100644 index b7c8235e..00000000 --- a/pinecone/core_ea/openapi/db_data/model/import_model.py +++ /dev/null @@ -1,313 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class ImportModel(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("status",): { - "PENDING": "Pending", - "INPROGRESS": "InProgress", - "FAILED": "Failed", - "COMPLETED": "Completed", - "CANCELLED": "Cancelled", - }, - } - - validations = { - ("id",): { - "max_length": 1000, - "min_length": 1, - }, - ("percent_complete",): { - "inclusive_maximum": 100.0, - "inclusive_minimum": 0.0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), # noqa: E501 - "uri": (str,), # noqa: E501 - "status": (str,), # noqa: E501 - "created_at": (datetime,), # noqa: E501 - "finished_at": (datetime,), # noqa: E501 - "percent_complete": (float,), # noqa: E501 - "records_imported": (int,), # noqa: E501 - "error": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", # noqa: E501 - "uri": "uri", # noqa: E501 - "status": "status", # noqa: E501 - "created_at": "createdAt", # noqa: E501 - "finished_at": "finishedAt", # noqa: E501 - "percent_complete": "percentComplete", # noqa: E501 - "records_imported": "recordsImported", # noqa: E501 - "error": "error", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ImportModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique identifier for the import operation.. [optional] # noqa: E501 - uri (str): The URI from where the data is imported.. [optional] # noqa: E501 - status (str): The status of the operation.. [optional] # noqa: E501 - created_at (datetime): The start time of the import operation.. [optional] # noqa: E501 - finished_at (datetime): The end time of the import operation.. [optional] # noqa: E501 - percent_complete (float): The progress made by the operation out of 100. [optional] # noqa: E501 - records_imported (int): The number of records successfully imported.. [optional] # noqa: E501 - error (str): The error message if the import process failed.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ImportModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique identifier for the import operation.. [optional] # noqa: E501 - uri (str): The URI from where the data is imported.. [optional] # noqa: E501 - status (str): The status of the operation.. [optional] # noqa: E501 - created_at (datetime): The start time of the import operation.. [optional] # noqa: E501 - finished_at (datetime): The end time of the import operation.. [optional] # noqa: E501 - percent_complete (float): The progress made by the operation out of 100. [optional] # noqa: E501 - records_imported (int): The number of records successfully imported.. [optional] # noqa: E501 - error (str): The error message if the import process failed.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/list_item.py b/pinecone/core_ea/openapi/db_data/model/list_item.py deleted file mode 100644 index 2c06a0fd..00000000 --- a/pinecone/core_ea/openapi/db_data/model/list_item.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class ListItem(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ListItem - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ListItem - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/list_response.py b/pinecone/core_ea/openapi/db_data/model/list_response.py deleted file mode 100644 index 6189c378..00000000 --- a/pinecone/core_ea/openapi/db_data/model/list_response.py +++ /dev/null @@ -1,292 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.list_item import ListItem - from pinecone.core_ea.openapi.db_data.model.pagination import Pagination - from pinecone.core_ea.openapi.db_data.model.usage import Usage - - globals()["ListItem"] = ListItem - globals()["Pagination"] = Pagination - globals()["Usage"] = Usage - - -class ListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "vectors": ([ListItem],), # noqa: E501 - "pagination": (Pagination,), # noqa: E501 - "namespace": (str,), # noqa: E501 - "usage": (Usage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "vectors": "vectors", # noqa: E501 - "pagination": "pagination", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "usage": "usage", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - vectors ([ListItem]): [optional] # noqa: E501 - pagination (Pagination): [optional] # noqa: E501 - namespace (str): The namespace of the vectors.. [optional] # noqa: E501 - usage (Usage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - vectors ([ListItem]): [optional] # noqa: E501 - pagination (Pagination): [optional] # noqa: E501 - namespace (str): The namespace of the vectors.. [optional] # noqa: E501 - usage (Usage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/namespace_summary.py b/pinecone/core_ea/openapi/db_data/model/namespace_summary.py deleted file mode 100644 index 438a4afc..00000000 --- a/pinecone/core_ea/openapi/db_data/model/namespace_summary.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class NamespaceSummary(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "vector_count": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "vector_count": "vectorCount", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NamespaceSummary - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - vector_count (int): The number of vectors stored in this namespace. Note that updates to this field may lag behind updates to the underlying index and corresponding query results, etc.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NamespaceSummary - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - vector_count (int): The number of vectors stored in this namespace. Note that updates to this field may lag behind updates to the underlying index and corresponding query results, etc.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/pagination.py b/pinecone/core_ea/openapi/db_data/model/pagination.py deleted file mode 100644 index 9115891f..00000000 --- a/pinecone/core_ea/openapi/db_data/model/pagination.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class Pagination(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "next": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "next": "next", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Pagination - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - next (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Pagination - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - next (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/protobuf_any.py b/pinecone/core_ea/openapi/db_data/model/protobuf_any.py deleted file mode 100644 index a4691171..00000000 --- a/pinecone/core_ea/openapi/db_data/model/protobuf_any.py +++ /dev/null @@ -1,272 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class ProtobufAny(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "type_url": (str,), # noqa: E501 - "value": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "type_url": "typeUrl", # noqa: E501 - "value": "value", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ProtobufAny - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type_url (str): [optional] # noqa: E501 - value (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ProtobufAny - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type_url (str): [optional] # noqa: E501 - value (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/protobuf_null_value.py b/pinecone/core_ea/openapi/db_data/model/protobuf_null_value.py deleted file mode 100644 index 43d7c99c..00000000 --- a/pinecone/core_ea/openapi/db_data/model/protobuf_null_value.py +++ /dev/null @@ -1,290 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class ProtobufNullValue(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "NULL_VALUE": "NULL_VALUE", - }, - } - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ProtobufNullValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`.. if omitted defaults to "NULL_VALUE", must be one of ["NULL_VALUE", ] # noqa: E501 - - Keyword Args: - value (str): `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`.. if omitted defaults to "NULL_VALUE", must be one of ["NULL_VALUE", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - value = "NULL_VALUE" - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ProtobufNullValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`.. if omitted defaults to "NULL_VALUE", must be one of ["NULL_VALUE", ] # noqa: E501 - - Keyword Args: - value (str): `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`.. if omitted defaults to "NULL_VALUE", must be one of ["NULL_VALUE", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - value = "NULL_VALUE" - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/pinecone/core_ea/openapi/db_data/model/query_request.py b/pinecone/core_ea/openapi/db_data/model/query_request.py deleted file mode 100644 index b023b35e..00000000 --- a/pinecone/core_ea/openapi/db_data/model/query_request.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.query_vector import QueryVector - from pinecone.core_ea.openapi.db_data.model.sparse_values import SparseValues - - globals()["QueryVector"] = QueryVector - globals()["SparseValues"] = SparseValues - - -class QueryRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("top_k",): { - "inclusive_maximum": 10000, - "inclusive_minimum": 1, - }, - ("queries",): {}, - ("vector",): {}, - ("id",): { - "max_length": 512, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "top_k": (int,), # noqa: E501 - "namespace": (str,), # noqa: E501 - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "include_values": (bool,), # noqa: E501 - "include_metadata": (bool,), # noqa: E501 - "queries": ([QueryVector],), # noqa: E501 - "vector": ([float],), # noqa: E501 - "sparse_vector": (SparseValues,), # noqa: E501 - "id": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "top_k": "topK", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "filter": "filter", # noqa: E501 - "include_values": "includeValues", # noqa: E501 - "include_metadata": "includeMetadata", # noqa: E501 - "queries": "queries", # noqa: E501 - "vector": "vector", # noqa: E501 - "sparse_vector": "sparseVector", # noqa: E501 - "id": "id", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, top_k, *args, **kwargs): # noqa: E501 - """QueryRequest - a model defined in OpenAPI - - Args: - top_k (int): The number of results to return for each query. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - namespace (str): The namespace to query.. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Filter with metadata](https://docs.pinecone.io/guides/data/filter-with-metadata).. [optional] # noqa: E501 - include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 - include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 - queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 - vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 - sparse_vector (SparseValues): [optional] # noqa: E501 - id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.top_k = top_k - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, top_k, *args, **kwargs): # noqa: E501 - """QueryRequest - a model defined in OpenAPI - - Args: - top_k (int): The number of results to return for each query. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - namespace (str): The namespace to query.. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Filter with metadata](https://docs.pinecone.io/guides/data/filter-with-metadata).. [optional] # noqa: E501 - include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 - include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 - queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 - vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 - sparse_vector (SparseValues): [optional] # noqa: E501 - id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.top_k = top_k - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/query_response.py b/pinecone/core_ea/openapi/db_data/model/query_response.py deleted file mode 100644 index 683e91e2..00000000 --- a/pinecone/core_ea/openapi/db_data/model/query_response.py +++ /dev/null @@ -1,292 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.scored_vector import ScoredVector - from pinecone.core_ea.openapi.db_data.model.single_query_results import SingleQueryResults - from pinecone.core_ea.openapi.db_data.model.usage import Usage - - globals()["ScoredVector"] = ScoredVector - globals()["SingleQueryResults"] = SingleQueryResults - globals()["Usage"] = Usage - - -class QueryResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "results": ([SingleQueryResults],), # noqa: E501 - "matches": ([ScoredVector],), # noqa: E501 - "namespace": (str,), # noqa: E501 - "usage": (Usage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "results": "results", # noqa: E501 - "matches": "matches", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "usage": "usage", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """QueryResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - results ([SingleQueryResults]): DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.. [optional] # noqa: E501 - matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 - namespace (str): The namespace for the vectors.. [optional] # noqa: E501 - usage (Usage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """QueryResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - results ([SingleQueryResults]): DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.. [optional] # noqa: E501 - matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 - namespace (str): The namespace for the vectors.. [optional] # noqa: E501 - usage (Usage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/query_vector.py b/pinecone/core_ea/openapi/db_data/model/query_vector.py deleted file mode 100644 index f45e010e..00000000 --- a/pinecone/core_ea/openapi/db_data/model/query_vector.py +++ /dev/null @@ -1,304 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.sparse_values import SparseValues - - globals()["SparseValues"] = SparseValues - - -class QueryVector(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("values",): {}, - ("top_k",): { - "inclusive_maximum": 10000, - "inclusive_minimum": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "values": ([float],), # noqa: E501 - "sparse_values": (SparseValues,), # noqa: E501 - "top_k": (int,), # noqa: E501 - "namespace": (str,), # noqa: E501 - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "values": "values", # noqa: E501 - "sparse_values": "sparseValues", # noqa: E501 - "top_k": "topK", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "filter": "filter", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, values, *args, **kwargs): # noqa: E501 - """QueryVector - a model defined in OpenAPI - - Args: - values ([float]): The query vector values. This should be the same length as the dimension of the index being queried. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sparse_values (SparseValues): [optional] # noqa: E501 - top_k (int): An override for the number of results to return for this query vector.. [optional] # noqa: E501 - namespace (str): An override the namespace to search.. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, values, *args, **kwargs): # noqa: E501 - """QueryVector - a model defined in OpenAPI - - Args: - values ([float]): The query vector values. This should be the same length as the dimension of the index being queried. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sparse_values (SparseValues): [optional] # noqa: E501 - top_k (int): An override for the number of results to return for this query vector.. [optional] # noqa: E501 - namespace (str): An override the namespace to search.. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/rpc_status.py b/pinecone/core_ea/openapi/db_data/model/rpc_status.py deleted file mode 100644 index 27a05b89..00000000 --- a/pinecone/core_ea/openapi/db_data/model/rpc_status.py +++ /dev/null @@ -1,284 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.protobuf_any import ProtobufAny - - globals()["ProtobufAny"] = ProtobufAny - - -class RpcStatus(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "code": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "details": ([ProtobufAny],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "code": "code", # noqa: E501 - "message": "message", # noqa: E501 - "details": "details", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """RpcStatus - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - details ([ProtobufAny]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """RpcStatus - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - details ([ProtobufAny]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/scored_vector.py b/pinecone/core_ea/openapi/db_data/model/scored_vector.py deleted file mode 100644 index 7c6aa092..00000000 --- a/pinecone/core_ea/openapi/db_data/model/scored_vector.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.sparse_values import SparseValues - - globals()["SparseValues"] = SparseValues - - -class ScoredVector(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("id",): { - "max_length": 512, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (str,), # noqa: E501 - "score": (float,), # noqa: E501 - "values": ([float],), # noqa: E501 - "sparse_values": (SparseValues,), # noqa: E501 - "metadata": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", # noqa: E501 - "score": "score", # noqa: E501 - "values": "values", # noqa: E501 - "sparse_values": "sparseValues", # noqa: E501 - "metadata": "metadata", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 - """ScoredVector - a model defined in OpenAPI - - Args: - id (str): This is the vector's unique id. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - score (float): This is a measure of similarity between this vector and the query vector. The higher the score, the more they are similar.. [optional] # noqa: E501 - values ([float]): This is the vector data, if it is requested.. [optional] # noqa: E501 - sparse_values (SparseValues): [optional] # noqa: E501 - metadata ({str: (bool, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, id, *args, **kwargs): # noqa: E501 - """ScoredVector - a model defined in OpenAPI - - Args: - id (str): This is the vector's unique id. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - score (float): This is a measure of similarity between this vector and the query vector. The higher the score, the more they are similar.. [optional] # noqa: E501 - values ([float]): This is the vector data, if it is requested.. [optional] # noqa: E501 - sparse_values (SparseValues): [optional] # noqa: E501 - metadata ({str: (bool, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/single_query_results.py b/pinecone/core_ea/openapi/db_data/model/single_query_results.py deleted file mode 100644 index 0463be6d..00000000 --- a/pinecone/core_ea/openapi/db_data/model/single_query_results.py +++ /dev/null @@ -1,280 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.scored_vector import ScoredVector - - globals()["ScoredVector"] = ScoredVector - - -class SingleQueryResults(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "matches": ([ScoredVector],), # noqa: E501 - "namespace": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "matches": "matches", # noqa: E501 - "namespace": "namespace", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SingleQueryResults - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 - namespace (str): The namespace for the vectors.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SingleQueryResults - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - matches ([ScoredVector]): The matches for the vectors.. [optional] # noqa: E501 - namespace (str): The namespace for the vectors.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/sparse_values.py b/pinecone/core_ea/openapi/db_data/model/sparse_values.py deleted file mode 100644 index 07550f7e..00000000 --- a/pinecone/core_ea/openapi/db_data/model/sparse_values.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class SparseValues(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("indices",): {}, - ("values",): {}, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "indices": ([int],), # noqa: E501 - "values": ([float],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "indices": "indices", # noqa: E501 - "values": "values", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, indices, values, *args, **kwargs): # noqa: E501 - """SparseValues - a model defined in OpenAPI - - Args: - indices ([int]): The indices of the sparse data. - values ([float]): The corresponding values of the sparse data, which must be with the same length as the indices. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.indices = indices - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, indices, values, *args, **kwargs): # noqa: E501 - """SparseValues - a model defined in OpenAPI - - Args: - indices ([int]): The indices of the sparse data. - values ([float]): The corresponding values of the sparse data, which must be with the same length as the indices. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.indices = indices - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/start_import_request.py b/pinecone/core_ea/openapi/db_data/model/start_import_request.py deleted file mode 100644 index 2971f848..00000000 --- a/pinecone/core_ea/openapi/db_data/model/start_import_request.py +++ /dev/null @@ -1,292 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.import_error_mode import ImportErrorMode - - globals()["ImportErrorMode"] = ImportErrorMode - - -class StartImportRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("integration_id",): { - "max_length": 1000, - "min_length": 1, - }, - ("uri",): { - "max_length": 1500, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "integration_id": (str,), # noqa: E501 - "uri": (str,), # noqa: E501 - "error_mode": (ImportErrorMode,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "integration_id": "integrationId", # noqa: E501 - "uri": "uri", # noqa: E501 - "error_mode": "errorMode", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StartImportRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integration_id (str): The id of the storage integration that should be used to access the data.. [optional] # noqa: E501 - uri (str): The URI prefix 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.. [optional] # noqa: E501 - error_mode (ImportErrorMode): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StartImportRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integration_id (str): The id of the storage integration that should be used to access the data.. [optional] # noqa: E501 - uri (str): The URI prefix 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.. [optional] # noqa: E501 - error_mode (ImportErrorMode): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/start_import_response.py b/pinecone/core_ea/openapi/db_data/model/start_import_response.py deleted file mode 100644 index 396151e3..00000000 --- a/pinecone/core_ea/openapi/db_data/model/start_import_response.py +++ /dev/null @@ -1,273 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class StartImportResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("id",): { - "max_length": 1000, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StartImportResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique identifier for the import operations.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StartImportResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique identifier for the import operations.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/update_request.py b/pinecone/core_ea/openapi/db_data/model/update_request.py deleted file mode 100644 index 0a06d728..00000000 --- a/pinecone/core_ea/openapi/db_data/model/update_request.py +++ /dev/null @@ -1,304 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.sparse_values import SparseValues - - globals()["SparseValues"] = SparseValues - - -class UpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("id",): { - "max_length": 512, - "min_length": 1, - }, - ("values",): {}, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (str,), # noqa: E501 - "values": ([float],), # noqa: E501 - "sparse_values": (SparseValues,), # noqa: E501 - "set_metadata": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "namespace": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", # noqa: E501 - "values": "values", # noqa: E501 - "sparse_values": "sparseValues", # noqa: E501 - "set_metadata": "setMetadata", # noqa: E501 - "namespace": "namespace", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 - """UpdateRequest - a model defined in OpenAPI - - Args: - id (str): Vector's unique id. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - values ([float]): Vector data.. [optional] # noqa: E501 - sparse_values (SparseValues): [optional] # noqa: E501 - set_metadata ({str: (bool, dict, float, int, list, str, none_type)}): Metadata to set for the vector.. [optional] # noqa: E501 - namespace (str): The namespace containing the vector to update.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, id, *args, **kwargs): # noqa: E501 - """UpdateRequest - a model defined in OpenAPI - - Args: - id (str): Vector's unique id. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - values ([float]): Vector data.. [optional] # noqa: E501 - sparse_values (SparseValues): [optional] # noqa: E501 - set_metadata ({str: (bool, dict, float, int, list, str, none_type)}): Metadata to set for the vector.. [optional] # noqa: E501 - namespace (str): The namespace containing the vector to update.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/upsert_request.py b/pinecone/core_ea/openapi/db_data/model/upsert_request.py deleted file mode 100644 index 26a41263..00000000 --- a/pinecone/core_ea/openapi/db_data/model/upsert_request.py +++ /dev/null @@ -1,288 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.vector import Vector - - globals()["Vector"] = Vector - - -class UpsertRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("vectors",): {}, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "vectors": ([Vector],), # noqa: E501 - "namespace": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "vectors": "vectors", # noqa: E501 - "namespace": "namespace", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, vectors, *args, **kwargs): # noqa: E501 - """UpsertRequest - a model defined in OpenAPI - - Args: - vectors ([Vector]): An array containing the vectors to upsert. Recommended batch limit is 100 vectors. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - namespace (str): The namespace where you upsert vectors.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.vectors = vectors - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, vectors, *args, **kwargs): # noqa: E501 - """UpsertRequest - a model defined in OpenAPI - - Args: - vectors ([Vector]): An array containing the vectors to upsert. Recommended batch limit is 100 vectors. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - namespace (str): The namespace where you upsert vectors.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.vectors = vectors - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/upsert_response.py b/pinecone/core_ea/openapi/db_data/model/upsert_response.py deleted file mode 100644 index ecf1e348..00000000 --- a/pinecone/core_ea/openapi/db_data/model/upsert_response.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class UpsertResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "upserted_count": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "upserted_count": "upsertedCount", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """UpsertResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - upserted_count (int): The number of vectors upserted.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """UpsertResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - upserted_count (int): The number of vectors upserted.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/usage.py b/pinecone/core_ea/openapi/db_data/model/usage.py deleted file mode 100644 index abb1fe3f..00000000 --- a/pinecone/core_ea/openapi/db_data/model/usage.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -class Usage(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "read_units": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "read_units": "readUnits", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Usage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - read_units (int): The number of read units consumed by this operation.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Usage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - read_units (int): The number of read units consumed by this operation.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/model/vector.py b/pinecone/core_ea/openapi/db_data/model/vector.py deleted file mode 100644 index ba374679..00000000 --- a/pinecone/core_ea/openapi/db_data/model/vector.py +++ /dev/null @@ -1,302 +0,0 @@ -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-10 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core_ea.openapi.shared.model_utils import ( # noqa: F401 - PineconeApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from pinecone.core_ea.openapi.shared.model_utils import OpenApiModel -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiAttributeError - - -def lazy_import(): - from pinecone.core_ea.openapi.db_data.model.sparse_values import SparseValues - - globals()["SparseValues"] = SparseValues - - -class Vector(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("id",): { - "max_length": 512, - "min_length": 1, - }, - ("values",): {}, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (str,), # noqa: E501 - "values": ([float],), # noqa: E501 - "sparse_values": (SparseValues,), # noqa: E501 - "metadata": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", # noqa: E501 - "values": "values", # noqa: E501 - "sparse_values": "sparseValues", # noqa: E501 - "metadata": "metadata", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, values, *args, **kwargs): # noqa: E501 - """Vector - a model defined in OpenAPI - - Args: - id (str): This is the vector's unique id. - values ([float]): This is the vector data included in the request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sparse_values (SparseValues): [optional] # noqa: E501 - metadata ({str: (bool, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, id, values, *args, **kwargs): # noqa: E501 - """Vector - a model defined in OpenAPI - - Args: - id (str): This is the vector's unique id. - values ([float]): This is the vector data included in the request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sparse_values (SparseValues): [optional] # noqa: E501 - metadata ({str: (bool, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/pinecone/core_ea/openapi/db_data/models/__init__.py b/pinecone/core_ea/openapi/db_data/models/__init__.py deleted file mode 100644 index be81d5c9..00000000 --- a/pinecone/core_ea/openapi/db_data/models/__init__.py +++ /dev/null @@ -1,38 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from pinecone.core_ea.openapi.db_data.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from pinecone.core_ea.openapi.db_data.model.delete_request import DeleteRequest -from pinecone.core_ea.openapi.db_data.model.describe_index_stats_request import DescribeIndexStatsRequest -from pinecone.core_ea.openapi.db_data.model.describe_index_stats_response import DescribeIndexStatsResponse -from pinecone.core_ea.openapi.db_data.model.fetch_response import FetchResponse -from pinecone.core_ea.openapi.db_data.model.import_error_mode import ImportErrorMode -from pinecone.core_ea.openapi.db_data.model.import_list_response import ImportListResponse -from pinecone.core_ea.openapi.db_data.model.import_model import ImportModel -from pinecone.core_ea.openapi.db_data.model.list_item import ListItem -from pinecone.core_ea.openapi.db_data.model.list_response import ListResponse -from pinecone.core_ea.openapi.db_data.model.namespace_summary import NamespaceSummary -from pinecone.core_ea.openapi.db_data.model.pagination import Pagination -from pinecone.core_ea.openapi.db_data.model.protobuf_any import ProtobufAny -from pinecone.core_ea.openapi.db_data.model.protobuf_null_value import ProtobufNullValue -from pinecone.core_ea.openapi.db_data.model.query_request import QueryRequest -from pinecone.core_ea.openapi.db_data.model.query_response import QueryResponse -from pinecone.core_ea.openapi.db_data.model.query_vector import QueryVector -from pinecone.core_ea.openapi.db_data.model.rpc_status import RpcStatus -from pinecone.core_ea.openapi.db_data.model.scored_vector import ScoredVector -from pinecone.core_ea.openapi.db_data.model.single_query_results import SingleQueryResults -from pinecone.core_ea.openapi.db_data.model.sparse_values import SparseValues -from pinecone.core_ea.openapi.db_data.model.start_import_request import StartImportRequest -from pinecone.core_ea.openapi.db_data.model.start_import_response import StartImportResponse -from pinecone.core_ea.openapi.db_data.model.update_request import UpdateRequest -from pinecone.core_ea.openapi.db_data.model.upsert_request import UpsertRequest -from pinecone.core_ea.openapi.db_data.model.upsert_response import UpsertResponse -from pinecone.core_ea.openapi.db_data.model.usage import Usage -from pinecone.core_ea.openapi.db_data.model.vector import Vector diff --git a/pinecone/core_ea/openapi/shared/__init__.py b/pinecone/core_ea/openapi/shared/__init__.py deleted file mode 100644 index ddc33e71..00000000 --- a/pinecone/core_ea/openapi/shared/__init__.py +++ /dev/null @@ -1 +0,0 @@ -API_VERSION = "2024-10" diff --git a/pinecone/data/features/bulk_import.py b/pinecone/data/features/bulk_import.py index e4888c05..485acff7 100644 --- a/pinecone/data/features/bulk_import.py +++ b/pinecone/data/features/bulk_import.py @@ -2,21 +2,21 @@ from typing import Optional, Literal, Iterator, List, Type, cast from pinecone.config.config import ConfigBuilder -from pinecone.core_ea.openapi.db_data import ApiClient -from pinecone.core_ea.openapi.db_data.api.bulk_operations_api import BulkOperationsApi -from pinecone.core_ea.openapi.shared import API_VERSION +from pinecone.openapi_support import ApiClient +from pinecone.core.openapi.db_data.api.bulk_operations_api import BulkOperationsApi +from pinecone.core.openapi.db_data import API_VERSION from pinecone.utils import parse_non_empty_args, install_json_repr_override, setup_openapi_client -from pinecone.core_ea.openapi.db_data.models import ( +from pinecone.core.openapi.db_data.models import ( StartImportRequest, StartImportResponse, - ImportListResponse, + ListImportsResponse, ImportModel, ImportErrorMode as ImportErrorModeClass, ) -for m in [StartImportResponse, ImportListResponse, ImportModel]: +for m in [StartImportResponse, ListImportsResponse, ImportModel]: install_json_repr_override(m) ImportErrorMode: Type[Enum] = cast( @@ -84,7 +84,7 @@ def start_import( ] ) - return self.__import_operations_api.start_import(StartImportRequest(**args_dict)) + return self.__import_operations_api.start_bulk_import(StartImportRequest(**args_dict)) def list_imports(self, **kwargs) -> Iterator[List[ImportModel]]: """ @@ -124,7 +124,7 @@ def list_imports(self, **kwargs) -> Iterator[List[ImportModel]]: def list_imports_paginated( self, limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs - ) -> ImportListResponse: + ) -> ListImportsResponse: """ The list_imports_paginated operation returns information about import operations. It returns operations in a paginated form, with a pagination token to fetch the next page of results. @@ -152,7 +152,7 @@ def list_imports_paginated( pagination_token (Optional[str]): A token needed to fetch the next page of results. This token is returned in the response if additional results are available. [optional] - Returns: ImportListResponse object which contains the list of operations as ImportModel objects, pagination information, + Returns: ListImportsResponse object which contains the list of operations as ImportModel objects, pagination information, and usage showing the number of read_units consumed. """ args_dict = parse_non_empty_args([("limit", limit), ("pagination_token", pagination_token)]) @@ -171,7 +171,7 @@ def describe_import(self, id: str) -> ImportModel: """ if isinstance(id, int): id = str(id) - return self.__import_operations_api.describe_import(id=id) + return self.__import_operations_api.describe_bulk_import(id=id) def cancel_import(self, id: str): """Cancel an import operation. diff --git a/pinecone/data/index.py b/pinecone/data/index.py index cc1bae6c..b0545b91 100644 --- a/pinecone/data/index.py +++ b/pinecone/data/index.py @@ -4,17 +4,17 @@ from pinecone.config import ConfigBuilder -from pinecone.core.openapi.shared import API_VERSION -from pinecone.core.openapi.data.models import SparseValues -from pinecone.core.openapi.data import ApiClient -from pinecone.core.openapi.data.models import ( +from pinecone.openapi_support import ApiClient +from pinecone.core.openapi.db_data.api.vector_operations_api import VectorOperationsApi +from pinecone.core.openapi.db_data import API_VERSION +from pinecone.core.openapi.db_data.models import ( FetchResponse, QueryRequest, QueryResponse, RpcStatus, ScoredVector, SingleQueryResults, - DescribeIndexStatsResponse, + IndexDescription as DescribeIndexStatsResponse, UpsertRequest, UpsertResponse, Vector, @@ -22,9 +22,9 @@ UpdateRequest, DescribeIndexStatsRequest, ListResponse, + SparseValues, ) from .features.bulk_import import ImportFeatureMixin -from pinecone.core.openapi.data.api.data_plane_api import DataPlaneApi from ..utils import setup_openapi_client, parse_non_empty_args from .vector_factory import VectorFactory @@ -96,7 +96,7 @@ def __init__( self._vector_api = setup_openapi_client( api_client_klass=ApiClient, - api_klass=DataPlaneApi, + api_klass=VectorOperationsApi, config=self._config, openapi_config=openapi_config, pool_threads=pool_threads, @@ -209,7 +209,7 @@ def _upsert_batch( def vec_builder(v): return VectorFactory.build(v, check_type=_check_type) - return self._vector_api.upsert( + return self._vector_api.upsert_vectors( UpsertRequest( vectors=list(map(vec_builder, vectors)), **args_dict, @@ -308,7 +308,7 @@ def delete( [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] ) - return self._vector_api.delete( + return self._vector_api.delete_vectors( DeleteRequest( **args_dict, **{ @@ -344,7 +344,7 @@ def fetch(self, ids: List[str], namespace: Optional[str] = None, **kwargs) -> Fe Returns: FetchResponse object which contains the list of Vector objects, and namespace name. """ args_dict = parse_non_empty_args([("namespace", namespace)]) - return self._vector_api.fetch(ids=ids, **args_dict, **kwargs) + return self._vector_api.fetch_vectors(ids=ids, **args_dict, **kwargs) @validate_and_convert_errors def query( @@ -427,7 +427,7 @@ def query( ("sparse_vector", sparse_vector), ] ) - response = self._vector_api.query( + response = self._vector_api.query_vectors( QueryRequest( **args_dict, _check_type=_check_type, @@ -492,7 +492,7 @@ def update( ("sparse_values", sparse_values), ] ) - return self._vector_api.update( + return self._vector_api.update_vector( UpdateRequest( id=id, **args_dict, @@ -577,7 +577,7 @@ def list_paginated( ("pagination_token", pagination_token), ] ) - return self._vector_api.list(**args_dict, **kwargs) + return self._vector_api.list_vectors(**args_dict, **kwargs) @validate_and_convert_errors def list(self, **kwargs): diff --git a/pinecone/data/sparse_vector_factory.py b/pinecone/data/sparse_vector_factory.py index b44cc41a..bc72c931 100644 --- a/pinecone/data/sparse_vector_factory.py +++ b/pinecone/data/sparse_vector_factory.py @@ -9,7 +9,7 @@ SparseValuesDictionaryExpectedError, ) -from pinecone.core.openapi.data.models import SparseValues +from pinecone.core.openapi.db_data.models import SparseValues class SparseValuesFactory: diff --git a/pinecone/data/vector_factory.py b/pinecone/data/vector_factory.py index 9482108c..2723a935 100644 --- a/pinecone/data/vector_factory.py +++ b/pinecone/data/vector_factory.py @@ -7,7 +7,7 @@ from ..utils.constants import REQUIRED_VECTOR_FIELDS, OPTIONAL_VECTOR_FIELDS from .sparse_vector_factory import SparseValuesFactory -from pinecone.core.openapi.data.models import Vector, SparseValues +from pinecone.core.openapi.db_data.models import Vector, SparseValues from .errors import ( VectorDictionaryMissingKeysError, diff --git a/pinecone/exceptions/__init__.py b/pinecone/exceptions/__init__.py index eb0e10fa..92b05fd7 100644 --- a/pinecone/exceptions/__init__.py +++ b/pinecone/exceptions/__init__.py @@ -1,4 +1,4 @@ -from pinecone.core.openapi.shared.exceptions import ( +from pinecone.openapi_support.exceptions import ( PineconeException, PineconeApiAttributeError, PineconeApiTypeError, diff --git a/pinecone/exceptions/exceptions.py b/pinecone/exceptions/exceptions.py index d7ba3acc..3860dc8b 100644 --- a/pinecone/exceptions/exceptions.py +++ b/pinecone/exceptions/exceptions.py @@ -1,4 +1,4 @@ -from pinecone.core.openapi.shared.exceptions import PineconeException +from pinecone.openapi_support.exceptions import PineconeException class PineconeProtocolError(PineconeException): diff --git a/pinecone/grpc/index_grpc.py b/pinecone/grpc/index_grpc.py index 6269c23d..e2a2b8e0 100644 --- a/pinecone/grpc/index_grpc.py +++ b/pinecone/grpc/index_grpc.py @@ -13,10 +13,10 @@ ) from .vector_factory_grpc import VectorFactoryGRPC -from pinecone.core.openapi.data.models import ( +from pinecone.core.openapi.db_data.models import ( FetchResponse, QueryResponse, - DescribeIndexStatsResponse, + IndexDescription as DescribeIndexStatsResponse, ) from pinecone.models.list_response import ListResponse as SimpleListResponse, Pagination from pinecone.core.grpc.protos.vector_service_pb2 import ( diff --git a/pinecone/grpc/utils.py b/pinecone/grpc/utils.py index 99f45460..38ca0d85 100644 --- a/pinecone/grpc/utils.py +++ b/pinecone/grpc/utils.py @@ -1,14 +1,14 @@ from typing import Optional import uuid -from pinecone.core.openapi.data.models import ( +from pinecone.core.openapi.db_data.models import ( Vector as _Vector, Usage, ScoredVector, SparseValues, FetchResponse, QueryResponse, - DescribeIndexStatsResponse, + IndexDescription as DescribeIndexStatsResponse, NamespaceSummary, ) diff --git a/pinecone/models/collection_list.py b/pinecone/models/collection_list.py index c3a8f578..508ec685 100644 --- a/pinecone/models/collection_list.py +++ b/pinecone/models/collection_list.py @@ -1,5 +1,5 @@ import json -from pinecone.core.openapi.control.models import CollectionList as OpenAPICollectionList +from pinecone.core.openapi.db_control.models import CollectionList as OpenAPICollectionList class CollectionList: diff --git a/pinecone/models/index_list.py b/pinecone/models/index_list.py index 5240ebe4..d0624a3e 100644 --- a/pinecone/models/index_list.py +++ b/pinecone/models/index_list.py @@ -1,5 +1,5 @@ import json -from pinecone.core.openapi.control.models import IndexList as OpenAPIIndexList +from pinecone.core.openapi.db_control.models import IndexList as OpenAPIIndexList from .index_model import IndexModel diff --git a/pinecone/models/index_model.py b/pinecone/models/index_model.py index ebf5d238..7deb2d7d 100644 --- a/pinecone/models/index_model.py +++ b/pinecone/models/index_model.py @@ -1,4 +1,4 @@ -from pinecone.core.openapi.control.models import IndexModel as OpenAPIIndexModel +from pinecone.core.openapi.db_control.models import IndexModel as OpenAPIIndexModel class IndexModel: diff --git a/pinecone/openapi_support/__init__.py b/pinecone/openapi_support/__init__.py new file mode 100644 index 00000000..8bf227bb --- /dev/null +++ b/pinecone/openapi_support/__init__.py @@ -0,0 +1,39 @@ +# Items in this openapi_support package were extracted from the openapi generated code. +# Since we need to generate code off of multiple spec files, having these items in a +# generated output led to unnecessary duplication. Morever, these classes do not have +# any dynamic content so they didn't need to be part of the generation process. + +from .api_client import ApiClient +from .endpoint import Endpoint +from .configuration import Configuration +from .exceptions import ( + PineconeException, + PineconeApiAttributeError, + PineconeApiTypeError, + PineconeApiValueError, + PineconeApiKeyError, + PineconeApiException, + NotFoundException, + UnauthorizedException, + ForbiddenException, + ServiceException, +) +from .model_utils import ( + OpenApiModel, + ModelNormal, + ModelSimple, + ModelComposed, + change_keys_js_to_python, + convert_js_args_to_python_args, + validate_get_composed_info, + cached_property, + validate_and_convert_types, + check_allowed_values, + check_validations, + file_type, + none_type, +) +from .rest import RESTClientObject, RESTResponse + +from datetime import date, datetime # noqa: F401 +from dateutil.parser import parse diff --git a/pinecone/core_ea/openapi/shared/api_client.py b/pinecone/openapi_support/api_client.py similarity index 58% rename from pinecone/core_ea/openapi/shared/api_client.py rename to pinecone/openapi_support/api_client.py index 1fd5e54f..2b75417b 100644 --- a/pinecone/core_ea/openapi/shared/api_client.py +++ b/pinecone/openapi_support/api_client.py @@ -5,26 +5,24 @@ import io import os import re -import typing from urllib.parse import quote from urllib3.fields import RequestField +from typing import Optional, List, Tuple, Dict, Any, Union -from pinecone.core_ea.openapi.shared import rest -from pinecone.core_ea.openapi.shared.configuration import Configuration -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiTypeError, PineconeApiValueError, PineconeApiException -from pinecone.core_ea.openapi.shared.model_utils import ( + +from .rest import RESTClientObject +from .configuration import Configuration +from .exceptions import PineconeApiValueError, PineconeApiException +from .model_utils import ( ModelNormal, ModelSimple, ModelComposed, - check_allowed_values, - check_validations, date, datetime, deserialize_file, file_type, model_to_dict, - none_type, validate_and_convert_types, ) @@ -53,13 +51,15 @@ class ApiClient(object): _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): + def __init__( + self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1 + ): if configuration is None: configuration = Configuration.get_default_copy() self.configuration = configuration self.pool_threads = pool_threads - self.rest_client = rest.RESTClientObject(configuration) + self.rest_client = RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value @@ -107,22 +107,21 @@ def __call_api( self, resource_path: str, method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, + path_params: Optional[Dict[str, Any]] = None, + query_params: Optional[List[Tuple[str, Any]]] = None, + header_params: Optional[Dict[str, Any]] = None, + body: Optional[Any] = None, + post_params: Optional[List[Tuple[str, Any]]] = None, + files: Optional[Dict[str, List[io.IOBase]]] = None, + response_type: Optional[Tuple[Any]] = None, + auth_settings: Optional[List[str]] = None, + _return_http_data_only: Optional[bool] = None, + collection_formats: Optional[Dict[str, str]] = None, _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, + _request_timeout: Optional[Union[int, float, Tuple]] = None, + _host: Optional[str] = None, + _check_type: Optional[bool] = None, ): - config = self.configuration # header parameters @@ -131,37 +130,59 @@ def __call_api( if self.cookie: header_params["Cookie"] = self.cookie if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, collection_formats)) + sanitized_header_params: Dict[str, Any] = self.sanitize_for_serialization(header_params) + processed_header_params: Dict[str, Any] = dict( + self.parameters_to_tuples(sanitized_header_params, collection_formats) + ) # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace("{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param)) + sanitized_path_params: Dict[str, Any] = self.sanitize_for_serialization(path_params or {}) + processed_path_params: List[Tuple[str, Any]] = self.parameters_to_tuples( + sanitized_path_params, collection_formats + ) + + for k, v in processed_path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) + ) # query parameters if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, collection_formats) + sanitized_query_params = self.sanitize_for_serialization(query_params) + processed_query_params = self.parameters_to_tuples( + sanitized_query_params, collection_formats + ) + else: + processed_query_params = [] # post parameters if post_params or files: post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params["Content-Type"].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, (dict)) + sanitized_post_params = self.sanitize_for_serialization(post_params) + if sanitized_path_params: + processed_post_params = self.parameters_to_tuples( + sanitized_post_params, collection_formats + ) + processed_post_params.extend(self.files_parameters(files)) + if processed_header_params["Content-Type"].startswith("multipart"): + processed_post_params = self.parameters_to_multipart(sanitized_post_params, (dict)) + else: + processed_post_params = None # body if body: body = self.sanitize_for_serialization(body) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) + self.update_params_for_auth( + processed_header_params, + processed_query_params, + auth_settings, + resource_path, + method, + body, + ) # request url if _host is None: @@ -175,9 +196,9 @@ def __call_api( response_data = self.request( method, url, - query_params=query_params, - headers=header_params, - post_params=post_params, + query_params=processed_query_params, + headers=processed_header_params, + post_params=processed_post_params, body=body, _preload_content=_preload_content, _request_timeout=_request_timeout, @@ -192,7 +213,6 @@ def __call_api( if not _preload_content: return return_data - return return_data # deserialize response data if response_type: @@ -225,7 +245,9 @@ def parameters_to_multipart(self, params, collection_types): if collection_types is None: collection_types = dict for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json + if isinstance( + v, collection_types + ): # v is instance of collection_type, formatting as application/json v = json.dumps(v, ensure_ascii=False).encode("utf-8") field = RequestField(k, v) field.make_multipart(content_type="application/json; charset=utf-8") @@ -235,7 +257,7 @@ def parameters_to_multipart(self, params, collection_types): return new_params @classmethod - def sanitize_for_serialization(cls, obj): + def sanitize_for_serialization(cls, obj) -> Any: """Prepares data for transmission before it is sent with the rest client If obj is None, return None. If obj is str, int, long, float, bool, return directly. @@ -249,10 +271,13 @@ def sanitize_for_serialization(cls, obj): :return: The serialized form of data. """ if isinstance(obj, (ModelNormal, ModelComposed)): - return {key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()} + return { + key: cls.sanitize_for_serialization(val) + for key, val in model_to_dict(obj, serialize=True).items() + } elif isinstance(obj, io.IOBase): return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + elif isinstance(obj, (str, int, float, bool)) or obj is None: return obj elif isinstance(obj, (datetime, date)): return obj.isoformat() @@ -262,7 +287,9 @@ def sanitize_for_serialization(cls, obj): return [cls.sanitize_for_serialization(item) for item in obj] if isinstance(obj, dict): return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise PineconeApiValueError("Unable to prepare type {} for serialization".format(obj.__class__.__name__)) + raise PineconeApiValueError( + "Unable to prepare type {} for serialization".format(obj.__class__.__name__) + ) def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -288,7 +315,9 @@ def deserialize(self, response, response_type, _check_type): # save response body into a tmp file and return the instance if response_type == (file_type,): content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, content_disposition=content_disposition) + return deserialize_file( + response.data, self.configuration, content_disposition=content_disposition + ) # fetch data from response object try: @@ -299,7 +328,12 @@ def deserialize(self, response, response_type, _check_type): # store our data under the key of 'received_data' so users have some # context if they are deserializing a string and the data type is wrong deserialized_data = validate_and_convert_types( - received_data, response_type, ["received_data"], True, _check_type, configuration=self.configuration + received_data, + response_type, + ["received_data"], + True, + _check_type, + configuration=self.configuration, ) return deserialized_data @@ -307,21 +341,21 @@ def call_api( self, resource_path: str, method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, + path_params: Optional[Dict[str, Any]] = None, + query_params: Optional[List[Tuple[str, Any]]] = None, + header_params: Optional[Dict[str, Any]] = None, + body: Optional[Any] = None, + post_params: Optional[List[Tuple[str, Any]]] = None, + files: Optional[Dict[str, List[io.IOBase]]] = None, + response_type: Optional[Tuple[Any]] = None, + auth_settings: Optional[List[str]] = None, + async_req: Optional[bool] = None, + _return_http_data_only: Optional[bool] = None, + collection_formats: Optional[Dict[str, str]] = None, _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, + _request_timeout: Optional[Union[int, float, Tuple]] = None, + _host: Optional[str] = None, + _check_type: Optional[bool] = None, ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -497,17 +531,23 @@ def request( ) else: raise PineconeApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`." + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." ) - def parameters_to_tuples(self, params, collection_formats): + @classmethod + def parameters_to_tuples( + cls, + params: Union[Dict[str, Any], List[Tuple[str, Any]]], + collection_formats: Optional[Dict[str, str]], + ) -> List[Tuple[str, str]]: """Get parameters as list of tuples, formatting collections. :param params: Parameters as dict or list of two-tuples :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, Any]] = [] if collection_formats is None: collection_formats = {} for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 @@ -535,7 +575,7 @@ def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: file_instance.close() return file_data - def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): + def files_parameters(self, files: Optional[Dict[str, List[io.IOBase]]] = None): """Builds form parameters. :param files: None or a dict with key=param_name and @@ -556,9 +596,10 @@ def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[i continue if file_instance.closed is True: raise PineconeApiValueError( - "Cannot read a closed file. The passed in file_type " "for %s must be open." % param_name + "Cannot read a closed file. The passed in file_type " + "for %s must be open." % param_name ) - filename = os.path.basename(file_instance.name) + filename = os.path.basename(file_instance.name) # type: ignore filedata = self.get_file_data_and_close_file(file_instance) mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" params.append(tuple([param_name, tuple([filename, filedata, mimetype])])) @@ -581,7 +622,7 @@ def select_header_accept(self, accepts): else: return ", ".join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types: List[str]) -> str: """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. @@ -622,216 +663,6 @@ def update_params_for_auth(self, headers, querys, auth_settings, resource_path, elif auth_setting["in"] == "query": querys.append((auth_setting["key"], auth_setting["value"])) else: - raise PineconeApiValueError("Authentication token must be in `query` or `header`") - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map["all"].extend( - [ - "async_req", - "_host_index", - "_preload_content", - "_request_timeout", - "_return_http_data_only", - "_check_input_type", - "_check_return_type", - ] - ) - self.params_map["nullable"].extend(["_request_timeout"]) - self.validations = root_map["validations"] - self.allowed_values = root_map["allowed_values"] - self.openapi_types = root_map["openapi_types"] - extra_types = { - "async_req": (bool,), - "_host_index": (none_type, int), - "_preload_content": (bool,), - "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), - "_return_http_data_only": (bool,), - "_check_input_type": (bool,), - "_check_return_type": (bool,), - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map["attribute_map"] - self.location_map = root_map["location_map"] - self.collection_format_map = root_map["collection_format_map"] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map["enum"]: - if param in kwargs: - check_allowed_values(self.allowed_values, (param,), kwargs[param]) - - for param in self.params_map["validation"]: - if param in kwargs: - check_validations( - self.validations, (param,), kwargs[param], configuration=self.api_client.configuration - ) - - if kwargs["_check_input_type"] is False: - return - - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs["_check_input_type"], - configuration=self.api_client.configuration, - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = {"body": None, "collection_format": {}, "file": {}, "form": [], "header": {}, "path": {}, "query": []} - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == "body": - params["body"] = param_value - continue - base_name = self.attribute_map[param_name] - if param_location == "form" and self.openapi_types[param_name] == (file_type,): - params["file"][param_name] = [param_value] - elif param_location == "form" and self.openapi_types[param_name] == ([file_type],): - # param_value is already a list - params["file"][param_name] = param_value - elif param_location in {"form", "query"}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {"form", "query"}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params["collection_format"][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """This method is invoked when endpoints are called - Example: - - api_instance = ManageIndexesApi() - api_instance.configure_index # this is an instance of the class Endpoint - api_instance.configure_index() # this invokes api_instance.configure_index.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.configure_index.callable or self.callable in this class - - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - index = ( - self.api_client.configuration.server_operation_index.get( - self.settings["operation_id"], self.api_client.configuration.server_index - ) - if kwargs["_host_index"] is None - else kwargs["_host_index"] - ) - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings["operation_id"], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings["servers"] - ) - except IndexError: - if self.settings["servers"]: - raise PineconeApiValueError( - "Invalid host index. Must be 0 <= index < %s" % len(self.settings["servers"]) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map["all"]: - raise PineconeApiTypeError( - "Got an unexpected parameter '%s'" " to method `%s`" % (key, self.settings["operation_id"]) - ) - # only throw this nullable PineconeApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if key not in self.params_map["nullable"] and value is None and kwargs["_check_input_type"] is False: - raise PineconeApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % (key, self.settings["operation_id"]) - ) - - for key in self.params_map["required"]: - if key not in kwargs.keys(): - raise PineconeApiValueError( - "Missing the required parameter `%s` when calling " "`%s`" % (key, self.settings["operation_id"]) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map["accept"] - if accept_headers_list: - params["header"]["Accept"] = self.api_client.select_header_accept(accept_headers_list) - - content_type_headers_list = self.headers_map["content_type"] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type(content_type_headers_list) - params["header"]["Content-Type"] = header_list - - return self.api_client.call_api( - self.settings["endpoint_path"], - self.settings["http_method"], - params["path"], - params["query"], - params["header"], - body=params["body"], - post_params=params["form"], - files=params["file"], - response_type=self.settings["response_type"], - auth_settings=self.settings["auth"], - async_req=kwargs["async_req"], - _check_type=kwargs["_check_return_type"], - _return_http_data_only=kwargs["_return_http_data_only"], - _preload_content=kwargs["_preload_content"], - _request_timeout=kwargs["_request_timeout"], - _host=_host, - collection_formats=params["collection_format"], - ) + raise PineconeApiValueError( + "Authentication token must be in `query` or `header`" + ) diff --git a/pinecone/core_ea/openapi/shared/configuration.py b/pinecone/openapi_support/configuration.py similarity index 96% rename from pinecone/core_ea/openapi/shared/configuration.py rename to pinecone/openapi_support/configuration.py index 184ab4f2..7e13e61d 100644 --- a/pinecone/core_ea/openapi/shared/configuration.py +++ b/pinecone/openapi_support/configuration.py @@ -5,7 +5,7 @@ import urllib3 from http import client as http_client -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiValueError +from .exceptions import PineconeApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { @@ -87,7 +87,7 @@ class Configuration(object): You can programmatically set the cookie: - conf = pinecone.core_ea.openapi.db_control.Configuration( + conf = pinecone.openapi_support.Configuration( api_key={'cookieAuth': 'abc123'} api_key_prefix={'cookieAuth': 'JSESSIONID'} ) @@ -155,7 +155,7 @@ def __init__( self.logger = {} """Logging Settings """ - self.logger["package_logger"] = logging.getLogger("pinecone.core_ea.openapi.db_control") + self.logger["package_logger"] = logging.getLogger("pinecone.openapi_support") self.logger["urllib3_logger"] = logging.getLogger("urllib3") self.logger_format = "%(asctime)s %(levelname)s %(message)s" """Log format @@ -391,9 +391,7 @@ def auth_settings(self): "type": "api_key", "in": "header", "key": "Api-Key", - "value": self.get_api_key_with_prefix( - "ApiKeyAuth", - ), + "value": self.get_api_key_with_prefix("ApiKeyAuth"), } return auth @@ -406,7 +404,7 @@ def to_debug_report(self): "Python SDK Debug Report:\n" "OS: {env}\n" "Python Version: {pyversion}\n" - "Version of the API: 2024-10\n" + "Version of the API: 2024-07\n" "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) ) @@ -415,12 +413,7 @@ def get_host_settings(self): :return: An array of host settings """ - return [ - { - "url": "https://api.pinecone.io", - "description": "Production API endpoints", - } - ] + return [{"url": "https://api.pinecone.io", "description": "Production API endpoints"}] def get_host_from_settings(self, index, variables=None, servers=None): """Gets host URL based on the index and variables @@ -452,7 +445,9 @@ def get_host_from_settings(self, index, variables=None, servers=None): if "enum_values" in variable and used_value not in variable["enum_values"]: raise ValueError( "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format(variable_name, variables[variable_name], variable["enum_values"]) + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], variable["enum_values"] + ) ) url = url.replace("{" + variable_name + "}", used_value) diff --git a/pinecone/openapi_support/endpoint.py b/pinecone/openapi_support/endpoint.py new file mode 100644 index 00000000..8aa3f67e --- /dev/null +++ b/pinecone/openapi_support/endpoint.py @@ -0,0 +1,244 @@ +from .exceptions import PineconeApiValueError, PineconeApiTypeError +from .model_utils import ( + none_type, + file_type, + check_allowed_values, + validate_and_convert_types, + check_validations, +) + + +class Endpoint(object): + def __init__( + self, + settings=None, + params_map=None, + root_map=None, + headers_map=None, + api_client=None, + callable=None, + ): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map["all"].extend( + [ + "async_req", + "_host_index", + "_preload_content", + "_request_timeout", + "_return_http_data_only", + "_check_input_type", + "_check_return_type", + ] + ) + self.params_map["nullable"].extend(["_request_timeout"]) + self.validations = root_map["validations"] + self.allowed_values = root_map["allowed_values"] + self.openapi_types = root_map["openapi_types"] + extra_types = { + "async_req": (bool,), + "_host_index": (none_type, int), + "_preload_content": (bool,), + "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), + "_return_http_data_only": (bool,), + "_check_input_type": (bool,), + "_check_return_type": (bool,), + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map["attribute_map"] + self.location_map = root_map["location_map"] + self.collection_format_map = root_map["collection_format_map"] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map["enum"]: + if param in kwargs: + check_allowed_values(self.allowed_values, (param,), kwargs[param]) + + for param in self.params_map["validation"]: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param], + configuration=self.api_client.configuration, + ) + + if kwargs["_check_input_type"] is False: + return + + for key, value in kwargs.items(): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs["_check_input_type"], + configuration=self.api_client.configuration, + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + "body": None, + "collection_format": {}, + "file": {}, + "form": [], + "header": {}, + "path": {}, + "query": [], + } + + for param_name, param_value in kwargs.items(): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == "body": + params["body"] = param_value + continue + base_name = self.attribute_map[param_name] + if param_location == "form" and self.openapi_types[param_name] == (file_type,): + params["file"][param_name] = [param_value] + elif param_location == "form" and self.openapi_types[param_name] == ([file_type],): + # param_value is already a list + params["file"][param_name] = param_value + elif param_location in {"form", "query"}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {"form", "query"}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params["collection_format"][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """This method is invoked when endpoints are called + Example: + + api_instance = InferenceApi() + api_instance.embed # this is an instance of the class Endpoint + api_instance.embed() # this invokes api_instance.embed.__call__() + which then invokes the callable functions stored in that endpoint at + api_instance.embed.callable or self.callable in this class + + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + try: + index = ( + self.api_client.configuration.server_operation_index.get( + self.settings["operation_id"], self.api_client.configuration.server_index + ) + if kwargs["_host_index"] is None + else kwargs["_host_index"] + ) + server_variables = self.api_client.configuration.server_operation_variables.get( + self.settings["operation_id"], self.api_client.configuration.server_variables + ) + _host = self.api_client.configuration.get_host_from_settings( + index, variables=server_variables, servers=self.settings["servers"] + ) + except IndexError: + if self.settings["servers"]: + raise PineconeApiValueError( + "Invalid host index. Must be 0 <= index < %s" % len(self.settings["servers"]) + ) + _host = None + + for key, value in kwargs.items(): + if key not in self.params_map["all"]: + raise PineconeApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % (key, self.settings["operation_id"]) + ) + # only throw this nullable PineconeApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if ( + key not in self.params_map["nullable"] + and value is None + and kwargs["_check_input_type"] is False + ): + raise PineconeApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % (key, self.settings["operation_id"]) + ) + + for key in self.params_map["required"]: + if key not in kwargs.keys(): + raise PineconeApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings["operation_id"]) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map["accept"] + if accept_headers_list: + params["header"]["Accept"] = self.api_client.select_header_accept(accept_headers_list) + + content_type_headers_list = self.headers_map["content_type"] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type(content_type_headers_list) + params["header"]["Content-Type"] = header_list + + return self.api_client.call_api( + self.settings["endpoint_path"], + self.settings["http_method"], + params["path"], + params["query"], + params["header"], + body=params["body"], + post_params=params["form"], + files=params["file"], + response_type=self.settings["response_type"], + auth_settings=self.settings["auth"], + async_req=kwargs["async_req"], + _check_type=kwargs["_check_return_type"], + _return_http_data_only=kwargs["_return_http_data_only"], + _preload_content=kwargs["_preload_content"], + _request_timeout=kwargs["_request_timeout"], + _host=_host, + collection_formats=params["collection_format"], + ) diff --git a/pinecone/core_ea/openapi/shared/exceptions.py b/pinecone/openapi_support/exceptions.py similarity index 99% rename from pinecone/core_ea/openapi/shared/exceptions.py rename to pinecone/openapi_support/exceptions.py index 187a1678..cd6045cd 100644 --- a/pinecone/core_ea/openapi/shared/exceptions.py +++ b/pinecone/openapi_support/exceptions.py @@ -85,7 +85,6 @@ def __init__(self, msg, path_to_item=None): class PineconeApiException(PineconeException): - def __init__(self, status=None, reason=None, http_resp=None): if http_resp: self.status = http_resp.status @@ -111,25 +110,21 @@ def __str__(self): class NotFoundException(PineconeApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(NotFoundException, self).__init__(status, reason, http_resp) class UnauthorizedException(PineconeApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(UnauthorizedException, self).__init__(status, reason, http_resp) class ForbiddenException(PineconeApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(ForbiddenException, self).__init__(status, reason, http_resp) class ServiceException(PineconeApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(ServiceException, self).__init__(status, reason, http_resp) diff --git a/pinecone/core_ea/openapi/shared/model_utils.py b/pinecone/openapi_support/model_utils.py similarity index 95% rename from pinecone/core_ea/openapi/shared/model_utils.py rename to pinecone/openapi_support/model_utils.py index 9e993dce..9db3c72b 100644 --- a/pinecone/core_ea/openapi/shared/model_utils.py +++ b/pinecone/openapi_support/model_utils.py @@ -8,7 +8,7 @@ import re import tempfile -from pinecone.core_ea.openapi.shared.exceptions import ( +from .exceptions import ( PineconeApiKeyError, PineconeApiAttributeError, PineconeApiTypeError, @@ -31,7 +31,9 @@ def wrapped_init(_self, *args, **kwargs): """ spec_property_naming = kwargs.get("_spec_property_naming", False) if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) + kwargs = change_keys_js_to_python( + kwargs, _self if isinstance(_self, type) else _self.__class__ + ) return fn(_self, *args, **kwargs) return wrapped_init @@ -126,9 +128,13 @@ def set_attribute(self, name, value): elif self.additional_properties_type is not None: required_types_mixed = self.additional_properties_type - if get_simple_class(name) != str: - error_msg = type_error_message(var_name=name, var_value=name, valid_classes=(str,), key_type=True) - raise PineconeApiTypeError(error_msg, path_to_item=path_to_item, valid_classes=(str,), key_type=True) + if get_simple_class(name) is not str: + error_msg = type_error_message( + var_name=name, var_value=name, valid_classes=(str,), key_type=True + ) + raise PineconeApiTypeError( + error_msg, path_to_item=path_to_item, valid_classes=(str,), key_type=True + ) if self._check_type: value = validate_and_convert_types( @@ -211,7 +217,8 @@ def __new__(cls, *args, **kwargs): path_to_item = kwargs.get("_path_to_item", ()) raise PineconeApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item) + "The discriminator property '%s' is missing at path: %s" + % (discr_propertyname_js, path_to_item) ) # Implementation note: the last argument to get_discriminator_class @@ -225,7 +232,8 @@ def __new__(cls, *args, **kwargs): raise PineconeApiValueError( "Cannot deserialize input data due to invalid discriminator " "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item) + "property '%s'='%s' at path: %s" + % (discr_propertyname_js, disc_prop_value, path_to_item) ) if new_cls in visited_composed_classes: @@ -250,7 +258,9 @@ def __new__(cls, *args, **kwargs): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes = None if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ()) + oneof_anyof_classes = cls._composed_schemas.get( + "oneOf", () + ) + cls._composed_schemas.get("anyOf", ()) oneof_anyof_child = new_cls in oneof_anyof_classes kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) @@ -316,7 +326,8 @@ def _new_from_openapi_data(cls, *args, **kwargs): path_to_item = kwargs.get("_path_to_item", ()) raise PineconeApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item) + "The discriminator property '%s' is missing at path: %s" + % (discr_propertyname_js, path_to_item) ) # Implementation note: the last argument to get_discriminator_class @@ -330,7 +341,8 @@ def _new_from_openapi_data(cls, *args, **kwargs): raise PineconeApiValueError( "Cannot deserialize input data due to invalid discriminator " "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item) + "property '%s'='%s' at path: %s" + % (discr_propertyname_js, disc_prop_value, path_to_item) ) if new_cls in visited_composed_classes: @@ -355,14 +367,16 @@ def _new_from_openapi_data(cls, *args, **kwargs): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes = None if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ()) + oneof_anyof_classes = cls._composed_schemas.get( + "oneOf", () + ) + cls._composed_schemas.get("anyOf", ()) oneof_anyof_child = new_cls in oneof_anyof_classes kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) if cls._composed_schemas.get("allOf") and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) + self_inst = cls._from_openapi_data(*args, **kwargs) # noqa: F841 new_inst = new_cls._new_from_openapi_data(*args, **kwargs) return new_inst @@ -393,7 +407,8 @@ def __getitem__(self, name): return self.get(name) raise PineconeApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], ) def __contains__(self, name): @@ -446,7 +461,8 @@ def __getitem__(self, name): return self.get(name) raise PineconeApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], ) def __contains__(self, name): @@ -600,7 +616,9 @@ def __contains__(self, name): if name in self.required_properties: return name in self.__dict__ - model_instances = self._var_name_to_model_instances.get(name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get( + name, self._additional_properties_model_instances + ) if model_instances: for model_instance in model_instances: @@ -730,7 +748,7 @@ def get_simple_class(input_value): return list elif isinstance(input_value, dict): return dict - elif isinstance(input_value, none_type): + elif input_value is None: return none_type elif isinstance(input_value, file_type): return file_type @@ -767,7 +785,9 @@ def check_allowed_values(allowed_values, input_variable_path, input_values): "Invalid values for `%s` [%s], must be a subset of [%s]" % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) ) - elif isinstance(input_values, dict) and not set(input_values.keys()).issubset(set(these_allowed_values)): + elif isinstance(input_values, dict) and not set(input_values.keys()).issubset( + set(these_allowed_values) + ): invalid_values = ", ".join(map(str, set(input_values.keys()) - set(these_allowed_values))) raise PineconeApiValueError( "Invalid keys in `%s` [%s], must be a subset of [%s]" @@ -959,11 +979,15 @@ def index_getter(class_or_instance): return COERCION_INDEX_BY_TYPE[class_or_instance] raise PineconeApiValueError("Unsupported type: %s" % class_or_instance) - sorted_types = sorted(required_types, key=lambda class_or_instance: index_getter(class_or_instance)) + sorted_types = sorted( + required_types, key=lambda class_or_instance: index_getter(class_or_instance) + ) return sorted_types -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, must_convert=True): +def remove_uncoercible( + required_types_classes, current_item, spec_property_naming, must_convert=True +): """Only keeps the type conversions that are possible Args: @@ -1103,9 +1127,14 @@ def change_keys_js_to_python(input_dict, model_class): def get_type_error(var_value, path_to_item, valid_classes, key_type=False): error_msg = type_error_message( - var_name=path_to_item[-1], var_value=var_value, valid_classes=valid_classes, key_type=key_type + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return PineconeApiTypeError( + error_msg, path_to_item=path_to_item, valid_classes=valid_classes, key_type=key_type ) - return PineconeApiTypeError(error_msg, path_to_item=path_to_item, valid_classes=valid_classes, key_type=key_type) def deserialize_primitive(data, klass, path_to_item): @@ -1145,7 +1174,7 @@ def deserialize_primitive(data, klass, path_to_item): return parse(data).date() else: converted_value = klass(data) - if isinstance(data, str) and klass == float: + if isinstance(data, str) and klass is float: if str(converted_value) != data: # '7' -> 7.0 -> '7.0' != '7' raise ValueError("This is not a float") @@ -1194,21 +1223,25 @@ def get_discriminator_class(model_class, discr_name, discr_value, cls_visited): # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig # if we try to make BasquePig from mammal, we need to travel through # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get("oneOf", ()) + model_class._composed_schemas.get( - "anyOf", () - ) + descendant_classes = model_class._composed_schemas.get( + "oneOf", () + ) + model_class._composed_schemas.get("anyOf", ()) ancestor_classes = model_class._composed_schemas.get("allOf", ()) possible_classes = descendant_classes + ancestor_classes for cls in possible_classes: # Check if the schema has inherited discriminators. if hasattr(cls, "discriminator") and cls.discriminator is not None: - used_model_class = get_discriminator_class(cls, discr_name, discr_value, cls_visited) + used_model_class = get_discriminator_class( + cls, discr_name, discr_value, cls_visited + ) if used_model_class is not None: return used_model_class return used_model_class -def deserialize_model(model_data, model_class, path_to_item, check_type, configuration, spec_property_naming): +def deserialize_model( + model_data, model_class, path_to_item, check_type, configuration, spec_property_naming +): """Deserializes model_data to model instance. Args: @@ -1320,7 +1353,9 @@ def attempt_convert_item( PineconeApiKeyError """ valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible(valid_classes_ordered, input_value, spec_property_naming) + valid_classes_coercible = remove_uncoercible( + valid_classes_ordered, input_value, spec_property_naming + ) if not valid_classes_coercible or key_type: # we do not handle keytype errors, json will take care # of this for us @@ -1330,7 +1365,12 @@ def attempt_convert_item( try: if issubclass(valid_class, OpenApiModel): return deserialize_model( - input_value, valid_class, path_to_item, check_type, configuration, spec_property_naming + input_value, + valid_class, + path_to_item, + check_type, + configuration, + spec_property_naming, ) elif valid_class == file_type: return deserialize_file(input_value, configuration) @@ -1386,7 +1426,9 @@ def is_valid_type(input_class_simple, valid_classes): bool """ valid_type = input_class_simple in valid_classes - if not valid_type and (issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type): + if not valid_type and ( + issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type + ): for valid_class in valid_classes: if input_class_simple is none_type and is_type_nullable(valid_class): # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. @@ -1402,7 +1444,12 @@ def is_valid_type(input_class_simple, valid_classes): def validate_and_convert_types( - input_value, required_types_mixed, path_to_item, spec_property_naming, _check_type, configuration=None + input_value, + required_types_mixed, + path_to_item, + spec_property_naming, + _check_type, + configuration=None, ): """Raises a TypeError is there is a problem, otherwise returns value @@ -1503,7 +1550,7 @@ def validate_and_convert_types( for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) - if get_simple_class(inner_key) != str: + if get_simple_class(inner_key) is not str: raise get_type_error(inner_key, inner_path, valid_classes, key_type=True) input_value[inner_key] = validate_and_convert_types( inner_val, @@ -1606,11 +1653,10 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, key_ty if key_type: key_or_value = "key" valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = "Invalid type for variable '{0}'. Required {1} type {2} and " "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, + msg = ( + "Invalid type for variable '{0}'. Required {1} type {2} and " "passed type was {3}".format( + var_name, key_or_value, valid_classes_phrase, type(var_value).__name__ + ) ) return msg @@ -1644,7 +1690,6 @@ def get_allof_instances(self, model_args, constant_args): """ composed_instances = [] for allof_class in self._composed_schemas["allOf"]: - try: allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) @@ -1652,7 +1697,8 @@ def get_allof_instances(self, model_args, constant_args): raise PineconeApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % (allof_class.__name__, allof_class.__name__, self.__class__.__name__, str(ex)) + "schema '%s'. Error=%s" + % (allof_class.__name__, allof_class.__name__, self.__class__.__name__, str(ex)) ) from ex return composed_instances @@ -1875,4 +1921,9 @@ def validate_get_composed_info(constant_args, model_args, self): if prop_name not in discarded_args: var_name_to_model_instances[prop_name] = [self] + composed_instances - return [composed_instances, var_name_to_model_instances, additional_properties_model_instances, discarded_args] + return [ + composed_instances, + var_name_to_model_instances, + additional_properties_model_instances, + discarded_args, + ] diff --git a/pinecone/core_ea/openapi/shared/rest.py b/pinecone/openapi_support/rest.py similarity index 94% rename from pinecone/core_ea/openapi/shared/rest.py rename to pinecone/openapi_support/rest.py index c200f592..6e271d8d 100644 --- a/pinecone/core_ea/openapi/shared/rest.py +++ b/pinecone/openapi_support/rest.py @@ -8,7 +8,7 @@ import urllib3 -from pinecone.core_ea.openapi.shared.exceptions import ( +from .exceptions import ( PineconeApiException, UnauthorizedException, ForbiddenException, @@ -34,7 +34,6 @@ class bcolors: class RESTResponse(io.IOBase): - def __init__(self, resp): self.urllib3_response = resp self.status = resp.status @@ -51,7 +50,6 @@ def getheader(self, name, default=None): class RESTClientObject(object): - def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 @@ -157,7 +155,10 @@ def request( print( bcolors.OKBLUE + "curl -X {method} '{url}' {formatted_headers} -d '{data}'".format( - method=method, url=formatted_url, formatted_headers=formatted_headers, data=formatted_body + method=method, + url=formatted_url, + formatted_headers=formatted_headers, + data=formatted_body, ) + bcolors.ENDC ) @@ -183,7 +184,9 @@ def request( headers["Content-Type"] = "application/json" if query_params: url += "?" + urlencode(query_params, quote_via=quote) - if ("Content-Type" not in headers) or (re.search("json", headers["Content-Type"], re.IGNORECASE)): + if ("Content-Type" not in headers) or ( + re.search("json", headers["Content-Type"], re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) @@ -280,7 +283,9 @@ def request( return r - def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + def GET( + self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None + ): return self.request( "GET", url, @@ -290,7 +295,9 @@ def GET(self, url, headers=None, query_params=None, _preload_content=True, _requ query_params=query_params, ) - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + def HEAD( + self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None + ): return self.request( "HEAD", url, @@ -321,7 +328,15 @@ def OPTIONS( body=body, ) - def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): + def DELETE( + self, + url, + headers=None, + query_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): return self.request( "DELETE", url, diff --git a/pyproject.toml b/pyproject.toml index 18e69fbd..342c5fb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,7 @@ pandas-stubs = [ ] types-tqdm = "^4.66.0.3" types-protobuf = "^4.24.0.4" +types-python-dateutil = "^2.9.0.20241003" [tool.poetry.group.dev.dependencies] pre-commit = "^3.0.0" @@ -86,6 +87,7 @@ urllib3_mock = "0.3.3" responses = ">=0.8.1" ddtrace = "^2.14.4" + [tool.poetry.extras] grpc = ["grpcio", "googleapis-common-protos", "lz4", "protobuf", "protoc-gen-openapiv2"] diff --git a/tests/unit/data/test_bulk_import.py b/tests/unit/data/test_bulk_import.py index 45484e14..71b90bae 100644 --- a/tests/unit/data/test_bulk_import.py +++ b/tests/unit/data/test_bulk_import.py @@ -2,10 +2,9 @@ from urllib3 import BaseHTTPResponse -from pinecone.core_ea.openapi.db_data.api.bulk_operations_api import BulkOperationsApi -from pinecone.core_ea.openapi.db_data.models import StartImportResponse -from pinecone.core_ea.openapi.shared.api_client import ApiClient -from pinecone.core_ea.openapi.shared.exceptions import PineconeApiException +from pinecone.openapi_support import ApiClient, PineconeApiException +from pinecone.core.openapi.db_data.api.bulk_operations_api import BulkOperationsApi +from pinecone.core.openapi.db_data.models import StartImportResponse from pinecone.data.features.bulk_import import ImportFeatureMixin, ImportErrorMode diff --git a/tests/unit/data/test_import_datetime_parsing.py b/tests/unit/data/test_import_datetime_parsing.py index b2af7a0d..be605b4a 100644 --- a/tests/unit/data/test_import_datetime_parsing.py +++ b/tests/unit/data/test_import_datetime_parsing.py @@ -2,9 +2,8 @@ from datetime import datetime, date -from pinecone.core_ea.openapi.db_data.api.bulk_operations_api import BulkOperationsApi -from pinecone.core_ea.openapi.shared.api_client import ApiClient -from pinecone.core_ea.openapi.shared.rest import RESTResponse +from pinecone.core.openapi.db_data.api.bulk_operations_api import BulkOperationsApi +from pinecone.openapi_support import ApiClient, RESTResponse def fake_response(mocker, body: str, status: int = 200) -> BaseHTTPResponse: @@ -35,7 +34,7 @@ def test_parsing_datetime_fields(self, mocker): api_client = fake_response(mocker, body, 200) api = BulkOperationsApi(api_client=api_client) - r = api.describe_import(id="1") + r = api.describe_bulk_import(id="1") assert r.created_at.year == 2024 assert r.created_at.month == 8 assert r.created_at.date() == date(year=2024, month=8, day=27) diff --git a/tests/unit/models/test_collection_list.py b/tests/unit/models/test_collection_list.py index 12eaa775..140bfb84 100644 --- a/tests/unit/models/test_collection_list.py +++ b/tests/unit/models/test_collection_list.py @@ -1,6 +1,6 @@ import pytest from pinecone import CollectionList -from pinecone.core.openapi.control.models import ( +from pinecone.core.openapi.db_control.models import ( CollectionList as OpenApiCollectionList, CollectionModel, ) diff --git a/tests/unit/models/test_index_list.py b/tests/unit/models/test_index_list.py index c44e3c57..4696cfd6 100644 --- a/tests/unit/models/test_index_list.py +++ b/tests/unit/models/test_index_list.py @@ -1,6 +1,6 @@ import pytest from pinecone import IndexList -from pinecone.core.openapi.control.models import ( +from pinecone.core.openapi.db_control.models import ( IndexList as OpenApiIndexList, IndexModel as OpenApiIndexModel, IndexModelSpec, diff --git a/tests/unit/models/test_index_model.py b/tests/unit/models/test_index_model.py index f80d4b74..e4979392 100644 --- a/tests/unit/models/test_index_model.py +++ b/tests/unit/models/test_index_model.py @@ -1,4 +1,4 @@ -from pinecone.core.openapi.control.models import ( +from pinecone.core.openapi.db_control.models import ( IndexModel as OpenApiIndexModel, IndexModelStatus, IndexModelSpec, diff --git a/tests/unit/openapi_support/__init__.py b/tests/unit/openapi_support/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/openapi_support/test_api_client.py b/tests/unit/openapi_support/test_api_client.py new file mode 100644 index 00000000..eb69f2e3 --- /dev/null +++ b/tests/unit/openapi_support/test_api_client.py @@ -0,0 +1,159 @@ +from pinecone.core.openapi.db_control.models import ( + IndexModel, + IndexModelStatus, + IndexModelSpec, + DeletionProtection, +) +from pinecone.openapi_support import ApiClient +from datetime import date, datetime + + +class TestSanitization: + def test_sanitize_for_serialization_returns_basic_types(self): + # Return basic types without modification + assert ApiClient.sanitize_for_serialization(None) is None + assert ApiClient.sanitize_for_serialization(1) == 1 + assert ApiClient.sanitize_for_serialization(-1) == -1 + assert ApiClient.sanitize_for_serialization("string") == "string" + assert ApiClient.sanitize_for_serialization(True) is True + assert ApiClient.sanitize_for_serialization(False) is False + assert ApiClient.sanitize_for_serialization(1.1) == 1.1 + + def test_sanitize_for_serialization_stringifies_dates(self): + assert ApiClient.sanitize_for_serialization(date(2021, 1, 1)) == "2021-01-01" + assert ( + ApiClient.sanitize_for_serialization(datetime(2021, 1, 1, 0, 0, 0)) + == "2021-01-01T00:00:00" + ) + + def sanitize_for_serialization_serializes_dicts(self): + assert ApiClient.sanitize_for_serialization({"key": "value"}) == {"key": "value"} + assert ApiClient.sanitize_for_serialization({"key": {"inner_key": "foo"}}) == { + "key": {"inner_key": "foo"} + } + + def test_sanitize_for_serialization_serializes_lists(self): + assert ApiClient.sanitize_for_serialization([1, 2, 3]) == [1, 2, 3] + assert ApiClient.sanitize_for_serialization([date(2021, 1, 1), date(2021, 1, 2)]) == [ + "2021-01-01", + "2021-01-02", + ] + + def test_sanitize_for_serialization_serializes_tuples(self): + assert ApiClient.sanitize_for_serialization((1, 2, 3)) == [1, 2, 3] + assert ApiClient.sanitize_for_serialization((date(2021, 1, 1), date(2021, 1, 2))) == [ + "2021-01-01", + "2021-01-02", + ] + assert ApiClient.sanitize_for_serialization((None, None, "1", 23.3)) == [ + None, + None, + "1", + 23.3, + ] + + def test_sanitization_for_serialization_serializes_io(self): + import io + + assert ApiClient.sanitize_for_serialization(io.BytesIO(b"test")) == b"test" + + def test_sanitize_for_serialization_serializes_model_normal(self): + m = IndexModel( + name="myindex", + dimension=10, + host="localhost", + spec=IndexModelSpec(), + status=IndexModelStatus(ready=True, state="Ready"), + ) + assert ApiClient.sanitize_for_serialization(m) == { + "name": "myindex", + "dimension": 10, + "metric": "cosine", + "host": "localhost", + "spec": {}, + "status": {"ready": True, "state": "Ready"}, + } + + def test_sanitize_for_serialization_serializes_model_simple(self): + # ModelSimple is used to model named values which are not objects + m = DeletionProtection(value="enabled") + assert ApiClient.sanitize_for_serialization(m) == "enabled" + + +class TestParametersToTuples: + def test_parameters_to_tuples_converts_dict_to_list_of_tuples(self): + params = {"key1": "value1", "key2": "value2"} + assert ApiClient.parameters_to_tuples(params, None) == [ + ("key1", "value1"), + ("key2", "value2"), + ] + assert ApiClient.parameters_to_tuples({}, None) == [] + + def test_parameters_to_tuples_tuple_input(self): + params = [("key1", "value1"), ("key2", "value2")] + assert ApiClient.parameters_to_tuples(params, None) == params + assert ApiClient.parameters_to_tuples([], None) == [] + + def test_parameters_to_tuples_accepts_dict_values(self): + params = {"key1": {"inner_key": "value1"}, "key2": {"inner_key": "value2"}} + assert ApiClient.parameters_to_tuples(params, None) == [ + ("key1", {"inner_key": "value1"}), + ("key2", {"inner_key": "value2"}), + ] + + def test_parameters_to_tuples_accepts_list_values(self): + params = {"key1": ["value1", "value2"], "key2": ["value3", "value4"]} + assert ApiClient.parameters_to_tuples(params, None) == [ + ("key1", ["value1", "value2"]), + ("key2", ["value3", "value4"]), + ] + + def test_parameters_to_tuples_with_collection_format(self): + collection_formats = {"key1": "csv", "key2": "ssv", "key3": "tsv", "key4": "pipes"} + params = { + "key1": ["value1", "value2", "value3"], + "key2": ["value1", "value2", "value3"], + "key3": ["value1", "value2", "value3"], + "key4": ["value1", "value2", "value3"], + } + + assert ApiClient.parameters_to_tuples(params, collection_formats) == [ + ("key1", "value1,value2,value3"), + ("key2", "value1 value2 value3"), + ("key3", "value1\tvalue2\tvalue3"), + ("key4", "value1|value2|value3"), + ] + + def test_parameters_to_tuples_with_collection_format_multi(self): + collection_formats = {"key1": "multi", "key2": "csv"} + params = {"key1": ["value1", "value2", "value3"], "key2": ["value4", "value5"]} + + assert ApiClient.parameters_to_tuples(params, collection_formats) == [ + ("key1", "value1"), + ("key1", "value2"), + ("key1", "value3"), + ("key2", "value4,value5"), + ] + + def test_tuple_with_collection_format_multi(self): + collection_formats = {"key1": "multi", "key2": "csv"} + params = [("key1", ["value1", "value2", "value3"]), ("key2", ["value4", "value5"])] + + assert ApiClient.parameters_to_tuples(params, collection_formats) == [ + ("key1", "value1"), + ("key1", "value2"), + ("key1", "value3"), + ("key2", "value4,value5"), + ] + + def test_casts_to_string(self): + collection_formats = {"key1": "multi", "key2": "csv"} + params = {"key1": [1, 2, 3], "key2": [1, 2]} + + # This seems kinda crazy, but I'm just characterizing the current behavior + assert ApiClient.parameters_to_tuples(params, collection_formats) == [ + ("key1", 1), + ("key1", 2), + ("key1", 3), + ("key2", "1,2"), + ] diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index 8ab7acbe..f7468f25 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -1,7 +1,7 @@ from pinecone import Pinecone from pinecone.exceptions.exceptions import PineconeConfigurationError from pinecone.config import PineconeConfig -from pinecone.core.openapi.shared.configuration import Configuration as OpenApiConfiguration +from pinecone.openapi_support.configuration import Configuration as OpenApiConfiguration import pytest import os diff --git a/tests/unit/test_config_builder.py b/tests/unit/test_config_builder.py index b3cf1c2a..37782aec 100644 --- a/tests/unit/test_config_builder.py +++ b/tests/unit/test_config_builder.py @@ -1,6 +1,6 @@ import pytest -from pinecone.core.openapi.shared.configuration import Configuration as OpenApiConfiguration +from pinecone.openapi_support.configuration import Configuration as OpenApiConfiguration from pinecone.config import ConfigBuilder from pinecone import PineconeConfigurationError diff --git a/tests/unit/test_control.py b/tests/unit/test_control.py index 2fb9e6da..40614005 100644 --- a/tests/unit/test_control.py +++ b/tests/unit/test_control.py @@ -2,8 +2,8 @@ import re from unittest.mock import patch, MagicMock from pinecone import ConfigBuilder, Pinecone, PodSpec, ServerlessSpec -from pinecone.core.openapi.control.models import IndexList, IndexModel, DeletionProtection -from pinecone.core.openapi.control.api.manage_indexes_api import ManageIndexesApi +from pinecone.core.openapi.db_control.models import IndexList, IndexModel, DeletionProtection +from pinecone.core.openapi.db_control.api.manage_indexes_api import ManageIndexesApi import time diff --git a/tests/unit/test_index.py b/tests/unit/test_index.py index e60c89c8..c9037ff9 100644 --- a/tests/unit/test_index.py +++ b/tests/unit/test_index.py @@ -36,9 +36,9 @@ def setup_method(self): # region: upsert tests def test_upsert_tuplesOfIdVec_UpserWithoutMD(self, mocker): - mocker.patch.object(self.index._vector_api, "upsert", autospec=True) + mocker.patch.object(self.index._vector_api, "upsert_vectors", autospec=True) self.index.upsert([("vec1", self.vals1), ("vec2", self.vals2)], namespace="ns") - self.index._vector_api.upsert.assert_called_once_with( + self.index._vector_api.upsert_vectors.assert_called_once_with( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, metadata={}), @@ -49,9 +49,9 @@ def test_upsert_tuplesOfIdVec_UpserWithoutMD(self, mocker): ) def test_upsert_tuplesOfIdVecMD_UpsertVectorsWithMD(self, mocker): - mocker.patch.object(self.index._vector_api, "upsert", autospec=True) + mocker.patch.object(self.index._vector_api, "upsert_vectors", autospec=True) self.index.upsert([("vec1", self.vals1, self.md1), ("vec2", self.vals2, self.md2)]) - self.index._vector_api.upsert.assert_called_once_with( + self.index._vector_api.upsert_vectors.assert_called_once_with( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, metadata=self.md1), @@ -61,14 +61,14 @@ def test_upsert_tuplesOfIdVecMD_UpsertVectorsWithMD(self, mocker): ) def test_upsert_dictOfIdVecMD_UpsertVectorsWithMD(self, mocker): - mocker.patch.object(self.index._vector_api, "upsert", autospec=True) + mocker.patch.object(self.index._vector_api, "upsert_vectors", autospec=True) self.index.upsert( [ {"id": self.id1, "values": self.vals1, "metadata": self.md1}, {"id": self.id2, "values": self.vals2, "metadata": self.md2}, ] ) - self.index._vector_api.upsert.assert_called_once_with( + self.index._vector_api.upsert_vectors.assert_called_once_with( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, metadata=self.md1), @@ -78,25 +78,25 @@ def test_upsert_dictOfIdVecMD_UpsertVectorsWithMD(self, mocker): ) def test_upsert_dictOfIdVecMD_UpsertVectorsWithoutMD(self, mocker): - mocker.patch.object(self.index._vector_api, "upsert", autospec=True) + mocker.patch.object(self.index._vector_api, "upsert_vectors", autospec=True) self.index.upsert( [{"id": self.id1, "values": self.vals1}, {"id": self.id2, "values": self.vals2}] ) - self.index._vector_api.upsert.assert_called_once_with( + self.index._vector_api.upsert_vectors.assert_called_once_with( UpsertRequest( vectors=[Vector(id="vec1", values=self.vals1), Vector(id="vec2", values=self.vals2)] ) ) def test_upsert_dictOfIdVecMD_UpsertVectorsWithSparseValues(self, mocker): - mocker.patch.object(self.index._vector_api, "upsert", autospec=True) + mocker.patch.object(self.index._vector_api, "upsert_vectors", autospec=True) self.index.upsert( [ {"id": self.id1, "values": self.vals1, "sparse_values": self.sv1}, {"id": self.id2, "values": self.vals2, "sparse_values": self.sv2}, ] ) - self.index._vector_api.upsert.assert_called_once_with( + self.index._vector_api.upsert_vectors.assert_called_once_with( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, sparse_values=SparseValues(**self.sv1)), @@ -106,7 +106,7 @@ def test_upsert_dictOfIdVecMD_UpsertVectorsWithSparseValues(self, mocker): ) def test_upsert_vectors_upsertInputVectors(self, mocker): - mocker.patch.object(self.index._vector_api, "upsert", autospec=True) + mocker.patch.object(self.index._vector_api, "upsert_vectors", autospec=True) self.index.upsert( vectors=[ Vector(id="vec1", values=self.vals1, metadata=self.md1), @@ -114,7 +114,7 @@ def test_upsert_vectors_upsertInputVectors(self, mocker): ], namespace="ns", ) - self.index._vector_api.upsert.assert_called_once_with( + self.index._vector_api.upsert_vectors.assert_called_once_with( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, metadata=self.md1), @@ -130,7 +130,7 @@ def test_upsert_parallelUpsert_callUpsertParallel(self, mocker): [Vector(id="vec2", values=self.vals2, metadata=self.md2)], ] with Index(api_key="asdf", host="https://test.pinecone.io", pool_threads=30) as index: - mocker.patch.object(index._vector_api, "upsert", autospec=True) + mocker.patch.object(index._vector_api, "upsert_vectors", autospec=True) # Send requests in parallel async_results = [ @@ -140,7 +140,7 @@ def test_upsert_parallelUpsert_callUpsertParallel(self, mocker): # Wait for and retrieve responses (this raises in case of error) [async_result.get() for async_result in async_results] - index._vector_api.upsert.assert_any_call( + index._vector_api.upsert_vectors.assert_any_call( UpsertRequest( vectors=[Vector(id="vec1", values=self.vals1, metadata=self.md1)], namespace="ns", @@ -148,7 +148,7 @@ def test_upsert_parallelUpsert_callUpsertParallel(self, mocker): async_req=True, ) - index._vector_api.upsert.assert_any_call( + index._vector_api.upsert_vectors.assert_any_call( UpsertRequest( vectors=[Vector(id="vec2", values=self.vals2, metadata=self.md2)], namespace="ns", @@ -159,7 +159,7 @@ def test_upsert_parallelUpsert_callUpsertParallel(self, mocker): def test_upsert_vectorListIsMultiplyOfBatchSize_vectorsUpsertedInBatches(self, mocker): mocker.patch.object( self.index._vector_api, - "upsert", + "upsert_vectors", autospec=True, side_effect=lambda upsert_request: UpsertResponse( upserted_count=len(upsert_request.vectors) @@ -176,13 +176,13 @@ def test_upsert_vectorListIsMultiplyOfBatchSize_vectorsUpsertedInBatches(self, m show_progress=False, ) - self.index._vector_api.upsert.assert_any_call( + self.index._vector_api.upsert_vectors.assert_any_call( UpsertRequest( vectors=[Vector(id="vec1", values=self.vals1, metadata=self.md1)], namespace="ns" ) ) - self.index._vector_api.upsert.assert_any_call( + self.index._vector_api.upsert_vectors.assert_any_call( UpsertRequest( vectors=[Vector(id="vec2", values=self.vals2, metadata=self.md2)], namespace="ns" ) @@ -193,7 +193,7 @@ def test_upsert_vectorListIsMultiplyOfBatchSize_vectorsUpsertedInBatches(self, m def test_upsert_vectorListNotMultiplyOfBatchSize_vectorsUpsertedInBatches(self, mocker): mocker.patch.object( self.index._vector_api, - "upsert", + "upsert_vectors", autospec=True, side_effect=lambda upsert_request: UpsertResponse( upserted_count=len(upsert_request.vectors) @@ -210,7 +210,7 @@ def test_upsert_vectorListNotMultiplyOfBatchSize_vectorsUpsertedInBatches(self, batch_size=2, ) - self.index._vector_api.upsert.assert_any_call( + self.index._vector_api.upsert_vectors.assert_any_call( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, metadata=self.md1), @@ -220,7 +220,7 @@ def test_upsert_vectorListNotMultiplyOfBatchSize_vectorsUpsertedInBatches(self, ) ) - self.index._vector_api.upsert.assert_any_call( + self.index._vector_api.upsert_vectors.assert_any_call( UpsertRequest( vectors=[Vector(id="vec3", values=self.vals1, metadata=self.md1)], namespace="ns" ) @@ -231,7 +231,7 @@ def test_upsert_vectorListNotMultiplyOfBatchSize_vectorsUpsertedInBatches(self, def test_upsert_vectorListSmallerThanBatchSize_vectorsUpsertedInBatches(self, mocker): mocker.patch.object( self.index._vector_api, - "upsert", + "upsert_vectors", autospec=True, side_effect=lambda upsert_request: UpsertResponse( upserted_count=len(upsert_request.vectors) @@ -248,7 +248,7 @@ def test_upsert_vectorListSmallerThanBatchSize_vectorsUpsertedInBatches(self, mo batch_size=5, ) - self.index._vector_api.upsert.assert_called_once_with( + self.index._vector_api.upsert_vectors.assert_called_once_with( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, metadata=self.md1), @@ -264,7 +264,7 @@ def test_upsert_vectorListSmallerThanBatchSize_vectorsUpsertedInBatches(self, mo def test_upsert_tuplesList_vectorsUpsertedInBatches(self, mocker): mocker.patch.object( self.index._vector_api, - "upsert", + "upsert_vectors", autospec=True, side_effect=lambda upsert_request: UpsertResponse( upserted_count=len(upsert_request.vectors) @@ -281,7 +281,7 @@ def test_upsert_tuplesList_vectorsUpsertedInBatches(self, mocker): batch_size=2, ) - self.index._vector_api.upsert.assert_any_call( + self.index._vector_api.upsert_vectors.assert_any_call( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, metadata=self.md1), @@ -291,7 +291,7 @@ def test_upsert_tuplesList_vectorsUpsertedInBatches(self, mocker): ) ) - self.index._vector_api.upsert.assert_any_call( + self.index._vector_api.upsert_vectors.assert_any_call( UpsertRequest( vectors=[Vector(id="vec3", values=self.vals1, metadata=self.md1)], namespace="ns" ) @@ -302,7 +302,7 @@ def test_upsert_tuplesList_vectorsUpsertedInBatches(self, mocker): def test_upsert_dataframe(self, mocker): mocker.patch.object( self.index._vector_api, - "upsert", + "upsert_vectors", autospec=True, return_value=UpsertResponse(upserted_count=2), ) @@ -314,7 +314,7 @@ def test_upsert_dataframe(self, mocker): ) self.index.upsert_from_dataframe(df) - self.index._vector_api.upsert.assert_called_once_with( + self.index._vector_api.upsert_vectors.assert_called_once_with( UpsertRequest( vectors=[ Vector(id="vec1", values=self.vals1, metadata=self.md1), @@ -359,11 +359,13 @@ def test_query_byVectorNoFilter_queryVectorNoFilter(self, mocker): matches=[ScoredVector(id="1", score=0.9, values=[0.0], metadata={"a": 2})], namespace="test", ) - mocker.patch.object(self.index._vector_api, "query", autospec=True, return_value=response) + mocker.patch.object( + self.index._vector_api, "query_vectors", autospec=True, return_value=response + ) actual = self.index.query(top_k=10, vector=self.vals1) - self.index._vector_api.query.assert_called_once_with( + self.index._vector_api.query_vectors.assert_called_once_with( pinecone.QueryRequest(top_k=10, vector=self.vals1) ) expected = QueryResponse( @@ -373,16 +375,16 @@ def test_query_byVectorNoFilter_queryVectorNoFilter(self, mocker): assert expected.to_dict() == actual.to_dict() def test_query_byVectorWithFilter_queryVectorWithFilter(self, mocker): - mocker.patch.object(self.index._vector_api, "query", autospec=True) + mocker.patch.object(self.index._vector_api, "query_vectors", autospec=True) self.index.query(top_k=10, vector=self.vals1, filter=self.filter1, namespace="ns") - self.index._vector_api.query.assert_called_once_with( + self.index._vector_api.query_vectors.assert_called_once_with( pinecone.QueryRequest(top_k=10, vector=self.vals1, filter=self.filter1, namespace="ns") ) def test_query_byVecId_queryByVecId(self, mocker): - mocker.patch.object(self.index._vector_api, "query", autospec=True) + mocker.patch.object(self.index._vector_api, "query_vectors", autospec=True) self.index.query(top_k=10, id="vec1", include_metadata=True, include_values=False) - self.index._vector_api.query.assert_called_once_with( + self.index._vector_api.query_vectors.assert_called_once_with( pinecone.QueryRequest(top_k=10, id="vec1", include_metadata=True, include_values=False) ) @@ -403,23 +405,23 @@ def test_query_with_positional_args(self, mocker): # region: delete tests def test_delete_byIds_deleteByIds(self, mocker): - mocker.patch.object(self.index._vector_api, "delete", autospec=True) + mocker.patch.object(self.index._vector_api, "delete_vectors", autospec=True) self.index.delete(ids=["vec1", "vec2"]) - self.index._vector_api.delete.assert_called_once_with( + self.index._vector_api.delete_vectors.assert_called_once_with( pinecone.DeleteRequest(ids=["vec1", "vec2"]) ) def test_delete_deleteAllByFilter_deleteAllByFilter(self, mocker): - mocker.patch.object(self.index._vector_api, "delete", autospec=True) + mocker.patch.object(self.index._vector_api, "delete_vectors", autospec=True) self.index.delete(delete_all=True, filter=self.filter1, namespace="ns") - self.index._vector_api.delete.assert_called_once_with( + self.index._vector_api.delete_vectors.assert_called_once_with( pinecone.DeleteRequest(delete_all=True, filter=self.filter1, namespace="ns") ) def test_delete_deleteAllNoFilter_deleteNoFilter(self, mocker): - mocker.patch.object(self.index._vector_api, "delete", autospec=True) + mocker.patch.object(self.index._vector_api, "delete_vectors", autospec=True) self.index.delete(delete_all=True) - self.index._vector_api.delete.assert_called_once_with( + self.index._vector_api.delete_vectors.assert_called_once_with( pinecone.DeleteRequest(delete_all=True) ) @@ -428,30 +430,32 @@ def test_delete_deleteAllNoFilter_deleteNoFilter(self, mocker): # region: fetch tests def test_fetch_byIds_fetchByIds(self, mocker): - mocker.patch.object(self.index._vector_api, "fetch", autospec=True) + mocker.patch.object(self.index._vector_api, "fetch_vectors", autospec=True) self.index.fetch(ids=["vec1", "vec2"]) - self.index._vector_api.fetch.assert_called_once_with(ids=["vec1", "vec2"]) + self.index._vector_api.fetch_vectors.assert_called_once_with(ids=["vec1", "vec2"]) def test_fetch_byIdsAndNS_fetchByIdsAndNS(self, mocker): - mocker.patch.object(self.index._vector_api, "fetch", autospec=True) + mocker.patch.object(self.index._vector_api, "fetch_vectors", autospec=True) self.index.fetch(ids=["vec1", "vec2"], namespace="ns") - self.index._vector_api.fetch.assert_called_once_with(ids=["vec1", "vec2"], namespace="ns") + self.index._vector_api.fetch_vectors.assert_called_once_with( + ids=["vec1", "vec2"], namespace="ns" + ) # endregion # region: update tests def test_update_byIdAnValues_updateByIdAndValues(self, mocker): - mocker.patch.object(self.index._vector_api, "update", autospec=True) + mocker.patch.object(self.index._vector_api, "update_vector", autospec=True) self.index.update(id="vec1", values=self.vals1, namespace="ns") - self.index._vector_api.update.assert_called_once_with( + self.index._vector_api.update_vector.assert_called_once_with( pinecone.UpdateRequest(id="vec1", values=self.vals1, namespace="ns") ) def test_update_byIdAnValuesAndMetadata_updateByIdAndValuesAndMetadata(self, mocker): - mocker.patch.object(self.index._vector_api, "update", autospec=True) + mocker.patch.object(self.index._vector_api, "update_vector", autospec=True) self.index.update("vec1", values=self.vals1, metadata=self.md1) - self.index._vector_api.update.assert_called_once_with( + self.index._vector_api.update_vector.assert_called_once_with( pinecone.UpdateRequest(id="vec1", values=self.vals1, metadata=self.md1) ) diff --git a/tests/unit/utils/test_setup_openapi_client.py b/tests/unit/utils/test_setup_openapi_client.py index 446aaaf5..acd96c34 100644 --- a/tests/unit/utils/test_setup_openapi_client.py +++ b/tests/unit/utils/test_setup_openapi_client.py @@ -1,8 +1,8 @@ import pytest import re from pinecone.config import ConfigBuilder -from pinecone.core.openapi.control.api.manage_indexes_api import ManageIndexesApi -from pinecone.core.openapi.shared.api_client import ApiClient +from pinecone.core.openapi.db_control.api.manage_indexes_api import ManageIndexesApi +from pinecone.openapi_support.api_client import ApiClient from pinecone.utils.setup_openapi_client import setup_openapi_client, build_plugin_setup_client From 0d894404effa22444c9b98ce974716e8616417e9 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Thu, 14 Nov 2024 11:23:39 -0500 Subject: [PATCH 2/6] Non-generated changes needed for regen --- pinecone/data/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pinecone/data/index.py b/pinecone/data/index.py index abe1f306..becf6450 100644 --- a/pinecone/data/index.py +++ b/pinecone/data/index.py @@ -116,8 +116,8 @@ def __init__( api_client_klass=ApiClient, api_klass=VectorOperationsApi, config=self.config, - openapi_config=self._openapi_config, - pool_threads=self._pool_threads, + openapi_config=openapi_config, + pool_threads=pool_threads, api_version=API_VERSION, ) From 07eabab40e5c33361b85ed5f908b9495ab732244 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Thu, 14 Nov 2024 11:53:17 -0500 Subject: [PATCH 3/6] Rescue recent manual changes in generated files --- pinecone/openapi_support/api_client.py | 33 +++++++++++++++++++++++ pinecone/openapi_support/configuration.py | 19 +++++++++++++ pinecone/openapi_support/endpoint.py | 3 +++ 3 files changed, 55 insertions(+) diff --git a/pinecone/openapi_support/api_client.py b/pinecone/openapi_support/api_client.py index 2b75417b..9c8d1fff 100644 --- a/pinecone/openapi_support/api_client.py +++ b/pinecone/openapi_support/api_client.py @@ -2,6 +2,7 @@ import atexit import mimetypes from multiprocessing.pool import ThreadPool +from concurrent.futures import ThreadPoolExecutor import io import os import re @@ -50,6 +51,7 @@ class ApiClient(object): """ _pool = None + _threadpool_executor = None def __init__( self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1 @@ -74,6 +76,9 @@ def __exit__(self, exc_type, exc_value, traceback): self.close() def close(self): + if self._threadpool_executor: + self._threadpool_executor.shutdown() + self._threadpool_executor = None if self._pool: self._pool.close() self._pool.join() @@ -91,6 +96,12 @@ def pool(self): self._pool = ThreadPool(self.pool_threads) return self._pool + @property + def threadpool_executor(self): + if self._threadpool_executor is None: + self._threadpool_executor = ThreadPoolExecutor(max_workers=self.pool_threads) + return self._threadpool_executor + @property def user_agent(self): """User agent for this API client""" @@ -350,6 +361,7 @@ def call_api( response_type: Optional[Tuple[Any]] = None, auth_settings: Optional[List[str]] = None, async_req: Optional[bool] = None, + async_threadpool_executor: Optional[bool] = None, _return_http_data_only: Optional[bool] = None, collection_formats: Optional[Dict[str, str]] = None, _preload_content: bool = True, @@ -410,6 +422,27 @@ def call_api( If parameter async_req is False or missing, then the method will return the response directly. """ + if async_threadpool_executor: + return self.threadpool_executor.submit( + self.__call_api, + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + _check_type, + ) + if not async_req: return self.__call_api( resource_path, diff --git a/pinecone/openapi_support/configuration.py b/pinecone/openapi_support/configuration.py index 7e13e61d..2c7443d2 100644 --- a/pinecone/openapi_support/configuration.py +++ b/pinecone/openapi_support/configuration.py @@ -464,3 +464,22 @@ def host(self, value): """Fix base path.""" self._base_path = value self.server_index = None + + def __repr__(self): + attrs = [ + f"host={self.host}", + "api_key=***", + f"api_key_prefix={self.api_key_prefix}", + f"access_token={self.access_token}", + f"connection_pool_maxsize={self.connection_pool_maxsize}", + f"username={self.username}", + f"password={self.password}", + f"discard_unknown_keys={self.discard_unknown_keys}", + f"disabled_client_side_validations={self.disabled_client_side_validations}", + f"server_index={self.server_index}", + f"server_variables={self.server_variables}", + f"server_operation_index={self.server_operation_index}", + f"server_operation_variables={self.server_operation_variables}", + f"ssl_ca_cert={self.ssl_ca_cert}", + ] + return f"Configuration({', '.join(attrs)})" diff --git a/pinecone/openapi_support/endpoint.py b/pinecone/openapi_support/endpoint.py index 8aa3f67e..a490d95c 100644 --- a/pinecone/openapi_support/endpoint.py +++ b/pinecone/openapi_support/endpoint.py @@ -56,6 +56,7 @@ def __init__( self.params_map["all"].extend( [ "async_req", + "async_threadpool_executor", "_host_index", "_preload_content", "_request_timeout", @@ -70,6 +71,7 @@ def __init__( self.openapi_types = root_map["openapi_types"] extra_types = { "async_req": (bool,), + "async_threadpool_executor": (bool,), "_host_index": (none_type, int), "_preload_content": (bool,), "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), @@ -235,6 +237,7 @@ def call_with_http_info(self, **kwargs): response_type=self.settings["response_type"], auth_settings=self.settings["auth"], async_req=kwargs["async_req"], + async_threadpool_executor=kwargs.get("async_threadpool_executor", None), _check_type=kwargs["_check_return_type"], _return_http_data_only=kwargs["_return_http_data_only"], _preload_content=kwargs["_preload_content"], From bbfd0ebb6eb30acf0d822f26d7fb983eca04114e Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Thu, 14 Nov 2024 11:54:47 -0500 Subject: [PATCH 4/6] Regenerate with updated spec --- pinecone/core/openapi/control/__init__.py | 28 - .../core/openapi/control/api/inference_api.py | 121 -- .../core/openapi/control/models/__init__.py | 35 - pinecone/core/openapi/data/__init__.py | 28 - pinecone/core/openapi/data/models/__init__.py | 33 - pinecone/core/openapi/db_control/__init__.py | 29 + .../{control => db_control}/api/__init__.py | 2 +- .../api/manage_indexes_api.py | 193 +- .../{data => db_control}/apis/__init__.py | 4 +- .../{control => db_control}/model/__init__.py | 0 .../model/collection_list.py | 42 +- .../model/collection_model.py | 45 +- .../model/configure_index_request.py | 48 +- .../model/configure_index_request_spec.py | 44 +- .../model/configure_index_request_spec_pod.py | 42 +- .../model/create_collection_request.py | 43 +- .../model/create_index_request.py | 62 +- .../model/deletion_protection.py | 57 +- .../model/error_response.py | 38 +- .../model/error_response_error.py | 39 +- .../model/index_list.py | 42 +- .../model/index_model.py | 64 +- .../model/index_model_spec.py | 40 +- .../model/index_model_status.py | 38 +- .../model/index_spec.py | 30 +- .../model/index_tags.py} | 56 +- .../{control => db_control}/model/pod_spec.py | 80 +- .../model/pod_spec_metadata_config.py | 40 +- .../model/serverless_spec.py | 44 +- .../openapi/db_control/models/__init__.py | 34 + pinecone/core/openapi/db_data/__init__.py | 29 + .../openapi/{data => db_data}/api/__init__.py | 2 +- .../db_data/api/bulk_operations_api.py | 352 +++ .../api/vector_operations_api.py} | 406 +--- .../{control => db_data}/apis/__init__.py | 6 +- .../{data => db_data}/model/__init__.py | 0 .../{data => db_data}/model/delete_request.py | 40 +- .../model/describe_index_stats_request.py | 40 +- .../{data => db_data}/model/fetch_response.py | 40 +- .../model/import_error_mode.py} | 52 +- .../model/import_model.py} | 97 +- .../model/index_description.py} | 48 +- .../model/list_imports_response.py} | 68 +- .../{data => db_data}/model/list_item.py | 40 +- .../{data => db_data}/model/list_response.py | 42 +- .../model/namespace_summary.py | 40 +- .../{data => db_data}/model/pagination.py | 40 +- .../{data => db_data}/model/protobuf_any.py | 36 +- .../model/protobuf_null_value.py | 56 +- .../{data => db_data}/model/query_request.py | 57 +- .../{data => db_data}/model/query_response.py | 42 +- .../{data => db_data}/model/query_vector.py | 43 +- .../{data => db_data}/model/rpc_status.py | 38 +- .../{data => db_data}/model/scored_vector.py | 45 +- .../model/single_query_results.py | 38 +- .../{data => db_data}/model/sparse_values.py | 41 +- .../model/start_import_request.py} | 87 +- .../model/start_import_response.py} | 52 +- .../{data => db_data}/model/update_request.py | 46 +- .../{data => db_data}/model/upsert_request.py | 42 +- .../model/upsert_response.py | 40 +- .../openapi/{data => db_data}/model/usage.py | 40 +- .../openapi/{data => db_data}/model/vector.py | 46 +- .../core/openapi/db_data/models/__init__.py | 40 + pinecone/core/openapi/shared/__init__.py | 1 - pinecone/core/openapi/shared/api_client.py | 898 -------- pinecone/core/openapi/shared/configuration.py | 491 ----- pinecone/core/openapi/shared/exceptions.py | 145 -- pinecone/core/openapi/shared/model_utils.py | 1878 ----------------- pinecone/core/openapi/shared/rest.py | 396 ---- 70 files changed, 1374 insertions(+), 5967 deletions(-) delete mode 100644 pinecone/core/openapi/control/__init__.py delete mode 100644 pinecone/core/openapi/control/api/inference_api.py delete mode 100644 pinecone/core/openapi/control/models/__init__.py delete mode 100644 pinecone/core/openapi/data/__init__.py delete mode 100644 pinecone/core/openapi/data/models/__init__.py create mode 100644 pinecone/core/openapi/db_control/__init__.py rename pinecone/core/openapi/{control => db_control}/api/__init__.py (71%) rename pinecone/core/openapi/{control => db_control}/api/manage_indexes_api.py (84%) rename pinecone/core/openapi/{data => db_control}/apis/__init__.py (72%) rename pinecone/core/openapi/{control => db_control}/model/__init__.py (100%) rename pinecone/core/openapi/{control => db_control}/model/collection_list.py (90%) rename pinecone/core/openapi/{control => db_control}/model/collection_model.py (92%) rename pinecone/core/openapi/{control => db_control}/model/configure_index_request.py (90%) rename pinecone/core/openapi/{control => db_control}/model/configure_index_request_spec.py (90%) rename pinecone/core/openapi/{control => db_control}/model/configure_index_request_spec_pod.py (92%) rename pinecone/core/openapi/{control => db_control}/model/create_collection_request.py (91%) rename pinecone/core/openapi/{control => db_control}/model/create_index_request.py (89%) rename pinecone/core/openapi/{control => db_control}/model/deletion_protection.py (89%) rename pinecone/core/openapi/{control => db_control}/model/error_response.py (91%) rename pinecone/core/openapi/{control => db_control}/model/error_response_error.py (93%) rename pinecone/core/openapi/{control => db_control}/model/index_list.py (90%) rename pinecone/core/openapi/{control => db_control}/model/index_model.py (89%) rename pinecone/core/openapi/{control => db_control}/model/index_model_spec.py (91%) rename pinecone/core/openapi/{control => db_control}/model/index_model_status.py (92%) rename pinecone/core/openapi/{control => db_control}/model/index_spec.py (92%) rename pinecone/core/openapi/{control/model/embeddings_list_usage.py => db_control/model/index_tags.py} (88%) rename pinecone/core/openapi/{control => db_control}/model/pod_spec.py (86%) rename pinecone/core/openapi/{control => db_control}/model/pod_spec_metadata_config.py (91%) rename pinecone/core/openapi/{control => db_control}/model/serverless_spec.py (91%) create mode 100644 pinecone/core/openapi/db_control/models/__init__.py create mode 100644 pinecone/core/openapi/db_data/__init__.py rename pinecone/core/openapi/{data => db_data}/api/__init__.py (72%) create mode 100644 pinecone/core/openapi/db_data/api/bulk_operations_api.py rename pinecone/core/openapi/{data/api/data_plane_api.py => db_data/api/vector_operations_api.py} (64%) rename pinecone/core/openapi/{control => db_data}/apis/__init__.py (61%) rename pinecone/core/openapi/{data => db_data}/model/__init__.py (100%) rename pinecone/core/openapi/{data => db_data}/model/delete_request.py (93%) rename pinecone/core/openapi/{data => db_data}/model/describe_index_stats_request.py (92%) rename pinecone/core/openapi/{data => db_data}/model/fetch_response.py (91%) rename pinecone/core/openapi/{control/model/embedding.py => db_data/model/import_error_mode.py} (88%) rename pinecone/core/openapi/{control/model/embed_request_parameters.py => db_data/model/import_model.py} (74%) rename pinecone/core/openapi/{data/model/describe_index_stats_response.py => db_data/model/index_description.py} (90%) rename pinecone/core/openapi/{control/model/embeddings_list.py => db_data/model/list_imports_response.py} (84%) rename pinecone/core/openapi/{data => db_data}/model/list_item.py (91%) rename pinecone/core/openapi/{data => db_data}/model/list_response.py (91%) rename pinecone/core/openapi/{data => db_data}/model/namespace_summary.py (91%) rename pinecone/core/openapi/{data => db_data}/model/pagination.py (91%) rename pinecone/core/openapi/{data => db_data}/model/protobuf_any.py (92%) rename pinecone/core/openapi/{data => db_data}/model/protobuf_null_value.py (89%) rename pinecone/core/openapi/{data => db_data}/model/query_request.py (89%) rename pinecone/core/openapi/{data => db_data}/model/query_response.py (91%) rename pinecone/core/openapi/{data => db_data}/model/query_vector.py (91%) rename pinecone/core/openapi/{data => db_data}/model/rpc_status.py (91%) rename pinecone/core/openapi/{data => db_data}/model/scored_vector.py (91%) rename pinecone/core/openapi/{data => db_data}/model/single_query_results.py (91%) rename pinecone/core/openapi/{data => db_data}/model/sparse_values.py (91%) rename pinecone/core/openapi/{control/model/embed_request.py => db_data/model/start_import_request.py} (79%) rename pinecone/core/openapi/{control/model/embed_request_inputs.py => db_data/model/start_import_response.py} (89%) rename pinecone/core/openapi/{data => db_data}/model/update_request.py (91%) rename pinecone/core/openapi/{data => db_data}/model/upsert_request.py (91%) rename pinecone/core/openapi/{data => db_data}/model/upsert_response.py (91%) rename pinecone/core/openapi/{data => db_data}/model/usage.py (91%) rename pinecone/core/openapi/{data => db_data}/model/vector.py (91%) create mode 100644 pinecone/core/openapi/db_data/models/__init__.py delete mode 100644 pinecone/core/openapi/shared/__init__.py delete mode 100644 pinecone/core/openapi/shared/api_client.py delete mode 100644 pinecone/core/openapi/shared/configuration.py delete mode 100644 pinecone/core/openapi/shared/exceptions.py delete mode 100644 pinecone/core/openapi/shared/model_utils.py delete mode 100644 pinecone/core/openapi/shared/rest.py diff --git a/pinecone/core/openapi/control/__init__.py b/pinecone/core/openapi/control/__init__.py deleted file mode 100644 index 413b2872..00000000 --- a/pinecone/core/openapi/control/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# flake8: noqa - -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - - -__version__ = "1.0.0" - -# import ApiClient -from pinecone.core.openapi.shared.api_client import ApiClient - -# import Configuration -from pinecone.core.openapi.shared.configuration import Configuration - -# import exceptions -from pinecone.core.openapi.shared.exceptions import PineconeException -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError -from pinecone.core.openapi.shared.exceptions import PineconeApiTypeError -from pinecone.core.openapi.shared.exceptions import PineconeApiValueError -from pinecone.core.openapi.shared.exceptions import PineconeApiKeyError -from pinecone.core.openapi.shared.exceptions import PineconeApiException diff --git a/pinecone/core/openapi/control/api/inference_api.py b/pinecone/core/openapi/control/api/inference_api.py deleted file mode 100644 index 271190d1..00000000 --- a/pinecone/core/openapi/control/api/inference_api.py +++ /dev/null @@ -1,121 +0,0 @@ -""" - Pinecone Control Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - -import re # noqa: F401 -import sys # noqa: F401 - -from pinecone.core.openapi.shared.api_client import ApiClient, Endpoint as _Endpoint -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types, -) -from pinecone.core.openapi.control.model.embed_request import EmbedRequest -from pinecone.core.openapi.control.model.embeddings_list import EmbeddingsList -from pinecone.core.openapi.control.model.error_response import ErrorResponse - - -class InferenceApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __embed(self, **kwargs): - """Embed data # noqa: E501 - - Generate embeddings for input data # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.embed(async_req=True) - >>> result = thread.get() - - - Keyword Args: - embed_request (EmbedRequest): Generate embeddings for inputs. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - EmbeddingsList - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.embed = _Endpoint( - settings={ - "response_type": (EmbeddingsList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/embed", - "operation_id": "embed", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "embed_request", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "embed_request": (EmbedRequest,), - }, - "attribute_map": {}, - "location_map": { - "embed_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - callable=__embed, - ) diff --git a/pinecone/core/openapi/control/models/__init__.py b/pinecone/core/openapi/control/models/__init__.py deleted file mode 100644 index b742b6a7..00000000 --- a/pinecone/core/openapi/control/models/__init__.py +++ /dev/null @@ -1,35 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from pinecone.core.openapi.control.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from pinecone.core.openapi.control.model.collection_list import CollectionList -from pinecone.core.openapi.control.model.collection_model import CollectionModel -from pinecone.core.openapi.control.model.configure_index_request import ConfigureIndexRequest -from pinecone.core.openapi.control.model.configure_index_request_spec import ConfigureIndexRequestSpec -from pinecone.core.openapi.control.model.configure_index_request_spec_pod import ConfigureIndexRequestSpecPod -from pinecone.core.openapi.control.model.create_collection_request import CreateCollectionRequest -from pinecone.core.openapi.control.model.create_index_request import CreateIndexRequest -from pinecone.core.openapi.control.model.deletion_protection import DeletionProtection -from pinecone.core.openapi.control.model.embed_request import EmbedRequest -from pinecone.core.openapi.control.model.embed_request_inputs import EmbedRequestInputs -from pinecone.core.openapi.control.model.embed_request_parameters import EmbedRequestParameters -from pinecone.core.openapi.control.model.embedding import Embedding -from pinecone.core.openapi.control.model.embeddings_list import EmbeddingsList -from pinecone.core.openapi.control.model.embeddings_list_usage import EmbeddingsListUsage -from pinecone.core.openapi.control.model.error_response import ErrorResponse -from pinecone.core.openapi.control.model.error_response_error import ErrorResponseError -from pinecone.core.openapi.control.model.index_list import IndexList -from pinecone.core.openapi.control.model.index_model import IndexModel -from pinecone.core.openapi.control.model.index_model_spec import IndexModelSpec -from pinecone.core.openapi.control.model.index_model_status import IndexModelStatus -from pinecone.core.openapi.control.model.index_spec import IndexSpec -from pinecone.core.openapi.control.model.pod_spec import PodSpec -from pinecone.core.openapi.control.model.pod_spec_metadata_config import PodSpecMetadataConfig -from pinecone.core.openapi.control.model.serverless_spec import ServerlessSpec diff --git a/pinecone/core/openapi/data/__init__.py b/pinecone/core/openapi/data/__init__.py deleted file mode 100644 index 208c4358..00000000 --- a/pinecone/core/openapi/data/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# flake8: noqa - -""" - Pinecone Data Plane API - - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech -""" - - -__version__ = "1.0.0" - -# import ApiClient -from pinecone.core.openapi.shared.api_client import ApiClient - -# import Configuration -from pinecone.core.openapi.shared.configuration import Configuration - -# import exceptions -from pinecone.core.openapi.shared.exceptions import PineconeException -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError -from pinecone.core.openapi.shared.exceptions import PineconeApiTypeError -from pinecone.core.openapi.shared.exceptions import PineconeApiValueError -from pinecone.core.openapi.shared.exceptions import PineconeApiKeyError -from pinecone.core.openapi.shared.exceptions import PineconeApiException diff --git a/pinecone/core/openapi/data/models/__init__.py b/pinecone/core/openapi/data/models/__init__.py deleted file mode 100644 index 09a0a48b..00000000 --- a/pinecone/core/openapi/data/models/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from pinecone.core.openapi.data.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from pinecone.core.openapi.data.model.delete_request import DeleteRequest -from pinecone.core.openapi.data.model.describe_index_stats_request import DescribeIndexStatsRequest -from pinecone.core.openapi.data.model.describe_index_stats_response import DescribeIndexStatsResponse -from pinecone.core.openapi.data.model.fetch_response import FetchResponse -from pinecone.core.openapi.data.model.list_item import ListItem -from pinecone.core.openapi.data.model.list_response import ListResponse -from pinecone.core.openapi.data.model.namespace_summary import NamespaceSummary -from pinecone.core.openapi.data.model.pagination import Pagination -from pinecone.core.openapi.data.model.protobuf_any import ProtobufAny -from pinecone.core.openapi.data.model.protobuf_null_value import ProtobufNullValue -from pinecone.core.openapi.data.model.query_request import QueryRequest -from pinecone.core.openapi.data.model.query_response import QueryResponse -from pinecone.core.openapi.data.model.query_vector import QueryVector -from pinecone.core.openapi.data.model.rpc_status import RpcStatus -from pinecone.core.openapi.data.model.scored_vector import ScoredVector -from pinecone.core.openapi.data.model.single_query_results import SingleQueryResults -from pinecone.core.openapi.data.model.sparse_values import SparseValues -from pinecone.core.openapi.data.model.update_request import UpdateRequest -from pinecone.core.openapi.data.model.upsert_request import UpsertRequest -from pinecone.core.openapi.data.model.upsert_response import UpsertResponse -from pinecone.core.openapi.data.model.usage import Usage -from pinecone.core.openapi.data.model.vector import Vector diff --git a/pinecone/core/openapi/db_control/__init__.py b/pinecone/core/openapi/db_control/__init__.py new file mode 100644 index 00000000..b142fc57 --- /dev/null +++ b/pinecone/core/openapi/db_control/__init__.py @@ -0,0 +1,29 @@ +# flake8: noqa + +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech +""" + +__version__ = "1.0.0" + +# import ApiClient +from pinecone.openapi_support import ApiClient + +# import Configuration +from pinecone.openapi_support import Configuration + +# import exceptions +from pinecone.openapi_support.exceptions import PineconeException +from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.exceptions import PineconeApiTypeError +from pinecone.openapi_support.exceptions import PineconeApiValueError +from pinecone.openapi_support.exceptions import PineconeApiKeyError +from pinecone.openapi_support.exceptions import PineconeApiException + +API_VERSION = "2024-10" diff --git a/pinecone/core/openapi/control/api/__init__.py b/pinecone/core/openapi/db_control/api/__init__.py similarity index 71% rename from pinecone/core/openapi/control/api/__init__.py rename to pinecone/core/openapi/db_control/api/__init__.py index 7bcc2992..820d2190 100644 --- a/pinecone/core/openapi/control/api/__init__.py +++ b/pinecone/core/openapi/db_control/api/__init__.py @@ -1,3 +1,3 @@ # do not import all apis into this module because that uses a lot of memory and stack frames # if you need the ability to import all apis from one package, import them with -# from pinecone.core.openapi.control.apis import InferenceApi +# from pinecone.core.openapi.db_control.apis import ManageIndexesApi diff --git a/pinecone/core/openapi/control/api/manage_indexes_api.py b/pinecone/core/openapi/db_control/api/manage_indexes_api.py similarity index 84% rename from pinecone/core/openapi/control/api/manage_indexes_api.py rename to pinecone/core/openapi/db_control/api/manage_indexes_api.py index b0f67810..77c71102 100644 --- a/pinecone/core/openapi/control/api/manage_indexes_api.py +++ b/pinecone/core/openapi/db_control/api/manage_indexes_api.py @@ -1,18 +1,18 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.api_client import ApiClient, Endpoint as _Endpoint -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ApiClient, Endpoint as _Endpoint +from pinecone.openapi_support import ( # noqa: F401 check_allowed_values, check_validations, date, @@ -21,14 +21,14 @@ none_type, validate_and_convert_types, ) -from pinecone.core.openapi.control.model.collection_list import CollectionList -from pinecone.core.openapi.control.model.collection_model import CollectionModel -from pinecone.core.openapi.control.model.configure_index_request import ConfigureIndexRequest -from pinecone.core.openapi.control.model.create_collection_request import CreateCollectionRequest -from pinecone.core.openapi.control.model.create_index_request import CreateIndexRequest -from pinecone.core.openapi.control.model.error_response import ErrorResponse -from pinecone.core.openapi.control.model.index_list import IndexList -from pinecone.core.openapi.control.model.index_model import IndexModel +from pinecone.core.openapi.db_control.model.collection_list import CollectionList +from pinecone.core.openapi.db_control.model.collection_model import CollectionModel +from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest +from pinecone.core.openapi.db_control.model.create_collection_request import CreateCollectionRequest +from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest +from pinecone.core.openapi.db_control.model.error_response import ErrorResponse +from pinecone.core.openapi.db_control.model.index_list import IndexList +from pinecone.core.openapi.db_control.model.index_model import IndexModel class ManageIndexesApi(object): @@ -46,7 +46,7 @@ def __init__(self, api_client=None): def __configure_index(self, index_name, configure_index_request, **kwargs): """Configure an index # noqa: E501 - This operation configures an existing index. For serverless indexes, you can configure only index deletion protection. For pod-based indexes, you can configure the pod size, number of replicas, 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/create-an-index#create-an-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/configure-an-index). # noqa: E501 + This operation configures an existing index. For serverless indexes, you can configure only index deletion protection and tags. 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/create-an-index#create-an-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/configure-an-index). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -104,14 +104,8 @@ def __configure_index(self, index_name, configure_index_request, **kwargs): "servers": None, }, params_map={ - "all": [ - "index_name", - "configure_index_request", - ], - "required": [ - "index_name", - "configure_index_request", - ], + "all": ["index_name", "configure_index_request"], + "required": ["index_name", "configure_index_request"], "nullable": [], "enum": [], "validation": [], @@ -123,13 +117,8 @@ def __configure_index(self, index_name, configure_index_request, **kwargs): "index_name": (str,), "configure_index_request": (ConfigureIndexRequest,), }, - "attribute_map": { - "index_name": "index_name", - }, - "location_map": { - "index_name": "path", - "configure_index_request": "body", - }, + "attribute_map": {"index_name": "index_name"}, + "location_map": {"index_name": "path", "configure_index_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -196,12 +185,8 @@ def __create_collection(self, create_collection_request, **kwargs): "servers": None, }, params_map={ - "all": [ - "create_collection_request", - ], - "required": [ - "create_collection_request", - ], + "all": ["create_collection_request"], + "required": ["create_collection_request"], "nullable": [], "enum": [], "validation": [], @@ -209,13 +194,9 @@ def __create_collection(self, create_collection_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "create_collection_request": (CreateCollectionRequest,), - }, + "openapi_types": {"create_collection_request": (CreateCollectionRequest,)}, "attribute_map": {}, - "location_map": { - "create_collection_request": "body", - }, + "location_map": {"create_collection_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -282,12 +263,8 @@ def __create_index(self, create_index_request, **kwargs): "servers": None, }, params_map={ - "all": [ - "create_index_request", - ], - "required": [ - "create_index_request", - ], + "all": ["create_index_request"], + "required": ["create_index_request"], "nullable": [], "enum": [], "validation": [], @@ -295,13 +272,9 @@ def __create_index(self, create_index_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "create_index_request": (CreateIndexRequest,), - }, + "openapi_types": {"create_index_request": (CreateIndexRequest,)}, "attribute_map": {}, - "location_map": { - "create_index_request": "body", - }, + "location_map": {"create_index_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -368,12 +341,8 @@ def __delete_collection(self, collection_name, **kwargs): "servers": None, }, params_map={ - "all": [ - "collection_name", - ], - "required": [ - "collection_name", - ], + "all": ["collection_name"], + "required": ["collection_name"], "nullable": [], "enum": [], "validation": [], @@ -381,21 +350,12 @@ def __delete_collection(self, collection_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "collection_name": (str,), - }, - "attribute_map": { - "collection_name": "collection_name", - }, - "location_map": { - "collection_name": "path", - }, + "openapi_types": {"collection_name": (str,)}, + "attribute_map": {"collection_name": "collection_name"}, + "location_map": {"collection_name": "path"}, "collection_format_map": {}, }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, callable=__delete_collection, ) @@ -459,12 +419,8 @@ def __delete_index(self, index_name, **kwargs): "servers": None, }, params_map={ - "all": [ - "index_name", - ], - "required": [ - "index_name", - ], + "all": ["index_name"], + "required": ["index_name"], "nullable": [], "enum": [], "validation": [], @@ -472,21 +428,12 @@ def __delete_index(self, index_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "index_name": (str,), - }, - "attribute_map": { - "index_name": "index_name", - }, - "location_map": { - "index_name": "path", - }, + "openapi_types": {"index_name": (str,)}, + "attribute_map": {"index_name": "index_name"}, + "location_map": {"index_name": "path"}, "collection_format_map": {}, }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, callable=__delete_index, ) @@ -550,12 +497,8 @@ def __describe_collection(self, collection_name, **kwargs): "servers": None, }, params_map={ - "all": [ - "collection_name", - ], - "required": [ - "collection_name", - ], + "all": ["collection_name"], + "required": ["collection_name"], "nullable": [], "enum": [], "validation": [], @@ -563,21 +506,12 @@ def __describe_collection(self, collection_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "collection_name": (str,), - }, - "attribute_map": { - "collection_name": "collection_name", - }, - "location_map": { - "collection_name": "path", - }, + "openapi_types": {"collection_name": (str,)}, + "attribute_map": {"collection_name": "collection_name"}, + "location_map": {"collection_name": "path"}, "collection_format_map": {}, }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, callable=__describe_collection, ) @@ -641,12 +575,8 @@ def __describe_index(self, index_name, **kwargs): "servers": None, }, params_map={ - "all": [ - "index_name", - ], - "required": [ - "index_name", - ], + "all": ["index_name"], + "required": ["index_name"], "nullable": [], "enum": [], "validation": [], @@ -654,21 +584,12 @@ def __describe_index(self, index_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "index_name": (str,), - }, - "attribute_map": { - "index_name": "index_name", - }, - "location_map": { - "index_name": "path", - }, + "openapi_types": {"index_name": (str,)}, + "attribute_map": {"index_name": "index_name"}, + "location_map": {"index_name": "path"}, "collection_format_map": {}, }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, callable=__describe_index, ) @@ -737,10 +658,7 @@ def __list_collections(self, **kwargs): "location_map": {}, "collection_format_map": {}, }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, callable=__list_collections, ) @@ -809,10 +727,7 @@ def __list_indexes(self, **kwargs): "location_map": {}, "collection_format_map": {}, }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, callable=__list_indexes, ) diff --git a/pinecone/core/openapi/data/apis/__init__.py b/pinecone/core/openapi/db_control/apis/__init__.py similarity index 72% rename from pinecone/core/openapi/data/apis/__init__.py rename to pinecone/core/openapi/db_control/apis/__init__.py index 81a897ea..c8258414 100644 --- a/pinecone/core/openapi/data/apis/__init__.py +++ b/pinecone/core/openapi/db_control/apis/__init__.py @@ -5,7 +5,7 @@ # raise a `RecursionError`. # In order to avoid this, import only the API that you directly need like: # -# from .api.data_plane_api import DataPlaneApi +# from .api.manage_indexes_api import ManageIndexesApi # # or import this package, but before doing it, use: # @@ -13,4 +13,4 @@ # sys.setrecursionlimit(n) # Import APIs into API package: -from pinecone.core.openapi.data.api.data_plane_api import DataPlaneApi +from pinecone.core.openapi.db_control.api.manage_indexes_api import ManageIndexesApi diff --git a/pinecone/core/openapi/control/model/__init__.py b/pinecone/core/openapi/db_control/model/__init__.py similarity index 100% rename from pinecone/core/openapi/control/model/__init__.py rename to pinecone/core/openapi/db_control/model/__init__.py diff --git a/pinecone/core/openapi/control/model/collection_list.py b/pinecone/core/openapi/db_control/model/collection_list.py similarity index 90% rename from pinecone/core/openapi/control/model/collection_list.py rename to pinecone/core/openapi/db_control/model/collection_list.py index bb649956..7997edce 100644 --- a/pinecone/core/openapi/control/model/collection_list.py +++ b/pinecone/core/openapi/db_control/model/collection_list.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.collection_model import CollectionModel + from pinecone.core.openapi.db_control.model.collection_model import CollectionModel globals()["CollectionModel"] = CollectionModel @@ -70,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -94,7 +86,7 @@ def openapi_types(): """ lazy_import() return { - "collections": ([CollectionModel],), # noqa: E501 + "collections": ([CollectionModel],) # noqa: E501 } @cached_property @@ -102,7 +94,7 @@ def discriminator(): return None attribute_map = { - "collections": "collections", # noqa: E501 + "collections": "collections" # noqa: E501 } read_only_vars = {} @@ -159,10 +151,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -244,10 +233,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/collection_model.py b/pinecone/core/openapi/db_control/model/collection_model.py similarity index 92% rename from pinecone/core/openapi/control/model/collection_model.py rename to pinecone/core/openapi/db_control/model/collection_model.py index a48a7742..5dd8f5af 100644 --- a/pinecone/core/openapi/control/model/collection_model.py +++ b/pinecone/core/openapi/db_control/model/collection_model.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class CollectionModel(ModelNormal): @@ -58,15 +58,10 @@ class CollectionModel(ModelNormal): "INITIALIZING": "Initializing", "READY": "Ready", "TERMINATING": "Terminating", - }, + } } - validations = { - ("dimension",): { - "inclusive_maximum": 20000, - "inclusive_minimum": 1, - }, - } + validations = {("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}} @cached_property def additional_properties_type(): @@ -74,15 +69,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -179,10 +166,7 @@ def _from_openapi_data(cls, name, status, environment, *args, **kwargs): # noqa if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -274,10 +258,7 @@ def __init__(self, name, status, environment, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/configure_index_request.py b/pinecone/core/openapi/db_control/model/configure_index_request.py similarity index 90% rename from pinecone/core/openapi/control/model/configure_index_request.py rename to pinecone/core/openapi/db_control/model/configure_index_request.py index c3dbce06..042600c8 100644 --- a/pinecone/core/openapi/control/model/configure_index_request.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,16 +25,20 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.configure_index_request_spec import ConfigureIndexRequestSpec - from pinecone.core.openapi.control.model.deletion_protection import DeletionProtection + from pinecone.core.openapi.db_control.model.configure_index_request_spec import ( + ConfigureIndexRequestSpec, + ) + from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection + from pinecone.core.openapi.db_control.model.index_tags import IndexTags globals()["ConfigureIndexRequestSpec"] = ConfigureIndexRequestSpec globals()["DeletionProtection"] = DeletionProtection + globals()["IndexTags"] = IndexTags class ConfigureIndexRequest(ModelNormal): @@ -72,15 +76,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,6 +94,7 @@ def openapi_types(): return { "spec": (ConfigureIndexRequestSpec,), # noqa: E501 "deletion_protection": (DeletionProtection,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 } @cached_property @@ -107,6 +104,7 @@ def discriminator(): attribute_map = { "spec": "spec", # noqa: E501 "deletion_protection": "deletion_protection", # noqa: E501 + "tags": "tags", # noqa: E501 } read_only_vars = {} @@ -151,6 +149,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) spec (ConfigureIndexRequestSpec): [optional] # noqa: E501 deletion_protection (DeletionProtection): [optional] # noqa: E501 + tags (IndexTags): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -164,10 +163,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -239,6 +235,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) spec (ConfigureIndexRequestSpec): [optional] # noqa: E501 deletion_protection (DeletionProtection): [optional] # noqa: E501 + tags (IndexTags): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -250,10 +247,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/configure_index_request_spec.py b/pinecone/core/openapi/db_control/model/configure_index_request_spec.py similarity index 90% rename from pinecone/core/openapi/control/model/configure_index_request_spec.py rename to pinecone/core/openapi/db_control/model/configure_index_request_spec.py index 58f9b772..b5e0b115 100644 --- a/pinecone/core/openapi/control/model/configure_index_request_spec.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request_spec.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,14 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.configure_index_request_spec_pod import ConfigureIndexRequestSpecPod + from pinecone.core.openapi.db_control.model.configure_index_request_spec_pod import ( + ConfigureIndexRequestSpecPod, + ) globals()["ConfigureIndexRequestSpecPod"] = ConfigureIndexRequestSpecPod @@ -70,15 +72,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -94,7 +88,7 @@ def openapi_types(): """ lazy_import() return { - "pod": (ConfigureIndexRequestSpecPod,), # noqa: E501 + "pod": (ConfigureIndexRequestSpecPod,) # noqa: E501 } @cached_property @@ -102,7 +96,7 @@ def discriminator(): return None attribute_map = { - "pod": "pod", # noqa: E501 + "pod": "pod" # noqa: E501 } read_only_vars = {} @@ -161,10 +155,7 @@ def _from_openapi_data(cls, pod, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -249,10 +240,7 @@ def __init__(self, pod, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/configure_index_request_spec_pod.py b/pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py similarity index 92% rename from pinecone/core/openapi/control/model/configure_index_request_spec_pod.py rename to pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py index 229559fb..01793eb5 100644 --- a/pinecone/core/openapi/control/model/configure_index_request_spec_pod.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class ConfigureIndexRequestSpecPod(ModelNormal): @@ -55,11 +55,7 @@ class ConfigureIndexRequestSpecPod(ModelNormal): allowed_values = {} - validations = { - ("replicas",): { - "inclusive_minimum": 1, - }, - } + validations = {("replicas",): {"inclusive_minimum": 1}} @cached_property def additional_properties_type(): @@ -67,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -158,10 +146,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -244,10 +229,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/create_collection_request.py b/pinecone/core/openapi/db_control/model/create_collection_request.py similarity index 91% rename from pinecone/core/openapi/control/model/create_collection_request.py rename to pinecone/core/openapi/db_control/model/create_collection_request.py index f59ed19c..0677a63d 100644 --- a/pinecone/core/openapi/control/model/create_collection_request.py +++ b/pinecone/core/openapi/db_control/model/create_collection_request.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class CreateCollectionRequest(ModelNormal): @@ -55,12 +55,7 @@ class CreateCollectionRequest(ModelNormal): allowed_values = {} - validations = { - ("name",): { - "max_length": 45, - "min_length": 1, - }, - } + validations = {("name",): {"max_length": 45, "min_length": 1}} @cached_property def additional_properties_type(): @@ -68,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -161,10 +148,7 @@ def _from_openapi_data(cls, name, source, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -251,10 +235,7 @@ def __init__(self, name, source, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/create_index_request.py b/pinecone/core/openapi/db_control/model/create_index_request.py similarity index 89% rename from pinecone/core/openapi/control/model/create_index_request.py rename to pinecone/core/openapi/db_control/model/create_index_request.py index 22f3a20f..815d0931 100644 --- a/pinecone/core/openapi/control/model/create_index_request.py +++ b/pinecone/core/openapi/db_control/model/create_index_request.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,16 +25,18 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.deletion_protection import DeletionProtection - from pinecone.core.openapi.control.model.index_spec import IndexSpec + from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection + from pinecone.core.openapi.db_control.model.index_spec import IndexSpec + from pinecone.core.openapi.db_control.model.index_tags import IndexTags globals()["DeletionProtection"] = DeletionProtection globals()["IndexSpec"] = IndexSpec + globals()["IndexTags"] = IndexTags class CreateIndexRequest(ModelNormal): @@ -62,22 +64,12 @@ class CreateIndexRequest(ModelNormal): """ allowed_values = { - ("metric",): { - "COSINE": "cosine", - "EUCLIDEAN": "euclidean", - "DOTPRODUCT": "dotproduct", - }, + ("metric",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} } validations = { - ("name",): { - "max_length": 45, - "min_length": 1, - }, - ("dimension",): { - "inclusive_maximum": 20000, - "inclusive_minimum": 1, - }, + ("name",): {"max_length": 45, "min_length": 1}, + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, } @cached_property @@ -87,15 +79,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -116,6 +100,7 @@ def openapi_types(): "spec": (IndexSpec,), # noqa: E501 "metric": (str,), # noqa: E501 "deletion_protection": (DeletionProtection,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 } @cached_property @@ -128,6 +113,7 @@ def discriminator(): "spec": "spec", # noqa: E501 "metric": "metric", # noqa: E501 "deletion_protection": "deletion_protection", # noqa: E501 + "tags": "tags", # noqa: E501 } read_only_vars = {} @@ -177,6 +163,7 @@ def _from_openapi_data(cls, name, dimension, spec, *args, **kwargs): # noqa: E5 _visited_composed_classes = (Animal,) metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine" # noqa: E501 deletion_protection (DeletionProtection): [optional] # noqa: E501 + tags (IndexTags): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -190,10 +177,7 @@ def _from_openapi_data(cls, name, dimension, spec, *args, **kwargs): # noqa: E5 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -273,6 +257,7 @@ def __init__(self, name, dimension, spec, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine" # noqa: E501 deletion_protection (DeletionProtection): [optional] # noqa: E501 + tags (IndexTags): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -284,10 +269,7 @@ def __init__(self, name, dimension, spec, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/deletion_protection.py b/pinecone/core/openapi/db_control/model/deletion_protection.py similarity index 89% rename from pinecone/core/openapi/control/model/deletion_protection.py rename to pinecone/core/openapi/db_control/model/deletion_protection.py index f18a6249..9b3a7255 100644 --- a/pinecone/core/openapi/control/model/deletion_protection.py +++ b/pinecone/core/openapi/db_control/model/deletion_protection.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class DeletionProtection(ModelSimple): @@ -49,12 +49,7 @@ class DeletionProtection(ModelSimple): as additional properties values. """ - allowed_values = { - ("value",): { - "DISABLED": "disabled", - "ENABLED": "enabled", - }, - } + allowed_values = {("value",): {"DISABLED": "disabled", "ENABLED": "enabled"}} validations = {} @@ -64,15 +59,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,9 +73,7 @@ def openapi_types(): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return { - "value": (str,), - } + return {"value": (str,)} @cached_property def discriminator(): @@ -172,10 +157,7 @@ def __init__(self, *args, **kwargs): if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -190,10 +172,7 @@ def __init__(self, *args, **kwargs): if kwargs: raise PineconeApiTypeError( "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), + % (kwargs, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -262,10 +241,7 @@ def _from_openapi_data(cls, *args, **kwargs): if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -280,10 +256,7 @@ def _from_openapi_data(cls, *args, **kwargs): if kwargs: raise PineconeApiTypeError( "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), + % (kwargs, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/error_response.py b/pinecone/core/openapi/db_control/model/error_response.py similarity index 91% rename from pinecone/core/openapi/control/model/error_response.py rename to pinecone/core/openapi/db_control/model/error_response.py index 0f6ac1ec..a03563f7 100644 --- a/pinecone/core/openapi/control/model/error_response.py +++ b/pinecone/core/openapi/db_control/model/error_response.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.error_response_error import ErrorResponseError + from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError globals()["ErrorResponseError"] = ErrorResponseError @@ -70,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -164,10 +156,7 @@ def _from_openapi_data(cls, status, error, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -254,10 +243,7 @@ def __init__(self, status, error, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/error_response_error.py b/pinecone/core/openapi/db_control/model/error_response_error.py similarity index 93% rename from pinecone/core/openapi/control/model/error_response_error.py rename to pinecone/core/openapi/db_control/model/error_response_error.py index 7289dc21..1e002870 100644 --- a/pinecone/core/openapi/control/model/error_response_error.py +++ b/pinecone/core/openapi/db_control/model/error_response_error.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class ErrorResponseError(ModelNormal): @@ -74,7 +74,8 @@ class ErrorResponseError(ModelNormal): "DATA_LOSS": "DATA_LOSS", "FORBIDDEN": "FORBIDDEN", "UNPROCESSABLE_ENTITY": "UNPROCESSABLE_ENTITY", - }, + "PAYMENT_REQUIRED": "PAYMENT_REQUIRED", + } } validations = {} @@ -85,15 +86,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -181,10 +174,7 @@ def _from_openapi_data(cls, code, message, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -272,10 +262,7 @@ def __init__(self, code, message, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/index_list.py b/pinecone/core/openapi/db_control/model/index_list.py similarity index 90% rename from pinecone/core/openapi/control/model/index_list.py rename to pinecone/core/openapi/db_control/model/index_list.py index 62a5656c..865e00db 100644 --- a/pinecone/core/openapi/control/model/index_list.py +++ b/pinecone/core/openapi/db_control/model/index_list.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.index_model import IndexModel + from pinecone.core.openapi.db_control.model.index_model import IndexModel globals()["IndexModel"] = IndexModel @@ -70,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -94,7 +86,7 @@ def openapi_types(): """ lazy_import() return { - "indexes": ([IndexModel],), # noqa: E501 + "indexes": ([IndexModel],) # noqa: E501 } @cached_property @@ -102,7 +94,7 @@ def discriminator(): return None attribute_map = { - "indexes": "indexes", # noqa: E501 + "indexes": "indexes" # noqa: E501 } read_only_vars = {} @@ -159,10 +151,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -244,10 +233,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/index_model.py b/pinecone/core/openapi/db_control/model/index_model.py similarity index 89% rename from pinecone/core/openapi/control/model/index_model.py rename to pinecone/core/openapi/db_control/model/index_model.py index 8baac932..95879ae7 100644 --- a/pinecone/core/openapi/control/model/index_model.py +++ b/pinecone/core/openapi/db_control/model/index_model.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,18 +25,20 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.deletion_protection import DeletionProtection - from pinecone.core.openapi.control.model.index_model_spec import IndexModelSpec - from pinecone.core.openapi.control.model.index_model_status import IndexModelStatus + from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection + from pinecone.core.openapi.db_control.model.index_model_spec import IndexModelSpec + from pinecone.core.openapi.db_control.model.index_model_status import IndexModelStatus + from pinecone.core.openapi.db_control.model.index_tags import IndexTags globals()["DeletionProtection"] = DeletionProtection globals()["IndexModelSpec"] = IndexModelSpec globals()["IndexModelStatus"] = IndexModelStatus + globals()["IndexTags"] = IndexTags class IndexModel(ModelNormal): @@ -64,22 +66,12 @@ class IndexModel(ModelNormal): """ allowed_values = { - ("metric",): { - "COSINE": "cosine", - "EUCLIDEAN": "euclidean", - "DOTPRODUCT": "dotproduct", - }, + ("metric",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} } validations = { - ("name",): { - "max_length": 45, - "min_length": 1, - }, - ("dimension",): { - "inclusive_maximum": 20000, - "inclusive_minimum": 1, - }, + ("name",): {"max_length": 45, "min_length": 1}, + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, } @cached_property @@ -89,15 +81,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -120,6 +104,7 @@ def openapi_types(): "spec": (IndexModelSpec,), # noqa: E501 "status": (IndexModelStatus,), # noqa: E501 "deletion_protection": (DeletionProtection,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 } @cached_property @@ -134,6 +119,7 @@ def discriminator(): "spec": "spec", # noqa: E501 "status": "status", # noqa: E501 "deletion_protection": "deletion_protection", # noqa: E501 + "tags": "tags", # noqa: E501 } read_only_vars = {} @@ -185,6 +171,7 @@ def _from_openapi_data(cls, name, dimension, host, spec, status, *args, **kwargs through its discriminator because we passed in _visited_composed_classes = (Animal,) deletion_protection (DeletionProtection): [optional] # noqa: E501 + tags (IndexTags): [optional] # noqa: E501 """ metric = kwargs.get("metric", "cosine") @@ -199,10 +186,7 @@ def _from_openapi_data(cls, name, dimension, host, spec, status, *args, **kwargs if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -287,6 +271,7 @@ def __init__(self, name, dimension, host, spec, status, *args, **kwargs): # noq through its discriminator because we passed in _visited_composed_classes = (Animal,) deletion_protection (DeletionProtection): [optional] # noqa: E501 + tags (IndexTags): [optional] # noqa: E501 """ metric = kwargs.get("metric", "cosine") @@ -299,10 +284,7 @@ def __init__(self, name, dimension, host, spec, status, *args, **kwargs): # noq if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/index_model_spec.py b/pinecone/core/openapi/db_control/model/index_model_spec.py similarity index 91% rename from pinecone/core/openapi/control/model/index_model_spec.py rename to pinecone/core/openapi/db_control/model/index_model_spec.py index dc723e39..086ff60e 100644 --- a/pinecone/core/openapi/control/model/index_model_spec.py +++ b/pinecone/core/openapi/db_control/model/index_model_spec.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,13 +25,13 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.pod_spec import PodSpec - from pinecone.core.openapi.control.model.serverless_spec import ServerlessSpec + from pinecone.core.openapi.db_control.model.pod_spec import PodSpec + from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec globals()["PodSpec"] = PodSpec globals()["ServerlessSpec"] = ServerlessSpec @@ -72,15 +72,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -164,10 +156,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -250,10 +239,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/index_model_status.py b/pinecone/core/openapi/db_control/model/index_model_status.py similarity index 92% rename from pinecone/core/openapi/control/model/index_model_status.py rename to pinecone/core/openapi/db_control/model/index_model_status.py index 4cb6edaf..01265912 100644 --- a/pinecone/core/openapi/control/model/index_model_status.py +++ b/pinecone/core/openapi/db_control/model/index_model_status.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class IndexModelStatus(ModelNormal): @@ -63,7 +63,7 @@ class IndexModelStatus(ModelNormal): "SCALINGDOWNPODSIZE": "ScalingDownPodSize", "TERMINATING": "Terminating", "READY": "Ready", - }, + } } validations = {} @@ -74,15 +74,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -167,10 +159,7 @@ def _from_openapi_data(cls, ready, state, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -257,10 +246,7 @@ def __init__(self, ready, state, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/index_spec.py b/pinecone/core/openapi/db_control/model/index_spec.py similarity index 92% rename from pinecone/core/openapi/control/model/index_spec.py rename to pinecone/core/openapi/db_control/model/index_spec.py index 195daedc..58afeca7 100644 --- a/pinecone/core/openapi/control/model/index_spec.py +++ b/pinecone/core/openapi/db_control/model/index_spec.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,13 +25,13 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.pod_spec import PodSpec - from pinecone.core.openapi.control.model.serverless_spec import ServerlessSpec + from pinecone.core.openapi.db_control.model.pod_spec import PodSpec + from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec globals()["PodSpec"] = PodSpec globals()["ServerlessSpec"] = ServerlessSpec @@ -149,10 +149,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -235,10 +232,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/embeddings_list_usage.py b/pinecone/core/openapi/db_control/model/index_tags.py similarity index 88% rename from pinecone/core/openapi/control/model/embeddings_list_usage.py rename to pinecone/core/openapi/db_control/model/index_tags.py index d09e31ec..1ea5266e 100644 --- a/pinecone/core/openapi/control/model/embeddings_list_usage.py +++ b/pinecone/core/openapi/db_control/model/index_tags.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,11 +25,11 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError -class EmbeddingsListUsage(ModelNormal): +class IndexTags(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -63,17 +63,9 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False + return (str,) # noqa: E501 + + _nullable = True @cached_property def openapi_types(): @@ -85,17 +77,13 @@ def openapi_types(): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return { - "total_tokens": (int,), # noqa: E501 - } + return {} @cached_property def discriminator(): return None - attribute_map = { - "total_tokens": "total_tokens", # noqa: E501 - } + attribute_map = {} read_only_vars = {} @@ -104,7 +92,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddingsListUsage - a model defined in OpenAPI + """IndexTags - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -137,7 +125,6 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - total_tokens (int): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -151,10 +138,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -191,7 +175,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddingsListUsage - a model defined in OpenAPI + """IndexTags - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -224,7 +208,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - total_tokens (int): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -236,10 +219,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/pod_spec.py b/pinecone/core/openapi/db_control/model/pod_spec.py similarity index 86% rename from pinecone/core/openapi/control/model/pod_spec.py rename to pinecone/core/openapi/db_control/model/pod_spec.py index 0996dfca..2ba224d7 100644 --- a/pinecone/core/openapi/control/model/pod_spec.py +++ b/pinecone/core/openapi/db_control/model/pod_spec.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,14 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.pod_spec_metadata_config import PodSpecMetadataConfig + from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import ( + PodSpecMetadataConfig, + ) globals()["PodSpecMetadataConfig"] = PodSpecMetadataConfig @@ -62,15 +64,9 @@ class PodSpec(ModelNormal): allowed_values = {} validations = { - ("replicas",): { - "inclusive_minimum": 1, - }, - ("shards",): { - "inclusive_minimum": 1, - }, - ("pods",): { - "inclusive_minimum": 1, - }, + ("replicas",): {"inclusive_minimum": 1}, + ("shards",): {"inclusive_minimum": 1}, + ("pods",): {"inclusive_minimum": 1}, } @cached_property @@ -80,15 +76,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -105,9 +93,9 @@ def openapi_types(): lazy_import() return { "environment": (str,), # noqa: E501 + "pod_type": (str,), # noqa: E501 "replicas": (int,), # noqa: E501 "shards": (int,), # noqa: E501 - "pod_type": (str,), # noqa: E501 "pods": (int,), # noqa: E501 "metadata_config": (PodSpecMetadataConfig,), # noqa: E501 "source_collection": (str,), # noqa: E501 @@ -119,9 +107,9 @@ def discriminator(): attribute_map = { "environment": "environment", # noqa: E501 + "pod_type": "pod_type", # noqa: E501 "replicas": "replicas", # noqa: E501 "shards": "shards", # noqa: E501 - "pod_type": "pod_type", # noqa: E501 "pods": "pods", # noqa: E501 "metadata_config": "metadata_config", # noqa: E501 "source_collection": "source_collection", # noqa: E501 @@ -140,10 +128,7 @@ def _from_openapi_data(cls, environment, *args, **kwargs): # noqa: E501 environment (str): The environment where the index is hosted. Keyword Args: - replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.. defaults to 1 # noqa: E501 - shards (int): The number of shards. Shards split your data across multiple pods so you can fit more data into an index.. defaults to 1 # noqa: E501 pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. defaults to "p1.x1" # noqa: E501 - pods (int): The number of pods to be used in the index. This should be equal to `shards` x `replicas`.'. defaults to 1 # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -174,14 +159,14 @@ def _from_openapi_data(cls, environment, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.. [optional] if omitted the server will use the default value of 1 # noqa: E501 + shards (int): The number of shards. Shards split your data across multiple pods so you can fit more data into an index.. [optional] if omitted the server will use the default value of 1 # noqa: E501 + pods (int): The number of pods to be used in the index. This should be equal to `shards` x `replicas`.'. [optional] if omitted the server will use the default value of 1 # noqa: E501 metadata_config (PodSpecMetadataConfig): [optional] # noqa: E501 source_collection (str): The name of the collection to be used as the source for the index.. [optional] # noqa: E501 """ - replicas = kwargs.get("replicas", 1) - shards = kwargs.get("shards", 1) pod_type = kwargs.get("pod_type", "p1.x1") - pods = kwargs.get("pods", 1) _check_type = kwargs.pop("_check_type", True) _spec_property_naming = kwargs.pop("_spec_property_naming", False) _path_to_item = kwargs.pop("_path_to_item", ()) @@ -193,10 +178,7 @@ def _from_openapi_data(cls, environment, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -209,10 +191,7 @@ def _from_openapi_data(cls, environment, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.environment = environment - self.replicas = replicas - self.shards = shards self.pod_type = pod_type - self.pods = pods for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -244,10 +223,7 @@ def __init__(self, environment, *args, **kwargs): # noqa: E501 environment (str): The environment where the index is hosted. Keyword Args: - replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.. defaults to 1 # noqa: E501 - shards (int): The number of shards. Shards split your data across multiple pods so you can fit more data into an index.. defaults to 1 # noqa: E501 pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. defaults to "p1.x1" # noqa: E501 - pods (int): The number of pods to be used in the index. This should be equal to `shards` x `replicas`.'. defaults to 1 # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -278,14 +254,14 @@ def __init__(self, environment, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.. [optional] if omitted the server will use the default value of 1 # noqa: E501 + shards (int): The number of shards. Shards split your data across multiple pods so you can fit more data into an index.. [optional] if omitted the server will use the default value of 1 # noqa: E501 + pods (int): The number of pods to be used in the index. This should be equal to `shards` x `replicas`.'. [optional] if omitted the server will use the default value of 1 # noqa: E501 metadata_config (PodSpecMetadataConfig): [optional] # noqa: E501 source_collection (str): The name of the collection to be used as the source for the index.. [optional] # noqa: E501 """ - replicas = kwargs.get("replicas", 1) - shards = kwargs.get("shards", 1) pod_type = kwargs.get("pod_type", "p1.x1") - pods = kwargs.get("pods", 1) _check_type = kwargs.pop("_check_type", True) _spec_property_naming = kwargs.pop("_spec_property_naming", False) _path_to_item = kwargs.pop("_path_to_item", ()) @@ -295,10 +271,7 @@ def __init__(self, environment, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -311,10 +284,7 @@ def __init__(self, environment, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.environment = environment - self.replicas = replicas - self.shards = shards self.pod_type = pod_type - self.pods = pods for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/pinecone/core/openapi/control/model/pod_spec_metadata_config.py b/pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py similarity index 91% rename from pinecone/core/openapi/control/model/pod_spec_metadata_config.py rename to pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py index 99a99c09..007f30ef 100644 --- a/pinecone/core/openapi/control/model/pod_spec_metadata_config.py +++ b/pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class PodSpecMetadataConfig(ModelNormal): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "indexed": ([str],), # noqa: E501 + "indexed": ([str],) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "indexed": "indexed", # noqa: E501 + "indexed": "indexed" # noqa: E501 } read_only_vars = {} @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/serverless_spec.py b/pinecone/core/openapi/db_control/model/serverless_spec.py similarity index 91% rename from pinecone/core/openapi/control/model/serverless_spec.py rename to pinecone/core/openapi/db_control/model/serverless_spec.py index 42f55239..f5841c56 100644 --- a/pinecone/core/openapi/control/model/serverless_spec.py +++ b/pinecone/core/openapi/db_control/model/serverless_spec.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class ServerlessSpec(ModelNormal): @@ -53,13 +53,7 @@ class ServerlessSpec(ModelNormal): as additional properties values. """ - allowed_values = { - ("cloud",): { - "GCP": "gcp", - "AWS": "aws", - "AZURE": "azure", - }, - } + allowed_values = {("cloud",): {"GCP": "gcp", "AWS": "aws", "AZURE": "azure"}} validations = {} @@ -69,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -162,10 +148,7 @@ def _from_openapi_data(cls, cloud, region, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -252,10 +235,7 @@ def __init__(self, cloud, region, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/db_control/models/__init__.py b/pinecone/core/openapi/db_control/models/__init__.py new file mode 100644 index 00000000..44249eb1 --- /dev/null +++ b/pinecone/core/openapi/db_control/models/__init__.py @@ -0,0 +1,34 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from pinecone.core.openapi.db_control.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from pinecone.core.openapi.db_control.model.collection_list import CollectionList +from pinecone.core.openapi.db_control.model.collection_model import CollectionModel +from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest +from pinecone.core.openapi.db_control.model.configure_index_request_spec import ( + ConfigureIndexRequestSpec, +) +from pinecone.core.openapi.db_control.model.configure_index_request_spec_pod import ( + ConfigureIndexRequestSpecPod, +) +from pinecone.core.openapi.db_control.model.create_collection_request import CreateCollectionRequest +from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest +from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection +from pinecone.core.openapi.db_control.model.error_response import ErrorResponse +from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError +from pinecone.core.openapi.db_control.model.index_list import IndexList +from pinecone.core.openapi.db_control.model.index_model import IndexModel +from pinecone.core.openapi.db_control.model.index_model_spec import IndexModelSpec +from pinecone.core.openapi.db_control.model.index_model_status import IndexModelStatus +from pinecone.core.openapi.db_control.model.index_spec import IndexSpec +from pinecone.core.openapi.db_control.model.index_tags import IndexTags +from pinecone.core.openapi.db_control.model.pod_spec import PodSpec +from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig +from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec diff --git a/pinecone/core/openapi/db_data/__init__.py b/pinecone/core/openapi/db_data/__init__.py new file mode 100644 index 00000000..e19083f0 --- /dev/null +++ b/pinecone/core/openapi/db_data/__init__.py @@ -0,0 +1,29 @@ +# flake8: noqa + +""" +Pinecone Data Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech +""" + +__version__ = "1.0.0" + +# import ApiClient +from pinecone.openapi_support import ApiClient + +# import Configuration +from pinecone.openapi_support import Configuration + +# import exceptions +from pinecone.openapi_support.exceptions import PineconeException +from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.exceptions import PineconeApiTypeError +from pinecone.openapi_support.exceptions import PineconeApiValueError +from pinecone.openapi_support.exceptions import PineconeApiKeyError +from pinecone.openapi_support.exceptions import PineconeApiException + +API_VERSION = "2024-10" diff --git a/pinecone/core/openapi/data/api/__init__.py b/pinecone/core/openapi/db_data/api/__init__.py similarity index 72% rename from pinecone/core/openapi/data/api/__init__.py rename to pinecone/core/openapi/db_data/api/__init__.py index 5f4a45d5..9adc008c 100644 --- a/pinecone/core/openapi/data/api/__init__.py +++ b/pinecone/core/openapi/db_data/api/__init__.py @@ -1,3 +1,3 @@ # do not import all apis into this module because that uses a lot of memory and stack frames # if you need the ability to import all apis from one package, import them with -# from pinecone.core.openapi.data.apis import DataPlaneApi +# from pinecone.core.openapi.db_data.apis import BulkOperationsApi diff --git a/pinecone/core/openapi/db_data/api/bulk_operations_api.py b/pinecone/core/openapi/db_data/api/bulk_operations_api.py new file mode 100644 index 00000000..ab391fee --- /dev/null +++ b/pinecone/core/openapi/db_data/api/bulk_operations_api.py @@ -0,0 +1,352 @@ +""" +Pinecone Data Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from pinecone.openapi_support import ApiClient, Endpoint as _Endpoint +from pinecone.openapi_support import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types, +) +from pinecone.core.openapi.db_data.model.import_model import ImportModel +from pinecone.core.openapi.db_data.model.list_imports_response import ListImportsResponse +from pinecone.core.openapi.db_data.model.rpc_status import RpcStatus +from pinecone.core.openapi.db_data.model.start_import_request import StartImportRequest +from pinecone.core.openapi.db_data.model.start_import_response import StartImportResponse + + +class BulkOperationsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __cancel_bulk_import(self, id, **kwargs): + """Cancel an import # noqa: E501 + + The `cancel_import` operation cancels 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/data/import-data). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.cancel_bulk_import(id, async_req=True) + >>> result = thread.get() + + Args: + id (str): Unique identifier for the import operation. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["id"] = id + return self.call_with_http_info(**kwargs) + + self.cancel_bulk_import = _Endpoint( + settings={ + "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports/{id}", + "operation_id": "cancel_bulk_import", + "http_method": "DELETE", + "servers": None, + }, + params_map={ + "all": ["id"], + "required": ["id"], + "nullable": [], + "enum": [], + "validation": ["id"], + }, + root_map={ + "validations": {("id",): {"max_length": 1000, "min_length": 1}}, + "allowed_values": {}, + "openapi_types": {"id": (str,)}, + "attribute_map": {"id": "id"}, + "location_map": {"id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__cancel_bulk_import, + ) + + def __describe_bulk_import(self, id, **kwargs): + """Describe an import # noqa: E501 + + The `describe_import` operation returns details of a specific import operation. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.describe_bulk_import(id, async_req=True) + >>> result = thread.get() + + Args: + id (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ImportModel + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["id"] = id + return self.call_with_http_info(**kwargs) + + self.describe_bulk_import = _Endpoint( + settings={ + "response_type": (ImportModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports/{id}", + "operation_id": "describe_bulk_import", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["id"], + "required": ["id"], + "nullable": [], + "enum": [], + "validation": ["id"], + }, + root_map={ + "validations": {("id",): {"max_length": 1000, "min_length": 1}}, + "allowed_values": {}, + "openapi_types": {"id": (str,)}, + "attribute_map": {"id": "id"}, + "location_map": {"id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__describe_bulk_import, + ) + + def __list_bulk_imports(self, **kwargs): + """List imports # noqa: E501 + + The `list_imports` operation lists all recent and ongoing import operations. By default, `list_imports` returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_bulk_imports(async_req=True) + >>> result = thread.get() + + + Keyword Args: + limit (int): Max number of operations to return per page.. [optional] + pagination_token (str): Pagination token to continue a previous listing operation.. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ListImportsResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + return self.call_with_http_info(**kwargs) + + self.list_bulk_imports = _Endpoint( + settings={ + "response_type": (ListImportsResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports", + "operation_id": "list_bulk_imports", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["limit", "pagination_token"], + "required": [], + "nullable": [], + "enum": [], + "validation": ["limit"], + }, + root_map={ + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "openapi_types": {"limit": (int,), "pagination_token": (str,)}, + "attribute_map": {"limit": "limit", "pagination_token": "paginationToken"}, + "location_map": {"limit": "query", "pagination_token": "query"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_bulk_imports, + ) + + def __start_bulk_import(self, start_import_request, **kwargs): + """Start import # noqa: E501 + + The `start_import` operation starts an asynchronous import of vectors from object storage into an index. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.start_bulk_import(start_import_request, async_req=True) + >>> result = thread.get() + + Args: + start_import_request (StartImportRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + StartImportResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["start_import_request"] = start_import_request + return self.call_with_http_info(**kwargs) + + self.start_bulk_import = _Endpoint( + settings={ + "response_type": (StartImportResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports", + "operation_id": "start_bulk_import", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["start_import_request"], + "required": ["start_import_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"start_import_request": (StartImportRequest,)}, + "attribute_map": {}, + "location_map": {"start_import_request": "body"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__start_bulk_import, + ) diff --git a/pinecone/core/openapi/data/api/data_plane_api.py b/pinecone/core/openapi/db_data/api/vector_operations_api.py similarity index 64% rename from pinecone/core/openapi/data/api/data_plane_api.py rename to pinecone/core/openapi/db_data/api/vector_operations_api.py index 5b20277a..2979d1fe 100644 --- a/pinecone/core/openapi/data/api/data_plane_api.py +++ b/pinecone/core/openapi/db_data/api/vector_operations_api.py @@ -1,18 +1,18 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.api_client import ApiClient, Endpoint as _Endpoint -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ApiClient, Endpoint as _Endpoint +from pinecone.openapi_support import ( # noqa: F401 check_allowed_values, check_validations, date, @@ -21,20 +21,22 @@ none_type, validate_and_convert_types, ) -from pinecone.core.openapi.data.model.delete_request import DeleteRequest -from pinecone.core.openapi.data.model.describe_index_stats_request import DescribeIndexStatsRequest -from pinecone.core.openapi.data.model.describe_index_stats_response import DescribeIndexStatsResponse -from pinecone.core.openapi.data.model.fetch_response import FetchResponse -from pinecone.core.openapi.data.model.list_response import ListResponse -from pinecone.core.openapi.data.model.query_request import QueryRequest -from pinecone.core.openapi.data.model.query_response import QueryResponse -from pinecone.core.openapi.data.model.rpc_status import RpcStatus -from pinecone.core.openapi.data.model.update_request import UpdateRequest -from pinecone.core.openapi.data.model.upsert_request import UpsertRequest -from pinecone.core.openapi.data.model.upsert_response import UpsertResponse - - -class DataPlaneApi(object): +from pinecone.core.openapi.db_data.model.delete_request import DeleteRequest +from pinecone.core.openapi.db_data.model.describe_index_stats_request import ( + DescribeIndexStatsRequest, +) +from pinecone.core.openapi.db_data.model.fetch_response import FetchResponse +from pinecone.core.openapi.db_data.model.index_description import IndexDescription +from pinecone.core.openapi.db_data.model.list_response import ListResponse +from pinecone.core.openapi.db_data.model.query_request import QueryRequest +from pinecone.core.openapi.db_data.model.query_response import QueryResponse +from pinecone.core.openapi.db_data.model.rpc_status import RpcStatus +from pinecone.core.openapi.db_data.model.update_request import UpdateRequest +from pinecone.core.openapi.db_data.model.upsert_request import UpsertRequest +from pinecone.core.openapi.db_data.model.upsert_response import UpsertResponse + + +class VectorOperationsApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -46,185 +48,14 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def __alt_delete(self, **kwargs): - """Delete vectors # noqa: E501 - - DEPRECATED. Use [`POST /delete`](https://docs.pinecone.io/reference/api/data-plane/delete) instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.alt_delete(async_req=True) - >>> result = thread.get() - - - Keyword Args: - ids ([str]): Vectors to delete.. [optional] - delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] if omitted the server will use the default value of False - namespace (str): The namespace to delete vectors from, if applicable.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.alt_delete = _Endpoint( - settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/delete", - "operation_id": "alt_delete", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "ids", - "delete_all", - "namespace", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "ids": ([str],), - "delete_all": (bool,), - "namespace": (str,), - }, - "attribute_map": { - "ids": "ids", - "delete_all": "deleteAll", - "namespace": "namespace", - }, - "location_map": { - "ids": "query", - "delete_all": "query", - "namespace": "query", - }, - "collection_format_map": { - "ids": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__alt_delete, - ) - - def __alt_describe_index_stats(self, **kwargs): - """Get index stats # noqa: E501 - - DEPRECATED. Use [`POST /describe_index_stats`](https://docs.pinecone.io/reference/api/data-plane/describeindexstats) instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.alt_describe_index_stats(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - DescribeIndexStatsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_host_index"] = kwargs.get("_host_index") - return self.call_with_http_info(**kwargs) - - self.alt_describe_index_stats = _Endpoint( - settings={ - "response_type": (DescribeIndexStatsResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/describe_index_stats", - "operation_id": "alt_describe_index_stats", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - callable=__alt_describe_index_stats, - ) - - def __delete(self, delete_request, **kwargs): + def __delete_vectors(self, delete_request, **kwargs): """Delete vectors # noqa: E501 The `delete` operation deletes vectors, by id, from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete(delete_request, async_req=True) + >>> thread = api.delete_vectors(delete_request, async_req=True) >>> result = thread.get() Args: @@ -266,22 +97,18 @@ def __delete(self, delete_request, **kwargs): kwargs["delete_request"] = delete_request return self.call_with_http_info(**kwargs) - self.delete = _Endpoint( + self.delete_vectors = _Endpoint( settings={ "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), "auth": ["ApiKeyAuth"], "endpoint_path": "/vectors/delete", - "operation_id": "delete", + "operation_id": "delete_vectors", "http_method": "POST", "servers": None, }, params_map={ - "all": [ - "delete_request", - ], - "required": [ - "delete_request", - ], + "all": ["delete_request"], + "required": ["delete_request"], "nullable": [], "enum": [], "validation": [], @@ -289,18 +116,14 @@ def __delete(self, delete_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "delete_request": (DeleteRequest,), - }, + "openapi_types": {"delete_request": (DeleteRequest,)}, "attribute_map": {}, - "location_map": { - "delete_request": "body", - }, + "location_map": {"delete_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__delete, + callable=__delete_vectors, ) def __describe_index_stats(self, describe_index_stats_request, **kwargs): @@ -338,7 +161,7 @@ def __describe_index_stats(self, describe_index_stats_request, **kwargs): async_req (bool): execute request asynchronously Returns: - DescribeIndexStatsResponse + IndexDescription If the method is called asynchronously, returns the request thread. """ @@ -354,7 +177,7 @@ def __describe_index_stats(self, describe_index_stats_request, **kwargs): self.describe_index_stats = _Endpoint( settings={ - "response_type": (DescribeIndexStatsResponse,), + "response_type": (IndexDescription,), "auth": ["ApiKeyAuth"], "endpoint_path": "/describe_index_stats", "operation_id": "describe_index_stats", @@ -362,12 +185,8 @@ def __describe_index_stats(self, describe_index_stats_request, **kwargs): "servers": None, }, params_map={ - "all": [ - "describe_index_stats_request", - ], - "required": [ - "describe_index_stats_request", - ], + "all": ["describe_index_stats_request"], + "required": ["describe_index_stats_request"], "nullable": [], "enum": [], "validation": [], @@ -375,13 +194,9 @@ def __describe_index_stats(self, describe_index_stats_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "describe_index_stats_request": (DescribeIndexStatsRequest,), - }, + "openapi_types": {"describe_index_stats_request": (DescribeIndexStatsRequest,)}, "attribute_map": {}, - "location_map": { - "describe_index_stats_request": "body", - }, + "location_map": {"describe_index_stats_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -389,14 +204,14 @@ def __describe_index_stats(self, describe_index_stats_request, **kwargs): callable=__describe_index_stats, ) - def __fetch(self, ids, **kwargs): + def __fetch_vectors(self, ids, **kwargs): """Fetch vectors # noqa: E501 The `fetch` operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fetch(ids, async_req=True) + >>> thread = api.fetch_vectors(ids, async_req=True) >>> result = thread.get() Args: @@ -439,23 +254,18 @@ def __fetch(self, ids, **kwargs): kwargs["ids"] = ids return self.call_with_http_info(**kwargs) - self.fetch = _Endpoint( + self.fetch_vectors = _Endpoint( settings={ "response_type": (FetchResponse,), "auth": ["ApiKeyAuth"], "endpoint_path": "/vectors/fetch", - "operation_id": "fetch", + "operation_id": "fetch_vectors", "http_method": "GET", "servers": None, }, params_map={ - "all": [ - "ids", - "namespace", - ], - "required": [ - "ids", - ], + "all": ["ids", "namespace"], + "required": ["ids"], "nullable": [], "enum": [], "validation": [], @@ -463,38 +273,24 @@ def __fetch(self, ids, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "ids": ([str],), - "namespace": (str,), - }, - "attribute_map": { - "ids": "ids", - "namespace": "namespace", - }, - "location_map": { - "ids": "query", - "namespace": "query", - }, - "collection_format_map": { - "ids": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], + "openapi_types": {"ids": ([str],), "namespace": (str,)}, + "attribute_map": {"ids": "ids", "namespace": "namespace"}, + "location_map": {"ids": "query", "namespace": "query"}, + "collection_format_map": {"ids": "multi"}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch, + callable=__fetch_vectors, ) - def __list(self, **kwargs): + def __list_vectors(self, **kwargs): """List vector IDs # noqa: E501 - The `list` operation lists 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. `list` returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. # noqa: E501 + The `list` operation lists 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. By default, `list` returns up to 100 IDs per page in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list_vectors` is supported only for serverless indexes. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list(async_req=True) + >>> thread = api.list_vectors(async_req=True) >>> result = thread.get() @@ -537,22 +333,17 @@ def __list(self, **kwargs): kwargs["_host_index"] = kwargs.get("_host_index") return self.call_with_http_info(**kwargs) - self.list = _Endpoint( + self.list_vectors = _Endpoint( settings={ "response_type": (ListResponse,), "auth": ["ApiKeyAuth"], "endpoint_path": "/vectors/list", - "operation_id": "list", + "operation_id": "list_vectors", "http_method": "GET", "servers": None, }, params_map={ - "all": [ - "prefix", - "limit", - "pagination_token", - "namespace", - ], + "all": ["prefix", "limit", "pagination_token", "namespace"], "required": [], "nullable": [], "enum": [], @@ -581,22 +372,19 @@ def __list(self, **kwargs): }, "collection_format_map": {}, }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list, + callable=__list_vectors, ) - def __query(self, query_request, **kwargs): + def __query_vectors(self, query_request, **kwargs): """Query vectors # noqa: E501 The `query` operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.query(query_request, async_req=True) + >>> thread = api.query_vectors(query_request, async_req=True) >>> result = thread.get() Args: @@ -638,22 +426,18 @@ def __query(self, query_request, **kwargs): kwargs["query_request"] = query_request return self.call_with_http_info(**kwargs) - self.query = _Endpoint( + self.query_vectors = _Endpoint( settings={ "response_type": (QueryResponse,), "auth": ["ApiKeyAuth"], "endpoint_path": "/query", - "operation_id": "query", + "operation_id": "query_vectors", "http_method": "POST", "servers": None, }, params_map={ - "all": [ - "query_request", - ], - "required": [ - "query_request", - ], + "all": ["query_request"], + "required": ["query_request"], "nullable": [], "enum": [], "validation": [], @@ -661,28 +445,24 @@ def __query(self, query_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "query_request": (QueryRequest,), - }, + "openapi_types": {"query_request": (QueryRequest,)}, "attribute_map": {}, - "location_map": { - "query_request": "body", - }, + "location_map": {"query_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__query, + callable=__query_vectors, ) - def __update(self, update_request, **kwargs): + def __update_vector(self, update_request, **kwargs): """Update a vector # noqa: E501 The `update` operation updates a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value. For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update(update_request, async_req=True) + >>> thread = api.update_vector(update_request, async_req=True) >>> result = thread.get() Args: @@ -724,22 +504,18 @@ def __update(self, update_request, **kwargs): kwargs["update_request"] = update_request return self.call_with_http_info(**kwargs) - self.update = _Endpoint( + self.update_vector = _Endpoint( settings={ "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), "auth": ["ApiKeyAuth"], "endpoint_path": "/vectors/update", - "operation_id": "update", + "operation_id": "update_vector", "http_method": "POST", "servers": None, }, params_map={ - "all": [ - "update_request", - ], - "required": [ - "update_request", - ], + "all": ["update_request"], + "required": ["update_request"], "nullable": [], "enum": [], "validation": [], @@ -747,28 +523,24 @@ def __update(self, update_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "update_request": (UpdateRequest,), - }, + "openapi_types": {"update_request": (UpdateRequest,)}, "attribute_map": {}, - "location_map": { - "update_request": "body", - }, + "location_map": {"update_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update, + callable=__update_vector, ) - def __upsert(self, upsert_request, **kwargs): + def __upsert_vectors(self, upsert_request, **kwargs): """Upsert vectors # noqa: E501 The `upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.upsert(upsert_request, async_req=True) + >>> thread = api.upsert_vectors(upsert_request, async_req=True) >>> result = thread.get() Args: @@ -810,22 +582,18 @@ def __upsert(self, upsert_request, **kwargs): kwargs["upsert_request"] = upsert_request return self.call_with_http_info(**kwargs) - self.upsert = _Endpoint( + self.upsert_vectors = _Endpoint( settings={ "response_type": (UpsertResponse,), "auth": ["ApiKeyAuth"], "endpoint_path": "/vectors/upsert", - "operation_id": "upsert", + "operation_id": "upsert_vectors", "http_method": "POST", "servers": None, }, params_map={ - "all": [ - "upsert_request", - ], - "required": [ - "upsert_request", - ], + "all": ["upsert_request"], + "required": ["upsert_request"], "nullable": [], "enum": [], "validation": [], @@ -833,16 +601,12 @@ def __upsert(self, upsert_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "upsert_request": (UpsertRequest,), - }, + "openapi_types": {"upsert_request": (UpsertRequest,)}, "attribute_map": {}, - "location_map": { - "upsert_request": "body", - }, + "location_map": {"upsert_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__upsert, + callable=__upsert_vectors, ) diff --git a/pinecone/core/openapi/control/apis/__init__.py b/pinecone/core/openapi/db_data/apis/__init__.py similarity index 61% rename from pinecone/core/openapi/control/apis/__init__.py rename to pinecone/core/openapi/db_data/apis/__init__.py index ee6d6a50..3d7112fd 100644 --- a/pinecone/core/openapi/control/apis/__init__.py +++ b/pinecone/core/openapi/db_data/apis/__init__.py @@ -5,7 +5,7 @@ # raise a `RecursionError`. # In order to avoid this, import only the API that you directly need like: # -# from .api.inference_api import InferenceApi +# from .api.bulk_operations_api import BulkOperationsApi # # or import this package, but before doing it, use: # @@ -13,5 +13,5 @@ # sys.setrecursionlimit(n) # Import APIs into API package: -from pinecone.core.openapi.control.api.inference_api import InferenceApi -from pinecone.core.openapi.control.api.manage_indexes_api import ManageIndexesApi +from pinecone.core.openapi.db_data.api.bulk_operations_api import BulkOperationsApi +from pinecone.core.openapi.db_data.api.vector_operations_api import VectorOperationsApi diff --git a/pinecone/core/openapi/data/model/__init__.py b/pinecone/core/openapi/db_data/model/__init__.py similarity index 100% rename from pinecone/core/openapi/data/model/__init__.py rename to pinecone/core/openapi/db_data/model/__init__.py diff --git a/pinecone/core/openapi/data/model/delete_request.py b/pinecone/core/openapi/db_data/model/delete_request.py similarity index 93% rename from pinecone/core/openapi/data/model/delete_request.py rename to pinecone/core/openapi/db_data/model/delete_request.py index 90ec790f..6412b708 100644 --- a/pinecone/core/openapi/data/model/delete_request.py +++ b/pinecone/core/openapi/db_data/model/delete_request.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class DeleteRequest(ModelNormal): @@ -55,9 +55,7 @@ class DeleteRequest(ModelNormal): allowed_values = {} - validations = { - ("ids",): {}, - } + validations = {("ids",): {}} @cached_property def additional_properties_type(): @@ -65,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -162,10 +152,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -250,10 +237,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/describe_index_stats_request.py b/pinecone/core/openapi/db_data/model/describe_index_stats_request.py similarity index 92% rename from pinecone/core/openapi/data/model/describe_index_stats_request.py rename to pinecone/core/openapi/db_data/model/describe_index_stats_request.py index 9c9f277e..0a1b2bfe 100644 --- a/pinecone/core/openapi/data/model/describe_index_stats_request.py +++ b/pinecone/core/openapi/db_data/model/describe_index_stats_request.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class DescribeIndexStatsRequest(ModelNormal): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + "filter": ({str: (bool, dict, float, int, list, str, none_type)},) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "filter": "filter", # noqa: E501 + "filter": "filter" # noqa: E501 } read_only_vars = {} @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/fetch_response.py b/pinecone/core/openapi/db_data/model/fetch_response.py similarity index 91% rename from pinecone/core/openapi/data/model/fetch_response.py rename to pinecone/core/openapi/db_data/model/fetch_response.py index 067ebcb3..8bcd3fe3 100644 --- a/pinecone/core/openapi/data/model/fetch_response.py +++ b/pinecone/core/openapi/db_data/model/fetch_response.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,13 +25,13 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.usage import Usage - from pinecone.core.openapi.data.model.vector import Vector + from pinecone.core.openapi.db_data.model.usage import Usage + from pinecone.core.openapi.db_data.model.vector import Vector globals()["Usage"] = Usage globals()["Vector"] = Vector @@ -72,15 +72,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -167,10 +159,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -254,10 +243,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/embedding.py b/pinecone/core/openapi/db_data/model/import_error_mode.py similarity index 88% rename from pinecone/core/openapi/control/model/embedding.py rename to pinecone/core/openapi/db_data/model/import_error_mode.py index 3ef3defc..0d92471f 100644 --- a/pinecone/core/openapi/control/model/embedding.py +++ b/pinecone/core/openapi/db_data/model/import_error_mode.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,11 +25,11 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError -class Embedding(ModelNormal): +class ImportErrorMode(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -53,7 +53,7 @@ class Embedding(ModelNormal): as additional properties values. """ - allowed_values = {} + allowed_values = {("on_error",): {"ABORT": "abort", "CONTINUE": "continue"}} validations = {} @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "values": ([float],), # noqa: E501 + "on_error": (str,) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "values": "values", # noqa: E501 + "on_error": "onError" # noqa: E501 } read_only_vars = {} @@ -104,7 +96,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Embedding - a model defined in OpenAPI + """ImportErrorMode - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -137,7 +129,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - values ([float]): The embedding values.. [optional] # noqa: E501 + on_error (str): Indicates how to respond to errors during the import process.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -191,7 +180,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """Embedding - a model defined in OpenAPI + """ImportErrorMode - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -224,7 +213,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - values ([float]): The embedding values.. [optional] # noqa: E501 + on_error (str): Indicates how to respond to errors during the import process.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/embed_request_parameters.py b/pinecone/core/openapi/db_data/model/import_model.py similarity index 74% rename from pinecone/core/openapi/control/model/embed_request_parameters.py rename to pinecone/core/openapi/db_data/model/import_model.py index 5f673aba..26544e20 100644 --- a/pinecone/core/openapi/control/model/embed_request_parameters.py +++ b/pinecone/core/openapi/db_data/model/import_model.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,11 +25,11 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError -class EmbedRequestParameters(ModelNormal): +class ImportModel(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -53,9 +53,20 @@ class EmbedRequestParameters(ModelNormal): as additional properties values. """ - allowed_values = {} + allowed_values = { + ("status",): { + "PENDING": "Pending", + "INPROGRESS": "InProgress", + "FAILED": "Failed", + "COMPLETED": "Completed", + "CANCELLED": "Cancelled", + } + } - validations = {} + validations = { + ("id",): {"max_length": 1000, "min_length": 1}, + ("percent_complete",): {"inclusive_maximum": 100.0, "inclusive_minimum": 0.0}, + } @cached_property def additional_properties_type(): @@ -63,15 +74,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,8 +89,14 @@ def openapi_types(): and the value is attribute type. """ return { - "input_type": (str,), # noqa: E501 - "truncate": (str,), # noqa: E501 + "id": (str,), # noqa: E501 + "uri": (str,), # noqa: E501 + "status": (str,), # noqa: E501 + "created_at": (datetime,), # noqa: E501 + "finished_at": (datetime,), # noqa: E501 + "percent_complete": (float,), # noqa: E501 + "records_imported": (int,), # noqa: E501 + "error": (str,), # noqa: E501 } @cached_property @@ -95,8 +104,14 @@ def discriminator(): return None attribute_map = { - "input_type": "input_type", # noqa: E501 - "truncate": "truncate", # noqa: E501 + "id": "id", # noqa: E501 + "uri": "uri", # noqa: E501 + "status": "status", # noqa: E501 + "created_at": "createdAt", # noqa: E501 + "finished_at": "finishedAt", # noqa: E501 + "percent_complete": "percentComplete", # noqa: E501 + "records_imported": "recordsImported", # noqa: E501 + "error": "error", # noqa: E501 } read_only_vars = {} @@ -106,7 +121,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbedRequestParameters - a model defined in OpenAPI + """ImportModel - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -139,8 +154,14 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - input_type (str): Common property used to distinguish between types of data.. [optional] # noqa: E501 - truncate (str): How to handle inputs longer than those supported by the model. If NONE, when the input exceeds the maximum input token length an error will be returned.. [optional] if omitted the server will use the default value of "END" # noqa: E501 + id (str): Unique identifier for the import operation.. [optional] # noqa: E501 + uri (str): The URI from where the data is imported.. [optional] # noqa: E501 + status (str): The status of the operation.. [optional] # noqa: E501 + created_at (datetime): The start time of the import operation.. [optional] # noqa: E501 + finished_at (datetime): The end time of the import operation.. [optional] # noqa: E501 + percent_complete (float): The progress made by the operation, as a percentage.. [optional] # noqa: E501 + records_imported (int): The number of records successfully imported.. [optional] # noqa: E501 + error (str): The error message if the import process failed.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -154,10 +175,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -194,7 +212,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """EmbedRequestParameters - a model defined in OpenAPI + """ImportModel - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -227,8 +245,14 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - input_type (str): Common property used to distinguish between types of data.. [optional] # noqa: E501 - truncate (str): How to handle inputs longer than those supported by the model. If NONE, when the input exceeds the maximum input token length an error will be returned.. [optional] if omitted the server will use the default value of "END" # noqa: E501 + id (str): Unique identifier for the import operation.. [optional] # noqa: E501 + uri (str): The URI from where the data is imported.. [optional] # noqa: E501 + status (str): The status of the operation.. [optional] # noqa: E501 + created_at (datetime): The start time of the import operation.. [optional] # noqa: E501 + finished_at (datetime): The end time of the import operation.. [optional] # noqa: E501 + percent_complete (float): The progress made by the operation, as a percentage.. [optional] # noqa: E501 + records_imported (int): The number of records successfully imported.. [optional] # noqa: E501 + error (str): The error message if the import process failed.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -240,10 +264,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/describe_index_stats_response.py b/pinecone/core/openapi/db_data/model/index_description.py similarity index 90% rename from pinecone/core/openapi/data/model/describe_index_stats_response.py rename to pinecone/core/openapi/db_data/model/index_description.py index ed4c52c1..613d978f 100644 --- a/pinecone/core/openapi/data/model/describe_index_stats_response.py +++ b/pinecone/core/openapi/db_data/model/index_description.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,17 +25,17 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.namespace_summary import NamespaceSummary + from pinecone.core.openapi.db_data.model.namespace_summary import NamespaceSummary globals()["NamespaceSummary"] = NamespaceSummary -class DescribeIndexStatsResponse(ModelNormal): +class IndexDescription(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -70,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -118,7 +110,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DescribeIndexStatsResponse - a model defined in OpenAPI + """IndexDescription - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -153,7 +145,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) namespaces ({str: (NamespaceSummary,)}): A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.. [optional] # noqa: E501 dimension (int): The dimension of the indexed vectors.. [optional] # noqa: E501 - index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index). . [optional] # noqa: E501 + index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index).. [optional] # noqa: E501 total_vector_count (int): The total number of vectors in the index, regardless of whether a metadata filter expression was passed. [optional] # noqa: E501 """ @@ -168,10 +160,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -208,7 +197,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """DescribeIndexStatsResponse - a model defined in OpenAPI + """IndexDescription - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -243,7 +232,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) namespaces ({str: (NamespaceSummary,)}): A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.. [optional] # noqa: E501 dimension (int): The dimension of the indexed vectors.. [optional] # noqa: E501 - index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index). . [optional] # noqa: E501 + index_fullness (float): The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index).. [optional] # noqa: E501 total_vector_count (int): The total number of vectors in the index, regardless of whether a metadata filter expression was passed. [optional] # noqa: E501 """ @@ -256,10 +245,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/embeddings_list.py b/pinecone/core/openapi/db_data/model/list_imports_response.py similarity index 84% rename from pinecone/core/openapi/control/model/embeddings_list.py rename to pinecone/core/openapi/db_data/model/list_imports_response.py index 73c8d0bb..42af9c7d 100644 --- a/pinecone/core/openapi/control/model/embeddings_list.py +++ b/pinecone/core/openapi/db_data/model/list_imports_response.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,19 +25,19 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.embedding import Embedding - from pinecone.core.openapi.control.model.embeddings_list_usage import EmbeddingsListUsage + from pinecone.core.openapi.db_data.model.import_model import ImportModel + from pinecone.core.openapi.db_data.model.pagination import Pagination - globals()["Embedding"] = Embedding - globals()["EmbeddingsListUsage"] = EmbeddingsListUsage + globals()["ImportModel"] = ImportModel + globals()["Pagination"] = Pagination -class EmbeddingsList(ModelNormal): +class ListImportsResponse(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -72,15 +72,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -96,9 +88,8 @@ def openapi_types(): """ lazy_import() return { - "model": (str,), # noqa: E501 - "data": ([Embedding],), # noqa: E501 - "usage": (EmbeddingsListUsage,), # noqa: E501 + "data": ([ImportModel],), # noqa: E501 + "pagination": (Pagination,), # noqa: E501 } @cached_property @@ -106,9 +97,8 @@ def discriminator(): return None attribute_map = { - "model": "model", # noqa: E501 "data": "data", # noqa: E501 - "usage": "usage", # noqa: E501 + "pagination": "pagination", # noqa: E501 } read_only_vars = {} @@ -118,7 +108,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddingsList - a model defined in OpenAPI + """ListImportsResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -151,9 +141,8 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - model (str): [optional] # noqa: E501 - data ([Embedding]): [optional] # noqa: E501 - usage (EmbeddingsListUsage): [optional] # noqa: E501 + data ([ImportModel]): [optional] # noqa: E501 + pagination (Pagination): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -167,10 +156,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -207,7 +193,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddingsList - a model defined in OpenAPI + """ListImportsResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -240,9 +226,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - model (str): [optional] # noqa: E501 - data ([Embedding]): [optional] # noqa: E501 - usage (EmbeddingsListUsage): [optional] # noqa: E501 + data ([ImportModel]): [optional] # noqa: E501 + pagination (Pagination): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -254,10 +239,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/list_item.py b/pinecone/core/openapi/db_data/model/list_item.py similarity index 91% rename from pinecone/core/openapi/data/model/list_item.py rename to pinecone/core/openapi/db_data/model/list_item.py index 6f23f1f4..1b6c813c 100644 --- a/pinecone/core/openapi/data/model/list_item.py +++ b/pinecone/core/openapi/db_data/model/list_item.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class ListItem(ModelNormal): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "id": (str,), # noqa: E501 + "id": (str,) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "id": "id", # noqa: E501 + "id": "id" # noqa: E501 } read_only_vars = {} @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/list_response.py b/pinecone/core/openapi/db_data/model/list_response.py similarity index 91% rename from pinecone/core/openapi/data/model/list_response.py rename to pinecone/core/openapi/db_data/model/list_response.py index a1a9207f..1f293889 100644 --- a/pinecone/core/openapi/data/model/list_response.py +++ b/pinecone/core/openapi/db_data/model/list_response.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,14 +25,14 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.list_item import ListItem - from pinecone.core.openapi.data.model.pagination import Pagination - from pinecone.core.openapi.data.model.usage import Usage + from pinecone.core.openapi.db_data.model.list_item import ListItem + from pinecone.core.openapi.db_data.model.pagination import Pagination + from pinecone.core.openapi.db_data.model.usage import Usage globals()["ListItem"] = ListItem globals()["Pagination"] = Pagination @@ -74,15 +74,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -172,10 +164,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -260,10 +249,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/namespace_summary.py b/pinecone/core/openapi/db_data/model/namespace_summary.py similarity index 91% rename from pinecone/core/openapi/data/model/namespace_summary.py rename to pinecone/core/openapi/db_data/model/namespace_summary.py index 951e00d4..fecc3ac6 100644 --- a/pinecone/core/openapi/data/model/namespace_summary.py +++ b/pinecone/core/openapi/db_data/model/namespace_summary.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class NamespaceSummary(ModelNormal): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "vector_count": (int,), # noqa: E501 + "vector_count": (int,) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "vector_count": "vectorCount", # noqa: E501 + "vector_count": "vectorCount" # noqa: E501 } read_only_vars = {} @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/pagination.py b/pinecone/core/openapi/db_data/model/pagination.py similarity index 91% rename from pinecone/core/openapi/data/model/pagination.py rename to pinecone/core/openapi/db_data/model/pagination.py index be14513b..4bbd53ea 100644 --- a/pinecone/core/openapi/data/model/pagination.py +++ b/pinecone/core/openapi/db_data/model/pagination.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class Pagination(ModelNormal): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "next": (str,), # noqa: E501 + "next": (str,) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "next": "next", # noqa: E501 + "next": "next" # noqa: E501 } read_only_vars = {} @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/protobuf_any.py b/pinecone/core/openapi/db_data/model/protobuf_any.py similarity index 92% rename from pinecone/core/openapi/data/model/protobuf_any.py rename to pinecone/core/openapi/db_data/model/protobuf_any.py index 3cfeaad2..927b0d94 100644 --- a/pinecone/core/openapi/data/model/protobuf_any.py +++ b/pinecone/core/openapi/db_data/model/protobuf_any.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class ProtobufAny(ModelNormal): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -154,10 +146,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -240,10 +229,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/protobuf_null_value.py b/pinecone/core/openapi/db_data/model/protobuf_null_value.py similarity index 89% rename from pinecone/core/openapi/data/model/protobuf_null_value.py rename to pinecone/core/openapi/db_data/model/protobuf_null_value.py index 7d0ac29d..5b333ded 100644 --- a/pinecone/core/openapi/data/model/protobuf_null_value.py +++ b/pinecone/core/openapi/db_data/model/protobuf_null_value.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class ProtobufNullValue(ModelSimple): @@ -49,11 +49,7 @@ class ProtobufNullValue(ModelSimple): as additional properties values. """ - allowed_values = { - ("value",): { - "NULL_VALUE": "NULL_VALUE", - }, - } + allowed_values = {("value",): {"NULL_VALUE": "NULL_VALUE"}} validations = {} @@ -63,15 +59,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -85,9 +73,7 @@ def openapi_types(): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return { - "value": (str,), - } + return {"value": (str,)} @cached_property def discriminator(): @@ -171,10 +157,7 @@ def __init__(self, *args, **kwargs): if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -189,10 +172,7 @@ def __init__(self, *args, **kwargs): if kwargs: raise PineconeApiTypeError( "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), + % (kwargs, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -261,10 +241,7 @@ def _from_openapi_data(cls, *args, **kwargs): if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -279,10 +256,7 @@ def _from_openapi_data(cls, *args, **kwargs): if kwargs: raise PineconeApiTypeError( "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), + % (kwargs, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/query_request.py b/pinecone/core/openapi/db_data/model/query_request.py similarity index 89% rename from pinecone/core/openapi/data/model/query_request.py rename to pinecone/core/openapi/db_data/model/query_request.py index ec918cb6..04c9f3b3 100644 --- a/pinecone/core/openapi/data/model/query_request.py +++ b/pinecone/core/openapi/db_data/model/query_request.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,13 +25,13 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.query_vector import QueryVector - from pinecone.core.openapi.data.model.sparse_values import SparseValues + from pinecone.core.openapi.db_data.model.query_vector import QueryVector + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues globals()["QueryVector"] = QueryVector globals()["SparseValues"] = SparseValues @@ -64,15 +64,10 @@ class QueryRequest(ModelNormal): allowed_values = {} validations = { - ("top_k",): { - "inclusive_maximum": 10000, - "inclusive_minimum": 1, - }, + ("top_k",): {"inclusive_maximum": 10000, "inclusive_minimum": 1}, ("queries",): {}, ("vector",): {}, - ("id",): { - "max_length": 512, - }, + ("id",): {"max_length": 512}, } @cached_property @@ -82,15 +77,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -181,9 +168,9 @@ def _from_openapi_data(cls, top_k, *args, **kwargs): # noqa: E501 include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 - vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 + vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 sparse_vector (SparseValues): [optional] # noqa: E501 - id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 + id (str): The unique ID of the vector to be used as a query vector. Each `query` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -197,10 +184,7 @@ def _from_openapi_data(cls, top_k, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -279,9 +263,9 @@ def __init__(self, top_k, *args, **kwargs): # noqa: E501 include_values (bool): Indicates whether vector values are included in the response.. [optional] if omitted the server will use the default value of False # noqa: E501 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids.. [optional] if omitted the server will use the default value of False # noqa: E501 queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 - vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query()` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 + vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query` request can contain only one of the parameters `id` or `vector`.. [optional] # noqa: E501 sparse_vector (SparseValues): [optional] # noqa: E501 - id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 + id (str): The unique ID of the vector to be used as a query vector. Each `query` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -293,10 +277,7 @@ def __init__(self, top_k, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/query_response.py b/pinecone/core/openapi/db_data/model/query_response.py similarity index 91% rename from pinecone/core/openapi/data/model/query_response.py rename to pinecone/core/openapi/db_data/model/query_response.py index a62b39ea..39aa888c 100644 --- a/pinecone/core/openapi/data/model/query_response.py +++ b/pinecone/core/openapi/db_data/model/query_response.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,14 +25,14 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.scored_vector import ScoredVector - from pinecone.core.openapi.data.model.single_query_results import SingleQueryResults - from pinecone.core.openapi.data.model.usage import Usage + from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector + from pinecone.core.openapi.db_data.model.single_query_results import SingleQueryResults + from pinecone.core.openapi.db_data.model.usage import Usage globals()["ScoredVector"] = ScoredVector globals()["SingleQueryResults"] = SingleQueryResults @@ -74,15 +74,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -172,10 +164,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -260,10 +249,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/query_vector.py b/pinecone/core/openapi/db_data/model/query_vector.py similarity index 91% rename from pinecone/core/openapi/data/model/query_vector.py rename to pinecone/core/openapi/db_data/model/query_vector.py index bb352002..4bc01839 100644 --- a/pinecone/core/openapi/data/model/query_vector.py +++ b/pinecone/core/openapi/db_data/model/query_vector.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.sparse_values import SparseValues + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues globals()["SparseValues"] = SparseValues @@ -63,10 +63,7 @@ class QueryVector(ModelNormal): validations = { ("values",): {}, - ("top_k",): { - "inclusive_maximum": 10000, - "inclusive_minimum": 1, - }, + ("top_k",): {"inclusive_maximum": 10000, "inclusive_minimum": 1}, } @cached_property @@ -76,15 +73,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -179,10 +168,7 @@ def _from_openapi_data(cls, values, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -271,10 +257,7 @@ def __init__(self, values, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/rpc_status.py b/pinecone/core/openapi/db_data/model/rpc_status.py similarity index 91% rename from pinecone/core/openapi/data/model/rpc_status.py rename to pinecone/core/openapi/db_data/model/rpc_status.py index dbe3ba30..021fd4f7 100644 --- a/pinecone/core/openapi/data/model/rpc_status.py +++ b/pinecone/core/openapi/db_data/model/rpc_status.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.protobuf_any import ProtobufAny + from pinecone.core.openapi.db_data.model.protobuf_any import ProtobufAny globals()["ProtobufAny"] = ProtobufAny @@ -70,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -165,10 +157,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -252,10 +241,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/scored_vector.py b/pinecone/core/openapi/db_data/model/scored_vector.py similarity index 91% rename from pinecone/core/openapi/data/model/scored_vector.py rename to pinecone/core/openapi/db_data/model/scored_vector.py index 9f42e4b3..5845dac9 100644 --- a/pinecone/core/openapi/data/model/scored_vector.py +++ b/pinecone/core/openapi/db_data/model/scored_vector.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.sparse_values import SparseValues + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues globals()["SparseValues"] = SparseValues @@ -61,12 +61,7 @@ class ScoredVector(ModelNormal): allowed_values = {} - validations = { - ("id",): { - "max_length": 512, - "min_length": 1, - }, - } + validations = {("id",): {"max_length": 512, "min_length": 1}} @cached_property def additional_properties_type(): @@ -75,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -178,10 +165,7 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -270,10 +254,7 @@ def __init__(self, id, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/single_query_results.py b/pinecone/core/openapi/db_data/model/single_query_results.py similarity index 91% rename from pinecone/core/openapi/data/model/single_query_results.py rename to pinecone/core/openapi/db_data/model/single_query_results.py index 184f04e8..8b80f10d 100644 --- a/pinecone/core/openapi/data/model/single_query_results.py +++ b/pinecone/core/openapi/db_data/model/single_query_results.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.scored_vector import ScoredVector + from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector globals()["ScoredVector"] = ScoredVector @@ -70,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -162,10 +154,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -248,10 +237,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/sparse_values.py b/pinecone/core/openapi/db_data/model/sparse_values.py similarity index 91% rename from pinecone/core/openapi/data/model/sparse_values.py rename to pinecone/core/openapi/db_data/model/sparse_values.py index f78b33a0..95e33dfe 100644 --- a/pinecone/core/openapi/data/model/sparse_values.py +++ b/pinecone/core/openapi/db_data/model/sparse_values.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class SparseValues(ModelNormal): @@ -55,10 +55,7 @@ class SparseValues(ModelNormal): allowed_values = {} - validations = { - ("indices",): {}, - ("values",): {}, - } + validations = {("indices",): {}, ("values",): {}} @cached_property def additional_properties_type(): @@ -66,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -159,10 +148,7 @@ def _from_openapi_data(cls, indices, values, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -249,10 +235,7 @@ def __init__(self, indices, values, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/control/model/embed_request.py b/pinecone/core/openapi/db_data/model/start_import_request.py similarity index 79% rename from pinecone/core/openapi/control/model/embed_request.py rename to pinecone/core/openapi/db_data/model/start_import_request.py index 1f977d6e..db2a25b5 100644 --- a/pinecone/core/openapi/control/model/embed_request.py +++ b/pinecone/core/openapi/db_data/model/start_import_request.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,19 +25,17 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.control.model.embed_request_inputs import EmbedRequestInputs - from pinecone.core.openapi.control.model.embed_request_parameters import EmbedRequestParameters + from pinecone.core.openapi.db_data.model.import_error_mode import ImportErrorMode - globals()["EmbedRequestInputs"] = EmbedRequestInputs - globals()["EmbedRequestParameters"] = EmbedRequestParameters + globals()["ImportErrorMode"] = ImportErrorMode -class EmbedRequest(ModelNormal): +class StartImportRequest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -63,7 +61,10 @@ class EmbedRequest(ModelNormal): allowed_values = {} - validations = {} + validations = { + ("uri",): {"max_length": 1500, "min_length": 1}, + ("integration_id",): {"max_length": 1000}, + } @cached_property def additional_properties_type(): @@ -72,15 +73,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -96,9 +89,9 @@ def openapi_types(): """ lazy_import() return { - "model": (str,), # noqa: E501 - "inputs": ([EmbedRequestInputs],), # noqa: E501 - "parameters": (EmbedRequestParameters,), # noqa: E501 + "uri": (str,), # noqa: E501 + "integration_id": (str,), # noqa: E501 + "error_mode": (ImportErrorMode,), # noqa: E501 } @cached_property @@ -106,9 +99,9 @@ def discriminator(): return None attribute_map = { - "model": "model", # noqa: E501 - "inputs": "inputs", # noqa: E501 - "parameters": "parameters", # noqa: E501 + "uri": "uri", # noqa: E501 + "integration_id": "integrationId", # noqa: E501 + "error_mode": "errorMode", # noqa: E501 } read_only_vars = {} @@ -117,12 +110,11 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, model, inputs, *args, **kwargs): # noqa: E501 - """EmbedRequest - a model defined in OpenAPI + def _from_openapi_data(cls, uri, *args, **kwargs): # noqa: E501 + """StartImportRequest - a model defined in OpenAPI Args: - model (str): - inputs ([EmbedRequestInputs]): + uri (str): The [URI prefix](https://docs.pinecone.io/guides/data/understanding-imports#directory-structure) 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. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -155,7 +147,8 @@ def _from_openapi_data(cls, model, inputs, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - parameters (EmbedRequestParameters): [optional] # noqa: E501 + integration_id (str): The id of the [storage integration](https://docs.pinecone.io/guides/operations/integrations/manage-storage-integrations) that should be used to access the data.. [optional] # noqa: E501 + error_mode (ImportErrorMode): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -169,10 +162,7 @@ def _from_openapi_data(cls, model, inputs, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -184,8 +174,7 @@ def _from_openapi_data(cls, model, inputs, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.model = model - self.inputs = inputs + self.uri = uri for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -210,12 +199,11 @@ def _from_openapi_data(cls, model, inputs, *args, **kwargs): # noqa: E501 ) @convert_js_args_to_python_args - def __init__(self, model, inputs, *args, **kwargs): # noqa: E501 - """EmbedRequest - a model defined in OpenAPI + def __init__(self, uri, *args, **kwargs): # noqa: E501 + """StartImportRequest - a model defined in OpenAPI Args: - model (str): - inputs ([EmbedRequestInputs]): + uri (str): The [URI prefix](https://docs.pinecone.io/guides/data/understanding-imports#directory-structure) 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. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -248,7 +236,8 @@ def __init__(self, model, inputs, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - parameters (EmbedRequestParameters): [optional] # noqa: E501 + integration_id (str): The id of the [storage integration](https://docs.pinecone.io/guides/operations/integrations/manage-storage-integrations) that should be used to access the data.. [optional] # noqa: E501 + error_mode (ImportErrorMode): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -260,10 +249,7 @@ def __init__(self, model, inputs, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -275,8 +261,7 @@ def __init__(self, model, inputs, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.model = model - self.inputs = inputs + self.uri = uri for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/pinecone/core/openapi/control/model/embed_request_inputs.py b/pinecone/core/openapi/db_data/model/start_import_response.py similarity index 89% rename from pinecone/core/openapi/control/model/embed_request_inputs.py rename to pinecone/core/openapi/db_data/model/start_import_response.py index 15f245e1..a32af8ad 100644 --- a/pinecone/core/openapi/control/model/embed_request_inputs.py +++ b/pinecone/core/openapi/db_data/model/start_import_response.py @@ -1,17 +1,17 @@ """ - Pinecone Control Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,11 +25,11 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError -class EmbedRequestInputs(ModelNormal): +class StartImportResponse(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -55,7 +55,7 @@ class EmbedRequestInputs(ModelNormal): allowed_values = {} - validations = {} + validations = {("id",): {"max_length": 1000, "min_length": 1}} @cached_property def additional_properties_type(): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "text": (str,), # noqa: E501 + "id": (str,) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "text": "text", # noqa: E501 + "id": "id" # noqa: E501 } read_only_vars = {} @@ -104,7 +96,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbedRequestInputs - a model defined in OpenAPI + """StartImportResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -137,7 +129,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - text (str): [optional] # noqa: E501 + id (str): Unique identifier for the import operation.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -191,7 +180,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """EmbedRequestInputs - a model defined in OpenAPI + """StartImportResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -224,7 +213,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - text (str): [optional] # noqa: E501 + id (str): Unique identifier for the import operation.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/update_request.py b/pinecone/core/openapi/db_data/model/update_request.py similarity index 91% rename from pinecone/core/openapi/data/model/update_request.py rename to pinecone/core/openapi/db_data/model/update_request.py index a7cf942f..2f4f1f79 100644 --- a/pinecone/core/openapi/data/model/update_request.py +++ b/pinecone/core/openapi/db_data/model/update_request.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.sparse_values import SparseValues + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues globals()["SparseValues"] = SparseValues @@ -61,13 +61,7 @@ class UpdateRequest(ModelNormal): allowed_values = {} - validations = { - ("id",): { - "max_length": 512, - "min_length": 1, - }, - ("values",): {}, - } + validations = {("id",): {"max_length": 512, "min_length": 1}, ("values",): {}} @cached_property def additional_properties_type(): @@ -76,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -179,10 +165,7 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -271,10 +254,7 @@ def __init__(self, id, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/upsert_request.py b/pinecone/core/openapi/db_data/model/upsert_request.py similarity index 91% rename from pinecone/core/openapi/data/model/upsert_request.py rename to pinecone/core/openapi/db_data/model/upsert_request.py index c6039af3..03430755 100644 --- a/pinecone/core/openapi/data/model/upsert_request.py +++ b/pinecone/core/openapi/db_data/model/upsert_request.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.vector import Vector + from pinecone.core.openapi.db_data.model.vector import Vector globals()["Vector"] = Vector @@ -61,9 +61,7 @@ class UpsertRequest(ModelNormal): allowed_values = {} - validations = { - ("vectors",): {}, - } + validations = {("vectors",): {}} @cached_property def additional_properties_type(): @@ -72,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -166,10 +156,7 @@ def _from_openapi_data(cls, vectors, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -255,10 +242,7 @@ def __init__(self, vectors, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/upsert_response.py b/pinecone/core/openapi/db_data/model/upsert_response.py similarity index 91% rename from pinecone/core/openapi/data/model/upsert_response.py rename to pinecone/core/openapi/db_data/model/upsert_response.py index fa87e6ce..ff279753 100644 --- a/pinecone/core/openapi/data/model/upsert_response.py +++ b/pinecone/core/openapi/db_data/model/upsert_response.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class UpsertResponse(ModelNormal): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "upserted_count": (int,), # noqa: E501 + "upserted_count": (int,) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "upserted_count": "upsertedCount", # noqa: E501 + "upserted_count": "upsertedCount" # noqa: E501 } read_only_vars = {} @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/usage.py b/pinecone/core/openapi/db_data/model/usage.py similarity index 91% rename from pinecone/core/openapi/data/model/usage.py rename to pinecone/core/openapi/db_data/model/usage.py index affff9e8..5316e10f 100644 --- a/pinecone/core/openapi/data/model/usage.py +++ b/pinecone/core/openapi/db_data/model/usage.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,8 +25,8 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError class Usage(ModelNormal): @@ -63,15 +63,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -86,7 +78,7 @@ def openapi_types(): and the value is attribute type. """ return { - "read_units": (int,), # noqa: E501 + "read_units": (int,) # noqa: E501 } @cached_property @@ -94,7 +86,7 @@ def discriminator(): return None attribute_map = { - "read_units": "readUnits", # noqa: E501 + "read_units": "readUnits" # noqa: E501 } read_only_vars = {} @@ -151,10 +143,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -236,10 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/data/model/vector.py b/pinecone/core/openapi/db_data/model/vector.py similarity index 91% rename from pinecone/core/openapi/data/model/vector.py rename to pinecone/core/openapi/db_data/model/vector.py index 99b3715f..6dc85746 100644 --- a/pinecone/core/openapi/data/model/vector.py +++ b/pinecone/core/openapi/db_data/model/vector.py @@ -1,17 +1,17 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 - The version of the OpenAPI document: 2024-07 - Contact: support@pinecone.io - Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2024-10 +Contact: support@pinecone.io +Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 -from pinecone.core.openapi.shared.model_utils import ( # noqa: F401 +from pinecone.openapi_support import ( # noqa: F401 PineconeApiTypeError, ModelComposed, ModelNormal, @@ -25,12 +25,12 @@ none_type, validate_get_composed_info, ) -from pinecone.core.openapi.shared.model_utils import OpenApiModel -from pinecone.core.openapi.shared.exceptions import PineconeApiAttributeError +from pinecone.openapi_support.model_utils import OpenApiModel +from pinecone.openapi_support.exceptions import PineconeApiAttributeError def lazy_import(): - from pinecone.core.openapi.data.model.sparse_values import SparseValues + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues globals()["SparseValues"] = SparseValues @@ -61,13 +61,7 @@ class Vector(ModelNormal): allowed_values = {} - validations = { - ("id",): { - "max_length": 512, - "min_length": 1, - }, - ("values",): {}, - } + validations = {("id",): {"max_length": 512, "min_length": 1}, ("values",): {}} @cached_property def additional_properties_type(): @@ -76,15 +70,7 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return ( - bool, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -176,10 +162,7 @@ def _from_openapi_data(cls, id, values, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) @@ -268,10 +251,7 @@ def __init__(self, id, values, *args, **kwargs): # noqa: E501 if args: raise PineconeApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), + % (args, self.__class__.__name__), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) diff --git a/pinecone/core/openapi/db_data/models/__init__.py b/pinecone/core/openapi/db_data/models/__init__.py new file mode 100644 index 00000000..14e62170 --- /dev/null +++ b/pinecone/core/openapi/db_data/models/__init__.py @@ -0,0 +1,40 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from pinecone.core.openapi.db_data.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from pinecone.core.openapi.db_data.model.delete_request import DeleteRequest +from pinecone.core.openapi.db_data.model.describe_index_stats_request import ( + DescribeIndexStatsRequest, +) +from pinecone.core.openapi.db_data.model.fetch_response import FetchResponse +from pinecone.core.openapi.db_data.model.import_error_mode import ImportErrorMode +from pinecone.core.openapi.db_data.model.import_model import ImportModel +from pinecone.core.openapi.db_data.model.index_description import IndexDescription +from pinecone.core.openapi.db_data.model.list_imports_response import ListImportsResponse +from pinecone.core.openapi.db_data.model.list_item import ListItem +from pinecone.core.openapi.db_data.model.list_response import ListResponse +from pinecone.core.openapi.db_data.model.namespace_summary import NamespaceSummary +from pinecone.core.openapi.db_data.model.pagination import Pagination +from pinecone.core.openapi.db_data.model.protobuf_any import ProtobufAny +from pinecone.core.openapi.db_data.model.protobuf_null_value import ProtobufNullValue +from pinecone.core.openapi.db_data.model.query_request import QueryRequest +from pinecone.core.openapi.db_data.model.query_response import QueryResponse +from pinecone.core.openapi.db_data.model.query_vector import QueryVector +from pinecone.core.openapi.db_data.model.rpc_status import RpcStatus +from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector +from pinecone.core.openapi.db_data.model.single_query_results import SingleQueryResults +from pinecone.core.openapi.db_data.model.sparse_values import SparseValues +from pinecone.core.openapi.db_data.model.start_import_request import StartImportRequest +from pinecone.core.openapi.db_data.model.start_import_response import StartImportResponse +from pinecone.core.openapi.db_data.model.update_request import UpdateRequest +from pinecone.core.openapi.db_data.model.upsert_request import UpsertRequest +from pinecone.core.openapi.db_data.model.upsert_response import UpsertResponse +from pinecone.core.openapi.db_data.model.usage import Usage +from pinecone.core.openapi.db_data.model.vector import Vector diff --git a/pinecone/core/openapi/shared/__init__.py b/pinecone/core/openapi/shared/__init__.py deleted file mode 100644 index b740b5e0..00000000 --- a/pinecone/core/openapi/shared/__init__.py +++ /dev/null @@ -1 +0,0 @@ -API_VERSION = "2024-07" diff --git a/pinecone/core/openapi/shared/api_client.py b/pinecone/core/openapi/shared/api_client.py deleted file mode 100644 index a35aa166..00000000 --- a/pinecone/core/openapi/shared/api_client.py +++ /dev/null @@ -1,898 +0,0 @@ -import json -import atexit -import mimetypes -from multiprocessing.pool import ThreadPool -from concurrent.futures import ThreadPoolExecutor -import io -import os -import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField -import time -import random - -def retry_api_call( - func, args=(), kwargs={}, retries=3, backoff=1, jitter=0.5 -): - attempts = 0 - while attempts < retries: - try: - return func(*args, **kwargs) # Attempt to call __call_api - except Exception as e: - attempts += 1 - if attempts >= retries: - print(f"API call failed after {attempts} attempts: {e}") - raise # Re-raise exception if retries are exhausted - sleep_time = backoff * (2 ** (attempts - 1)) + random.uniform(0, jitter) - # print(f"Retrying ({attempts}/{retries}) in {sleep_time:.2f} seconds after error: {e}") - time.sleep(sleep_time) - - -from pinecone.core.openapi.shared import rest -from pinecone.core.openapi.shared.configuration import Configuration -from pinecone.core.openapi.shared.exceptions import PineconeApiTypeError, PineconeApiValueError, PineconeApiException -from pinecone.core.openapi.shared.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types, -) - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - _threadpool_executor = None - - def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/1.0.0/python" - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._threadpool_executor: - self._threadpool_executor.shutdown() - self._threadpool_executor = None - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, "unregister"): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def threadpool_executor(self): - if self._threadpool_executor is None: - self._threadpool_executor = ThreadPoolExecutor(max_workers=self.pool_threads) - return self._threadpool_executor - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers["User-Agent"] - - @user_agent.setter - def user_agent(self, value): - self.default_headers["User-Agent"] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - ): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params["Cookie"] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace("{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param)) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params["Content-Type"].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = self.request( - method, - url, - query_params=query_params, - headers=header_params, - post_params=post_params, - body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - ) - except PineconeApiException as e: - e.body = e.body.decode("utf-8") - raise e - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - return return_data - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - content_type = response_data.getheader("content-type") - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize(response_data, response_type, _check_type) - else: - return_data = None - - if _return_http_data_only: - return return_data - else: - return (return_data, response_data.status, response_data.getheaders()) - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = dict - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return {key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise PineconeApiValueError("Unable to prepare type {} for serialization".format(obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, response_type, ["received_data"], True, _check_type, configuration=self.configuration - ) - return deserialized_data - - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - async_threadpool_executor: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if async_threadpool_executor: - return self.threadpool_executor.submit( - self.__call_api, - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - _check_type, - ) - - if not async_req: - return self.__call_api( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - _check_type, - ) - - return self.pool.apply_async( - retry_api_call, - args=( - self.__call_api, # Pass the API call function as the first argument - ( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - _check_type, - ), - {}, # empty kwargs dictionary - 3, # retries - 1, # backoff time - 0.5 # jitter - ) - ) - - def request( - self, - method, - url, - query_params=None, - headers=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET( - url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - ) - elif method == "HEAD": - return self.rest_client.HEAD( - url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - ) - elif method == "OPTIONS": - return self.rest_client.OPTIONS( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "POST": - return self.rest_client.POST( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "PUT": - return self.rest_client.PUT( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "PATCH": - return self.rest_client.PATCH( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "DELETE": - return self.rest_client.DELETE( - url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - else: - raise PineconeApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == "multi": - new_params.extend((k, value) for value in v) - else: - if collection_format == "ssv": - delimiter = " " - elif collection_format == "tsv": - delimiter = "\t" - elif collection_format == "pipes": - delimiter = "|" - else: # csv is the default - delimiter = "," - new_params.append((k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise PineconeApiValueError( - "Cannot read a closed file. The passed in file_type " "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" - params.append(tuple([param_name, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if "application/json" in accepts: - return "application/json" - else: - return ", ".join(accepts) - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return "application/json" - - content_types = [x.lower() for x in content_types] - - if "application/json" in content_types or "*/*" in content_types: - return "application/json" - else: - return content_types[0] - - def update_params_for_auth(self, headers, querys, auth_settings, resource_path, method, body): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting["in"] == "cookie": - headers["Cookie"] = auth_setting["value"] - elif auth_setting["in"] == "header": - if auth_setting["type"] != "http-signature": - headers[auth_setting["key"]] = auth_setting["value"] - elif auth_setting["in"] == "query": - querys.append((auth_setting["key"], auth_setting["value"])) - else: - raise PineconeApiValueError("Authentication token must be in `query` or `header`") - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map["all"].extend( - [ - "async_req", - "async_threadpool_executor", - "_host_index", - "_preload_content", - "_request_timeout", - "_return_http_data_only", - "_check_input_type", - "_check_return_type", - ] - ) - self.params_map["nullable"].extend(["_request_timeout"]) - self.validations = root_map["validations"] - self.allowed_values = root_map["allowed_values"] - self.openapi_types = root_map["openapi_types"] - extra_types = { - "async_req": (bool,), - "async_threadpool_executor": (bool, ), - "_host_index": (none_type, int), - "_preload_content": (bool,), - "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), - "_return_http_data_only": (bool,), - "_check_input_type": (bool,), - "_check_return_type": (bool,), - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map["attribute_map"] - self.location_map = root_map["location_map"] - self.collection_format_map = root_map["collection_format_map"] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map["enum"]: - if param in kwargs: - check_allowed_values(self.allowed_values, (param,), kwargs[param]) - - for param in self.params_map["validation"]: - if param in kwargs: - check_validations( - self.validations, (param,), kwargs[param], configuration=self.api_client.configuration - ) - - if kwargs["_check_input_type"] is False: - return - - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs["_check_input_type"], - configuration=self.api_client.configuration, - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = {"body": None, "collection_format": {}, "file": {}, "form": [], "header": {}, "path": {}, "query": []} - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == "body": - params["body"] = param_value - continue - base_name = self.attribute_map[param_name] - if param_location == "form" and self.openapi_types[param_name] == (file_type,): - params["file"][param_name] = [param_value] - elif param_location == "form" and self.openapi_types[param_name] == ([file_type],): - # param_value is already a list - params["file"][param_name] = param_value - elif param_location in {"form", "query"}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {"form", "query"}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params["collection_format"][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """This method is invoked when endpoints are called - Example: - - api_instance = InferenceApi() - api_instance.embed # this is an instance of the class Endpoint - api_instance.embed() # this invokes api_instance.embed.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.embed.callable or self.callable in this class - - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - index = ( - self.api_client.configuration.server_operation_index.get( - self.settings["operation_id"], self.api_client.configuration.server_index - ) - if kwargs["_host_index"] is None - else kwargs["_host_index"] - ) - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings["operation_id"], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings["servers"] - ) - except IndexError: - if self.settings["servers"]: - raise PineconeApiValueError( - "Invalid host index. Must be 0 <= index < %s" % len(self.settings["servers"]) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map["all"]: - raise PineconeApiTypeError( - "Got an unexpected parameter '%s'" " to method `%s`" % (key, self.settings["operation_id"]) - ) - # only throw this nullable PineconeApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if key not in self.params_map["nullable"] and value is None and kwargs["_check_input_type"] is False: - raise PineconeApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % (key, self.settings["operation_id"]) - ) - - for key in self.params_map["required"]: - if key not in kwargs.keys(): - raise PineconeApiValueError( - "Missing the required parameter `%s` when calling " "`%s`" % (key, self.settings["operation_id"]) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map["accept"] - if accept_headers_list: - params["header"]["Accept"] = self.api_client.select_header_accept(accept_headers_list) - - content_type_headers_list = self.headers_map["content_type"] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type(content_type_headers_list) - params["header"]["Content-Type"] = header_list - - return self.api_client.call_api( - self.settings["endpoint_path"], - self.settings["http_method"], - params["path"], - params["query"], - params["header"], - body=params["body"], - post_params=params["form"], - files=params["file"], - response_type=self.settings["response_type"], - auth_settings=self.settings["auth"], - async_req=kwargs["async_req"], - async_threadpool_executor=kwargs.get("async_threadpool_executor", None), - _check_type=kwargs["_check_return_type"], - _return_http_data_only=kwargs["_return_http_data_only"], - _preload_content=kwargs["_preload_content"], - _request_timeout=kwargs["_request_timeout"], - _host=_host, - collection_formats=params["collection_format"], - ) diff --git a/pinecone/core/openapi/shared/configuration.py b/pinecone/core/openapi/shared/configuration.py deleted file mode 100644 index 83ddad29..00000000 --- a/pinecone/core/openapi/shared/configuration.py +++ /dev/null @@ -1,491 +0,0 @@ -import copy -import logging -import multiprocessing -import sys -import urllib3 - -from http import client as http_client -from pinecone.core.openapi.shared.exceptions import PineconeApiValueError - - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - "multipleOf", - "maximum", - "exclusiveMaximum", - "minimum", - "exclusiveMinimum", - "maxLength", - "minLength", - "pattern", - "maxItems", - "minItems", -} - - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - - conf = pinecone.core.openapi.control.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - """ - - _default = None - - def __init__( - self, - host=None, - api_key=None, - api_key_prefix=None, - access_token=None, - username=None, - password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor""" - self._base_path = "https://api.pinecone.io" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.access_token = access_token - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("pinecone.core.openapi.control") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = "%(asctime)s %(levelname)s %(message)s" - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = "" - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ("logger", "logger_file_handler"): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - if name == "disabled_client_side_validations": - s = set(filter(None, value.split(","))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise PineconeApiValueError("Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers(basic_auth=username + ":" + password).get("authorization") - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if "ApiKeyAuth" in self.api_key: - auth["ApiKeyAuth"] = { - "type": "api_key", - "in": "header", - "key": "Api-Key", - "value": self.get_api_key_with_prefix( - "ApiKeyAuth", - ), - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return ( - "Python SDK Debug Report:\n" - "OS: {env}\n" - "Python Version: {pyversion}\n" - "Version of the API: 2024-07\n" - "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) - ) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - "url": "https://api.pinecone.io", - "description": "Production API endpoints", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers)) - ) - - url = server["url"] - - # go through variables and replace placeholders - for variable_name, variable in server.get("variables", {}).items(): - used_value = variables.get(variable_name, variable["default_value"]) - - if "enum_values" in variable and used_value not in variable["enum_values"]: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format(variable_name, variables[variable_name], variable["enum_values"]) - ) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None - - def __repr__(self): - attrs = [ - f"host={self.host}", - f"api_key=***", - f"api_key_prefix={self.api_key_prefix}", - f"access_token={self.access_token}", - f"connection_pool_maxsize={self.connection_pool_maxsize}", - f"username={self.username}", - f"password={self.password}", - f"discard_unknown_keys={self.discard_unknown_keys}", - f"disabled_client_side_validations={self.disabled_client_side_validations}", - f"server_index={self.server_index}", - f"server_variables={self.server_variables}", - f"server_operation_index={self.server_operation_index}", - f"server_operation_variables={self.server_operation_variables}", - f"ssl_ca_cert={self.ssl_ca_cert}", - - ] - return f"Configuration({', '.join(attrs)})" diff --git a/pinecone/core/openapi/shared/exceptions.py b/pinecone/core/openapi/shared/exceptions.py deleted file mode 100644 index 187a1678..00000000 --- a/pinecone/core/openapi/shared/exceptions.py +++ /dev/null @@ -1,145 +0,0 @@ -class PineconeException(Exception): - """The base exception class for all exceptions in the Pinecone Python SDK""" - - -class PineconeApiTypeError(PineconeException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): - """Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(PineconeApiTypeError, self).__init__(full_msg) - - -class PineconeApiValueError(PineconeException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(PineconeApiValueError, self).__init__(full_msg) - - -class PineconeApiAttributeError(PineconeException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(PineconeApiAttributeError, self).__init__(full_msg) - - -class PineconeApiKeyError(PineconeException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(PineconeApiKeyError, self).__init__(full_msg) - - -class PineconeApiException(PineconeException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format(self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(PineconeApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(PineconeApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(PineconeApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(PineconeApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/pinecone/core/openapi/shared/model_utils.py b/pinecone/core/openapi/shared/model_utils.py deleted file mode 100644 index cec0ad3c..00000000 --- a/pinecone/core/openapi/shared/model_utils.py +++ /dev/null @@ -1,1878 +0,0 @@ -from datetime import date, datetime # noqa: F401 -from dateutil.parser import parse - -import inspect -import io -import os -import pprint -import re -import tempfile - -from pinecone.core.openapi.shared.exceptions import ( - PineconeApiKeyError, - PineconeApiAttributeError, - PineconeApiTypeError, - PineconeApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get("_spec_property_naming", False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = "_results" - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas["oneOf"]: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas["oneOf"]) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas["oneOf"]: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas["oneOf"]: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise PineconeApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message(var_name=name, var_value=name, valid_classes=(str,), key_type=True) - raise PineconeApiTypeError(error_msg, path_to_item=path_to_item, valid_classes=(str,), key_type=True) - - if self._check_type: - value = validate_and_convert_types( - value, - required_types_mixed, - path_to_item, - self._spec_property_naming, - self._check_type, - configuration=self._configuration, - ) - if (name,) in self.allowed_values: - check_allowed_values(self.allowed_values, (name,), value) - if (name,) in self.validations: - check_validations(self.validations, (name,), value, self._configuration) - self.__dict__["_data_store"][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.get(attr) - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - if cls.discriminator is None or cls in visited_composed_classes: - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get("_path_to_item", ()) - raise PineconeApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get("_path_to_item", ()) - disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise PineconeApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ()) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get("allOf") and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - if cls.discriminator is None or cls in visited_composed_classes: - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get("_path_to_item", ()) - raise PineconeApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get("_path_to_item", ()) - disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise PineconeApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ()) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get("allOf") and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__["_data_store"].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise PineconeApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__["_data_store"] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store["value"] - that_val = other._data_store["value"] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__["_data_store"].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise PineconeApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__["_data_store"] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise PineconeApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), - [e for e in [self._path_to_item, name] if e], - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__["_var_name_to_model_instances"][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise PineconeApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e], - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise PineconeApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), - [e for e in [self._path_to_item, name] if e], - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get(name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - # date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - # (str, date), - (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - (str, file_type), - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if isinstance(input_values, list) and not set(input_values).issubset(set(these_allowed_values)): - invalid_values = (", ".join(map(str, set(input_values) - set(these_allowed_values))),) - raise PineconeApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" - % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) - ) - elif isinstance(input_values, dict) and not set(input_values.keys()).issubset(set(these_allowed_values)): - invalid_values = ", ".join(map(str, set(input_values.keys()) - set(these_allowed_values))) - raise PineconeApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" - % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) - ) - elif not isinstance(input_values, (list, dict)) and input_values not in these_allowed_values: - raise PineconeApiValueError( - "Invalid value for `%s` (%s), must be one of %s" - % (input_variable_path[0], input_values, these_allowed_values) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return ( - configuration is None - or not hasattr(configuration, "_disabled_client_side_validations") - or schema_keyword not in configuration._disabled_client_side_validations - ) - - -def check_validations(validations, input_variable_path, input_values, configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if ( - is_json_validation_enabled("multipleOf", configuration) - and "multiple_of" in current_validations - and isinstance(input_values, (int, float)) - and not (float(input_values) / current_validations["multiple_of"]).is_integer() - ): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise PineconeApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % (input_variable_path[0], current_validations["multiple_of"]) - ) - - if ( - is_json_validation_enabled("maxLength", configuration) - and "max_length" in current_validations - and len(input_values) > current_validations["max_length"] - ): - raise PineconeApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % (input_variable_path[0], current_validations["max_length"]) - ) - - if ( - is_json_validation_enabled("minLength", configuration) - and "min_length" in current_validations - and len(input_values) < current_validations["min_length"] - ): - raise PineconeApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % (input_variable_path[0], current_validations["min_length"]) - ) - - if ( - is_json_validation_enabled("maxItems", configuration) - and "max_items" in current_validations - and len(input_values) > current_validations["max_items"] - ): - raise PineconeApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % (input_variable_path[0], current_validations["max_items"]) - ) - - if ( - is_json_validation_enabled("minItems", configuration) - and "min_items" in current_validations - and len(input_values) < current_validations["min_items"] - ): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % (input_variable_path[0], current_validations["min_items"]) - ) - - items = ("exclusive_maximum", "inclusive_maximum", "exclusive_minimum", "inclusive_minimum") - if any(item in current_validations for item in items): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if ( - is_json_validation_enabled("exclusiveMaximum", configuration) - and "exclusive_maximum" in current_validations - and max_val >= current_validations["exclusive_maximum"] - ): - raise PineconeApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" - % (input_variable_path[0], current_validations["exclusive_maximum"]) - ) - - if ( - is_json_validation_enabled("maximum", configuration) - and "inclusive_maximum" in current_validations - and max_val > current_validations["inclusive_maximum"] - ): - raise PineconeApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % (input_variable_path[0], current_validations["inclusive_maximum"]) - ) - - if ( - is_json_validation_enabled("exclusiveMinimum", configuration) - and "exclusive_minimum" in current_validations - and min_val <= current_validations["exclusive_minimum"] - ): - raise PineconeApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" - % (input_variable_path[0], current_validations["exclusive_maximum"]) - ) - - if ( - is_json_validation_enabled("minimum", configuration) - and "inclusive_minimum" in current_validations - and min_val < current_validations["inclusive_minimum"] - ): - raise PineconeApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % (input_variable_path[0], current_validations["inclusive_minimum"]) - ) - flags = current_validations.get("regex", {}).get("flags", 0) - if ( - is_json_validation_enabled("pattern", configuration) - and "regex" in current_validations - and not re.search(current_validations["regex"]["pattern"], input_values, flags=flags) - ): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations["regex"]["pattern"], - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise PineconeApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelComposed): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelNormal): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelSimple): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise PineconeApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted(required_types, key=lambda class_or_instance: index_getter(class_or_instance)) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, "discriminator") and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, "discriminator") and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, "attribute_map", None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], var_value=var_value, valid_classes=valid_classes, key_type=key_type - ) - return PineconeApiTypeError(error_msg, path_to_item=path_to_item, valid_classes=valid_classes, key_type=key_type) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 - and parsed_datetime.minute == 0 - and parsed_datetime.second == 0 - and parsed_datetime.tzinfo is None - and 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError("This is not a float") - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise PineconeApiValueError( - "{0}Failed to parse {1} as {2}".format(additional_message, repr(data), klass.__name__), - path_to_item=path_to_item, - ) from ex - - -def get_discriminator_class(model_class, discr_name, discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get("oneOf", ()) + model_class._composed_schemas.get( - "anyOf", () - ) - ancestor_classes = model_class._composed_schemas.get("allOf", ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, "discriminator") and cls.discriminator is not None: - used_model_class = get_discriminator_class(cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - PineconeApiTypeError - PineconeApiValueError - PineconeApiKeyError - """ - - kw_args = dict( - _check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming, - ) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode("utf-8") - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=True, -): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - PineconeApiTypeError - PineconeApiValueError - PineconeApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible(valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model( - input_value, valid_class, path_to_item, check_type, configuration, spec_property_naming - ) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, path_to_item) - except (PineconeApiTypeError, PineconeApiValueError, PineconeApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get("oneOf", ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get("anyOf", ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - valid_type = input_class_simple in valid_classes - if not valid_type and (issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = valid_class.discriminator[discr_propertyname_py].values() - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types( - input_value, required_types_mixed, path_to_item, spec_property_naming, _check_type, configuration=None -): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - PineconeApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if configuration: - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type, - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False - ) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type, - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get(type(input_value)) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration, - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration, - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - res.append(v) - elif isinstance(v, ModelSimple): - res.append(v.value) - else: - res.append(model_to_dict(v, serialize=serialize)) - result[attr] = res - elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: ( - (item[0], model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], "_data_store") - else item - ), - value.items(), - ) - ) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, "_data_store"): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = "value" - if key_type: - key_or_value = "key" - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = "Invalid type for variable '{0}'. Required {1} type {2} and " "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed""" - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return "is {0}".format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas["allOf"]: - - try: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise PineconeApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % (allof_class.__name__, allof_class.__name__, self.__class__.__name__, str(ex)) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas["oneOf"]) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas["oneOf"]: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs["_path_to_item"], - constant_kwargs["_spec_property_naming"], - constant_kwargs["_check_type"], - configuration=constant_kwargs["_configuration"], - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise PineconeApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % cls.__name__ - ) - elif len(oneof_instances) > 1: - raise PineconeApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas["anyOf"]) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas["anyOf"]: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise PineconeApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas["allOf"]: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + composed_instances - - return [composed_instances, var_name_to_model_instances, additional_properties_model_instances, discarded_args] diff --git a/pinecone/core/openapi/shared/rest.py b/pinecone/core/openapi/shared/rest.py deleted file mode 100644 index 609f26ad..00000000 --- a/pinecone/core/openapi/shared/rest.py +++ /dev/null @@ -1,396 +0,0 @@ -import io -import json -import logging -import re -import ssl -import os -from urllib.parse import urlencode, quote - -import urllib3 - -from pinecone.core.openapi.shared.exceptions import ( - PineconeApiException, - UnauthorizedException, - ForbiddenException, - NotFoundException, - ServiceException, - PineconeApiValueError, -) - - -class bcolors: - HEADER = "\033[95m" - OKBLUE = "\033[94m" - OKCYAN = "\033[96m" - OKGREEN = "\033[92m" - WARNING = "\033[93m" - FAIL = "\033[91m" - ENDC = "\033[0m" - BOLD = "\033[1m" - UNDERLINE = "\033[4m" - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args["assert_hostname"] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args["retries"] = configuration.retries - - if configuration.socket_options is not None: - addition_pool_args["socket_options"] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args, - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args, - ) - - def request( - self, - method, - url, - query_params=None, - headers=None, - body=None, - post_params=None, - _preload_content=True, - _request_timeout=None, - ): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] - - if os.environ.get("PINECONE_DEBUG_CURL"): - formatted_headers = " ".join(["-H '{0}: {1}'".format(k, v) for k, v in headers.items()]) - formatted_query = urlencode(query_params) - if formatted_query: - formatted_url = f"{url}?{formatted_query}" - else: - formatted_url = url - if body is None: - print( - bcolors.OKBLUE - + "curl -X {method} '{url}' {formatted_headers}".format( - method=method, url=formatted_url, formatted_headers=formatted_headers - ) - + bcolors.ENDC - ) - else: - formatted_body = json.dumps(body) - print( - bcolors.OKBLUE - + "curl -X {method} '{url}' {formatted_headers} -d '{data}'".format( - method=method, url=formatted_url, formatted_headers=formatted_headers, data=formatted_body - ) - + bcolors.ENDC - ) - - if post_params and body: - raise PineconeApiValueError("body parameter cannot be used with post_params parameter.") - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: - timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != "DELETE") and ("Content-Type" not in headers): - headers["Content-Type"] = "application/json" - if query_params: - url += "?" + urlencode(query_params, quote_via=quote) - if ("Content-Type" not in headers) or (re.search("json", headers["Content-Type"], re.IGNORECASE)): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - ) - elif headers["Content-Type"] == "application/x-www-form-urlencoded": # noqa: E501 - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - ) - elif headers["Content-Type"] == "multipart/form-data": - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers["Content-Type"] - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - ) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - ) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise PineconeApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - if query_params: - url += "?" + urlencode(query_params, quote_via=quote) - r = self.pool_manager.request( - method, url, preload_content=_preload_content, timeout=timeout, headers=headers - ) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise PineconeApiException(status=0, reason=msg) - - if os.environ.get("PINECONE_DEBUG_CURL"): - o = RESTResponse(r) - - if o.status <= 300: - print(bcolors.OKGREEN + o.data.decode("utf-8") + bcolors.ENDC) - else: - print(bcolors.FAIL + o.data.decode("utf-8") + bcolors.ENDC) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise PineconeApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): - return self.request( - "GET", - url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - ) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): - return self.request( - "HEAD", - url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - ) - - def OPTIONS( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "OPTIONS", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): - return self.request( - "DELETE", - url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def POST( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "POST", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def PUT( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "PUT", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def PATCH( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "PATCH", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) From 56a07d478b68283981fbfeedc4dd3d330ec84aca Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Thu, 14 Nov 2024 12:55:18 -0500 Subject: [PATCH 5/6] Unit test fixes --- pinecone/data/index.py | 2 +- pinecone/data/query_results_aggregator.py | 4 ++-- poetry.lock | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pinecone/data/index.py b/pinecone/data/index.py index becf6450..d75b0da9 100644 --- a/pinecone/data/index.py +++ b/pinecone/data/index.py @@ -116,7 +116,7 @@ def __init__( api_client_klass=ApiClient, api_klass=VectorOperationsApi, config=self.config, - openapi_config=openapi_config, + openapi_config=self._openapi_config, pool_threads=pool_threads, api_version=API_VERSION, ) diff --git a/pinecone/data/query_results_aggregator.py b/pinecone/data/query_results_aggregator.py index 98ca77a2..651477e2 100644 --- a/pinecone/data/query_results_aggregator.py +++ b/pinecone/data/query_results_aggregator.py @@ -1,8 +1,8 @@ from typing import List, Tuple, Optional, Any, Dict import json import heapq -from pinecone.core.openapi.data.models import Usage -from pinecone.core.openapi.data.models import QueryResponse as OpenAPIQueryResponse +from pinecone.core.openapi.db_data.models import Usage +from pinecone.core.openapi.db_data.models import QueryResponse as OpenAPIQueryResponse from dataclasses import dataclass, asdict diff --git a/poetry.lock b/poetry.lock index fd34b315..5d4aedf3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1382,6 +1382,17 @@ files = [ {file = "types_protobuf-4.24.0.4-py3-none-any.whl", hash = "sha256:131ab7d0cbc9e444bc89c994141327dcce7bcaeded72b1acb72a94827eb9c7af"}, ] +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20241003" +description = "Typing stubs for python-dateutil" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-python-dateutil-2.9.0.20241003.tar.gz", hash = "sha256:58cb85449b2a56d6684e41aeefb4c4280631246a0da1a719bdbe6f3fb0317446"}, + {file = "types_python_dateutil-2.9.0.20241003-py3-none-any.whl", hash = "sha256:250e1d8e80e7bbc3a6c99b907762711d1a1cdd00e978ad39cb5940f6f0a87f3d"}, +] + [[package]] name = "types-pytz" version = "2023.3.1.1" From 9937889aa557df75932ccba51b5e17f84777a233 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Thu, 14 Nov 2024 13:23:31 -0500 Subject: [PATCH 6/6] Commit submodule changes --- codegen/apis | 2 +- codegen/python-oas-templates | 2 +- poetry.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codegen/apis b/codegen/apis index 3b7369b8..38acd80d 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit 3b7369b89469ddc6ef4c08d3f8df905302966624 +Subproject commit 38acd80d935f556c115ec53aa2b4a0d80c8d8da4 diff --git a/codegen/python-oas-templates b/codegen/python-oas-templates index c48d935f..c37f9f8c 160000 --- a/codegen/python-oas-templates +++ b/codegen/python-oas-templates @@ -1 +1 @@ -Subproject commit c48d935fc0954b1cff0abd013c276a5adc2a129b +Subproject commit c37f9f8ca16ff016205f24b7ca697d16c2b302ca diff --git a/poetry.lock b/poetry.lock index 5d4aedf3..348b32da 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1628,4 +1628,4 @@ grpc = ["googleapis-common-protos", "grpcio", "grpcio", "lz4", "protobuf", "prot [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "3e9f0091f7a4dad77c0dfff7f9a009a413e8902c81c1ececd60a13929375e907" +content-hash = "648e5233ed7f5cb5ef7b152a01a35eef44c1f8994ea54dc3241131fc5aa4a1f1"