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

from __future__ import annotations

import typing

import httpx
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .environment import KlavisEnvironment

if typing.TYPE_CHECKING:
    from .amplitude_oauth.client import AmplitudeOauthClient, AsyncAmplitudeOauthClient
    from .clockwise_oauth.client import AsyncClockwiseOauthClient, ClockwiseOauthClient
    from .google_cloud_oauth.client import AsyncGoogleCloudOauthClient, GoogleCloudOauthClient
    from .google_forms_oauth.client import AsyncGoogleFormsOauthClient, GoogleFormsOauthClient
    from .honeycomb_oauth.client import AsyncHoneycombOauthClient, HoneycombOauthClient
    from .huggingface_oauth.client import AsyncHuggingfaceOauthClient, HuggingfaceOauthClient
    from .instagram_oauth.client import AsyncInstagramOauthClient, InstagramOauthClient
    from .intercom_oauth.client import AsyncIntercomOauthClient, IntercomOauthClient
    from .jotform_oauth.client import AsyncJotformOauthClient, JotformOauthClient
    from .mcp_server.client import AsyncMcpServerClient, McpServerClient
    from .mscalendar_oauth.client import AsyncMscalendarOauthClient, MscalendarOauthClient
    from .netlify_oauth.client import AsyncNetlifyOauthClient, NetlifyOauthClient
    from .oauth.client import AsyncOauthClient, OauthClient
    from .onedrive_oauth.client import AsyncOnedriveOauthClient, OnedriveOauthClient
    from .outlook_oauth.client import AsyncOutlookOauthClient, OutlookOauthClient
    from .paypal_oauth.client import AsyncPaypalOauthClient, PaypalOauthClient
    from .sandbox.client import AsyncSandboxClient, SandboxClient
    from .sentry_oauth.client import AsyncSentryOauthClient, SentryOauthClient
    from .sharesight_oauth.client import AsyncSharesightOauthClient, SharesightOauthClient
    from .square_oauth.client import AsyncSquareOauthClient, SquareOauthClient
    from .teams_oauth.client import AsyncTeamsOauthClient, TeamsOauthClient
    from .universe.client import AsyncUniverseClient, UniverseClient
    from .user.client import AsyncUserClient, UserClient
    from .white_labeling.client import AsyncWhiteLabelingClient, WhiteLabelingClient
    from .youtube_oauth.client import AsyncYoutubeOauthClient, YoutubeOauthClient
    from .zoho_mail_oauth.client import AsyncZohoMailOauthClient, ZohoMailOauthClient
    from .zoom_oauth.client import AsyncZoomOauthClient, ZoomOauthClient


class Klavis:
    """
    Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.

    Parameters
    ----------
    base_url : typing.Optional[str]
        The base url to use for requests from the client.

    environment : KlavisEnvironment
        The environment to use for requests from the client. from .environment import KlavisEnvironment



        Defaults to KlavisEnvironment.DEFAULT



    api_key : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
    headers : typing.Optional[typing.Dict[str, str]]
        Additional headers to send with every request.

    timeout : typing.Optional[float]
        The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.

    follow_redirects : typing.Optional[bool]
        Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.

    httpx_client : typing.Optional[httpx.Client]
        The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.

    Examples
    --------
    from klavis import Klavis

    client = Klavis(
        api_key="YOUR_API_KEY",
    )
    """

    def __init__(
        self,
        *,
        base_url: typing.Optional[str] = None,
        environment: KlavisEnvironment = KlavisEnvironment.DEFAULT,
        api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
        headers: typing.Optional[typing.Dict[str, str]] = None,
        timeout: typing.Optional[float] = None,
        follow_redirects: typing.Optional[bool] = True,
        httpx_client: typing.Optional[httpx.Client] = None,
    ):
        _defaulted_timeout = (
            timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
        )
        self._client_wrapper = SyncClientWrapper(
            base_url=_get_base_url(base_url=base_url, environment=environment),
            api_key=api_key,
            headers=headers,
            httpx_client=httpx_client
            if httpx_client is not None
            else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
            if follow_redirects is not None
            else httpx.Client(timeout=_defaulted_timeout),
            timeout=_defaulted_timeout,
        )
        self._mcp_server: typing.Optional[McpServerClient] = None
        self._white_labeling: typing.Optional[WhiteLabelingClient] = None
        self._user: typing.Optional[UserClient] = None
        self._oauth: typing.Optional[OauthClient] = None
        self._google_cloud_oauth: typing.Optional[GoogleCloudOauthClient] = None
        self._google_forms_oauth: typing.Optional[GoogleFormsOauthClient] = None
        self._onedrive_oauth: typing.Optional[OnedriveOauthClient] = None
        self._outlook_oauth: typing.Optional[OutlookOauthClient] = None
        self._mscalendar_oauth: typing.Optional[MscalendarOauthClient] = None
        self._teams_oauth: typing.Optional[TeamsOauthClient] = None
        self._zoom_oauth: typing.Optional[ZoomOauthClient] = None
        self._zoho_mail_oauth: typing.Optional[ZohoMailOauthClient] = None
        self._sharesight_oauth: typing.Optional[SharesightOauthClient] = None
        self._instagram_oauth: typing.Optional[InstagramOauthClient] = None
        self._youtube_oauth: typing.Optional[YoutubeOauthClient] = None
        self._intercom_oauth: typing.Optional[IntercomOauthClient] = None
        self._paypal_oauth: typing.Optional[PaypalOauthClient] = None
        self._sentry_oauth: typing.Optional[SentryOauthClient] = None
        self._netlify_oauth: typing.Optional[NetlifyOauthClient] = None
        self._huggingface_oauth: typing.Optional[HuggingfaceOauthClient] = None
        self._square_oauth: typing.Optional[SquareOauthClient] = None
        self._clockwise_oauth: typing.Optional[ClockwiseOauthClient] = None
        self._jotform_oauth: typing.Optional[JotformOauthClient] = None
        self._honeycomb_oauth: typing.Optional[HoneycombOauthClient] = None
        self._amplitude_oauth: typing.Optional[AmplitudeOauthClient] = None
        self._sandbox: typing.Optional[SandboxClient] = None
        self._universe: typing.Optional[UniverseClient] = None

    @property
    def mcp_server(self):
        if self._mcp_server is None:
            from .mcp_server.client import McpServerClient  # noqa: E402

            self._mcp_server = McpServerClient(client_wrapper=self._client_wrapper)
        return self._mcp_server

    @property
    def white_labeling(self):
        if self._white_labeling is None:
            from .white_labeling.client import WhiteLabelingClient  # noqa: E402

            self._white_labeling = WhiteLabelingClient(client_wrapper=self._client_wrapper)
        return self._white_labeling

    @property
    def user(self):
        if self._user is None:
            from .user.client import UserClient  # noqa: E402

            self._user = UserClient(client_wrapper=self._client_wrapper)
        return self._user

    @property
    def oauth(self):
        if self._oauth is None:
            from .oauth.client import OauthClient  # noqa: E402

            self._oauth = OauthClient(client_wrapper=self._client_wrapper)
        return self._oauth

    @property
    def google_cloud_oauth(self):
        if self._google_cloud_oauth is None:
            from .google_cloud_oauth.client import GoogleCloudOauthClient  # noqa: E402

            self._google_cloud_oauth = GoogleCloudOauthClient(client_wrapper=self._client_wrapper)
        return self._google_cloud_oauth

    @property
    def google_forms_oauth(self):
        if self._google_forms_oauth is None:
            from .google_forms_oauth.client import GoogleFormsOauthClient  # noqa: E402

            self._google_forms_oauth = GoogleFormsOauthClient(client_wrapper=self._client_wrapper)
        return self._google_forms_oauth

    @property
    def onedrive_oauth(self):
        if self._onedrive_oauth is None:
            from .onedrive_oauth.client import OnedriveOauthClient  # noqa: E402

            self._onedrive_oauth = OnedriveOauthClient(client_wrapper=self._client_wrapper)
        return self._onedrive_oauth

    @property
    def outlook_oauth(self):
        if self._outlook_oauth is None:
            from .outlook_oauth.client import OutlookOauthClient  # noqa: E402

            self._outlook_oauth = OutlookOauthClient(client_wrapper=self._client_wrapper)
        return self._outlook_oauth

    @property
    def mscalendar_oauth(self):
        if self._mscalendar_oauth is None:
            from .mscalendar_oauth.client import MscalendarOauthClient  # noqa: E402

            self._mscalendar_oauth = MscalendarOauthClient(client_wrapper=self._client_wrapper)
        return self._mscalendar_oauth

    @property
    def teams_oauth(self):
        if self._teams_oauth is None:
            from .teams_oauth.client import TeamsOauthClient  # noqa: E402

            self._teams_oauth = TeamsOauthClient(client_wrapper=self._client_wrapper)
        return self._teams_oauth

    @property
    def zoom_oauth(self):
        if self._zoom_oauth is None:
            from .zoom_oauth.client import ZoomOauthClient  # noqa: E402

            self._zoom_oauth = ZoomOauthClient(client_wrapper=self._client_wrapper)
        return self._zoom_oauth

    @property
    def zoho_mail_oauth(self):
        if self._zoho_mail_oauth is None:
            from .zoho_mail_oauth.client import ZohoMailOauthClient  # noqa: E402

            self._zoho_mail_oauth = ZohoMailOauthClient(client_wrapper=self._client_wrapper)
        return self._zoho_mail_oauth

    @property
    def sharesight_oauth(self):
        if self._sharesight_oauth is None:
            from .sharesight_oauth.client import SharesightOauthClient  # noqa: E402

            self._sharesight_oauth = SharesightOauthClient(client_wrapper=self._client_wrapper)
        return self._sharesight_oauth

    @property
    def instagram_oauth(self):
        if self._instagram_oauth is None:
            from .instagram_oauth.client import InstagramOauthClient  # noqa: E402

            self._instagram_oauth = InstagramOauthClient(client_wrapper=self._client_wrapper)
        return self._instagram_oauth

    @property
    def youtube_oauth(self):
        if self._youtube_oauth is None:
            from .youtube_oauth.client import YoutubeOauthClient  # noqa: E402

            self._youtube_oauth = YoutubeOauthClient(client_wrapper=self._client_wrapper)
        return self._youtube_oauth

    @property
    def intercom_oauth(self):
        if self._intercom_oauth is None:
            from .intercom_oauth.client import IntercomOauthClient  # noqa: E402

            self._intercom_oauth = IntercomOauthClient(client_wrapper=self._client_wrapper)
        return self._intercom_oauth

    @property
    def paypal_oauth(self):
        if self._paypal_oauth is None:
            from .paypal_oauth.client import PaypalOauthClient  # noqa: E402

            self._paypal_oauth = PaypalOauthClient(client_wrapper=self._client_wrapper)
        return self._paypal_oauth

    @property
    def sentry_oauth(self):
        if self._sentry_oauth is None:
            from .sentry_oauth.client import SentryOauthClient  # noqa: E402

            self._sentry_oauth = SentryOauthClient(client_wrapper=self._client_wrapper)
        return self._sentry_oauth

    @property
    def netlify_oauth(self):
        if self._netlify_oauth is None:
            from .netlify_oauth.client import NetlifyOauthClient  # noqa: E402

            self._netlify_oauth = NetlifyOauthClient(client_wrapper=self._client_wrapper)
        return self._netlify_oauth

    @property
    def huggingface_oauth(self):
        if self._huggingface_oauth is None:
            from .huggingface_oauth.client import HuggingfaceOauthClient  # noqa: E402

            self._huggingface_oauth = HuggingfaceOauthClient(client_wrapper=self._client_wrapper)
        return self._huggingface_oauth

    @property
    def square_oauth(self):
        if self._square_oauth is None:
            from .square_oauth.client import SquareOauthClient  # noqa: E402

            self._square_oauth = SquareOauthClient(client_wrapper=self._client_wrapper)
        return self._square_oauth

    @property
    def clockwise_oauth(self):
        if self._clockwise_oauth is None:
            from .clockwise_oauth.client import ClockwiseOauthClient  # noqa: E402

            self._clockwise_oauth = ClockwiseOauthClient(client_wrapper=self._client_wrapper)
        return self._clockwise_oauth

    @property
    def jotform_oauth(self):
        if self._jotform_oauth is None:
            from .jotform_oauth.client import JotformOauthClient  # noqa: E402

            self._jotform_oauth = JotformOauthClient(client_wrapper=self._client_wrapper)
        return self._jotform_oauth

    @property
    def honeycomb_oauth(self):
        if self._honeycomb_oauth is None:
            from .honeycomb_oauth.client import HoneycombOauthClient  # noqa: E402

            self._honeycomb_oauth = HoneycombOauthClient(client_wrapper=self._client_wrapper)
        return self._honeycomb_oauth

    @property
    def amplitude_oauth(self):
        if self._amplitude_oauth is None:
            from .amplitude_oauth.client import AmplitudeOauthClient  # noqa: E402

            self._amplitude_oauth = AmplitudeOauthClient(client_wrapper=self._client_wrapper)
        return self._amplitude_oauth

    @property
    def sandbox(self):
        if self._sandbox is None:
            from .sandbox.client import SandboxClient  # noqa: E402

            self._sandbox = SandboxClient(client_wrapper=self._client_wrapper)
        return self._sandbox

    @property
    def universe(self):
        if self._universe is None:
            from .universe.client import UniverseClient  # noqa: E402

            self._universe = UniverseClient(client_wrapper=self._client_wrapper)
        return self._universe


class AsyncKlavis:
    """
    Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.

    Parameters
    ----------
    base_url : typing.Optional[str]
        The base url to use for requests from the client.

    environment : KlavisEnvironment
        The environment to use for requests from the client. from .environment import KlavisEnvironment



        Defaults to KlavisEnvironment.DEFAULT



    api_key : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
    headers : typing.Optional[typing.Dict[str, str]]
        Additional headers to send with every request.

    timeout : typing.Optional[float]
        The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.

    follow_redirects : typing.Optional[bool]
        Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.

    httpx_client : typing.Optional[httpx.AsyncClient]
        The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.

    Examples
    --------
    from klavis import AsyncKlavis

    client = AsyncKlavis(
        api_key="YOUR_API_KEY",
    )
    """

    def __init__(
        self,
        *,
        base_url: typing.Optional[str] = None,
        environment: KlavisEnvironment = KlavisEnvironment.DEFAULT,
        api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
        headers: typing.Optional[typing.Dict[str, str]] = None,
        timeout: typing.Optional[float] = None,
        follow_redirects: typing.Optional[bool] = True,
        httpx_client: typing.Optional[httpx.AsyncClient] = None,
    ):
        _defaulted_timeout = (
            timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
        )
        self._client_wrapper = AsyncClientWrapper(
            base_url=_get_base_url(base_url=base_url, environment=environment),
            api_key=api_key,
            headers=headers,
            httpx_client=httpx_client
            if httpx_client is not None
            else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
            if follow_redirects is not None
            else httpx.AsyncClient(timeout=_defaulted_timeout),
            timeout=_defaulted_timeout,
        )
        self._mcp_server: typing.Optional[AsyncMcpServerClient] = None
        self._white_labeling: typing.Optional[AsyncWhiteLabelingClient] = None
        self._user: typing.Optional[AsyncUserClient] = None
        self._oauth: typing.Optional[AsyncOauthClient] = None
        self._google_cloud_oauth: typing.Optional[AsyncGoogleCloudOauthClient] = None
        self._google_forms_oauth: typing.Optional[AsyncGoogleFormsOauthClient] = None
        self._onedrive_oauth: typing.Optional[AsyncOnedriveOauthClient] = None
        self._outlook_oauth: typing.Optional[AsyncOutlookOauthClient] = None
        self._mscalendar_oauth: typing.Optional[AsyncMscalendarOauthClient] = None
        self._teams_oauth: typing.Optional[AsyncTeamsOauthClient] = None
        self._zoom_oauth: typing.Optional[AsyncZoomOauthClient] = None
        self._zoho_mail_oauth: typing.Optional[AsyncZohoMailOauthClient] = None
        self._sharesight_oauth: typing.Optional[AsyncSharesightOauthClient] = None
        self._instagram_oauth: typing.Optional[AsyncInstagramOauthClient] = None
        self._youtube_oauth: typing.Optional[AsyncYoutubeOauthClient] = None
        self._intercom_oauth: typing.Optional[AsyncIntercomOauthClient] = None
        self._paypal_oauth: typing.Optional[AsyncPaypalOauthClient] = None
        self._sentry_oauth: typing.Optional[AsyncSentryOauthClient] = None
        self._netlify_oauth: typing.Optional[AsyncNetlifyOauthClient] = None
        self._huggingface_oauth: typing.Optional[AsyncHuggingfaceOauthClient] = None
        self._square_oauth: typing.Optional[AsyncSquareOauthClient] = None
        self._clockwise_oauth: typing.Optional[AsyncClockwiseOauthClient] = None
        self._jotform_oauth: typing.Optional[AsyncJotformOauthClient] = None
        self._honeycomb_oauth: typing.Optional[AsyncHoneycombOauthClient] = None
        self._amplitude_oauth: typing.Optional[AsyncAmplitudeOauthClient] = None
        self._sandbox: typing.Optional[AsyncSandboxClient] = None
        self._universe: typing.Optional[AsyncUniverseClient] = None

    @property
    def mcp_server(self):
        if self._mcp_server is None:
            from .mcp_server.client import AsyncMcpServerClient  # noqa: E402

            self._mcp_server = AsyncMcpServerClient(client_wrapper=self._client_wrapper)
        return self._mcp_server

    @property
    def white_labeling(self):
        if self._white_labeling is None:
            from .white_labeling.client import AsyncWhiteLabelingClient  # noqa: E402

            self._white_labeling = AsyncWhiteLabelingClient(client_wrapper=self._client_wrapper)
        return self._white_labeling

    @property
    def user(self):
        if self._user is None:
            from .user.client import AsyncUserClient  # noqa: E402

            self._user = AsyncUserClient(client_wrapper=self._client_wrapper)
        return self._user

    @property
    def oauth(self):
        if self._oauth is None:
            from .oauth.client import AsyncOauthClient  # noqa: E402

            self._oauth = AsyncOauthClient(client_wrapper=self._client_wrapper)
        return self._oauth

    @property
    def google_cloud_oauth(self):
        if self._google_cloud_oauth is None:
            from .google_cloud_oauth.client import AsyncGoogleCloudOauthClient  # noqa: E402

            self._google_cloud_oauth = AsyncGoogleCloudOauthClient(client_wrapper=self._client_wrapper)
        return self._google_cloud_oauth

    @property
    def google_forms_oauth(self):
        if self._google_forms_oauth is None:
            from .google_forms_oauth.client import AsyncGoogleFormsOauthClient  # noqa: E402

            self._google_forms_oauth = AsyncGoogleFormsOauthClient(client_wrapper=self._client_wrapper)
        return self._google_forms_oauth

    @property
    def onedrive_oauth(self):
        if self._onedrive_oauth is None:
            from .onedrive_oauth.client import AsyncOnedriveOauthClient  # noqa: E402

            self._onedrive_oauth = AsyncOnedriveOauthClient(client_wrapper=self._client_wrapper)
        return self._onedrive_oauth

    @property
    def outlook_oauth(self):
        if self._outlook_oauth is None:
            from .outlook_oauth.client import AsyncOutlookOauthClient  # noqa: E402

            self._outlook_oauth = AsyncOutlookOauthClient(client_wrapper=self._client_wrapper)
        return self._outlook_oauth

    @property
    def mscalendar_oauth(self):
        if self._mscalendar_oauth is None:
            from .mscalendar_oauth.client import AsyncMscalendarOauthClient  # noqa: E402

            self._mscalendar_oauth = AsyncMscalendarOauthClient(client_wrapper=self._client_wrapper)
        return self._mscalendar_oauth

    @property
    def teams_oauth(self):
        if self._teams_oauth is None:
            from .teams_oauth.client import AsyncTeamsOauthClient  # noqa: E402

            self._teams_oauth = AsyncTeamsOauthClient(client_wrapper=self._client_wrapper)
        return self._teams_oauth

    @property
    def zoom_oauth(self):
        if self._zoom_oauth is None:
            from .zoom_oauth.client import AsyncZoomOauthClient  # noqa: E402

            self._zoom_oauth = AsyncZoomOauthClient(client_wrapper=self._client_wrapper)
        return self._zoom_oauth

    @property
    def zoho_mail_oauth(self):
        if self._zoho_mail_oauth is None:
            from .zoho_mail_oauth.client import AsyncZohoMailOauthClient  # noqa: E402

            self._zoho_mail_oauth = AsyncZohoMailOauthClient(client_wrapper=self._client_wrapper)
        return self._zoho_mail_oauth

    @property
    def sharesight_oauth(self):
        if self._sharesight_oauth is None:
            from .sharesight_oauth.client import AsyncSharesightOauthClient  # noqa: E402

            self._sharesight_oauth = AsyncSharesightOauthClient(client_wrapper=self._client_wrapper)
        return self._sharesight_oauth

    @property
    def instagram_oauth(self):
        if self._instagram_oauth is None:
            from .instagram_oauth.client import AsyncInstagramOauthClient  # noqa: E402

            self._instagram_oauth = AsyncInstagramOauthClient(client_wrapper=self._client_wrapper)
        return self._instagram_oauth

    @property
    def youtube_oauth(self):
        if self._youtube_oauth is None:
            from .youtube_oauth.client import AsyncYoutubeOauthClient  # noqa: E402

            self._youtube_oauth = AsyncYoutubeOauthClient(client_wrapper=self._client_wrapper)
        return self._youtube_oauth

    @property
    def intercom_oauth(self):
        if self._intercom_oauth is None:
            from .intercom_oauth.client import AsyncIntercomOauthClient  # noqa: E402

            self._intercom_oauth = AsyncIntercomOauthClient(client_wrapper=self._client_wrapper)
        return self._intercom_oauth

    @property
    def paypal_oauth(self):
        if self._paypal_oauth is None:
            from .paypal_oauth.client import AsyncPaypalOauthClient  # noqa: E402

            self._paypal_oauth = AsyncPaypalOauthClient(client_wrapper=self._client_wrapper)
        return self._paypal_oauth

    @property
    def sentry_oauth(self):
        if self._sentry_oauth is None:
            from .sentry_oauth.client import AsyncSentryOauthClient  # noqa: E402

            self._sentry_oauth = AsyncSentryOauthClient(client_wrapper=self._client_wrapper)
        return self._sentry_oauth

    @property
    def netlify_oauth(self):
        if self._netlify_oauth is None:
            from .netlify_oauth.client import AsyncNetlifyOauthClient  # noqa: E402

            self._netlify_oauth = AsyncNetlifyOauthClient(client_wrapper=self._client_wrapper)
        return self._netlify_oauth

    @property
    def huggingface_oauth(self):
        if self._huggingface_oauth is None:
            from .huggingface_oauth.client import AsyncHuggingfaceOauthClient  # noqa: E402

            self._huggingface_oauth = AsyncHuggingfaceOauthClient(client_wrapper=self._client_wrapper)
        return self._huggingface_oauth

    @property
    def square_oauth(self):
        if self._square_oauth is None:
            from .square_oauth.client import AsyncSquareOauthClient  # noqa: E402

            self._square_oauth = AsyncSquareOauthClient(client_wrapper=self._client_wrapper)
        return self._square_oauth

    @property
    def clockwise_oauth(self):
        if self._clockwise_oauth is None:
            from .clockwise_oauth.client import AsyncClockwiseOauthClient  # noqa: E402

            self._clockwise_oauth = AsyncClockwiseOauthClient(client_wrapper=self._client_wrapper)
        return self._clockwise_oauth

    @property
    def jotform_oauth(self):
        if self._jotform_oauth is None:
            from .jotform_oauth.client import AsyncJotformOauthClient  # noqa: E402

            self._jotform_oauth = AsyncJotformOauthClient(client_wrapper=self._client_wrapper)
        return self._jotform_oauth

    @property
    def honeycomb_oauth(self):
        if self._honeycomb_oauth is None:
            from .honeycomb_oauth.client import AsyncHoneycombOauthClient  # noqa: E402

            self._honeycomb_oauth = AsyncHoneycombOauthClient(client_wrapper=self._client_wrapper)
        return self._honeycomb_oauth

    @property
    def amplitude_oauth(self):
        if self._amplitude_oauth is None:
            from .amplitude_oauth.client import AsyncAmplitudeOauthClient  # noqa: E402

            self._amplitude_oauth = AsyncAmplitudeOauthClient(client_wrapper=self._client_wrapper)
        return self._amplitude_oauth

    @property
    def sandbox(self):
        if self._sandbox is None:
            from .sandbox.client import AsyncSandboxClient  # noqa: E402

            self._sandbox = AsyncSandboxClient(client_wrapper=self._client_wrapper)
        return self._sandbox

    @property
    def universe(self):
        if self._universe is None:
            from .universe.client import AsyncUniverseClient  # noqa: E402

            self._universe = AsyncUniverseClient(client_wrapper=self._client_wrapper)
        return self._universe


def _get_base_url(*, base_url: typing.Optional[str] = None, environment: KlavisEnvironment) -> str:
    if base_url is not None:
        return base_url
    elif environment is not None:
        return environment.value
    else:
        raise Exception("Please pass in either base_url or environment to construct the client")
