{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "purpose": {
            "description": "values are: createAccount - this action can create the candidate's account. Applies only to general actions. apply - this action can apply for a job. Applies only to job actions. editDetails - this action can edit candidate details. Applies only to general actions.",
            "enum": [
                "createAccount",
                "editDetails",
                "apply"
            ]
        },
        "gateForElement": {
            "type": "object",
            "description": "a purpose that (e.g. 'apply') that this button is a gate for.",
            "properties": {
                "purpose": {
                    "$ref": "#/definitions/purpose"
                }
            },
            "allowAdditionalProperties": false,
            "required": [
                "purpose"
            ]
        },
        "semantics": {
            "description": "details about the semantics of this action that can be used by other apps. For example, knowledge that the action is used to apply for jobs may be useful if we want to (e.g.) prevent the user from applying unless they have completed some pre-qualification stage",
            "type": "object",
            "properties": {
                "purpose": {
                    "$ref": "#/definitions/purpose"
                },
                "gateFor": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/gateForElement"
                    }
                }
            },
            "allowAdditionalProperties": false
        },
        "possibleAction": {
            "type": "object",
            "properties": {
                "actionName": {
                    "type": "string",
                    "description": "A fixed name of this action, containing only lower case alpha, digits and '-' characters, length <= 30. The actionName is displayed to the user at setup time (e.g. to enable or disable the button) so it should make some sense to them. actionName should be unique within this app and scope, i.e. an app should never return more than one action with the same actionName as a possible job action."
                },
                "description": {
                    "type": "string",
                    "description": "A description of what this action does"
                },
                "availableToInternals": {
                    "type": "boolean"
                },
                "availableToExternals": {
                    "type": "boolean"
                },
                "mayRequireSetupFlag": {
                    "type": "boolean",
                    "description": "true if this action may provide a setup page (i.e. require some setup before it can be used)"
                },
                "semantics": {
                    "$ref": "#/definitions/semantics"
                }
            },
            "allowAdditionalProperties": false,
            "required": [
                "actionName",
                "availableToInternals",
                "availableToExternals",
                "mayRequireSetupFlag"
            ]
        }
    },
    "type": "array",
    "items": {
        "$ref": "#/definitions/possibleAction"
    }
}