# 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 AsyncRawSsoClient, RawSsoClient

if typing.TYPE_CHECKING:
    from .saml.client import AsyncSamlClient, SamlClient
    from .scim.client import AsyncScimClient, ScimClient


class SsoClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawSsoClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._saml: typing.Optional[SamlClient] = None
        self._scim: typing.Optional[ScimClient] = None

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

        Returns
        -------
        RawSsoClient
        """
        return self._raw_client

    @property
    def saml(self):
        if self._saml is None:
            from .saml.client import SamlClient  # noqa: E402

            self._saml = SamlClient(client_wrapper=self._client_wrapper)
        return self._saml

    @property
    def scim(self):
        if self._scim is None:
            from .scim.client import ScimClient  # noqa: E402

            self._scim = ScimClient(client_wrapper=self._client_wrapper)
        return self._scim


class AsyncSsoClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawSsoClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._saml: typing.Optional[AsyncSamlClient] = None
        self._scim: typing.Optional[AsyncScimClient] = None

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

        Returns
        -------
        AsyncRawSsoClient
        """
        return self._raw_client

    @property
    def saml(self):
        if self._saml is None:
            from .saml.client import AsyncSamlClient  # noqa: E402

            self._saml = AsyncSamlClient(client_wrapper=self._client_wrapper)
        return self._saml

    @property
    def scim(self):
        if self._scim is None:
            from .scim.client import AsyncScimClient  # noqa: E402

            self._scim = AsyncScimClient(client_wrapper=self._client_wrapper)
        return self._scim
