# 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 AsyncRawCredentialingClient, RawCredentialingClient

if typing.TYPE_CHECKING:
    from .resources.v_2.client import AsyncV2Client, V2Client


class CredentialingClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawCredentialingClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._v_2: typing.Optional[V2Client] = None

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

        Returns
        -------
        RawCredentialingClient
        """
        return self._raw_client

    @property
    def v_2(self):
        if self._v_2 is None:
            from .resources.v_2.client import V2Client  # noqa: E402

            self._v_2 = V2Client(client_wrapper=self._client_wrapper)
        return self._v_2


class AsyncCredentialingClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawCredentialingClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._v_2: typing.Optional[AsyncV2Client] = None

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

        Returns
        -------
        AsyncRawCredentialingClient
        """
        return self._raw_client

    @property
    def v_2(self):
        if self._v_2 is None:
            from .resources.v_2.client import AsyncV2Client  # noqa: E402

            self._v_2 = AsyncV2Client(client_wrapper=self._client_wrapper)
        return self._v_2
