"""
Type annotations for awscrt.eventstream module.

Copyright 2024 Vlad Emelianov
"""

from enum import IntEnum
from typing import Any
from uuid import UUID

__all__ = ["Header", "HeaderType"]

class HeaderType(IntEnum):
    BOOL_TRUE = 0
    BOOL_FALSE = 1
    BYTE = 2
    INT16 = 3
    INT32 = 4
    INT64 = 5
    BYTE_BUF = 6
    STRING = 7
    TIMESTAMP = 8
    UUID = 9
    def __format__(self, format_spec: str) -> str: ...

class Header:
    def __init__(self, name: str, value: Any, header_type: HeaderType) -> None: ...
    @classmethod
    def from_bool(cls, name: str, value: bool) -> Header: ...
    @classmethod
    def from_byte(cls, name: str, value: int) -> Header: ...
    @classmethod
    def from_int16(cls, name: str, value: int) -> Header: ...
    @classmethod
    def from_int32(cls, name: str, value: int) -> Header: ...
    @classmethod
    def from_int64(cls, name: str, value: int) -> Header: ...
    @classmethod
    def from_byte_buf(cls, name: str, value: bytes | bytearray) -> Header: ...
    @classmethod
    def from_string(cls, name: str, value: str) -> Header: ...
    @classmethod
    def from_timestamp(cls, name: str, value: int) -> Header: ...
    @classmethod
    def from_uuid(cls, name: str, value: UUID) -> Header: ...
    @property
    def name(self) -> str: ...
    @property
    def type(self) -> HeaderType: ...
    @property
    def value(self) -> Any: ...
    def value_as_bool(self) -> bool: ...
    def value_as_byte(self) -> int: ...
    def value_as_int16(self) -> int: ...
    def value_as_int32(self) -> int: ...
    def value_as_int64(self) -> int: ...
    def value_as_byte_buf(self) -> bytes | bytearray: ...
    def value_as_string(self) -> str: ...
    def value_as_timestamp(self) -> int: ...
    def value_as_uuid(self) -> UUID: ...
