{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Organization action",
    "description": "Execute an action for the organization. Only one action at a time.",
    "type": "object",
    "oneOf": [
        {
            "description": "Action: Add user to an organization",
            "type": "object",
            "required": [
                "type"
            ],
            "properties": {
                "type": {
                    "description": "addUser action type",
                    "type": "string",
                    "enum": [
                        "addUser"
                    ]
                },
                "email": {
                    "description": "The email address to add the user",
                    "type": "string"
                },
                "userId": {
                    "description": "The user id",
                    "type": "integer"
                }
            }
        },
        {
            "description": "Action: Remove user from an organization",
            "type": "object",
            "required": [
                "type"
            ],
            "properties": {
                "type": {
                    "description": "removeUser action type",
                    "type": "string",
                    "enum": [
                        "removeUser"
                    ]
                },
                "email": {
                    "description": "The email address to remove the user",
                    "type": "string"
                },
                "userId": {
                    "description": "The user id",
                    "type": "integer"
                }
            }
        }
    ]
}