import uuid
from datetime import datetime


def make_event(name, payload, safe=True, idempotent=True):
    """
    Build an event structure made of the given payload
    """
    return {
        "id": str(uuid.uuid4()),
        "name": name,
        "created": datetime.utcnow().isoformat(),
        "safe": safe,
        "idempotent": idempotent,
        "payload": payload
    }