# 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.hotkeys import Hotkeys
from ..types.lse_user import LseUser
from ..types.lse_user_api import LseUserApi
from ..types.who_am_i_user import WhoAmIUser
from .raw_client import AsyncRawUsersClient, RawUsersClient
from .types.get_token_users_response import GetTokenUsersResponse
from .types.reset_token_users_response import ResetTokenUsersResponse

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


class UsersClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawUsersClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawUsersClient
        """
        return self._raw_client

    def get_current_user(self, *, request_options: typing.Optional[RequestOptions] = None) -> LseUserApi:
        """
        <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 info about the currently authenticated user.

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

        Returns
        -------
        LseUserApi


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

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

    def update_current_user(
        self,
        *,
        active_organization: typing.Optional[int] = OMIT,
        allow_newsletters: typing.Optional[bool] = OMIT,
        custom_hotkeys: typing.Optional[typing.Any] = OMIT,
        date_joined: typing.Optional[dt.datetime] = OMIT,
        email_notification_settings: typing.Optional[typing.Any] = OMIT,
        first_name: typing.Optional[str] = OMIT,
        is_email_verified: typing.Optional[bool] = OMIT,
        last_name: typing.Optional[str] = OMIT,
        onboarding_state: typing.Optional[str] = OMIT,
        password: typing.Optional[str] = OMIT,
        phone: typing.Optional[str] = OMIT,
        username: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseUserApi:
        """
        <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 details for the currently authenticated user.

        Parameters
        ----------
        active_organization : typing.Optional[int]

        allow_newsletters : typing.Optional[bool]
            Allow sending newsletters to user

        custom_hotkeys : typing.Optional[typing.Any]
            Custom keyboard shortcuts configuration for the user interface

        date_joined : typing.Optional[dt.datetime]

        email_notification_settings : typing.Optional[typing.Any]

        first_name : typing.Optional[str]

        is_email_verified : typing.Optional[bool]

        last_name : typing.Optional[str]

        onboarding_state : typing.Optional[str]

        password : typing.Optional[str]

        phone : typing.Optional[str]

        username : typing.Optional[str]

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

        Returns
        -------
        LseUserApi


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.users.update_current_user()
        """
        _response = self._raw_client.update_current_user(
            active_organization=active_organization,
            allow_newsletters=allow_newsletters,
            custom_hotkeys=custom_hotkeys,
            date_joined=date_joined,
            email_notification_settings=email_notification_settings,
            first_name=first_name,
            is_email_verified=is_email_verified,
            last_name=last_name,
            onboarding_state=onboarding_state,
            password=password,
            phone=phone,
            username=username,
            request_options=request_options,
        )
        return _response.data

    def get_hotkeys(self, *, request_options: typing.Optional[RequestOptions] = None) -> Hotkeys:
        """
        Retrieve the custom hotkeys configuration for the current user.

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

        Returns
        -------
        Hotkeys


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

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

    def update_hotkeys(
        self,
        *,
        custom_hotkeys: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Hotkeys:
        """
        Update the custom hotkeys configuration for the current user.

        Parameters
        ----------
        custom_hotkeys : typing.Optional[typing.Dict[str, typing.Any]]

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

        Returns
        -------
        Hotkeys


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.users.update_hotkeys()
        """
        _response = self._raw_client.update_hotkeys(custom_hotkeys=custom_hotkeys, request_options=request_options)
        return _response.data

    def reset_token(self, *, request_options: typing.Optional[RequestOptions] = None) -> ResetTokenUsersResponse:
        """
        Reset the user token for the current user.

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

        Returns
        -------
        ResetTokenUsersResponse
            User token response

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

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

    def get_token(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetTokenUsersResponse:
        """
        Get a user token to authenticate to the API as the current user.

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

        Returns
        -------
        GetTokenUsersResponse
            User token response

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

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

    def whoami(self, *, request_options: typing.Optional[RequestOptions] = None) -> WhoAmIUser:
        """
        Retrieve details of the account that you are using to access the API.

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

        Returns
        -------
        WhoAmIUser


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

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

    def list(
        self, *, ordering: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[LseUserApi]:
        """
        List the users that exist on the Label Studio server.

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

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

        Returns
        -------
        typing.List[LseUserApi]


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.users.list()
        """
        _response = self._raw_client.list(ordering=ordering, request_options=request_options)
        return _response.data

    def create(
        self,
        *,
        allow_newsletters: typing.Optional[bool] = OMIT,
        avatar: typing.Optional[str] = OMIT,
        email: typing.Optional[str] = OMIT,
        first_name: typing.Optional[str] = OMIT,
        id: typing.Optional[int] = OMIT,
        initials: typing.Optional[str] = OMIT,
        last_name: typing.Optional[str] = OMIT,
        phone: typing.Optional[str] = OMIT,
        username: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseUser:
        """
        Create a user in Label Studio.

        Parameters
        ----------
        allow_newsletters : typing.Optional[bool]
            Whether the user allows newsletters

        avatar : typing.Optional[str]
            Avatar URL of the user

        email : typing.Optional[str]
            Email of the user

        first_name : typing.Optional[str]
            First name of the user

        id : typing.Optional[int]
            User ID

        initials : typing.Optional[str]
            Initials of the user

        last_name : typing.Optional[str]
            Last name of the user

        phone : typing.Optional[str]
            Phone number of the user

        username : typing.Optional[str]
            Username of the user

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

        Returns
        -------
        LseUser


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.users.create()
        """
        _response = self._raw_client.create(
            allow_newsletters=allow_newsletters,
            avatar=avatar,
            email=email,
            first_name=first_name,
            id=id,
            initials=initials,
            last_name=last_name,
            phone=phone,
            username=username,
            request_options=request_options,
        )
        return _response.data

    def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LseUser:
        """
        Get info about a specific Label Studio user, based on the user ID.

        Parameters
        ----------
        id : int
            User ID

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

        Returns
        -------
        LseUser


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.users.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:
        """
        Delete a specific Label Studio user. Only available in community edition.

        <Warning>Use caution when deleting a user, as this can cause issues such as breaking the "Annotated by" filter or leaving orphaned records.</Warning>

        Parameters
        ----------
        id : int
            User ID

        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.users.delete(
            id=1,
        )
        """
        _response = self._raw_client.delete(id, request_options=request_options)
        return _response.data

    def update(
        self,
        id: int,
        *,
        allow_newsletters: typing.Optional[bool] = OMIT,
        avatar: typing.Optional[str] = OMIT,
        email: typing.Optional[str] = OMIT,
        first_name: typing.Optional[str] = OMIT,
        update_users_request_id: typing.Optional[int] = OMIT,
        initials: typing.Optional[str] = OMIT,
        last_name: typing.Optional[str] = OMIT,
        phone: typing.Optional[str] = OMIT,
        username: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseUser:
        """

                Update details for a specific user, such as their name or contact information, in Label Studio.


        Parameters
        ----------
        id : int
            User ID

        allow_newsletters : typing.Optional[bool]
            Whether the user allows newsletters

        avatar : typing.Optional[str]
            Avatar URL of the user

        email : typing.Optional[str]
            Email of the user

        first_name : typing.Optional[str]
            First name of the user

        update_users_request_id : typing.Optional[int]
            User ID

        initials : typing.Optional[str]
            Initials of the user

        last_name : typing.Optional[str]
            Last name of the user

        phone : typing.Optional[str]
            Phone number of the user

        username : typing.Optional[str]
            Username of the user

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

        Returns
        -------
        LseUser


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.users.update(
            id=1,
        )
        """
        _response = self._raw_client.update(
            id,
            allow_newsletters=allow_newsletters,
            avatar=avatar,
            email=email,
            first_name=first_name,
            update_users_request_id=update_users_request_id,
            initials=initials,
            last_name=last_name,
            phone=phone,
            username=username,
            request_options=request_options,
        )
        return _response.data


class AsyncUsersClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawUsersClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawUsersClient
        """
        return self._raw_client

    async def get_current_user(self, *, request_options: typing.Optional[RequestOptions] = None) -> LseUserApi:
        """
        <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 info about the currently authenticated user.

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

        Returns
        -------
        LseUserApi


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.get_current_user()


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

    async def update_current_user(
        self,
        *,
        active_organization: typing.Optional[int] = OMIT,
        allow_newsletters: typing.Optional[bool] = OMIT,
        custom_hotkeys: typing.Optional[typing.Any] = OMIT,
        date_joined: typing.Optional[dt.datetime] = OMIT,
        email_notification_settings: typing.Optional[typing.Any] = OMIT,
        first_name: typing.Optional[str] = OMIT,
        is_email_verified: typing.Optional[bool] = OMIT,
        last_name: typing.Optional[str] = OMIT,
        onboarding_state: typing.Optional[str] = OMIT,
        password: typing.Optional[str] = OMIT,
        phone: typing.Optional[str] = OMIT,
        username: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseUserApi:
        """
        <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 details for the currently authenticated user.

        Parameters
        ----------
        active_organization : typing.Optional[int]

        allow_newsletters : typing.Optional[bool]
            Allow sending newsletters to user

        custom_hotkeys : typing.Optional[typing.Any]
            Custom keyboard shortcuts configuration for the user interface

        date_joined : typing.Optional[dt.datetime]

        email_notification_settings : typing.Optional[typing.Any]

        first_name : typing.Optional[str]

        is_email_verified : typing.Optional[bool]

        last_name : typing.Optional[str]

        onboarding_state : typing.Optional[str]

        password : typing.Optional[str]

        phone : typing.Optional[str]

        username : typing.Optional[str]

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

        Returns
        -------
        LseUserApi


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.update_current_user()


        asyncio.run(main())
        """
        _response = await self._raw_client.update_current_user(
            active_organization=active_organization,
            allow_newsletters=allow_newsletters,
            custom_hotkeys=custom_hotkeys,
            date_joined=date_joined,
            email_notification_settings=email_notification_settings,
            first_name=first_name,
            is_email_verified=is_email_verified,
            last_name=last_name,
            onboarding_state=onboarding_state,
            password=password,
            phone=phone,
            username=username,
            request_options=request_options,
        )
        return _response.data

    async def get_hotkeys(self, *, request_options: typing.Optional[RequestOptions] = None) -> Hotkeys:
        """
        Retrieve the custom hotkeys configuration for the current user.

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

        Returns
        -------
        Hotkeys


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.get_hotkeys()


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

    async def update_hotkeys(
        self,
        *,
        custom_hotkeys: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Hotkeys:
        """
        Update the custom hotkeys configuration for the current user.

        Parameters
        ----------
        custom_hotkeys : typing.Optional[typing.Dict[str, typing.Any]]

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

        Returns
        -------
        Hotkeys


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.update_hotkeys()


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

    async def reset_token(self, *, request_options: typing.Optional[RequestOptions] = None) -> ResetTokenUsersResponse:
        """
        Reset the user token for the current user.

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

        Returns
        -------
        ResetTokenUsersResponse
            User token response

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.reset_token()


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

    async def get_token(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetTokenUsersResponse:
        """
        Get a user token to authenticate to the API as the current user.

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

        Returns
        -------
        GetTokenUsersResponse
            User token response

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.get_token()


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

    async def whoami(self, *, request_options: typing.Optional[RequestOptions] = None) -> WhoAmIUser:
        """
        Retrieve details of the account that you are using to access the API.

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

        Returns
        -------
        WhoAmIUser


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.whoami()


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

    async def list(
        self, *, ordering: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[LseUserApi]:
        """
        List the users that exist on the Label Studio server.

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

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

        Returns
        -------
        typing.List[LseUserApi]


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.list()


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

    async def create(
        self,
        *,
        allow_newsletters: typing.Optional[bool] = OMIT,
        avatar: typing.Optional[str] = OMIT,
        email: typing.Optional[str] = OMIT,
        first_name: typing.Optional[str] = OMIT,
        id: typing.Optional[int] = OMIT,
        initials: typing.Optional[str] = OMIT,
        last_name: typing.Optional[str] = OMIT,
        phone: typing.Optional[str] = OMIT,
        username: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseUser:
        """
        Create a user in Label Studio.

        Parameters
        ----------
        allow_newsletters : typing.Optional[bool]
            Whether the user allows newsletters

        avatar : typing.Optional[str]
            Avatar URL of the user

        email : typing.Optional[str]
            Email of the user

        first_name : typing.Optional[str]
            First name of the user

        id : typing.Optional[int]
            User ID

        initials : typing.Optional[str]
            Initials of the user

        last_name : typing.Optional[str]
            Last name of the user

        phone : typing.Optional[str]
            Phone number of the user

        username : typing.Optional[str]
            Username of the user

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

        Returns
        -------
        LseUser


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.create()


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            allow_newsletters=allow_newsletters,
            avatar=avatar,
            email=email,
            first_name=first_name,
            id=id,
            initials=initials,
            last_name=last_name,
            phone=phone,
            username=username,
            request_options=request_options,
        )
        return _response.data

    async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LseUser:
        """
        Get info about a specific Label Studio user, based on the user ID.

        Parameters
        ----------
        id : int
            User ID

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

        Returns
        -------
        LseUser


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.users.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:
        """
        Delete a specific Label Studio user. Only available in community edition.

        <Warning>Use caution when deleting a user, as this can cause issues such as breaking the "Annotated by" filter or leaving orphaned records.</Warning>

        Parameters
        ----------
        id : int
            User ID

        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.users.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,
        *,
        allow_newsletters: typing.Optional[bool] = OMIT,
        avatar: typing.Optional[str] = OMIT,
        email: typing.Optional[str] = OMIT,
        first_name: typing.Optional[str] = OMIT,
        update_users_request_id: typing.Optional[int] = OMIT,
        initials: typing.Optional[str] = OMIT,
        last_name: typing.Optional[str] = OMIT,
        phone: typing.Optional[str] = OMIT,
        username: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LseUser:
        """

                Update details for a specific user, such as their name or contact information, in Label Studio.


        Parameters
        ----------
        id : int
            User ID

        allow_newsletters : typing.Optional[bool]
            Whether the user allows newsletters

        avatar : typing.Optional[str]
            Avatar URL of the user

        email : typing.Optional[str]
            Email of the user

        first_name : typing.Optional[str]
            First name of the user

        update_users_request_id : typing.Optional[int]
            User ID

        initials : typing.Optional[str]
            Initials of the user

        last_name : typing.Optional[str]
            Last name of the user

        phone : typing.Optional[str]
            Phone number of the user

        username : typing.Optional[str]
            Username of the user

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

        Returns
        -------
        LseUser


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            id,
            allow_newsletters=allow_newsletters,
            avatar=avatar,
            email=email,
            first_name=first_name,
            update_users_request_id=update_users_request_id,
            initials=initials,
            last_name=last_name,
            phone=phone,
            username=username,
            request_options=request_options,
        )
        return _response.data
