'return the current message as expected by batch body format'

def as_batch_body(self):

    if ((sys.version_info >= (3,)) and isinstance(self.body, bytes)):
        body = self.body.decode('utf-8')
    else:
        body = self.body
    result = {'Body': body}
    if self.custom_properties:
        result['UserProperties'] = {name: self._serialize_basic_properties_value(value) for (name, value) in self.custom_properties.items()}
    if self.broker_properties:
        result['BrokerProperties'] = {name: self._serialize_basic_properties_value(value) for (name, value) in self.broker_properties.items()}
    return result
