
    jd
              	          d dl Z d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ 	 dde j        eef         de j        ej                 d	e	fd
Z	 dde j        e j        eef         ej        eef         f         de j        e j        eef                  de j        ej                 d	e	fdZde j        ee j        f         d	e	fdZdS )    N)	from_dict)	from_http)	from_json)
CloudEvent)typesdatadata_unmarshallerreturnc                 .    t          t          | |          S )a  
    Parses JSON string `data` into a CloudEvent.

    :param data: JSON string representation of a CloudEvent.
    :param data_unmarshaller: Callable function that casts `data` to a
        Python object.
    :returns: A CloudEvent parsed from the given JSON representation.
    )_abstract_from_jsonr   )r   r	   s     f/DATA/AppData/hermes/projects/honcho/.venv/lib/python3.11/site-packages/cloudevents/http/conversion.pyr   r      s     z41BCCC    headersc                 0    t          t          | ||          S )a'  
    Parses CloudEvent `data` and `headers` into a CloudEvent`.

    The method supports both binary and structured representations.

    :param headers: The HTTP request headers.
    :param data: The HTTP request body. If set to None, "" or b'', the returned
        event's `data` field will be set to None.
    :param data_unmarshaller: Callable function to map data to a python object
        e.g. lambda x: x or lambda x: json.loads(x)
    :returns: A CloudEvent instance parsed from the passed HTTP parameters of
        the specified type.
    )_abstract_from_httpr   )r   r   r	   s      r   r   r   '   s    ( z7D:KLLLr   eventc                 ,    t          t          |           S )z
    Constructs a CloudEvent from a dict `event` representation.

    :param event: The event represented as a dict.
    :returns: The event of the specified type backed by the given dict.
    )_abstract_from_dictr   )r   s    r   r   r   >   s     z5111r   )N)typingcloudevents.conversionr   r   r   r   r   r   cloudevents.http.eventr   cloudevents.sdkr   UnionstrbytesOptionalUnmarshallerTypeMappingSupportsDuplicateItemsAny r   r   <module>r"      s    C C C C C C C C C C C C C C C C C C - - - - - - ! ! ! ! ! !
 BFD D
,sEz
"Du'=>D D D D D( BFM M\sCx %">sCx"HHM /&,sEz2
3	M
 u'=>M M M M M.	2>#vz/*	2	2 	2 	2 	2 	2 	2r   