# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from .raw_client import AsyncRawImportStorageClient, RawImportStorageClient
from .types.list_types_import_storage_response_item import ListTypesImportStorageResponseItem

if typing.TYPE_CHECKING:
    from .azure.client import AsyncAzureClient, AzureClient
    from .azure_spi.client import AsyncAzureSpiClient, AzureSpiClient
    from .databricks.client import AsyncDatabricksClient, DatabricksClient
    from .gcs.client import AsyncGcsClient, GcsClient
    from .gcswif.client import AsyncGcswifClient, GcswifClient
    from .local.client import AsyncLocalClient, LocalClient
    from .redis.client import AsyncRedisClient, RedisClient
    from .s3.client import AsyncS3Client, S3Client
    from .s3s.client import AsyncS3SClient, S3SClient


class ImportStorageClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawImportStorageClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._azure: typing.Optional[AzureClient] = None
        self._azure_spi: typing.Optional[AzureSpiClient] = None
        self._databricks: typing.Optional[DatabricksClient] = None
        self._gcs: typing.Optional[GcsClient] = None
        self._gcswif: typing.Optional[GcswifClient] = None
        self._local: typing.Optional[LocalClient] = None
        self._redis: typing.Optional[RedisClient] = None
        self._s3: typing.Optional[S3Client] = None
        self._s3s: typing.Optional[S3SClient] = None

    @property
    def with_raw_response(self) -> RawImportStorageClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawImportStorageClient
        """
        return self._raw_client

    def list_types(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ListTypesImportStorageResponseItem]:
        """
        Retrieve a list of the import storages types.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[ListTypesImportStorageResponseItem]
            List of import storage types

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.import_storage.list_types()
        """
        _response = self._raw_client.list_types(request_options=request_options)
        return _response.data

    @property
    def azure(self):
        if self._azure is None:
            from .azure.client import AzureClient  # noqa: E402

            self._azure = AzureClient(client_wrapper=self._client_wrapper)
        return self._azure

    @property
    def azure_spi(self):
        if self._azure_spi is None:
            from .azure_spi.client import AzureSpiClient  # noqa: E402

            self._azure_spi = AzureSpiClient(client_wrapper=self._client_wrapper)
        return self._azure_spi

    @property
    def databricks(self):
        if self._databricks is None:
            from .databricks.client import DatabricksClient  # noqa: E402

            self._databricks = DatabricksClient(client_wrapper=self._client_wrapper)
        return self._databricks

    @property
    def gcs(self):
        if self._gcs is None:
            from .gcs.client import GcsClient  # noqa: E402

            self._gcs = GcsClient(client_wrapper=self._client_wrapper)
        return self._gcs

    @property
    def gcswif(self):
        if self._gcswif is None:
            from .gcswif.client import GcswifClient  # noqa: E402

            self._gcswif = GcswifClient(client_wrapper=self._client_wrapper)
        return self._gcswif

    @property
    def local(self):
        if self._local is None:
            from .local.client import LocalClient  # noqa: E402

            self._local = LocalClient(client_wrapper=self._client_wrapper)
        return self._local

    @property
    def redis(self):
        if self._redis is None:
            from .redis.client import RedisClient  # noqa: E402

            self._redis = RedisClient(client_wrapper=self._client_wrapper)
        return self._redis

    @property
    def s3(self):
        if self._s3 is None:
            from .s3.client import S3Client  # noqa: E402

            self._s3 = S3Client(client_wrapper=self._client_wrapper)
        return self._s3

    @property
    def s3s(self):
        if self._s3s is None:
            from .s3s.client import S3SClient  # noqa: E402

            self._s3s = S3SClient(client_wrapper=self._client_wrapper)
        return self._s3s


class AsyncImportStorageClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawImportStorageClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._azure: typing.Optional[AsyncAzureClient] = None
        self._azure_spi: typing.Optional[AsyncAzureSpiClient] = None
        self._databricks: typing.Optional[AsyncDatabricksClient] = None
        self._gcs: typing.Optional[AsyncGcsClient] = None
        self._gcswif: typing.Optional[AsyncGcswifClient] = None
        self._local: typing.Optional[AsyncLocalClient] = None
        self._redis: typing.Optional[AsyncRedisClient] = None
        self._s3: typing.Optional[AsyncS3Client] = None
        self._s3s: typing.Optional[AsyncS3SClient] = None

    @property
    def with_raw_response(self) -> AsyncRawImportStorageClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawImportStorageClient
        """
        return self._raw_client

    async def list_types(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ListTypesImportStorageResponseItem]:
        """
        Retrieve a list of the import storages types.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[ListTypesImportStorageResponseItem]
            List of import storage types

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.import_storage.list_types()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_types(request_options=request_options)
        return _response.data

    @property
    def azure(self):
        if self._azure is None:
            from .azure.client import AsyncAzureClient  # noqa: E402

            self._azure = AsyncAzureClient(client_wrapper=self._client_wrapper)
        return self._azure

    @property
    def azure_spi(self):
        if self._azure_spi is None:
            from .azure_spi.client import AsyncAzureSpiClient  # noqa: E402

            self._azure_spi = AsyncAzureSpiClient(client_wrapper=self._client_wrapper)
        return self._azure_spi

    @property
    def databricks(self):
        if self._databricks is None:
            from .databricks.client import AsyncDatabricksClient  # noqa: E402

            self._databricks = AsyncDatabricksClient(client_wrapper=self._client_wrapper)
        return self._databricks

    @property
    def gcs(self):
        if self._gcs is None:
            from .gcs.client import AsyncGcsClient  # noqa: E402

            self._gcs = AsyncGcsClient(client_wrapper=self._client_wrapper)
        return self._gcs

    @property
    def gcswif(self):
        if self._gcswif is None:
            from .gcswif.client import AsyncGcswifClient  # noqa: E402

            self._gcswif = AsyncGcswifClient(client_wrapper=self._client_wrapper)
        return self._gcswif

    @property
    def local(self):
        if self._local is None:
            from .local.client import AsyncLocalClient  # noqa: E402

            self._local = AsyncLocalClient(client_wrapper=self._client_wrapper)
        return self._local

    @property
    def redis(self):
        if self._redis is None:
            from .redis.client import AsyncRedisClient  # noqa: E402

            self._redis = AsyncRedisClient(client_wrapper=self._client_wrapper)
        return self._redis

    @property
    def s3(self):
        if self._s3 is None:
            from .s3.client import AsyncS3Client  # noqa: E402

            self._s3 = AsyncS3Client(client_wrapper=self._client_wrapper)
        return self._s3

    @property
    def s3s(self):
        if self._s3s is None:
            from .s3s.client import AsyncS3SClient  # noqa: E402

            self._s3s = AsyncS3SClient(client_wrapper=self._client_wrapper)
        return self._s3s
