{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "notScheduled": {
            "allOf": [
                {
                    "$ref": "#/definitions/shared"
                }
            ],
            "properties": {
                "runMode": {
                    "description": "Determines the run mode of the Azure Webjob. \n\n Triggered: manually triggered \n Scheduled: runs on a specific schedule \n Continuous: runs all the time",
                    "enum": [
                        "Continuous",
                        "OnDemand"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "runMode"
            ]
        },
        "scheduled": {
            "allOf": [
                {
                    "$ref": "#/definitions/shared"
                }
            ],
            "properties": {
                "runMode": {
                    "description": "Determines the run mode of the Azure Webjob. \n\n Triggered: manually triggered \n Scheduled: runs on a specific schedule \n Continuous: runs all the time",
                    "enum": [
                        "Scheduled"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "webJobName",
                "startTime",
                "endTime",
                "jobRecurrenceFrequency",
                "interval"
            ]
        },
        "shared": {
            "properties": {
                "endTime": {
                    "_format": "date-time",
                    "description": "The end time of a scheduled job. Example. 2014-06-12T00:00:00-08:00",
                    "type": "string"
                },
                "interval": {
                    "description": "The interval of how often the Azure Webjob should run. Use it with the 'jobRecurrenceFrequency' property.",
                    "type": "integer"
                },
                "jobRecurrenceFrequency": {
                    "description": "The frequency metric used with the 'interval' property.",
                    "enum": [
                        "Second",
                        "Minute",
                        "Hour",
                        "Day",
                        "Week",
                        "Month"
                    ],
                    "type": "string"
                },
                "startTime": {
                    "_format": "date-time",
                    "description": "The start time of a scheduled job. Example. 2014-06-11T00:00:00-08:00",
                    "type": "string"
                },
                "webJobName": {
                    "description": "The name of the Azure Webjob.",
                    "type": "string"
                }
            }
        }
    },
    "oneOf": [
        {
            "$ref": "#/definitions/scheduled"
        },
        {
            "$ref": "#/definitions/notScheduled"
        }
    ],
    "required": [
        "runMode"
    ],
    "title": "JSON schema for Azure Webjobs configuration files",
    "type": "object"
}