diff --git a/pinecone/core/openapi/ckb_knowledge_data/models/__init__.py b/pinecone/core/openapi/ckb_knowledge_data/models/__init__.py deleted file mode 100644 index 48f85e201..000000000 --- a/pinecone/core/openapi/ckb_knowledge_data/models/__init__.py +++ /dev/null @@ -1,27 +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.ckb_knowledge_data.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from pinecone.core.openapi.ckb_knowledge_data.model.delete_document_response import ( - DeleteDocumentResponse, -) -from pinecone.core.openapi.ckb_knowledge_data.model.document import Document -from pinecone.core.openapi.ckb_knowledge_data.model.document_for_upsert import DocumentForUpsert -from pinecone.core.openapi.ckb_knowledge_data.model.document_list import DocumentList -from pinecone.core.openapi.ckb_knowledge_data.model.get_document_response import GetDocumentResponse -from pinecone.core.openapi.ckb_knowledge_data.model.lsn_status import LSNStatus -from pinecone.core.openapi.ckb_knowledge_data.model.list_document_response import ( - ListDocumentResponse, -) -from pinecone.core.openapi.ckb_knowledge_data.model.pagination_response import PaginationResponse -from pinecone.core.openapi.ckb_knowledge_data.model.upsert_document_response import ( - UpsertDocumentResponse, -) -from pinecone.core.openapi.ckb_knowledge_data.model.usage import Usage diff --git a/pinecone/core/openapi/repository_control/__init__.py b/pinecone/core/openapi/repository_control/__init__.py new file mode 100644 index 000000000..8010019d5 --- /dev/null +++ b/pinecone/core/openapi/repository_control/__init__.py @@ -0,0 +1,30 @@ +# flake8: noqa + +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +__version__ = "1.0.0" + +# import ApiClient +from pinecone.openapi_support.api_client import ApiClient + +# import Configuration +from pinecone.config.openapi_configuration 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 = "unstable" diff --git a/pinecone/core/openapi/ckb_knowledge_data/api/__init__.py b/pinecone/core/openapi/repository_control/api/__init__.py similarity index 67% rename from pinecone/core/openapi/ckb_knowledge_data/api/__init__.py rename to pinecone/core/openapi/repository_control/api/__init__.py index 094e63d11..00b342ea1 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/api/__init__.py +++ b/pinecone/core/openapi/repository_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.ckb_knowledge_data.apis import DocumentOperationsApi +# from pinecone.core.openapi.repository_control.apis import ManageRepositoriesApi diff --git a/pinecone/core/openapi/repository_control/api/manage_repositories_api.py b/pinecone/core/openapi/repository_control/api/manage_repositories_api.py new file mode 100644 index 000000000..23416b363 --- /dev/null +++ b/pinecone/core/openapi/repository_control/api/manage_repositories_api.py @@ -0,0 +1,563 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support import ApiClient, AsyncioApiClient +from pinecone.openapi_support.endpoint_utils import ( + ExtraOpenApiKwargsTypedDict, + KwargsWithOpenApiKwargDefaultsTypedDict, +) +from pinecone.openapi_support.endpoint import Endpoint as _Endpoint, ExtraOpenApiKwargsTypedDict +from pinecone.openapi_support.asyncio_endpoint import AsyncioEndpoint as _AsyncioEndpoint +from pinecone.openapi_support.model_utils import ( # noqa: F401 + date, + datetime, + file_type, + none_type, + validate_and_convert_types, +) +from pinecone.core.openapi.repository_control.model.create_repository_request import ( + CreateRepositoryRequest, +) +from pinecone.core.openapi.repository_control.model.error_response import ErrorResponse +from pinecone.core.openapi.repository_control.model.repository_list import RepositoryList +from pinecone.core.openapi.repository_control.model.repository_model import RepositoryModel + + +class ManageRepositoriesApi: + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __create_repository( + self, create_repository_request, **kwargs: ExtraOpenApiKwargsTypedDict + ): + """Create a repository # noqa: E501 + + Create a Pinecone Repository in the cloud provider and region of your choice. # 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_repository(create_repository_request, async_req=True) + >>> result = thread.get() + + Args: + create_repository_request (CreateRepositoryRequest): The desired configuration for the repository. + + 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. + async_req (bool): execute request asynchronously + + Returns: + RepositoryModel + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["create_repository_request"] = create_repository_request + return self.call_with_http_info(**kwargs) + + self.create_repository = _Endpoint( + settings={ + "response_type": (RepositoryModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/repositories", + "operation_id": "create_repository", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["create_repository_request"], + "required": ["create_repository_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"create_repository_request": (CreateRepositoryRequest,)}, + "attribute_map": {}, + "location_map": {"create_repository_request": "body"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_repository, + ) + + def __delete_repository(self, repository_name, **kwargs: ExtraOpenApiKwargsTypedDict): + """Delete a repository # noqa: E501 + + Delete an existing repository. # 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_repository(repository_name, async_req=True) + >>> result = thread.get() + + Args: + repository_name (str): The name of the repository 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. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["repository_name"] = repository_name + return self.call_with_http_info(**kwargs) + + self.delete_repository = _Endpoint( + settings={ + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/repositories/{repository_name}", + "operation_id": "delete_repository", + "http_method": "DELETE", + "servers": None, + }, + params_map={ + "all": ["repository_name"], + "required": ["repository_name"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"repository_name": (str,)}, + "attribute_map": {"repository_name": "repository_name"}, + "location_map": {"repository_name": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__delete_repository, + ) + + def __describe_repository(self, repository_name, **kwargs: ExtraOpenApiKwargsTypedDict): + """Describe a repository # noqa: E501 + + Get a description of a repository. # 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_repository(repository_name, async_req=True) + >>> result = thread.get() + + Args: + repository_name (str): The name of the repository 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. + async_req (bool): execute request asynchronously + + Returns: + RepositoryModel + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["repository_name"] = repository_name + return self.call_with_http_info(**kwargs) + + self.describe_repository = _Endpoint( + settings={ + "response_type": (RepositoryModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/repositories/{repository_name}", + "operation_id": "describe_repository", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["repository_name"], + "required": ["repository_name"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"repository_name": (str,)}, + "attribute_map": {"repository_name": "repository_name"}, + "location_map": {"repository_name": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__describe_repository, + ) + + def __list_repositories(self, **kwargs: ExtraOpenApiKwargsTypedDict): + """List repositories # noqa: E501 + + List all repositories 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_repositories(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. + async_req (bool): execute request asynchronously + + Returns: + RepositoryList + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + return self.call_with_http_info(**kwargs) + + self.list_repositories = _Endpoint( + settings={ + "response_type": (RepositoryList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/repositories", + "operation_id": "list_repositories", + "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_repositories, + ) + + +class AsyncioManageRepositoriesApi: + """NOTE: This class is @generated using OpenAPI + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = AsyncioApiClient() + self.api_client = api_client + + async def __create_repository(self, create_repository_request, **kwargs): + """Create a repository # noqa: E501 + + Create a Pinecone Repository in the cloud provider and region of your choice. # noqa: E501 + + + Args: + create_repository_request (CreateRepositoryRequest): The desired configuration for the repository. + + 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. + + Returns: + RepositoryModel + """ + self._process_openapi_kwargs(kwargs) + kwargs["create_repository_request"] = create_repository_request + return await self.call_with_http_info(**kwargs) + + self.create_repository = _AsyncioEndpoint( + settings={ + "response_type": (RepositoryModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/repositories", + "operation_id": "create_repository", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["create_repository_request"], + "required": ["create_repository_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"create_repository_request": (CreateRepositoryRequest,)}, + "attribute_map": {}, + "location_map": {"create_repository_request": "body"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_repository, + ) + + async def __delete_repository(self, repository_name, **kwargs): + """Delete a repository # noqa: E501 + + Delete an existing repository. # noqa: E501 + + + Args: + repository_name (str): The name of the repository 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. + + Returns: + None + """ + self._process_openapi_kwargs(kwargs) + kwargs["repository_name"] = repository_name + return await self.call_with_http_info(**kwargs) + + self.delete_repository = _AsyncioEndpoint( + settings={ + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/repositories/{repository_name}", + "operation_id": "delete_repository", + "http_method": "DELETE", + "servers": None, + }, + params_map={ + "all": ["repository_name"], + "required": ["repository_name"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"repository_name": (str,)}, + "attribute_map": {"repository_name": "repository_name"}, + "location_map": {"repository_name": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__delete_repository, + ) + + async def __describe_repository(self, repository_name, **kwargs): + """Describe a repository # noqa: E501 + + Get a description of a repository. # noqa: E501 + + + Args: + repository_name (str): The name of the repository 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. + + Returns: + RepositoryModel + """ + self._process_openapi_kwargs(kwargs) + kwargs["repository_name"] = repository_name + return await self.call_with_http_info(**kwargs) + + self.describe_repository = _AsyncioEndpoint( + settings={ + "response_type": (RepositoryModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/repositories/{repository_name}", + "operation_id": "describe_repository", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["repository_name"], + "required": ["repository_name"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"repository_name": (str,)}, + "attribute_map": {"repository_name": "repository_name"}, + "location_map": {"repository_name": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__describe_repository, + ) + + async def __list_repositories(self, **kwargs): + """List repositories # noqa: E501 + + List all repositories in a project. # noqa: E501 + + + + 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. + + Returns: + RepositoryList + """ + self._process_openapi_kwargs(kwargs) + return await self.call_with_http_info(**kwargs) + + self.list_repositories = _AsyncioEndpoint( + settings={ + "response_type": (RepositoryList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/repositories", + "operation_id": "list_repositories", + "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_repositories, + ) diff --git a/pinecone/core/openapi/repository_control/apis/__init__.py b/pinecone/core/openapi/repository_control/apis/__init__.py new file mode 100644 index 000000000..02323f0ec --- /dev/null +++ b/pinecone/core/openapi/repository_control/apis/__init__.py @@ -0,0 +1,18 @@ +# 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_repositories_api import ManageRepositoriesApi +# +# or import this package, but before doing it, use: +# +# import sys +# sys.setrecursionlimit(n) + +# Import APIs into API package: +from pinecone.core.openapi.repository_control.api.manage_repositories_api import ( + ManageRepositoriesApi, +) diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/__init__.py b/pinecone/core/openapi/repository_control/model/__init__.py similarity index 100% rename from pinecone/core/openapi/ckb_knowledge_data/model/__init__.py rename to pinecone/core/openapi/repository_control/model/__init__.py diff --git a/pinecone/core/openapi/repository_control/model/create_repository_request.py b/pinecone/core/openapi/repository_control/model/create_repository_request.py new file mode 100644 index 000000000..319259f9a --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/create_repository_request.py @@ -0,0 +1,300 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.repository_control.model.document_schema import DocumentSchema + from pinecone.core.openapi.repository_control.model.repository_spec import RepositorySpec + + globals()["DocumentSchema"] = DocumentSchema + globals()["RepositorySpec"] = RepositorySpec + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="CreateRepositoryRequest") + + +class CreateRepositoryRequest(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ("name",): {"max_length": 45, "min_length": 1} + } + + @cached_class_property + def additional_properties_type(cls): + """ + 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_class_property + def openapi_types(cls): + """ + 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 + "spec": (RepositorySpec,), # noqa: E501 + "schema": (DocumentSchema,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "name": "name", # noqa: E501 + "spec": "spec", # noqa: E501 + "schema": "schema", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], name, spec, schema, *args, **kwargs) -> T: # noqa: E501 + """CreateRepositoryRequest - a model defined in OpenAPI + + Args: + name (str): The name of the repository. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. + spec (RepositorySpec): + schema (DocumentSchema): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.spec = spec + self.schema = schema + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, name, spec, schema, *args, **kwargs) -> None: # noqa: E501 + """CreateRepositoryRequest - a model defined in OpenAPI + + Args: + name (str): The name of the repository. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. + spec (RepositorySpec): + schema (DocumentSchema): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.spec = spec + self.schema = schema + 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/openapi/repository_control/model/document_schema.py b/pinecone/core/openapi/repository_control/model/document_schema.py new file mode 100644 index 000000000..2bb70a974 --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/document_schema.py @@ -0,0 +1,286 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.repository_control.model.document_schema_field_map import ( + DocumentSchemaFieldMap, + ) + + globals()["DocumentSchemaFieldMap"] = DocumentSchemaFieldMap + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="DocumentSchema") + + +class DocumentSchema(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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_class_property + def openapi_types(cls): + """ + 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 { + "fields": (DocumentSchemaFieldMap,) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "fields": "fields" # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E501 + """DocumentSchema - a model defined in OpenAPI + + Args: + fields (DocumentSchemaFieldMap): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.fields = fields + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, fields, *args, **kwargs) -> None: # noqa: E501 + """DocumentSchema - a model defined in OpenAPI + + Args: + fields (DocumentSchemaFieldMap): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.fields = fields + 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/openapi/repository_control/model/document_schema_field_map.py b/pinecone/core/openapi/repository_control/model/document_schema_field_map.py new file mode 100644 index 000000000..bf4b48b65 --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/document_schema_field_map.py @@ -0,0 +1,264 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="DocumentSchemaFieldMap") + + +class DocumentSchemaFieldMap(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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 ({str: (bool, dict, float, int, list, str, none_type)},) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + 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 {} + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = {} + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 + """DocumentSchemaFieldMap - 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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) -> None: # noqa: E501 + """DocumentSchemaFieldMap - 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/openapi/repository_control/model/error_response.py b/pinecone/core/openapi/repository_control/model/error_response.py new file mode 100644 index 000000000..f4a675942 --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/error_response.py @@ -0,0 +1,292 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.repository_control.model.error_response_error import ( + ErrorResponseError, + ) + + globals()["ErrorResponseError"] = ErrorResponseError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ErrorResponse") + + +class ErrorResponse(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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_class_property + def openapi_types(cls): + """ + 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_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "status": "status", # noqa: E501 + "error": "error", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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) -> None: # 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/openapi/repository_control/model/error_response_error.py b/pinecone/core/openapi/repository_control/model/error_response_error.py new file mode 100644 index 000000000..792b0b855 --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/error_response_error.py @@ -0,0 +1,286 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ErrorResponseError") + + +class ErrorResponseError(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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_class_property + def openapi_types(cls): + """ + 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_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "code": "code", # noqa: E501 + "message": "message", # noqa: E501 + "details": "details", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # noqa: E501 + """ErrorResponseError - a model defined in OpenAPI + + Args: + code (str): The code of the error. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, `UNPROCESSABLE_ENTITY`, or `PAYMENT_REQUIRED`. + 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 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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) -> None: # noqa: E501 + """ErrorResponseError - a model defined in OpenAPI + + Args: + code (str): The code of the error. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, `UNPROCESSABLE_ENTITY`, or `PAYMENT_REQUIRED`. + 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 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/openapi/repository_control/model/repository_list.py b/pinecone/core/openapi/repository_control/model/repository_list.py new file mode 100644 index 000000000..68f0c5564 --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/repository_list.py @@ -0,0 +1,278 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.repository_control.model.repository_model import RepositoryModel + + globals()["RepositoryModel"] = RepositoryModel + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="RepositoryList") + + +class RepositoryList(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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_class_property + def openapi_types(cls): + """ + 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 { + "repositories": ([RepositoryModel],) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "repositories": "repositories" # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 + """RepositoryList - 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,) + repositories ([RepositoryModel]): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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) -> None: # noqa: E501 + """RepositoryList - 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,) + repositories ([RepositoryModel]): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/openapi/repository_control/model/repository_model.py b/pinecone/core/openapi/repository_control/model/repository_model.py new file mode 100644 index 000000000..d3674be8e --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/repository_model.py @@ -0,0 +1,316 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.repository_control.model.document_schema import DocumentSchema + from pinecone.core.openapi.repository_control.model.repository_model_spec import ( + RepositoryModelSpec, + ) + from pinecone.core.openapi.repository_control.model.repository_model_status import ( + RepositoryModelStatus, + ) + + globals()["DocumentSchema"] = DocumentSchema + globals()["RepositoryModelSpec"] = RepositoryModelSpec + globals()["RepositoryModelStatus"] = RepositoryModelStatus + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="RepositoryModel") + + +class RepositoryModel(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ("name",): {"max_length": 45, "min_length": 1} + } + + @cached_class_property + def additional_properties_type(cls): + """ + 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_class_property + def openapi_types(cls): + """ + 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 + "host": (str,), # noqa: E501 + "spec": (RepositoryModelSpec,), # noqa: E501 + "status": (RepositoryModelStatus,), # noqa: E501 + "schema": (DocumentSchema,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "name": "name", # noqa: E501 + "host": "host", # noqa: E501 + "spec": "spec", # noqa: E501 + "status": "status", # noqa: E501 + "schema": "schema", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], name, host, spec, status, *args, **kwargs) -> T: # noqa: E501 + """RepositoryModel - a model defined in OpenAPI + + Args: + name (str): The name of the repository. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. + host (str): The URL address where the repository is hosted. + spec (RepositoryModelSpec): + status (RepositoryModelStatus): + + 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,) + schema (DocumentSchema): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, name, host, spec, status, *args, **kwargs) -> None: # noqa: E501 + """RepositoryModel - a model defined in OpenAPI + + Args: + name (str): The name of the repository. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. + host (str): The URL address where the repository is hosted. + spec (RepositoryModelSpec): + status (RepositoryModelStatus): + + 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,) + schema (DocumentSchema): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.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/openapi/ckb_knowledge_data/model/document_for_upsert.py b/pinecone/core/openapi/repository_control/model/repository_model_spec.py similarity index 93% rename from pinecone/core/openapi/ckb_knowledge_data/model/document_for_upsert.py rename to pinecone/core/openapi/repository_control/model/repository_model_spec.py index 1c8b4b67e..fdb090394 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/document_for_upsert.py +++ b/pinecone/core/openapi/repository_control/model/repository_model_spec.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Control Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 This file is @generated using OpenAPI. @@ -27,13 +27,19 @@ from pinecone.openapi_support.exceptions import PineconeApiAttributeError +def lazy_import(): + from pinecone.core.openapi.repository_control.model.serverless_spec import ServerlessSpec + + globals()["ServerlessSpec"] = ServerlessSpec + + from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="DocumentForUpsert") +T = TypeVar("T", bound="RepositoryModelSpec") -class DocumentForUpsert(ModelNormal): +class RepositoryModelSpec(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -69,6 +75,7 @@ def additional_properties_type(cls): 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 @@ -83,8 +90,9 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - "id": (str,) # noqa: E501 + "serverless": (ServerlessSpec,) # noqa: E501 } @cached_class_property @@ -92,7 +100,7 @@ def discriminator(cls): return None attribute_map: Dict[str, str] = { - "id": "_id" # noqa: E501 + "serverless": "serverless" # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -102,7 +110,7 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 - """DocumentForUpsert - a model defined in OpenAPI + """RepositoryModelSpec - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -135,7 +143,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - id (str): Optional unique identifier for the document. If not provided, a new ID will be generated. [optional] # noqa: E501 + serverless (ServerlessSpec): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -192,7 +200,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs) -> None: # noqa: E501 - """DocumentForUpsert - a model defined in OpenAPI + """RepositoryModelSpec - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -225,7 +233,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - id (str): Optional unique identifier for the document. If not provided, a new ID will be generated. [optional] # noqa: E501 + serverless (ServerlessSpec): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/repository_control/model/repository_model_status.py b/pinecone/core/openapi/repository_control/model/repository_model_status.py new file mode 100644 index 000000000..3ccc23d8a --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/repository_model_status.py @@ -0,0 +1,282 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="RepositoryModelStatus") + + +class RepositoryModelStatus(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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_class_property + def openapi_types(cls): + """ + 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_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "ready": "ready", # noqa: E501 + "state": "state", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], ready, state, *args, **kwargs) -> T: # noqa: E501 + """RepositoryModelStatus - a model defined in OpenAPI + + Args: + ready (bool): + state (str): The state of the repository. Possible values: `Initializing`, `InitializationFailed`, `Terminating`, `Ready`, or `Disabled`. + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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) -> None: # noqa: E501 + """RepositoryModelStatus - a model defined in OpenAPI + + Args: + ready (bool): + state (str): The state of the repository. Possible values: `Initializing`, `InitializationFailed`, `Terminating`, `Ready`, or `Disabled`. + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/openapi/repository_control/model/repository_spec.py b/pinecone/core/openapi/repository_control/model/repository_spec.py new file mode 100644 index 000000000..fe84c9dc7 --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/repository_spec.py @@ -0,0 +1,271 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.repository_control.model.serverless_spec import ServerlessSpec + + globals()["ServerlessSpec"] = ServerlessSpec + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="RepositorySpec") + + +class RepositorySpec(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + additional_properties_type = None + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + 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 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "serverless": "serverless" # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 + """RepositorySpec - 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 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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) -> None: # noqa: E501 + """RepositorySpec - 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 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/openapi/repository_control/model/serverless_spec.py b/pinecone/core/openapi/repository_control/model/serverless_spec.py new file mode 100644 index 000000000..6110aa02f --- /dev/null +++ b/pinecone/core/openapi/repository_control/model/serverless_spec.py @@ -0,0 +1,282 @@ +""" +Pinecone Control Plane API for Repositories + +Pinecone Repositories make it easy to search and retrieve billions of documents using lexical and semantic search. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: unstable +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + 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.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ServerlessSpec") + + +class ServerlessSpec(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + 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. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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_class_property + def openapi_types(cls): + """ + 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_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "cloud": "cloud", # noqa: E501 + "region": "region", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # noqa: E501 + """ServerlessSpec - a model defined in OpenAPI + + Args: + cloud (str): The public cloud where you would like your repository hosted. + region (str): The region where you would like your repository 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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) -> None: # noqa: E501 + """ServerlessSpec - a model defined in OpenAPI + + Args: + cloud (str): The public cloud where you would like your repository hosted. + region (str): The region where you would like your repository 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/openapi/repository_control/models/__init__.py b/pinecone/core/openapi/repository_control/models/__init__.py new file mode 100644 index 000000000..200da3d24 --- /dev/null +++ b/pinecone/core/openapi/repository_control/models/__init__.py @@ -0,0 +1,28 @@ +# 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.repository_control.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from pinecone.core.openapi.repository_control.model.create_repository_request import ( + CreateRepositoryRequest, +) +from pinecone.core.openapi.repository_control.model.document_schema import DocumentSchema +from pinecone.core.openapi.repository_control.model.document_schema_field_map import ( + DocumentSchemaFieldMap, +) +from pinecone.core.openapi.repository_control.model.error_response import ErrorResponse +from pinecone.core.openapi.repository_control.model.error_response_error import ErrorResponseError +from pinecone.core.openapi.repository_control.model.repository_list import RepositoryList +from pinecone.core.openapi.repository_control.model.repository_model import RepositoryModel +from pinecone.core.openapi.repository_control.model.repository_model_spec import RepositoryModelSpec +from pinecone.core.openapi.repository_control.model.repository_model_status import ( + RepositoryModelStatus, +) +from pinecone.core.openapi.repository_control.model.repository_spec import RepositorySpec +from pinecone.core.openapi.repository_control.model.serverless_spec import ServerlessSpec diff --git a/pinecone/core/openapi/ckb_knowledge_data/__init__.py b/pinecone/core/openapi/repository_data/__init__.py similarity index 82% rename from pinecone/core/openapi/ckb_knowledge_data/__init__.py rename to pinecone/core/openapi/repository_data/__init__.py index b00bb6f56..b661aaf50 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/__init__.py +++ b/pinecone/core/openapi/repository_data/__init__.py @@ -1,9 +1,9 @@ # flake8: noqa """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. diff --git a/pinecone/core/openapi/repository_data/api/__init__.py b/pinecone/core/openapi/repository_data/api/__init__.py new file mode 100644 index 000000000..a5d112a67 --- /dev/null +++ b/pinecone/core/openapi/repository_data/api/__init__.py @@ -0,0 +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.repository_data.apis import DocumentOperationsApi diff --git a/pinecone/core/openapi/ckb_knowledge_data/api/document_operations_api.py b/pinecone/core/openapi/repository_data/api/document_operations_api.py similarity index 89% rename from pinecone/core/openapi/ckb_knowledge_data/api/document_operations_api.py rename to pinecone/core/openapi/repository_data/api/document_operations_api.py index 9985bccdc..3b7e585fc 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/api/document_operations_api.py +++ b/pinecone/core/openapi/repository_data/api/document_operations_api.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. @@ -23,15 +23,14 @@ none_type, validate_and_convert_types, ) -from pinecone.core.openapi.ckb_knowledge_data.model.delete_document_response import ( +from pinecone.core.openapi.repository_data.model.delete_document_response import ( DeleteDocumentResponse, ) -from pinecone.core.openapi.ckb_knowledge_data.model.document_for_upsert import DocumentForUpsert -from pinecone.core.openapi.ckb_knowledge_data.model.get_document_response import GetDocumentResponse -from pinecone.core.openapi.ckb_knowledge_data.model.list_document_response import ( - ListDocumentResponse, +from pinecone.core.openapi.repository_data.model.get_document_response import GetDocumentResponse +from pinecone.core.openapi.repository_data.model.list_documents_response import ( + ListDocumentsResponse, ) -from pinecone.core.openapi.ckb_knowledge_data.model.upsert_document_response import ( +from pinecone.core.openapi.repository_data.model.upsert_document_response import ( UpsertDocumentResponse, ) @@ -93,7 +92,7 @@ def __delete_document(self, namespace, document_id, **kwargs: ExtraOpenApiKwargs settings={ "response_type": (DeleteDocumentResponse,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}/documents/{document_id}", + "endpoint_path": "/ckb-stub-namespaces/{namespace}/documents/{document_id}", "operation_id": "delete_document", "http_method": "DELETE", "servers": None, @@ -164,7 +163,7 @@ def __get_document(self, namespace, document_id, **kwargs: ExtraOpenApiKwargsTyp settings={ "response_type": (GetDocumentResponse,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}/documents/{document_id}", + "endpoint_path": "/ckb-stub-namespaces/{namespace}/documents/{document_id}", "operation_id": "get_document", "http_method": "GET", "servers": None, @@ -221,7 +220,7 @@ def __list_documents(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): async_req (bool): execute request asynchronously Returns: - ListDocumentResponse + ListDocumentsResponse If the method is called asynchronously, returns the request thread. """ @@ -231,9 +230,9 @@ def __list_documents(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): self.list_documents = _Endpoint( settings={ - "response_type": (ListDocumentResponse,), + "response_type": (ListDocumentsResponse,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}/documents", + "endpoint_path": "/ckb-stub-namespaces/{namespace}/documents", "operation_id": "list_documents", "http_method": "GET", "servers": None, @@ -258,21 +257,19 @@ def __list_documents(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__list_documents, ) - def __upsert_document( - self, namespace, document_for_upsert, **kwargs: ExtraOpenApiKwargsTypedDict - ): + def __upsert_document(self, namespace, request_body, **kwargs: ExtraOpenApiKwargsTypedDict): """Create or update a document in the given namespace # noqa: E501 Upserts a document into the specified namespace. The request body may contain any valid JSON document that conforms to the schema. Optionally, an `_id` field can be provided to use as the document's identifier; if omitted, the system will assign one. # 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_document(namespace, document_for_upsert, async_req=True) + >>> thread = api.upsert_document(namespace, request_body, async_req=True) >>> result = thread.get() Args: namespace (str): Namespace where the document will be stored. - document_for_upsert (DocumentForUpsert): + request_body ({str: (bool, dict, float, int, list, str, none_type)}): Keyword Args: _return_http_data_only (bool): response data without head status @@ -299,21 +296,21 @@ def __upsert_document( """ kwargs = self._process_openapi_kwargs(kwargs) kwargs["namespace"] = namespace - kwargs["document_for_upsert"] = document_for_upsert + kwargs["request_body"] = request_body return self.call_with_http_info(**kwargs) self.upsert_document = _Endpoint( settings={ "response_type": (UpsertDocumentResponse,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}/documents/upsert", + "endpoint_path": "/ckb-stub-namespaces/{namespace}/documents/upsert", "operation_id": "upsert_document", "http_method": "POST", "servers": None, }, params_map={ - "all": ["namespace", "document_for_upsert"], - "required": ["namespace", "document_for_upsert"], + "all": ["namespace", "request_body"], + "required": ["namespace", "request_body"], "nullable": [], "enum": [], "validation": [], @@ -321,9 +318,12 @@ def __upsert_document( root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"namespace": (str,), "document_for_upsert": (DocumentForUpsert,)}, + "openapi_types": { + "namespace": (str,), + "request_body": ({str: (bool, dict, float, int, list, str, none_type)},), + }, "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path", "document_for_upsert": "body"}, + "location_map": {"namespace": "path", "request_body": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -382,7 +382,7 @@ async def __delete_document(self, namespace, document_id, **kwargs): settings={ "response_type": (DeleteDocumentResponse,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}/documents/{document_id}", + "endpoint_path": "/ckb-stub-namespaces/{namespace}/documents/{document_id}", "operation_id": "delete_document", "http_method": "DELETE", "servers": None, @@ -446,7 +446,7 @@ async def __get_document(self, namespace, document_id, **kwargs): settings={ "response_type": (GetDocumentResponse,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}/documents/{document_id}", + "endpoint_path": "/ckb-stub-namespaces/{namespace}/documents/{document_id}", "operation_id": "get_document", "http_method": "GET", "servers": None, @@ -498,7 +498,7 @@ async def __list_documents(self, namespace, **kwargs): Default is True. Returns: - ListDocumentResponse + ListDocumentsResponse """ self._process_openapi_kwargs(kwargs) kwargs["namespace"] = namespace @@ -506,9 +506,9 @@ async def __list_documents(self, namespace, **kwargs): self.list_documents = _AsyncioEndpoint( settings={ - "response_type": (ListDocumentResponse,), + "response_type": (ListDocumentsResponse,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}/documents", + "endpoint_path": "/ckb-stub-namespaces/{namespace}/documents", "operation_id": "list_documents", "http_method": "GET", "servers": None, @@ -533,7 +533,7 @@ async def __list_documents(self, namespace, **kwargs): callable=__list_documents, ) - async def __upsert_document(self, namespace, document_for_upsert, **kwargs): + async def __upsert_document(self, namespace, request_body, **kwargs): """Create or update a document in the given namespace # noqa: E501 Upserts a document into the specified namespace. The request body may contain any valid JSON document that conforms to the schema. Optionally, an `_id` field can be provided to use as the document's identifier; if omitted, the system will assign one. # noqa: E501 @@ -541,7 +541,7 @@ async def __upsert_document(self, namespace, document_for_upsert, **kwargs): Args: namespace (str): Namespace where the document will be stored. - document_for_upsert (DocumentForUpsert): + request_body ({str: (bool, dict, float, int, list, str, none_type)}): Keyword Args: _return_http_data_only (bool): response data without head status @@ -565,21 +565,21 @@ async def __upsert_document(self, namespace, document_for_upsert, **kwargs): """ self._process_openapi_kwargs(kwargs) kwargs["namespace"] = namespace - kwargs["document_for_upsert"] = document_for_upsert + kwargs["request_body"] = request_body return await self.call_with_http_info(**kwargs) self.upsert_document = _AsyncioEndpoint( settings={ "response_type": (UpsertDocumentResponse,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}/documents/upsert", + "endpoint_path": "/ckb-stub-namespaces/{namespace}/documents/upsert", "operation_id": "upsert_document", "http_method": "POST", "servers": None, }, params_map={ - "all": ["namespace", "document_for_upsert"], - "required": ["namespace", "document_for_upsert"], + "all": ["namespace", "request_body"], + "required": ["namespace", "request_body"], "nullable": [], "enum": [], "validation": [], @@ -587,9 +587,12 @@ async def __upsert_document(self, namespace, document_for_upsert, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"namespace": (str,), "document_for_upsert": (DocumentForUpsert,)}, + "openapi_types": { + "namespace": (str,), + "request_body": ({str: (bool, dict, float, int, list, str, none_type)},), + }, "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path", "document_for_upsert": "body"}, + "location_map": {"namespace": "path", "request_body": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, diff --git a/pinecone/core/openapi/ckb_knowledge_data/apis/__init__.py b/pinecone/core/openapi/repository_data/apis/__init__.py similarity index 79% rename from pinecone/core/openapi/ckb_knowledge_data/apis/__init__.py rename to pinecone/core/openapi/repository_data/apis/__init__.py index e9aaf0362..44f505a0e 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/apis/__init__.py +++ b/pinecone/core/openapi/repository_data/apis/__init__.py @@ -13,6 +13,4 @@ # sys.setrecursionlimit(n) # Import APIs into API package: -from pinecone.core.openapi.ckb_knowledge_data.api.document_operations_api import ( - DocumentOperationsApi, -) +from pinecone.core.openapi.repository_data.api.document_operations_api import DocumentOperationsApi diff --git a/pinecone/core/openapi/repository_data/model/__init__.py b/pinecone/core/openapi/repository_data/model/__init__.py new file mode 100644 index 000000000..cfe32b784 --- /dev/null +++ b/pinecone/core/openapi/repository_data/model/__init__.py @@ -0,0 +1,5 @@ +# 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/openapi/ckb_knowledge_data/model/delete_document_response.py b/pinecone/core/openapi/repository_data/model/delete_document_response.py similarity index 97% rename from pinecone/core/openapi/ckb_knowledge_data/model/delete_document_response.py rename to pinecone/core/openapi/repository_data/model/delete_document_response.py index 8de625771..f1607674f 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/delete_document_response.py +++ b/pinecone/core/openapi/repository_data/model/delete_document_response.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. @@ -28,8 +28,8 @@ def lazy_import(): - from pinecone.core.openapi.ckb_knowledge_data.model.lsn_status import LSNStatus - from pinecone.core.openapi.ckb_knowledge_data.model.usage import Usage + from pinecone.core.openapi.repository_data.model.lsn_status import LSNStatus + from pinecone.core.openapi.repository_data.model.usage import Usage globals()["LSNStatus"] = LSNStatus globals()["Usage"] = Usage diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/document.py b/pinecone/core/openapi/repository_data/model/document.py similarity index 98% rename from pinecone/core/openapi/ckb_knowledge_data/model/document.py rename to pinecone/core/openapi/repository_data/model/document.py index e6b69febe..46ac58c32 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/document.py +++ b/pinecone/core/openapi/repository_data/model/document.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/document_list.py b/pinecone/core/openapi/repository_data/model/document_list.py similarity index 96% rename from pinecone/core/openapi/ckb_knowledge_data/model/document_list.py rename to pinecone/core/openapi/repository_data/model/document_list.py index aafffb501..55532fc54 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/document_list.py +++ b/pinecone/core/openapi/repository_data/model/document_list.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. @@ -28,7 +28,7 @@ def lazy_import(): - from pinecone.core.openapi.ckb_knowledge_data.model.document import Document + from pinecone.core.openapi.repository_data.model.document import Document globals()["Document"] = Document @@ -119,10 +119,10 @@ def __init__(self, *args, **kwargs) -> None: Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] ([Document]): The list of documents that exist in the knowledge base/namespace.. # noqa: E501 + args[0] ([Document]): The list of documents that exist in the Repository namespace.. # noqa: E501 Keyword Args: - value ([Document]): The list of documents that exist in the knowledge base/namespace.. # noqa: E501 + value ([Document]): The list of documents that exist in the Repository namespace.. # 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. @@ -211,10 +211,10 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] ([Document]): The list of documents that exist in the knowledge base/namespace. # noqa: E501 + args[0] ([Document]): The list of documents that exist in the Repository namespace. # noqa: E501 Keyword Args: - value ([Document]): The list of documents that exist in the knowledge base/namespace. # noqa: E501 + value ([Document]): The list of documents that exist in the Repository namespace. # 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. diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/get_document_response.py b/pinecone/core/openapi/repository_data/model/get_document_response.py similarity index 96% rename from pinecone/core/openapi/ckb_knowledge_data/model/get_document_response.py rename to pinecone/core/openapi/repository_data/model/get_document_response.py index f7197fe15..7ff1afb31 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/get_document_response.py +++ b/pinecone/core/openapi/repository_data/model/get_document_response.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. @@ -28,9 +28,9 @@ def lazy_import(): - from pinecone.core.openapi.ckb_knowledge_data.model.document import Document - from pinecone.core.openapi.ckb_knowledge_data.model.lsn_status import LSNStatus - from pinecone.core.openapi.ckb_knowledge_data.model.usage import Usage + from pinecone.core.openapi.repository_data.model.document import Document + from pinecone.core.openapi.repository_data.model.lsn_status import LSNStatus + from pinecone.core.openapi.repository_data.model.usage import Usage globals()["Document"] = Document globals()["LSNStatus"] = LSNStatus diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/list_document_response.py b/pinecone/core/openapi/repository_data/model/list_documents_response.py similarity index 94% rename from pinecone/core/openapi/ckb_knowledge_data/model/list_document_response.py rename to pinecone/core/openapi/repository_data/model/list_documents_response.py index 340a894eb..ee953eff8 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/list_document_response.py +++ b/pinecone/core/openapi/repository_data/model/list_documents_response.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. @@ -28,12 +28,10 @@ def lazy_import(): - from pinecone.core.openapi.ckb_knowledge_data.model.document_list import DocumentList - from pinecone.core.openapi.ckb_knowledge_data.model.lsn_status import LSNStatus - from pinecone.core.openapi.ckb_knowledge_data.model.pagination_response import ( - PaginationResponse, - ) - from pinecone.core.openapi.ckb_knowledge_data.model.usage import Usage + from pinecone.core.openapi.repository_data.model.document_list import DocumentList + from pinecone.core.openapi.repository_data.model.lsn_status import LSNStatus + from pinecone.core.openapi.repository_data.model.pagination_response import PaginationResponse + from pinecone.core.openapi.repository_data.model.usage import Usage globals()["DocumentList"] = DocumentList globals()["LSNStatus"] = LSNStatus @@ -44,10 +42,10 @@ def lazy_import(): from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="ListDocumentResponse") +T = TypeVar("T", bound="ListDocumentsResponse") -class ListDocumentResponse(ModelNormal): +class ListDocumentsResponse(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -128,7 +126,7 @@ def discriminator(cls): def _from_openapi_data( cls: Type[T], namespace, documents, usage, lsn_status, *args, **kwargs ) -> T: # noqa: E501 - """ListDocumentResponse - a model defined in OpenAPI + """ListDocumentsResponse - a model defined in OpenAPI Args: namespace (str): Namespace of the documents to fetch. @@ -228,7 +226,7 @@ def _from_openapi_data( @convert_js_args_to_python_args def __init__(self, namespace, documents, usage, lsn_status, *args, **kwargs) -> None: # noqa: E501 - """ListDocumentResponse - a model defined in OpenAPI + """ListDocumentsResponse - a model defined in OpenAPI Args: namespace (str): Namespace of the documents to fetch. diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/lsn_status.py b/pinecone/core/openapi/repository_data/model/lsn_status.py similarity index 98% rename from pinecone/core/openapi/ckb_knowledge_data/model/lsn_status.py rename to pinecone/core/openapi/repository_data/model/lsn_status.py index 3414f6e4c..574895313 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/lsn_status.py +++ b/pinecone/core/openapi/repository_data/model/lsn_status.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/pagination_response.py b/pinecone/core/openapi/repository_data/model/pagination_response.py similarity index 98% rename from pinecone/core/openapi/ckb_knowledge_data/model/pagination_response.py rename to pinecone/core/openapi/repository_data/model/pagination_response.py index 3ce1852ca..b1c119249 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/pagination_response.py +++ b/pinecone/core/openapi/repository_data/model/pagination_response.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/upsert_document_response.py b/pinecone/core/openapi/repository_data/model/upsert_document_response.py similarity index 98% rename from pinecone/core/openapi/ckb_knowledge_data/model/upsert_document_response.py rename to pinecone/core/openapi/repository_data/model/upsert_document_response.py index 0df0c51b0..cf2215b58 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/upsert_document_response.py +++ b/pinecone/core/openapi/repository_data/model/upsert_document_response.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. @@ -28,7 +28,7 @@ def lazy_import(): - from pinecone.core.openapi.ckb_knowledge_data.model.lsn_status import LSNStatus + from pinecone.core.openapi.repository_data.model.lsn_status import LSNStatus globals()["LSNStatus"] = LSNStatus diff --git a/pinecone/core/openapi/ckb_knowledge_data/model/usage.py b/pinecone/core/openapi/repository_data/model/usage.py similarity index 98% rename from pinecone/core/openapi/ckb_knowledge_data/model/usage.py rename to pinecone/core/openapi/repository_data/model/usage.py index 68f89e426..fa195ec90 100644 --- a/pinecone/core/openapi/ckb_knowledge_data/model/usage.py +++ b/pinecone/core/openapi/repository_data/model/usage.py @@ -1,7 +1,7 @@ """ -Pinecone Knowledge Base Data Plane API +Pinecone Data Plane API for Repositories -Pinecone Knowledge Base builds on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 +Pinecone Repositories build on the vector database to make it easy to store, search and retrieve your data. # noqa: E501 This file is @generated using OpenAPI. diff --git a/pinecone/core/openapi/repository_data/models/__init__.py b/pinecone/core/openapi/repository_data/models/__init__.py new file mode 100644 index 000000000..2615558ea --- /dev/null +++ b/pinecone/core/openapi/repository_data/models/__init__.py @@ -0,0 +1,26 @@ +# 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.repository_data.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from pinecone.core.openapi.repository_data.model.delete_document_response import ( + DeleteDocumentResponse, +) +from pinecone.core.openapi.repository_data.model.document import Document +from pinecone.core.openapi.repository_data.model.document_list import DocumentList +from pinecone.core.openapi.repository_data.model.get_document_response import GetDocumentResponse +from pinecone.core.openapi.repository_data.model.lsn_status import LSNStatus +from pinecone.core.openapi.repository_data.model.list_documents_response import ( + ListDocumentsResponse, +) +from pinecone.core.openapi.repository_data.model.pagination_response import PaginationResponse +from pinecone.core.openapi.repository_data.model.upsert_document_response import ( + UpsertDocumentResponse, +) +from pinecone.core.openapi.repository_data.model.usage import Usage