{
    "additionalProperties": false,
    "description": "Schema for R2F (Right to be forgotten) criteria files that contain the identifiers for events that should be deleted.",
    "oneOf": [
        {
            "required": [
                "pojo"
            ]
        },
        {
            "required": [
                "json"
            ]
        }
    ],
    "properties": {
        "json": {
            "additionalProperties": false,
            "description": "A JSON field from the EnrichedEvent POJO (e.g. contexts).",
            "properties": {
                "fieldName": {
                    "description": "The name of the field",
                    "enum": [
                        "contexts",
                        "derived_contexts",
                        "unstruct_event"
                    ]
                },
                "jsonPath": {
                    "description": "The JsonPath that was specified",
                    "type": "string"
                },
                "schemaCriterion": {
                    "description": "The iglu schema corresponding to this field and value",
                    "pattern": "^iglu:([a-zA-Z0-9-_.]+)/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/([1-9][0-9]*|\\*)-((?:0|[1-9][0-9]*)|\\*)-((?:0|[1-9][0-9]*)|\\*)$",
                    "type": "string"
                },
                "valueForWhichEventWillBeDeleted": {
                    "description": "The value that, if present in that field, will cause the event to be deleted",
                    "type": "string"
                }
            },
            "required": [
                "fieldName",
                "jsonPath",
                "valueForWhichEventWillBeDeleted",
                "schemaCriterion"
            ],
            "type": "object"
        },
        "pojo": {
            "additionalProperties": false,
            "description": "A scalar field from the EnrichedEvent POJO (e.g. user_id)",
            "properties": {
                "fieldName": {
                    "description": "The name of the field",
                    "enum": [
                        "user_id",
                        "user_ipaddress",
                        "user_fingerprint",
                        "domain_userid",
                        "network_userid",
                        "ip_organization",
                        "ip_domain",
                        "tr_orderid",
                        "ti_orderid",
                        "mkt_term",
                        "mkt_content",
                        "se_category",
                        "se_action",
                        "se_label",
                        "se_property",
                        "mkt_clickid",
                        "refr_domain_userid",
                        "domain_sessionid"
                    ]
                },
                "valueForWhichEventWillBeDeleted": {
                    "description": "The value that, if present in that field, will cause the event to be deleted",
                    "type": "string"
                }
            },
            "required": [
                "fieldName",
                "valueForWhichEventWillBeDeleted"
            ],
            "type": "object"
        }
    },
    "self": {
        "format": "jsonschema",
        "name": "removal_criteria",
        "vendor": "com.snowplowanalytics.snowplow.r2f",
        "version": "1-0-0"
    },
    "type": "object"
}