def METHOD_NAME(code, message, severity="ERROR", detail=None, hint=None):
    fields = {
        "S": severity,
        "V": severity,
        "C": code,
        "M": message,
    }
    if detail is not None:
        fields["D"] = detail
    if hint is not None:
        fields["H"] = hint
    return fields