diff --git a/fern/openapi.json b/fern/openapi.json index cca2b6bf..09927f68 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -7033,12 +7033,7 @@ "in": "query", "name": "deleteDocuments", "schema": { - "default": "true", - "type": "string", - "enum": [ - "true", - "false" - ] + "type": "boolean" }, "description": "Also delete documents this connector imported. Defaults to true." } @@ -7817,40 +7812,84 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "const": true, - "description": "Confirms the namespace was deleted" - }, - "namespace": { - "type": "string", - "description": "Deleted namespace identifier" - }, - "deletedDocumentsCount": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991, - "description": "Number of documents permanently removed" + "oneOf": [ + { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "const": true, + "description": "Confirms the namespace was deleted" + }, + "status": { + "type": "string", + "const": "deleted", + "description": "The namespace and its content are gone" + }, + "namespace": { + "type": "string", + "description": "Deleted namespace identifier" + }, + "deletedDocumentsCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of documents permanently removed" + }, + "deletedMemoriesCount": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Number of memories permanently removed" + } + }, + "required": [ + "success", + "status", + "namespace", + "deletedDocumentsCount", + "deletedMemoriesCount" + ] }, - "deletedMemoriesCount": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991, - "description": "Number of memories permanently removed" + { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "const": true, + "description": "Confirms the namespace move was accepted" + }, + "status": { + "type": "string", + "const": "queued", + "description": "The move continues asynchronously after this response" + }, + "operationId": { + "type": "string", + "description": "Identifier used to trace the asynchronous move operation" + }, + "namespace": { + "type": "string", + "description": "Source namespace being removed" + }, + "moveTo": { + "type": "string", + "description": "Destination namespace receiving the content" + } + }, + "required": [ + "success", + "status", + "operationId", + "namespace", + "moveTo" + ] } - }, - "required": [ - "success", - "namespace", - "deletedDocumentsCount", - "deletedMemoriesCount" ] } } }, - "description": "Namespace permanently deleted" + "description": "Namespace permanently deleted (status \"deleted\"). A move answers 202 with status \"queued\"." }, "202": { "content": { diff --git a/pyproject.toml b/pyproject.toml index c1002583..6ba243b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "5.0.0rc1" +version = "5.0.0rc2" description = "The official Python library for the Supermemory API" readme = "README.md" license = "Apache-2.0" diff --git a/reference.md b/reference.md index ba5c13f2..68b18ce2 100644 --- a/reference.md +++ b/reference.md @@ -2213,7 +2213,7 @@ client.connectors.delete(
-**delete_documents:** `typing.Optional[DeleteConnectorsRequestDeleteDocuments]` — Also delete documents this connector imported. Defaults to true. +**delete_documents:** `typing.Optional[bool]` — Also delete documents this connector imported. Defaults to true.
diff --git a/src/supermemory/__init__.py b/src/supermemory/__init__.py index 7c2b2cb5..df6ca317 100644 --- a/src/supermemory/__init__.py +++ b/src/supermemory/__init__.py @@ -92,6 +92,10 @@ MetadataValue, Namespace, NamespaceDeleted, + NamespaceDeletedDeleted, + NamespaceDeletedQueued, + NamespaceDeleted_Deleted, + NamespaceDeleted_Queued, NamespaceDetails, NamespaceSystem, Organization, @@ -127,7 +131,6 @@ ) from . import connectors, documents, memories, namespaces, organization, profiles from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient - from .connectors import DeleteConnectorsRequestDeleteDocuments from .environment import SupermemoryEnvironment from .requests import ( BadRequestErrorBodyParams, @@ -196,7 +199,11 @@ MemoryParams, MemorySystemParams, MetadataValueParams, + NamespaceDeletedDeletedParams, NamespaceDeletedParams, + NamespaceDeletedQueuedParams, + NamespaceDeleted_DeletedParams, + NamespaceDeleted_QueuedParams, NamespaceDetailsParams, NamespaceParams, NamespaceSystemParams, @@ -301,7 +308,6 @@ "ConnectorSyncTrigger": ".types", "DefaultAioHttpClient": "._default_clients", "DefaultAsyncHttpxClient": "._default_clients", - "DeleteConnectorsRequestDeleteDocuments": ".connectors", "DeleteDocumentError": ".types", "DeleteDocumentErrorParams": ".requests", "DeleteDocumentsResult": ".types", @@ -377,7 +383,15 @@ "MetadataValueParams": ".requests", "Namespace": ".types", "NamespaceDeleted": ".types", + "NamespaceDeletedDeleted": ".types", + "NamespaceDeletedDeletedParams": ".requests", "NamespaceDeletedParams": ".requests", + "NamespaceDeletedQueued": ".types", + "NamespaceDeletedQueuedParams": ".requests", + "NamespaceDeleted_Deleted": ".types", + "NamespaceDeleted_DeletedParams": ".requests", + "NamespaceDeleted_Queued": ".types", + "NamespaceDeleted_QueuedParams": ".requests", "NamespaceDetails": ".types", "NamespaceDetailsParams": ".requests", "NamespaceParams": ".requests", @@ -544,7 +558,6 @@ def __dir__(): "ConnectorSyncTrigger", "DefaultAioHttpClient", "DefaultAsyncHttpxClient", - "DeleteConnectorsRequestDeleteDocuments", "DeleteDocumentError", "DeleteDocumentErrorParams", "DeleteDocumentsResult", @@ -621,7 +634,15 @@ def __dir__(): "MetadataValueParams", "Namespace", "NamespaceDeleted", + "NamespaceDeletedDeleted", + "NamespaceDeletedDeletedParams", "NamespaceDeletedParams", + "NamespaceDeletedQueued", + "NamespaceDeletedQueuedParams", + "NamespaceDeleted_Deleted", + "NamespaceDeleted_DeletedParams", + "NamespaceDeleted_Queued", + "NamespaceDeleted_QueuedParams", "NamespaceDetails", "NamespaceDetailsParams", "NamespaceParams", diff --git a/src/supermemory/connectors/__init__.py b/src/supermemory/connectors/__init__.py index 14909025..5cde0202 100644 --- a/src/supermemory/connectors/__init__.py +++ b/src/supermemory/connectors/__init__.py @@ -2,33 +2,3 @@ # isort: skip_file -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import DeleteConnectorsRequestDeleteDocuments -_dynamic_imports: typing.Dict[str, str] = {"DeleteConnectorsRequestDeleteDocuments": ".types"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["DeleteConnectorsRequestDeleteDocuments"] diff --git a/src/supermemory/connectors/client.py b/src/supermemory/connectors/client.py index fc54ffbf..7593d645 100644 --- a/src/supermemory/connectors/client.py +++ b/src/supermemory/connectors/client.py @@ -17,7 +17,6 @@ from ..types.connector_setup_result import ConnectorSetupResult from ..types.connector_sync_started import ConnectorSyncStarted from .raw_client import AsyncRawConnectorsClient, RawConnectorsClient -from .types.delete_connectors_request_delete_documents import DeleteConnectorsRequestDeleteDocuments # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -244,7 +243,7 @@ def delete( namespace: str, id: str, *, - delete_documents: typing.Optional[DeleteConnectorsRequestDeleteDocuments] = None, + delete_documents: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, extra_query: typing.Optional[typing.Mapping[str, typing.Any]] = None, @@ -262,7 +261,7 @@ def delete( id : str Connector identifier returned when the connector was created - delete_documents : typing.Optional[DeleteConnectorsRequestDeleteDocuments] + delete_documents : typing.Optional[bool] Also delete documents this connector imported. Defaults to true. request_options : typing.Optional[RequestOptions] @@ -644,7 +643,7 @@ async def delete( namespace: str, id: str, *, - delete_documents: typing.Optional[DeleteConnectorsRequestDeleteDocuments] = None, + delete_documents: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, extra_query: typing.Optional[typing.Mapping[str, typing.Any]] = None, @@ -662,7 +661,7 @@ async def delete( id : str Connector identifier returned when the connector was created - delete_documents : typing.Optional[DeleteConnectorsRequestDeleteDocuments] + delete_documents : typing.Optional[bool] Also delete documents this connector imported. Defaults to true. request_options : typing.Optional[RequestOptions] diff --git a/src/supermemory/connectors/raw_client.py b/src/supermemory/connectors/raw_client.py index 2395f157..3a1f081c 100644 --- a/src/supermemory/connectors/raw_client.py +++ b/src/supermemory/connectors/raw_client.py @@ -33,7 +33,6 @@ from ..types.connector_setup_result import ConnectorSetupResult from ..types.connector_sync_started import ConnectorSyncStarted from ..types.error_response import ErrorResponse -from .types.delete_connectors_request_delete_documents import DeleteConnectorsRequestDeleteDocuments from pydantic import ValidationError # this is used as the default value for optional parameters @@ -514,7 +513,7 @@ def delete( namespace: str, id: str, *, - delete_documents: typing.Optional[DeleteConnectorsRequestDeleteDocuments] = None, + delete_documents: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, extra_query: typing.Optional[typing.Mapping[str, typing.Any]] = None, @@ -532,7 +531,7 @@ def delete( id : str Connector identifier returned when the connector was created - delete_documents : typing.Optional[DeleteConnectorsRequestDeleteDocuments] + delete_documents : typing.Optional[bool] Also delete documents this connector imported. Defaults to true. request_options : typing.Optional[RequestOptions] @@ -1369,7 +1368,7 @@ async def delete( namespace: str, id: str, *, - delete_documents: typing.Optional[DeleteConnectorsRequestDeleteDocuments] = None, + delete_documents: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, extra_headers: typing.Optional[typing.Mapping[str, str]] = None, extra_query: typing.Optional[typing.Mapping[str, typing.Any]] = None, @@ -1387,7 +1386,7 @@ async def delete( id : str Connector identifier returned when the connector was created - delete_documents : typing.Optional[DeleteConnectorsRequestDeleteDocuments] + delete_documents : typing.Optional[bool] Also delete documents this connector imported. Defaults to true. request_options : typing.Optional[RequestOptions] diff --git a/src/supermemory/connectors/types/__init__.py b/src/supermemory/connectors/types/__init__.py deleted file mode 100644 index 0963f5a3..00000000 --- a/src/supermemory/connectors/types/__init__.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .delete_connectors_request_delete_documents import DeleteConnectorsRequestDeleteDocuments -_dynamic_imports: typing.Dict[str, str] = { - "DeleteConnectorsRequestDeleteDocuments": ".delete_connectors_request_delete_documents" -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["DeleteConnectorsRequestDeleteDocuments"] diff --git a/src/supermemory/connectors/types/delete_connectors_request_delete_documents.py b/src/supermemory/connectors/types/delete_connectors_request_delete_documents.py deleted file mode 100644 index cbffb5bb..00000000 --- a/src/supermemory/connectors/types/delete_connectors_request_delete_documents.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DeleteConnectorsRequestDeleteDocuments = typing.Union[typing.Literal["true", "false"], typing.Any] diff --git a/src/supermemory/core/client_wrapper.py b/src/supermemory/core/client_wrapper.py index 1955eb68..4ed96e7f 100644 --- a/src/supermemory/core/client_wrapper.py +++ b/src/supermemory/core/client_wrapper.py @@ -33,7 +33,7 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "supermemory/5.0.0rc1", + "User-Agent": "supermemory/5.0.0rc2", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", diff --git a/src/supermemory/namespaces/client.py b/src/supermemory/namespaces/client.py index 7768aaf0..070bd37f 100644 --- a/src/supermemory/namespaces/client.py +++ b/src/supermemory/namespaces/client.py @@ -134,7 +134,7 @@ def delete( Returns ------- NamespaceDeleted - Namespace permanently deleted + Namespace permanently deleted (status "deleted"). A move answers 202 with status "queued". Examples -------- @@ -330,7 +330,7 @@ async def delete( Returns ------- NamespaceDeleted - Namespace permanently deleted + Namespace permanently deleted (status "deleted"). A move answers 202 with status "queued". Examples -------- diff --git a/src/supermemory/namespaces/raw_client.py b/src/supermemory/namespaces/raw_client.py index a298513f..5d90c23d 100644 --- a/src/supermemory/namespaces/raw_client.py +++ b/src/supermemory/namespaces/raw_client.py @@ -247,7 +247,7 @@ def delete( Returns ------- HttpResponse[NamespaceDeleted] - Namespace permanently deleted + Namespace permanently deleted (status "deleted"). A move answers 202 with status "queued". """ _response = self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}", @@ -679,7 +679,7 @@ async def delete( Returns ------- AsyncHttpResponse[NamespaceDeleted] - Namespace permanently deleted + Namespace permanently deleted (status "deleted"). A move answers 202 with status "queued". """ _response = await self._client_wrapper.httpx_client.request( f"ns/{encode_path_param(namespace)}", diff --git a/src/supermemory/requests/__init__.py b/src/supermemory/requests/__init__.py index 4ad14415..b52199f1 100644 --- a/src/supermemory/requests/__init__.py +++ b/src/supermemory/requests/__init__.py @@ -75,7 +75,9 @@ from .memory_system import MemorySystemParams from .metadata_value import MetadataValueParams from .namespace import NamespaceParams - from .namespace_deleted import NamespaceDeletedParams + from .namespace_deleted import NamespaceDeletedParams, NamespaceDeleted_DeletedParams, NamespaceDeleted_QueuedParams + from .namespace_deleted_deleted import NamespaceDeletedDeletedParams + from .namespace_deleted_queued import NamespaceDeletedQueuedParams from .namespace_details import NamespaceDetailsParams from .namespace_system import NamespaceSystemParams from .organization import OrganizationParams @@ -165,7 +167,11 @@ "MemoryParams": ".memory", "MemorySystemParams": ".memory_system", "MetadataValueParams": ".metadata_value", + "NamespaceDeletedDeletedParams": ".namespace_deleted_deleted", "NamespaceDeletedParams": ".namespace_deleted", + "NamespaceDeletedQueuedParams": ".namespace_deleted_queued", + "NamespaceDeleted_DeletedParams": ".namespace_deleted", + "NamespaceDeleted_QueuedParams": ".namespace_deleted", "NamespaceDetailsParams": ".namespace_details", "NamespaceParams": ".namespace", "NamespaceSystemParams": ".namespace_system", @@ -280,7 +286,11 @@ def __dir__(): "MemoryParams", "MemorySystemParams", "MetadataValueParams", + "NamespaceDeletedDeletedParams", "NamespaceDeletedParams", + "NamespaceDeletedQueuedParams", + "NamespaceDeleted_DeletedParams", + "NamespaceDeleted_QueuedParams", "NamespaceDetailsParams", "NamespaceParams", "NamespaceSystemParams", diff --git a/src/supermemory/requests/namespace_deleted.py b/src/supermemory/requests/namespace_deleted.py index 721d3951..b3db5e74 100644 --- a/src/supermemory/requests/namespace_deleted.py +++ b/src/supermemory/requests/namespace_deleted.py @@ -1,28 +1,27 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import typing_extensions from ..core.serialization import FieldMetadata -class NamespaceDeletedParams(typing_extensions.TypedDict): +class NamespaceDeleted_DeletedParams(typing_extensions.TypedDict): + status: typing.Literal["deleted"] success: typing.Literal[True] - """ - Confirms the namespace was deleted - """ + namespace: str + deleted_documents_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedDocumentsCount")] + deleted_memories_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedMemoriesCount")] + +class NamespaceDeleted_QueuedParams(typing_extensions.TypedDict): + status: typing.Literal["queued"] + success: typing.Literal[True] + operation_id: typing_extensions.Annotated[str, FieldMetadata(alias="operationId")] namespace: str - """ - Deleted namespace identifier - """ + move_to: typing_extensions.Annotated[str, FieldMetadata(alias="moveTo")] - deleted_documents_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedDocumentsCount")] - """ - Number of documents permanently removed - """ - deleted_memories_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedMemoriesCount")] - """ - Number of memories permanently removed - """ +NamespaceDeletedParams = typing.Union[NamespaceDeleted_DeletedParams, NamespaceDeleted_QueuedParams] diff --git a/src/supermemory/requests/namespace_deleted_deleted.py b/src/supermemory/requests/namespace_deleted_deleted.py new file mode 100644 index 00000000..7437fe6d --- /dev/null +++ b/src/supermemory/requests/namespace_deleted_deleted.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ..core.serialization import FieldMetadata + + +class NamespaceDeletedDeletedParams(typing_extensions.TypedDict): + success: typing.Literal[True] + """ + Confirms the namespace was deleted + """ + + namespace: str + """ + Deleted namespace identifier + """ + + deleted_documents_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedDocumentsCount")] + """ + Number of documents permanently removed + """ + + deleted_memories_count: typing_extensions.Annotated[int, FieldMetadata(alias="deletedMemoriesCount")] + """ + Number of memories permanently removed + """ diff --git a/src/supermemory/requests/namespace_deleted_queued.py b/src/supermemory/requests/namespace_deleted_queued.py new file mode 100644 index 00000000..6f6fc9bd --- /dev/null +++ b/src/supermemory/requests/namespace_deleted_queued.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ..core.serialization import FieldMetadata + + +class NamespaceDeletedQueuedParams(typing_extensions.TypedDict): + success: typing.Literal[True] + """ + Confirms the namespace move was accepted + """ + + operation_id: typing_extensions.Annotated[str, FieldMetadata(alias="operationId")] + """ + Identifier used to trace the asynchronous move operation + """ + + namespace: str + """ + Source namespace being removed + """ + + move_to: typing_extensions.Annotated[str, FieldMetadata(alias="moveTo")] + """ + Destination namespace receiving the content + """ diff --git a/src/supermemory/types/__init__.py b/src/supermemory/types/__init__.py index 6c33597e..20037e77 100644 --- a/src/supermemory/types/__init__.py +++ b/src/supermemory/types/__init__.py @@ -92,7 +92,9 @@ from .memory_system import MemorySystem from .metadata_value import MetadataValue from .namespace import Namespace - from .namespace_deleted import NamespaceDeleted + from .namespace_deleted import NamespaceDeleted, NamespaceDeleted_Deleted, NamespaceDeleted_Queued + from .namespace_deleted_deleted import NamespaceDeletedDeleted + from .namespace_deleted_queued import NamespaceDeletedQueued from .namespace_details import NamespaceDetails from .namespace_system import NamespaceSystem from .organization import Organization @@ -205,6 +207,10 @@ "MetadataValue": ".metadata_value", "Namespace": ".namespace", "NamespaceDeleted": ".namespace_deleted", + "NamespaceDeletedDeleted": ".namespace_deleted_deleted", + "NamespaceDeletedQueued": ".namespace_deleted_queued", + "NamespaceDeleted_Deleted": ".namespace_deleted", + "NamespaceDeleted_Queued": ".namespace_deleted", "NamespaceDetails": ".namespace_details", "NamespaceSystem": ".namespace_system", "Organization": ".organization", @@ -341,6 +347,10 @@ def __dir__(): "MetadataValue", "Namespace", "NamespaceDeleted", + "NamespaceDeletedDeleted", + "NamespaceDeletedQueued", + "NamespaceDeleted_Deleted", + "NamespaceDeleted_Queued", "NamespaceDetails", "NamespaceSystem", "Organization", diff --git a/src/supermemory/types/namespace_deleted.py b/src/supermemory/types/namespace_deleted.py index 6ca9fbb1..ec944552 100644 --- a/src/supermemory/types/namespace_deleted.py +++ b/src/supermemory/types/namespace_deleted.py @@ -1,42 +1,45 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel - - -class NamespaceDeleted(UncheckedBaseModel): - success: typing.Literal[True] = pydantic.Field(default=True) - """ - Confirms the namespace was deleted - """ +from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata - namespace: str = pydantic.Field() - """ - Deleted namespace identifier - """ +class NamespaceDeleted_Deleted(UncheckedBaseModel): + status: typing.Literal["deleted"] = "deleted" + success: typing.Literal[True] = True + namespace: str deleted_documents_count: typing_extensions.Annotated[ - int, - FieldMetadata(alias="deletedDocumentsCount"), - pydantic.Field(alias="deletedDocumentsCount", description="Number of documents permanently removed"), + int, FieldMetadata(alias="deletedDocumentsCount"), pydantic.Field(alias="deletedDocumentsCount") ] - """ - Number of documents permanently removed - """ - deleted_memories_count: typing_extensions.Annotated[ - int, - FieldMetadata(alias="deletedMemoriesCount"), - pydantic.Field(alias="deletedMemoriesCount", description="Number of memories permanently removed"), + int, FieldMetadata(alias="deletedMemoriesCount"), pydantic.Field(alias="deletedMemoriesCount") + ] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class NamespaceDeleted_Queued(UncheckedBaseModel): + status: typing.Literal["queued"] = "queued" + success: typing.Literal[True] = True + operation_id: typing_extensions.Annotated[ + str, FieldMetadata(alias="operationId"), pydantic.Field(alias="operationId") ] - """ - Number of memories permanently removed - """ + namespace: str + move_to: typing_extensions.Annotated[str, FieldMetadata(alias="moveTo"), pydantic.Field(alias="moveTo")] if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -46,3 +49,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +NamespaceDeleted = typing_extensions.Annotated[ + typing.Union[NamespaceDeleted_Deleted, NamespaceDeleted_Queued], UnionMetadata(discriminant="status") +] diff --git a/src/supermemory/types/namespace_deleted_deleted.py b/src/supermemory/types/namespace_deleted_deleted.py new file mode 100644 index 00000000..05c09835 --- /dev/null +++ b/src/supermemory/types/namespace_deleted_deleted.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class NamespaceDeletedDeleted(UncheckedBaseModel): + success: typing.Literal[True] = pydantic.Field(default=True) + """ + Confirms the namespace was deleted + """ + + namespace: str = pydantic.Field() + """ + Deleted namespace identifier + """ + + deleted_documents_count: typing_extensions.Annotated[ + int, + FieldMetadata(alias="deletedDocumentsCount"), + pydantic.Field(alias="deletedDocumentsCount", description="Number of documents permanently removed"), + ] + """ + Number of documents permanently removed + """ + + deleted_memories_count: typing_extensions.Annotated[ + int, + FieldMetadata(alias="deletedMemoriesCount"), + pydantic.Field(alias="deletedMemoriesCount", description="Number of memories permanently removed"), + ] + """ + Number of memories permanently removed + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/supermemory/types/namespace_deleted_queued.py b/src/supermemory/types/namespace_deleted_queued.py new file mode 100644 index 00000000..acf46ee9 --- /dev/null +++ b/src/supermemory/types/namespace_deleted_queued.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class NamespaceDeletedQueued(UncheckedBaseModel): + success: typing.Literal[True] = pydantic.Field(default=True) + """ + Confirms the namespace move was accepted + """ + + operation_id: typing_extensions.Annotated[ + str, + FieldMetadata(alias="operationId"), + pydantic.Field(alias="operationId", description="Identifier used to trace the asynchronous move operation"), + ] + """ + Identifier used to trace the asynchronous move operation + """ + + namespace: str = pydantic.Field() + """ + Source namespace being removed + """ + + move_to: typing_extensions.Annotated[ + str, + FieldMetadata(alias="moveTo"), + pydantic.Field(alias="moveTo", description="Destination namespace receiving the content"), + ] + """ + Destination namespace receiving the content + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow