"""Top-level Search resources — SearchResource and AsyncSearchResource."""

from __future__ import annotations

from ..._api.client import AsyncBaseResource, BaseResource
from ..._api.client import SyncSearchSearchAPI, SearchSearchAPI
from ..._config import SDKConfig
from ._mixins import _AsyncSearchMixin, _SearchMixin


class SearchResource(_SearchMixin, BaseResource):
    """Web Search tool (sync).

    Uses generated SyncSearchSearchAPI client.
    """

    def __init__(self, config: SDKConfig) -> None:
        super().__init__(config)
        self._api = SyncSearchSearchAPI(self._http_client)


class AsyncSearchResource(_AsyncSearchMixin, AsyncBaseResource):
    """Web Search tool (async).

    Uses generated SearchSearchAPI client.
    """

    def __init__(self, config: SDKConfig) -> None:
        super().__init__(config)
        self._api = SearchSearchAPI(self._http_client)


__all__ = [
    "SearchResource",
    "AsyncSearchResource",
]
