# 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 AsyncRawProductionsClient, RawProductionsClient

if typing.TYPE_CHECKING:
    from .orders.client import AsyncOrdersClient, OrdersClient


class ProductionsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawProductionsClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._orders: typing.Optional[OrdersClient] = None

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

        Returns
        -------
        RawProductionsClient
        """
        return self._raw_client

    @property
    def orders(self):
        if self._orders is None:
            from .orders.client import OrdersClient  # noqa: E402

            self._orders = OrdersClient(client_wrapper=self._client_wrapper)
        return self._orders


class AsyncProductionsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawProductionsClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._orders: typing.Optional[AsyncOrdersClient] = None

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

        Returns
        -------
        AsyncRawProductionsClient
        """
        return self._raw_client

    @property
    def orders(self):
        if self._orders is None:
            from .orders.client import AsyncOrdersClient  # noqa: E402

            self._orders = AsyncOrdersClient(client_wrapper=self._client_wrapper)
        return self._orders
