# 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 .raw_client import AsyncRawAuthtokenClient, RawAuthtokenClient

if typing.TYPE_CHECKING:
    from .auth.client import AsyncAuthClient, AuthClient


class AuthtokenClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAuthtokenClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._auth: typing.Optional[AuthClient] = None

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

        Returns
        -------
        RawAuthtokenClient
        """
        return self._raw_client

    @property
    def auth(self):
        if self._auth is None:
            from .auth.client import AuthClient  # noqa: E402

            self._auth = AuthClient(client_wrapper=self._client_wrapper)
        return self._auth


class AsyncAuthtokenClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAuthtokenClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._auth: typing.Optional[AsyncAuthClient] = None

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

        Returns
        -------
        AsyncRawAuthtokenClient
        """
        return self._raw_client

    @property
    def auth(self):
        if self._auth is None:
            from .auth.client import AsyncAuthClient  # noqa: E402

            self._auth = AsyncAuthClient(client_wrapper=self._client_wrapper)
        return self._auth
