def read( self, event: event_base.BaseEvent, headers: dict, body: typing.IO, data_unmarshaller: typing.Callable, ) -> event_base.BaseEvent: event.UnmarshalJSON(body, data_unmarshaller) return event
def read( self, event: event_base.BaseEvent, headers: dict, body: typing.IO, data_unmarshaller: types.UnmarshallerType, ) -> event_base.BaseEvent: if type(event) not in self.SUPPORTED_VERSIONS: raise exceptions.UnsupportedEvent(type(event)) event.UnmarshalBinary(headers, body, data_unmarshaller) return event
def write( self, event: event_base.BaseEvent, data_marshaller: types.MarshallerType ) -> typing.Tuple[dict, bytes]: return event.MarshalBinary(data_marshaller)
def write(self, event: event_base.BaseEvent, data_marshaller: types.MarshallerType) -> (dict, bytes): return event.MarshalBinary(data_marshaller)
def write( self, event: event_base.BaseEvent, data_marshaller: typing.Callable ) -> (dict, typing.IO): http_headers = {"content-type": self.MIME_TYPE} return http_headers, event.MarshalJSON(data_marshaller)
def write(self, event: event_base.BaseEvent, data_marshaller: typing.Callable) -> (dict, typing.IO): return event.MarshalBinary(data_marshaller)
def write( self, event: event_base.BaseEvent, data_marshaller: types.MarshallerType ) -> typing.Tuple[dict, bytes]: http_headers = {"content-type": self.MIME_TYPE} return http_headers, event.MarshalJSON(data_marshaller).encode("utf-8")