# 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 AsyncRawFleetClient, RawFleetClient

if typing.TYPE_CHECKING:
    from .attributes.client import AsyncAttributesClient, AttributesClient
    from .carrier_proposed_assignments.client import (
        AsyncCarrierProposedAssignmentsClient,
        CarrierProposedAssignmentsClient,
    )


class FleetClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawFleetClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._carrier_proposed_assignments: typing.Optional[CarrierProposedAssignmentsClient] = None
        self._attributes: typing.Optional[AttributesClient] = None

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

        Returns
        -------
        RawFleetClient
        """
        return self._raw_client

    @property
    def carrier_proposed_assignments(self):
        if self._carrier_proposed_assignments is None:
            from .carrier_proposed_assignments.client import CarrierProposedAssignmentsClient  # noqa: E402

            self._carrier_proposed_assignments = CarrierProposedAssignmentsClient(client_wrapper=self._client_wrapper)
        return self._carrier_proposed_assignments

    @property
    def attributes(self):
        if self._attributes is None:
            from .attributes.client import AttributesClient  # noqa: E402

            self._attributes = AttributesClient(client_wrapper=self._client_wrapper)
        return self._attributes


class AsyncFleetClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawFleetClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._carrier_proposed_assignments: typing.Optional[AsyncCarrierProposedAssignmentsClient] = None
        self._attributes: typing.Optional[AsyncAttributesClient] = None

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

        Returns
        -------
        AsyncRawFleetClient
        """
        return self._raw_client

    @property
    def carrier_proposed_assignments(self):
        if self._carrier_proposed_assignments is None:
            from .carrier_proposed_assignments.client import AsyncCarrierProposedAssignmentsClient  # noqa: E402

            self._carrier_proposed_assignments = AsyncCarrierProposedAssignmentsClient(
                client_wrapper=self._client_wrapper
            )
        return self._carrier_proposed_assignments

    @property
    def attributes(self):
        if self._attributes is None:
            from .attributes.client import AsyncAttributesClient  # noqa: E402

            self._attributes = AsyncAttributesClient(client_wrapper=self._client_wrapper)
        return self._attributes
