{
    "id": "http://www.ubisoft.com/ugc/acd/v1/actions#",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "JSON Schema for Assassin's Creed Dynasty UGC",
    "Action": {
        "oneOf": [
            {
                "$ref": "#/definitions/ChangeScheduleAction"
            },
            {
                "$ref": "#/definitions/TransactionAction"
            },
            {
                "$ref": "#/definitions/InvestigationAction"
            },
            {
                "$ref": "#/definitions/SetVariableAction"
            }
        ]
    },
    "definitions": {
        "ChangeScheduleAction": {
            "type": "object",
            "properties": {
                "Type": {
                    "type": "string",
                    "enum": [
                        "ChangeSchedule"
                    ]
                },
                "Schedule": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#ObjectId"
                },
                "Target": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/typedtarget#TypedTarget"
                }
            },
            "required": [
                "Type",
                "Schedule",
                "Target"
            ],
            "additionalProperties": false
        },
        "TransactionAction": {
            "type": "object",
            "properties": {
                "Type": {
                    "type": "string",
                    "enum": [
                        "Transaction"
                    ]
                },
                "Participant": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "Item": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "Count": {
                    "type": "integer",
                    "minimum": 1
                },
                "FromPlayer": {
                    "type": "boolean"
                }
            },
            "required": [
                "Type",
                "Participant",
                "Item"
            ],
            "additionalProperties": false
        },
        "InvestigationAction": {
            "type": "object",
            "properties": {
                "Type": {
                    "type": "string",
                    "enum": [
                        "Investigation"
                    ]
                },
                "Clue": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                }
            },
            "required": [
                "Type",
                "Clue"
            ],
            "additionalProperties": false
        },
        "SetVariableAction": {
            "type": "object",
            "properties": {
                "Type": {
                    "type": "string",
                    "enum": [
                        "SetVariable"
                    ]
                },
                "Expression": {
                    "type": "string",
                    "pattern": "^\\s*\\$[A-Za-z][A-Za-z0-9_]*\\s*=.+",
                    "maxLength": 1024
                }
            },
            "required": [
                "Type",
                "Expression"
            ],
            "additionalProperties": false
        }
    }
}