# Path: cloudevents/sdk/converters/binary.py
# class BinaryHTTPCloudEventConverter(base.Converter):
#     TYPE = "binary"
#     SUPPORTED_VERSIONS = [v03.Event, v1.Event]
#     def can_read(
#         self,
#         content_type: str = None,
#         headers: typing.Dict[str, str] = {"ce-specversion": None},
#     ) -> bool:
#     def event_supported(self, event: object) -> bool:
#     def read(
#         self,
#         event: event_base.BaseEvent,
#         headers: dict,
#         body: typing.IO,
#         data_unmarshaller: types.UnmarshallerType,
#     ) -> event_base.BaseEvent:
#     def write(
#         self, event: event_base.BaseEvent, data_marshaller: types.MarshallerType
#     ) -> (dict, bytes):
# def NewBinaryHTTPCloudEventConverter() -> BinaryHTTPCloudEventConverter:
# 
# Path: cloudevents/sdk/converters/structured.py
# class JSONHTTPCloudEventConverter(base.Converter):
#     TYPE = "structured"
#     MIME_TYPE = "application/cloudevents+json"
#     def can_read(
#         self, content_type: str, headers: typing.Dict[str, str] = {}
#     ) -> bool:
#     def event_supported(self, event: object) -> bool:
#     def read(
#         self,
#         event: event_base.BaseEvent,
#         headers: dict,
#         body: typing.IO,
#         data_unmarshaller: types.UnmarshallerType,
#     ) -> event_base.BaseEvent:
#     def write(
#         self, event: event_base.BaseEvent, data_marshaller: types.MarshallerType
#     ) -> (dict, bytes):
# def NewJSONHTTPCloudEventConverter() -> JSONHTTPCloudEventConverter:


import typing
from cloudevents.sdk.converters import binary, structured



def is_binary(headers: typing.Dict[str, str]) -> bool:
    """Uses internal marshallers to determine whether this event is binary
    :param headers: the HTTP headers
    :type headers: typing.Dict[str, str]
    :returns bool: returns a bool indicating whether the headers indicate
        a binary event type
    """
    headers = {key.lower(): value for key, value in headers.items()}
    content_type = headers.get("content-type", "")
    binary_parser = binary.BinaryHTTPCloudEventConverter()
    return binary_parser.can_read(content_type=content_type, headers=headers)


def is_structured(headers: typing.Dict[str, str]) -> bool:
    """Uses internal marshallers to determine whether this event is structured
    :param headers: the HTTP headers
    :type headers: typing.Dict[str, str]
    :returns bool: returns a bool indicating whether the headers indicate
        a structured event type
    """
    headers = {key.lower(): value for key, value in headers.items()}
    content_type = headers.get("content-type", "")

# Path: cloudevents/sdk/converters/binary.py
# class BinaryHTTPCloudEventConverter(base.Converter):
#     TYPE = "binary"
#     SUPPORTED_VERSIONS = [v03.Event, v1.Event]
#     def can_read(
#         self,
#         content_type: str = None,
#         headers: typing.Dict[str, str] = {"ce-specversion": None},
#     ) -> bool:
#     def event_supported(self, event: object) -> bool:
#     def read(
#         self,
#         event: event_base.BaseEvent,
#         headers: dict,
#         body: typing.IO,
#         data_unmarshaller: types.UnmarshallerType,
#     ) -> event_base.BaseEvent:
#     def write(
#         self, event: event_base.BaseEvent, data_marshaller: types.MarshallerType
#     ) -> (dict, bytes):
# def NewBinaryHTTPCloudEventConverter() -> BinaryHTTPCloudEventConverter:
# 
# Path: cloudevents/sdk/converters/structured.py
# class JSONHTTPCloudEventConverter(base.Converter):
#     TYPE = "structured"
#     MIME_TYPE = "application/cloudevents+json"
#     def can_read(
#         self, content_type: str, headers: typing.Dict[str, str] = {}
#     ) -> bool:
#     def event_supported(self, event: object) -> bool:
#     def read(
#         self,
#         event: event_base.BaseEvent,
#         headers: dict,
#         body: typing.IO,
#         data_unmarshaller: types.UnmarshallerType,
#     ) -> event_base.BaseEvent:
#     def write(
#         self, event: event_base.BaseEvent, data_marshaller: types.MarshallerType
#     ) -> (dict, bytes):
# def NewJSONHTTPCloudEventConverter() -> JSONHTTPCloudEventConverter:


# Path: cloudevents/http/event_type.py
import typing
from cloudevents.sdk.converters import binary, structured




def is_binary(headers: typing.Dict[str, str]) -> bool:
    """Uses internal marshallers to determine whether this event is binary
    :param headers: the HTTP headers
    :type headers: typing.Dict[str, str]
    :returns bool: returns a bool indicating whether the headers indicate
        a binary event type
    """
    headers = {key.lower(): value for key, value in headers.items()}
    content_type = headers.get("content-type", "")
    binary_parser = binary.BinaryHTTPCloudEventConverter()
    return binary_parser.can_read(content_type=content_type, headers=headers)


def is_structured(headers: typing.Dict[str, str]) -> bool:
    """Uses internal marshallers to determine whether this event is structured
    :param headers: the HTTP headers
    :type headers: typing.Dict[str, str]
    :returns bool: returns a bool indicating whether the headers indicate
        a structured event type
    """
    headers = {key.lower(): value for key, value in headers.items()}
    content_type = headers.get("content-type", "")

    structured_parser = structured.JSONHTTPCloudEventConverter()