"""
openalex_get_institution

Get a single OpenAlex institution by Institution ID (I...). You can pass either the short ID (e.g...
"""

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


def openalex_get_institution(
    institution_id: str,
    mailto: Optional[str] = None,
    *,
    stream_callback: Optional[Callable[[str], None]] = None,
    use_cache: bool = False,
    validate: bool = True,
) -> Optional[dict[str, Any]]:
    """
    Get a single OpenAlex institution by Institution ID (I...). You can pass either the short ID (e.g...

    Parameters
    ----------
    institution_id : str
        OpenAlex Institution ID (I...) or full OpenAlex URL.
    mailto : str
        Optional contact email for OpenAlex polite pool.
    stream_callback : Callable, optional
        Callback for streaming output
    use_cache : bool, default False
        Enable caching
    validate : bool, default True
        Validate parameters

    Returns
    -------
    Optional[dict[str, Any]]
    """
    # Handle mutable defaults to avoid B006 linting error

    return get_shared_client().run_one_function(
        {
            "name": "openalex_get_institution",
            "arguments": {"institution_id": institution_id, "mailto": mailto},
        },
        stream_callback=stream_callback,
        use_cache=use_cache,
        validate=validate,
    )


__all__ = ["openalex_get_institution"]
