def encode_metadata_dict(encoder): dict_data_ben = { "name": "Ben", "favorite_number": 7, "favorite_color": "red" } encoded_metadata_ben = encoder.encode(dict_data_ben, schema=SCHEMA_STRING) print("Encoded metadata is: ", encoded_metadata_ben) return EventData.from_message_data( encoded_metadata_ben["data"], encoded_metadata_ben["content_type"], )
def sample_create_event_data(data, content_type, **kwargs): print("Creating sample EventData with callback.") return EventData.from_message_data(data, content_type, **kwargs)