"""
Type annotations for botocore.loaders module.

Copyright 2024 Vlad Emelianov
"""

from logging import Logger
from typing import Any, Callable, Iterable, Mapping

from botocore.compat import OrderedDict as OrderedDict
from botocore.exceptions import DataNotFoundError as DataNotFoundError
from botocore.exceptions import UnknownServiceError as UnknownServiceError
from botocore.utils import deep_merge as deep_merge

logger: Logger = ...

HAS_GZIP: bool

def instance_cache(func: Callable[..., Any]) -> Callable[..., Any]: ...

class JSONFileLoader:
    def exists(self, file_path: str) -> bool: ...
    def load_file(self, file_path: str) -> Any: ...

def create_loader(search_path_string: str | None = ...) -> Loader: ...

class Loader:
    FILE_LOADER_CLASS: type[JSONFileLoader] = ...
    BUILTIN_DATA_PATH: str = ...
    CUSTOMER_DATA_PATH: str = ...
    BUILTIN_EXTRAS_TYPES: list[str] = ...
    def __init__(
        self,
        extra_search_paths: Iterable[str] | None = ...,
        file_loader: JSONFileLoader | None = ...,
        cache: Any | None = ...,
        include_default_search_paths: bool = ...,
        include_default_extras: bool = ...,
    ) -> None:
        self.file_loader: JSONFileLoader

    @property
    def search_paths(self) -> list[str]: ...
    @property
    def extras_types(self) -> list[str]: ...
    def list_available_services(self, type_name: str) -> list[str]: ...
    def determine_latest_version(self, service_name: str, type_name: str) -> str: ...
    def list_api_versions(self, service_name: str, type_name: str) -> list[str]: ...
    def load_data_with_path(self, name: str) -> tuple[dict[str, Any], str]: ...
    def load_service_model(
        self, service_name: str, type_name: str, api_version: Any | None = ...
    ) -> Any: ...
    def load_data(self, name: str) -> Any: ...
    def is_builtin_path(self, path: str) -> bool: ...

class ExtrasProcessor:
    def process(
        self, original_model: Mapping[str, Any], extra_models: Iterable[Mapping[str, Any]]
    ) -> None: ...
