{
    "additionalProperties": false,
    "description": "Schema for PII pseudonymization enrichment",
    "properties": {
        "enabled": {
            "type": "boolean"
        },
        "name": {
            "type": "string"
        },
        "parameters": {
            "additionalProperties": false,
            "properties": {
                "pii": {
                    "items": {
                        "additionalProperties": false,
                        "oneOf": [
                            {
                                "required": [
                                    "pojo"
                                ]
                            },
                            {
                                "required": [
                                    "json"
                                ]
                            }
                        ],
                        "properties": {
                            "json": {
                                "additionalProperties": false,
                                "properties": {
                                    "field": {
                                        "type": "string"
                                    },
                                    "jsonPath": {
                                        "pattern": "^\\$.*$",
                                        "type": "string"
                                    },
                                    "schemaCriterion": {
                                        "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"
                                    }
                                },
                                "required": [
                                    "field",
                                    "schemaCriterion",
                                    "jsonPath"
                                ],
                                "type": "object"
                            },
                            "pojo": {
                                "additionalProperties": false,
                                "properties": {
                                    "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"
                                        ]
                                    }
                                },
                                "required": [
                                    "field"
                                ],
                                "type": "object"
                            }
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "strategy": {
                    "additionalProperties": false,
                    "properties": {
                        "pseudonymize": {
                            "additionalProperties": false,
                            "properties": {
                                "hashFunction": {
                                    "enum": [
                                        "MD2",
                                        "MD5",
                                        "SHA-1",
                                        "SHA-256",
                                        "SHA-384",
                                        "SHA-512"
                                    ]
                                }
                            },
                            "required": [
                                "hashFunction"
                            ],
                            "type": "object"
                        }
                    },
                    "required": [
                        "pseudonymize"
                    ],
                    "type": "object"
                }
            },
            "required": [
                "pii",
                "strategy"
            ],
            "type": "object"
        },
        "vendor": {
            "type": "string"
        }
    },
    "required": [
        "vendor",
        "name",
        "enabled",
        "parameters"
    ],
    "self": {
        "format": "jsonschema",
        "name": "pii_enrichment_config",
        "vendor": "com.snowplowanalytics.snowplow.enrichments",
        "version": "1-0-0"
    },
    "type": "object"
}