# 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 AsyncRawMessageClient, RawMessageClient

if typing.TYPE_CHECKING:
    from .sms.client import AsyncSmsClient, SmsClient


class MessageClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMessageClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._sms: typing.Optional[SmsClient] = None

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

        Returns
        -------
        RawMessageClient
        """
        return self._raw_client

    @property
    def sms(self):
        if self._sms is None:
            from .sms.client import SmsClient  # noqa: E402

            self._sms = SmsClient(client_wrapper=self._client_wrapper)
        return self._sms


class AsyncMessageClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMessageClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._sms: typing.Optional[AsyncSmsClient] = None

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

        Returns
        -------
        AsyncRawMessageClient
        """
        return self._raw_client

    @property
    def sms(self):
        if self._sms is None:
            from .sms.client import AsyncSmsClient  # noqa: E402

            self._sms = AsyncSmsClient(client_wrapper=self._client_wrapper)
        return self._sms
