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

import datetime as dt
import typing

from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.request_options import RequestOptions
from ...types.lse_s3import_storage import LseS3ImportStorage
from ...types.status_c5a_enum import StatusC5AEnum
from .raw_client import AsyncRawS3SClient, RawS3SClient

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class S3SClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawS3SClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawS3SClient
        """
        return self._raw_client

    def list(
        self,
        *,
        project: int,
        ordering: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[LseS3ImportStorage]:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Get list of all S3 import storage connections set up with IAM role access.

        Parameters
        ----------
        project : int
            Project ID

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

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

        Returns
        -------
        typing.List[LseS3ImportStorage]


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.import_storage.s3s.list(
            project=1,
        )
        """
        _response = self._raw_client.list(project=project, ordering=ordering, request_options=request_options)
        return _response.data

    def create(
        self,
        *,
        project: int,
        role_arn: str,
        aws_access_key_id: typing.Optional[str] = OMIT,
        aws_secret_access_key: typing.Optional[str] = OMIT,
        aws_session_token: typing.Optional[str] = OMIT,
        aws_sse_kms_key_id: typing.Optional[str] = OMIT,
        bucket: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        external_id: typing.Optional[str] = OMIT,
        last_sync: typing.Optional[dt.datetime] = OMIT,
        last_sync_count: typing.Optional[int] = OMIT,
        last_sync_job: typing.Optional[str] = OMIT,
        legacy_auth: typing.Optional[bool] = OMIT,
        meta: typing.Optional[typing.Any] = OMIT,
        prefix: typing.Optional[str] = OMIT,
        presign: typing.Optional[bool] = OMIT,
        presign_ttl: typing.Optional[int] = OMIT,
        recursive_scan: typing.Optional[bool] = OMIT,
        regex_filter: typing.Optional[str] = OMIT,
        region_name: typing.Optional[str] = OMIT,
        s3endpoint: typing.Optional[str] = OMIT,
        status: typing.Optional[StatusC5AEnum] = OMIT,
        synchronizable: typing.Optional[bool] = OMIT,
        title: typing.Optional[str] = OMIT,
        traceback: typing.Optional[str] = OMIT,
        use_blob_urls: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseS3ImportStorage:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Create S3 import storage with IAM role access.

        Parameters
        ----------
        project : int
            A unique integer value identifying this project.

        role_arn : str
            AWS RoleArn

        aws_access_key_id : typing.Optional[str]
            AWS_ACCESS_KEY_ID

        aws_secret_access_key : typing.Optional[str]
            AWS_SECRET_ACCESS_KEY

        aws_session_token : typing.Optional[str]
            AWS_SESSION_TOKEN

        aws_sse_kms_key_id : typing.Optional[str]
            AWS SSE KMS Key ID

        bucket : typing.Optional[str]
            S3 bucket name

        description : typing.Optional[str]
            Cloud storage description

        external_id : typing.Optional[str]
            AWS ExternalId

        last_sync : typing.Optional[dt.datetime]
            Last sync finished time

        last_sync_count : typing.Optional[int]
            Count of tasks synced last time

        last_sync_job : typing.Optional[str]
            Last sync job ID

        legacy_auth : typing.Optional[bool]

        meta : typing.Optional[typing.Any]
            Meta and debug information about storage processes

        prefix : typing.Optional[str]
            S3 bucket prefix

        presign : typing.Optional[bool]

        presign_ttl : typing.Optional[int]
            Presigned URLs TTL (in minutes)

        recursive_scan : typing.Optional[bool]
            Perform recursive scan over the bucket content

        regex_filter : typing.Optional[str]
            Cloud storage regex for filtering objects

        region_name : typing.Optional[str]
            AWS Region

        s3endpoint : typing.Optional[str]
            S3 Endpoint

        status : typing.Optional[StatusC5AEnum]

        synchronizable : typing.Optional[bool]

        title : typing.Optional[str]
            Cloud storage title

        traceback : typing.Optional[str]
            Traceback report for the last failed sync

        use_blob_urls : typing.Optional[bool]
            Interpret objects as BLOBs and generate URLs

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

        Returns
        -------
        LseS3ImportStorage


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.import_storage.s3s.create(
            project=1,
            role_arn="role_arn",
        )
        """
        _response = self._raw_client.create(
            project=project,
            role_arn=role_arn,
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            aws_session_token=aws_session_token,
            aws_sse_kms_key_id=aws_sse_kms_key_id,
            bucket=bucket,
            description=description,
            external_id=external_id,
            last_sync=last_sync,
            last_sync_count=last_sync_count,
            last_sync_job=last_sync_job,
            legacy_auth=legacy_auth,
            meta=meta,
            prefix=prefix,
            presign=presign,
            presign_ttl=presign_ttl,
            recursive_scan=recursive_scan,
            regex_filter=regex_filter,
            region_name=region_name,
            s3endpoint=s3endpoint,
            status=status,
            synchronizable=synchronizable,
            title=title,
            traceback=traceback,
            use_blob_urls=use_blob_urls,
            request_options=request_options,
        )
        return _response.data

    def validate(
        self,
        *,
        project: int,
        role_arn: str,
        aws_access_key_id: typing.Optional[str] = OMIT,
        aws_secret_access_key: typing.Optional[str] = OMIT,
        aws_session_token: typing.Optional[str] = OMIT,
        aws_sse_kms_key_id: typing.Optional[str] = OMIT,
        bucket: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        external_id: typing.Optional[str] = OMIT,
        last_sync: typing.Optional[dt.datetime] = OMIT,
        last_sync_count: typing.Optional[int] = OMIT,
        last_sync_job: typing.Optional[str] = OMIT,
        legacy_auth: typing.Optional[bool] = OMIT,
        meta: typing.Optional[typing.Any] = OMIT,
        prefix: typing.Optional[str] = OMIT,
        presign: typing.Optional[bool] = OMIT,
        presign_ttl: typing.Optional[int] = OMIT,
        recursive_scan: typing.Optional[bool] = OMIT,
        regex_filter: typing.Optional[str] = OMIT,
        region_name: typing.Optional[str] = OMIT,
        s3endpoint: typing.Optional[str] = OMIT,
        status: typing.Optional[StatusC5AEnum] = OMIT,
        synchronizable: typing.Optional[bool] = OMIT,
        title: typing.Optional[str] = OMIT,
        traceback: typing.Optional[str] = OMIT,
        use_blob_urls: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Validate a specific S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        project : int
            A unique integer value identifying this project.

        role_arn : str
            AWS RoleArn

        aws_access_key_id : typing.Optional[str]
            AWS_ACCESS_KEY_ID

        aws_secret_access_key : typing.Optional[str]
            AWS_SECRET_ACCESS_KEY

        aws_session_token : typing.Optional[str]
            AWS_SESSION_TOKEN

        aws_sse_kms_key_id : typing.Optional[str]
            AWS SSE KMS Key ID

        bucket : typing.Optional[str]
            S3 bucket name

        description : typing.Optional[str]
            Cloud storage description

        external_id : typing.Optional[str]
            AWS ExternalId

        last_sync : typing.Optional[dt.datetime]
            Last sync finished time

        last_sync_count : typing.Optional[int]
            Count of tasks synced last time

        last_sync_job : typing.Optional[str]
            Last sync job ID

        legacy_auth : typing.Optional[bool]

        meta : typing.Optional[typing.Any]
            Meta and debug information about storage processes

        prefix : typing.Optional[str]
            S3 bucket prefix

        presign : typing.Optional[bool]

        presign_ttl : typing.Optional[int]
            Presigned URLs TTL (in minutes)

        recursive_scan : typing.Optional[bool]
            Perform recursive scan over the bucket content

        regex_filter : typing.Optional[str]
            Cloud storage regex for filtering objects

        region_name : typing.Optional[str]
            AWS Region

        s3endpoint : typing.Optional[str]
            S3 Endpoint

        status : typing.Optional[StatusC5AEnum]

        synchronizable : typing.Optional[bool]

        title : typing.Optional[str]
            Cloud storage title

        traceback : typing.Optional[str]
            Traceback report for the last failed sync

        use_blob_urls : typing.Optional[bool]
            Interpret objects as BLOBs and generate URLs

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

        Returns
        -------
        None

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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.import_storage.s3s.validate(
            project=1,
            role_arn="role_arn",
        )
        """
        _response = self._raw_client.validate(
            project=project,
            role_arn=role_arn,
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            aws_session_token=aws_session_token,
            aws_sse_kms_key_id=aws_sse_kms_key_id,
            bucket=bucket,
            description=description,
            external_id=external_id,
            last_sync=last_sync,
            last_sync_count=last_sync_count,
            last_sync_job=last_sync_job,
            legacy_auth=legacy_auth,
            meta=meta,
            prefix=prefix,
            presign=presign,
            presign_ttl=presign_ttl,
            recursive_scan=recursive_scan,
            regex_filter=regex_filter,
            region_name=region_name,
            s3endpoint=s3endpoint,
            status=status,
            synchronizable=synchronizable,
            title=title,
            traceback=traceback,
            use_blob_urls=use_blob_urls,
            request_options=request_options,
        )
        return _response.data

    def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LseS3ImportStorage:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Get a specific S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        LseS3ImportStorage


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.import_storage.s3s.get(
            id=1,
        )
        """
        _response = self._raw_client.get(id, request_options=request_options)
        return _response.data

    def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Delete a specific S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        None

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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.import_storage.s3s.delete(
            id=1,
        )
        """
        _response = self._raw_client.delete(id, request_options=request_options)
        return _response.data

    def update(
        self,
        id: int,
        *,
        aws_access_key_id: typing.Optional[str] = OMIT,
        aws_secret_access_key: typing.Optional[str] = OMIT,
        aws_session_token: typing.Optional[str] = OMIT,
        aws_sse_kms_key_id: typing.Optional[str] = OMIT,
        bucket: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        external_id: typing.Optional[str] = OMIT,
        last_sync: typing.Optional[dt.datetime] = OMIT,
        last_sync_count: typing.Optional[int] = OMIT,
        last_sync_job: typing.Optional[str] = OMIT,
        legacy_auth: typing.Optional[bool] = OMIT,
        meta: typing.Optional[typing.Any] = OMIT,
        prefix: typing.Optional[str] = OMIT,
        presign: typing.Optional[bool] = OMIT,
        presign_ttl: typing.Optional[int] = OMIT,
        project: typing.Optional[int] = OMIT,
        recursive_scan: typing.Optional[bool] = OMIT,
        regex_filter: typing.Optional[str] = OMIT,
        region_name: typing.Optional[str] = OMIT,
        role_arn: typing.Optional[str] = OMIT,
        s3endpoint: typing.Optional[str] = OMIT,
        status: typing.Optional[StatusC5AEnum] = OMIT,
        synchronizable: typing.Optional[bool] = OMIT,
        title: typing.Optional[str] = OMIT,
        traceback: typing.Optional[str] = OMIT,
        use_blob_urls: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseS3ImportStorage:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Update a specific S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        id : int

        aws_access_key_id : typing.Optional[str]
            AWS_ACCESS_KEY_ID

        aws_secret_access_key : typing.Optional[str]
            AWS_SECRET_ACCESS_KEY

        aws_session_token : typing.Optional[str]
            AWS_SESSION_TOKEN

        aws_sse_kms_key_id : typing.Optional[str]
            AWS SSE KMS Key ID

        bucket : typing.Optional[str]
            S3 bucket name

        description : typing.Optional[str]
            Cloud storage description

        external_id : typing.Optional[str]
            AWS ExternalId

        last_sync : typing.Optional[dt.datetime]
            Last sync finished time

        last_sync_count : typing.Optional[int]
            Count of tasks synced last time

        last_sync_job : typing.Optional[str]
            Last sync job ID

        legacy_auth : typing.Optional[bool]

        meta : typing.Optional[typing.Any]
            Meta and debug information about storage processes

        prefix : typing.Optional[str]
            S3 bucket prefix

        presign : typing.Optional[bool]

        presign_ttl : typing.Optional[int]
            Presigned URLs TTL (in minutes)

        project : typing.Optional[int]
            A unique integer value identifying this project.

        recursive_scan : typing.Optional[bool]
            Perform recursive scan over the bucket content

        regex_filter : typing.Optional[str]
            Cloud storage regex for filtering objects

        region_name : typing.Optional[str]
            AWS Region

        role_arn : typing.Optional[str]
            AWS RoleArn

        s3endpoint : typing.Optional[str]
            S3 Endpoint

        status : typing.Optional[StatusC5AEnum]

        synchronizable : typing.Optional[bool]

        title : typing.Optional[str]
            Cloud storage title

        traceback : typing.Optional[str]
            Traceback report for the last failed sync

        use_blob_urls : typing.Optional[bool]
            Interpret objects as BLOBs and generate URLs

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

        Returns
        -------
        LseS3ImportStorage


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.import_storage.s3s.update(
            id=1,
        )
        """
        _response = self._raw_client.update(
            id,
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            aws_session_token=aws_session_token,
            aws_sse_kms_key_id=aws_sse_kms_key_id,
            bucket=bucket,
            description=description,
            external_id=external_id,
            last_sync=last_sync,
            last_sync_count=last_sync_count,
            last_sync_job=last_sync_job,
            legacy_auth=legacy_auth,
            meta=meta,
            prefix=prefix,
            presign=presign,
            presign_ttl=presign_ttl,
            project=project,
            recursive_scan=recursive_scan,
            regex_filter=regex_filter,
            region_name=region_name,
            role_arn=role_arn,
            s3endpoint=s3endpoint,
            status=status,
            synchronizable=synchronizable,
            title=title,
            traceback=traceback,
            use_blob_urls=use_blob_urls,
            request_options=request_options,
        )
        return _response.data

    def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LseS3ImportStorage:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Sync tasks from an S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        LseS3ImportStorage


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.import_storage.s3s.sync(
            id=1,
        )
        """
        _response = self._raw_client.sync(id, request_options=request_options)
        return _response.data


class AsyncS3SClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawS3SClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawS3SClient
        """
        return self._raw_client

    async def list(
        self,
        *,
        project: int,
        ordering: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[LseS3ImportStorage]:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Get list of all S3 import storage connections set up with IAM role access.

        Parameters
        ----------
        project : int
            Project ID

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

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

        Returns
        -------
        typing.List[LseS3ImportStorage]


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.import_storage.s3s.list(
                project=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list(project=project, ordering=ordering, request_options=request_options)
        return _response.data

    async def create(
        self,
        *,
        project: int,
        role_arn: str,
        aws_access_key_id: typing.Optional[str] = OMIT,
        aws_secret_access_key: typing.Optional[str] = OMIT,
        aws_session_token: typing.Optional[str] = OMIT,
        aws_sse_kms_key_id: typing.Optional[str] = OMIT,
        bucket: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        external_id: typing.Optional[str] = OMIT,
        last_sync: typing.Optional[dt.datetime] = OMIT,
        last_sync_count: typing.Optional[int] = OMIT,
        last_sync_job: typing.Optional[str] = OMIT,
        legacy_auth: typing.Optional[bool] = OMIT,
        meta: typing.Optional[typing.Any] = OMIT,
        prefix: typing.Optional[str] = OMIT,
        presign: typing.Optional[bool] = OMIT,
        presign_ttl: typing.Optional[int] = OMIT,
        recursive_scan: typing.Optional[bool] = OMIT,
        regex_filter: typing.Optional[str] = OMIT,
        region_name: typing.Optional[str] = OMIT,
        s3endpoint: typing.Optional[str] = OMIT,
        status: typing.Optional[StatusC5AEnum] = OMIT,
        synchronizable: typing.Optional[bool] = OMIT,
        title: typing.Optional[str] = OMIT,
        traceback: typing.Optional[str] = OMIT,
        use_blob_urls: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseS3ImportStorage:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Create S3 import storage with IAM role access.

        Parameters
        ----------
        project : int
            A unique integer value identifying this project.

        role_arn : str
            AWS RoleArn

        aws_access_key_id : typing.Optional[str]
            AWS_ACCESS_KEY_ID

        aws_secret_access_key : typing.Optional[str]
            AWS_SECRET_ACCESS_KEY

        aws_session_token : typing.Optional[str]
            AWS_SESSION_TOKEN

        aws_sse_kms_key_id : typing.Optional[str]
            AWS SSE KMS Key ID

        bucket : typing.Optional[str]
            S3 bucket name

        description : typing.Optional[str]
            Cloud storage description

        external_id : typing.Optional[str]
            AWS ExternalId

        last_sync : typing.Optional[dt.datetime]
            Last sync finished time

        last_sync_count : typing.Optional[int]
            Count of tasks synced last time

        last_sync_job : typing.Optional[str]
            Last sync job ID

        legacy_auth : typing.Optional[bool]

        meta : typing.Optional[typing.Any]
            Meta and debug information about storage processes

        prefix : typing.Optional[str]
            S3 bucket prefix

        presign : typing.Optional[bool]

        presign_ttl : typing.Optional[int]
            Presigned URLs TTL (in minutes)

        recursive_scan : typing.Optional[bool]
            Perform recursive scan over the bucket content

        regex_filter : typing.Optional[str]
            Cloud storage regex for filtering objects

        region_name : typing.Optional[str]
            AWS Region

        s3endpoint : typing.Optional[str]
            S3 Endpoint

        status : typing.Optional[StatusC5AEnum]

        synchronizable : typing.Optional[bool]

        title : typing.Optional[str]
            Cloud storage title

        traceback : typing.Optional[str]
            Traceback report for the last failed sync

        use_blob_urls : typing.Optional[bool]
            Interpret objects as BLOBs and generate URLs

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

        Returns
        -------
        LseS3ImportStorage


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.import_storage.s3s.create(
                project=1,
                role_arn="role_arn",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            project=project,
            role_arn=role_arn,
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            aws_session_token=aws_session_token,
            aws_sse_kms_key_id=aws_sse_kms_key_id,
            bucket=bucket,
            description=description,
            external_id=external_id,
            last_sync=last_sync,
            last_sync_count=last_sync_count,
            last_sync_job=last_sync_job,
            legacy_auth=legacy_auth,
            meta=meta,
            prefix=prefix,
            presign=presign,
            presign_ttl=presign_ttl,
            recursive_scan=recursive_scan,
            regex_filter=regex_filter,
            region_name=region_name,
            s3endpoint=s3endpoint,
            status=status,
            synchronizable=synchronizable,
            title=title,
            traceback=traceback,
            use_blob_urls=use_blob_urls,
            request_options=request_options,
        )
        return _response.data

    async def validate(
        self,
        *,
        project: int,
        role_arn: str,
        aws_access_key_id: typing.Optional[str] = OMIT,
        aws_secret_access_key: typing.Optional[str] = OMIT,
        aws_session_token: typing.Optional[str] = OMIT,
        aws_sse_kms_key_id: typing.Optional[str] = OMIT,
        bucket: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        external_id: typing.Optional[str] = OMIT,
        last_sync: typing.Optional[dt.datetime] = OMIT,
        last_sync_count: typing.Optional[int] = OMIT,
        last_sync_job: typing.Optional[str] = OMIT,
        legacy_auth: typing.Optional[bool] = OMIT,
        meta: typing.Optional[typing.Any] = OMIT,
        prefix: typing.Optional[str] = OMIT,
        presign: typing.Optional[bool] = OMIT,
        presign_ttl: typing.Optional[int] = OMIT,
        recursive_scan: typing.Optional[bool] = OMIT,
        regex_filter: typing.Optional[str] = OMIT,
        region_name: typing.Optional[str] = OMIT,
        s3endpoint: typing.Optional[str] = OMIT,
        status: typing.Optional[StatusC5AEnum] = OMIT,
        synchronizable: typing.Optional[bool] = OMIT,
        title: typing.Optional[str] = OMIT,
        traceback: typing.Optional[str] = OMIT,
        use_blob_urls: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Validate a specific S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        project : int
            A unique integer value identifying this project.

        role_arn : str
            AWS RoleArn

        aws_access_key_id : typing.Optional[str]
            AWS_ACCESS_KEY_ID

        aws_secret_access_key : typing.Optional[str]
            AWS_SECRET_ACCESS_KEY

        aws_session_token : typing.Optional[str]
            AWS_SESSION_TOKEN

        aws_sse_kms_key_id : typing.Optional[str]
            AWS SSE KMS Key ID

        bucket : typing.Optional[str]
            S3 bucket name

        description : typing.Optional[str]
            Cloud storage description

        external_id : typing.Optional[str]
            AWS ExternalId

        last_sync : typing.Optional[dt.datetime]
            Last sync finished time

        last_sync_count : typing.Optional[int]
            Count of tasks synced last time

        last_sync_job : typing.Optional[str]
            Last sync job ID

        legacy_auth : typing.Optional[bool]

        meta : typing.Optional[typing.Any]
            Meta and debug information about storage processes

        prefix : typing.Optional[str]
            S3 bucket prefix

        presign : typing.Optional[bool]

        presign_ttl : typing.Optional[int]
            Presigned URLs TTL (in minutes)

        recursive_scan : typing.Optional[bool]
            Perform recursive scan over the bucket content

        regex_filter : typing.Optional[str]
            Cloud storage regex for filtering objects

        region_name : typing.Optional[str]
            AWS Region

        s3endpoint : typing.Optional[str]
            S3 Endpoint

        status : typing.Optional[StatusC5AEnum]

        synchronizable : typing.Optional[bool]

        title : typing.Optional[str]
            Cloud storage title

        traceback : typing.Optional[str]
            Traceback report for the last failed sync

        use_blob_urls : typing.Optional[bool]
            Interpret objects as BLOBs and generate URLs

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.import_storage.s3s.validate(
                project=1,
                role_arn="role_arn",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.validate(
            project=project,
            role_arn=role_arn,
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            aws_session_token=aws_session_token,
            aws_sse_kms_key_id=aws_sse_kms_key_id,
            bucket=bucket,
            description=description,
            external_id=external_id,
            last_sync=last_sync,
            last_sync_count=last_sync_count,
            last_sync_job=last_sync_job,
            legacy_auth=legacy_auth,
            meta=meta,
            prefix=prefix,
            presign=presign,
            presign_ttl=presign_ttl,
            recursive_scan=recursive_scan,
            regex_filter=regex_filter,
            region_name=region_name,
            s3endpoint=s3endpoint,
            status=status,
            synchronizable=synchronizable,
            title=title,
            traceback=traceback,
            use_blob_urls=use_blob_urls,
            request_options=request_options,
        )
        return _response.data

    async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LseS3ImportStorage:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Get a specific S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        LseS3ImportStorage


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.import_storage.s3s.get(
                id=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get(id, request_options=request_options)
        return _response.data

    async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Delete a specific S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.import_storage.s3s.delete(
                id=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete(id, request_options=request_options)
        return _response.data

    async def update(
        self,
        id: int,
        *,
        aws_access_key_id: typing.Optional[str] = OMIT,
        aws_secret_access_key: typing.Optional[str] = OMIT,
        aws_session_token: typing.Optional[str] = OMIT,
        aws_sse_kms_key_id: typing.Optional[str] = OMIT,
        bucket: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        external_id: typing.Optional[str] = OMIT,
        last_sync: typing.Optional[dt.datetime] = OMIT,
        last_sync_count: typing.Optional[int] = OMIT,
        last_sync_job: typing.Optional[str] = OMIT,
        legacy_auth: typing.Optional[bool] = OMIT,
        meta: typing.Optional[typing.Any] = OMIT,
        prefix: typing.Optional[str] = OMIT,
        presign: typing.Optional[bool] = OMIT,
        presign_ttl: typing.Optional[int] = OMIT,
        project: typing.Optional[int] = OMIT,
        recursive_scan: typing.Optional[bool] = OMIT,
        regex_filter: typing.Optional[str] = OMIT,
        region_name: typing.Optional[str] = OMIT,
        role_arn: typing.Optional[str] = OMIT,
        s3endpoint: typing.Optional[str] = OMIT,
        status: typing.Optional[StatusC5AEnum] = OMIT,
        synchronizable: typing.Optional[bool] = OMIT,
        title: typing.Optional[str] = OMIT,
        traceback: typing.Optional[str] = OMIT,
        use_blob_urls: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseS3ImportStorage:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Update a specific S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        id : int

        aws_access_key_id : typing.Optional[str]
            AWS_ACCESS_KEY_ID

        aws_secret_access_key : typing.Optional[str]
            AWS_SECRET_ACCESS_KEY

        aws_session_token : typing.Optional[str]
            AWS_SESSION_TOKEN

        aws_sse_kms_key_id : typing.Optional[str]
            AWS SSE KMS Key ID

        bucket : typing.Optional[str]
            S3 bucket name

        description : typing.Optional[str]
            Cloud storage description

        external_id : typing.Optional[str]
            AWS ExternalId

        last_sync : typing.Optional[dt.datetime]
            Last sync finished time

        last_sync_count : typing.Optional[int]
            Count of tasks synced last time

        last_sync_job : typing.Optional[str]
            Last sync job ID

        legacy_auth : typing.Optional[bool]

        meta : typing.Optional[typing.Any]
            Meta and debug information about storage processes

        prefix : typing.Optional[str]
            S3 bucket prefix

        presign : typing.Optional[bool]

        presign_ttl : typing.Optional[int]
            Presigned URLs TTL (in minutes)

        project : typing.Optional[int]
            A unique integer value identifying this project.

        recursive_scan : typing.Optional[bool]
            Perform recursive scan over the bucket content

        regex_filter : typing.Optional[str]
            Cloud storage regex for filtering objects

        region_name : typing.Optional[str]
            AWS Region

        role_arn : typing.Optional[str]
            AWS RoleArn

        s3endpoint : typing.Optional[str]
            S3 Endpoint

        status : typing.Optional[StatusC5AEnum]

        synchronizable : typing.Optional[bool]

        title : typing.Optional[str]
            Cloud storage title

        traceback : typing.Optional[str]
            Traceback report for the last failed sync

        use_blob_urls : typing.Optional[bool]
            Interpret objects as BLOBs and generate URLs

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

        Returns
        -------
        LseS3ImportStorage


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.import_storage.s3s.update(
                id=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            id,
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            aws_session_token=aws_session_token,
            aws_sse_kms_key_id=aws_sse_kms_key_id,
            bucket=bucket,
            description=description,
            external_id=external_id,
            last_sync=last_sync,
            last_sync_count=last_sync_count,
            last_sync_job=last_sync_job,
            legacy_auth=legacy_auth,
            meta=meta,
            prefix=prefix,
            presign=presign,
            presign_ttl=presign_ttl,
            project=project,
            recursive_scan=recursive_scan,
            regex_filter=regex_filter,
            region_name=region_name,
            role_arn=role_arn,
            s3endpoint=s3endpoint,
            status=status,
            synchronizable=synchronizable,
            title=title,
            traceback=traceback,
            use_blob_urls=use_blob_urls,
            request_options=request_options,
        )
        return _response.data

    async def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LseS3ImportStorage:
        """
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Sync tasks from an S3 import storage connection that was set up with IAM role access.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        LseS3ImportStorage


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.import_storage.s3s.sync(
                id=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.sync(id, request_options=request_options)
        return _response.data
