"""
Type annotations for botocore.serialize module.

Copyright 2025 Vlad Emelianov
"""

from typing import Any, Mapping, Pattern

from botocore.compat import formatdate as formatdate
from botocore.model import OperationModel
from botocore.utils import is_json_value_header as is_json_value_header
from botocore.utils import parse_to_aware_datetime as parse_to_aware_datetime
from botocore.utils import percent_encode as percent_encode

DEFAULT_TIMESTAMP_FORMAT: str
ISO8601: str
ISO8601_MICRO: str
HOST_PREFIX_RE: Pattern[str]

def create_serializer(protocol_name: str, include_validation: bool = ...) -> Any: ...

class Serializer:
    DEFAULT_METHOD: str = ...
    MAP_TYPE: type[dict[str, Any]] = ...
    DEFAULT_ENCODING: str = ...
    def serialize_to_request(
        self, parameters: Mapping[str, Any], operation_model: OperationModel
    ) -> dict[str, Any]: ...

class QuerySerializer(Serializer):
    TIMESTAMP_FORMAT: str = ...
    def serialize_to_request(
        self, parameters: Mapping[str, Any], operation_model: OperationModel
    ) -> dict[str, Any]: ...

class EC2Serializer(QuerySerializer): ...

class JSONSerializer(Serializer):
    TIMESTAMP_FORMAT: str = ...
    def serialize_to_request(
        self, parameters: Mapping[str, Any], operation_model: OperationModel
    ) -> dict[str, Any]: ...

class CBORSerializer(Serializer):
    UNSIGNED_INT_MAJOR_TYPE: int = ...
    NEGATIVE_INT_MAJOR_TYPE: int = ...
    BLOB_MAJOR_TYPE: int = ...
    STRING_MAJOR_TYPE: int = ...
    LIST_MAJOR_TYPE: int = ...
    MAP_MAJOR_TYPE: int = ...
    TAG_MAJOR_TYPE: int = ...
    FLOAT_AND_SIMPLE_MAJOR_TYPE: int = ...

class BaseRestSerializer(Serializer):
    QUERY_STRING_TIMESTAMP_FORMAT: str = ...
    HEADER_TIMESTAMP_FORMAT: str = ...
    KNOWN_LOCATIONS: list[str] = ...
    def serialize_to_request(
        self, parameters: Mapping[str, Any], operation_model: OperationModel
    ) -> dict[str, Any]: ...

class BaseRpcV2Serializer(Serializer): ...
class RestJSONSerializer(BaseRestSerializer, JSONSerializer): ...

class RestXMLSerializer(BaseRestSerializer):
    TIMESTAMP_FORMAT: str = ...

class RpcV2CBORSerializer(BaseRpcV2Serializer, CBORSerializer):
    TIMESTAMP_FORMAT: str = ...

SERIALIZERS: dict[str, Serializer]
