# 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 AsyncRawV1Client, RawV1Client

if typing.TYPE_CHECKING:
    from .distribution_credentials.client import AsyncDistributionCredentialsClient, DistributionCredentialsClient


class V1Client:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawV1Client(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._distribution_credentials: typing.Optional[DistributionCredentialsClient] = None

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

        Returns
        -------
        RawV1Client
        """
        return self._raw_client

    @property
    def distribution_credentials(self):
        if self._distribution_credentials is None:
            from .distribution_credentials.client import DistributionCredentialsClient  # noqa: E402

            self._distribution_credentials = DistributionCredentialsClient(client_wrapper=self._client_wrapper)
        return self._distribution_credentials


class AsyncV1Client:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawV1Client(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._distribution_credentials: typing.Optional[AsyncDistributionCredentialsClient] = None

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

        Returns
        -------
        AsyncRawV1Client
        """
        return self._raw_client

    @property
    def distribution_credentials(self):
        if self._distribution_credentials is None:
            from .distribution_credentials.client import AsyncDistributionCredentialsClient  # noqa: E402

            self._distribution_credentials = AsyncDistributionCredentialsClient(client_wrapper=self._client_wrapper)
        return self._distribution_credentials
