"""
PrivilegeQuery Message Schema
"""
from .query_fields import query_fields

PrivilegeQuery = {
	"type": "object",
	"allOf": [
		{"$ref": "#/definitions/query_fields"}
	],
	"properties": {
		"criteria": {
			"type": "object",
			"properties": {
				"id": {"type": "string", "pattern": "^[=!~]([0-9]{14},?)+$"},
				"user": {"type": "string", "pattern": "^[=!][A-Z0-9]{2}\\-[0-9A-Z]{8}$"},
				"type": {"type": "string", "pattern": "^[=!](host|event)$"}
			},
    		"unevaluatedProperties": False
		}
	},
	"required": ["criteria"],
    "unevaluatedProperties": False,
    "definitions": {
        "query_fields": query_fields
    }
}
