def METHOD_NAME(data, **metadata):
    """Build pubsub message obj for given input.
    Args:
        data: dict, data that needs to be published.
        metadata: dict, attributes for pubsub message.
    Returns:
        dict, encoded data.
    """
    message = {
        'data': data,
        'attributes': {
            'batch_id': metadata.get('batch_id', ''),
            'message_id': metadata.get('message_id', ''),
            'publish_time': metadata.get('publishTime', ''),
            'src_message_id': metadata.get('src_message_id', ''),
        }
    }
    _encode(message)
    return message