"""
OpenFDA_search_drug_labels

Search the FDA drug label (SPL - Structured Product Labeling) database via openFDA. Contains appr...
"""

from typing import Any, Optional, Callable
from ._shared_client import get_shared_client


def OpenFDA_search_drug_labels(
    search: str,
    limit: Optional[int | Any] = None,
    *,
    stream_callback: Optional[Callable[[str], None]] = None,
    use_cache: bool = False,
    validate: bool = True,
) -> Any:
    """
    Search the FDA drug label (SPL - Structured Product Labeling) database via openFDA. Contains appr...

    Parameters
    ----------
    search : str
        Lucene query to search drug labels (e.g., 'openfda.brand_name:aspirin', 'open...
    limit : int | Any
        Maximum number of results (default 1, max 100)
    stream_callback : Callable, optional
        Callback for streaming output
    use_cache : bool, default False
        Enable caching
    validate : bool, default True
        Validate parameters

    Returns
    -------
    Any
    """
    # Handle mutable defaults to avoid B006 linting error

    return get_shared_client().run_one_function(
        {
            "name": "OpenFDA_search_drug_labels",
            "arguments": {"search": search, "limit": limit},
        },
        stream_callback=stream_callback,
        use_cache=use_cache,
        validate=validate,
    )


__all__ = ["OpenFDA_search_drug_labels"]
