{
    "$schema": "http://json-schema.org/schema#",
    "type": "object",
    "properties": {
        "type": {
            "type": "string",
            "description": "The service type (should always be 'cloudwatchevent')",
            "pattern": "cloudwatchevent",
            "errorMessage": "Must equal 'cloudwatchevent'"
        },
        "description": {
            "type": "string",
            "description": "The event description",
            "errorMessage": "Must be a string"
        },
        "schedule": {
            "type": "string",
            "description": "The cron or rate string specifying the schedule on which to fire the event",
            "errorMessage": "Must be a string"
        },
        "event_pattern": {
            "type": "object",
            "description": "The list of event patterns on which to fire the event",
            "errorMessage": "Must be an object"
        },
        "state": {
            "type": "string",
            "description": "What state the rule should be in",
            "pattern": "^(enabled|disabled)$",
            "errorMessage": "Must be one of the following values: enabled, disabled"
        },
        "event_consumers": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "service_name": {
                        "type": "string",
                        "errorMessage": "Must be a string"
                    },
                    "event_input": {
                        "type": "string",
                        "errorMessage": "Must be a JSON string"
                    }
                },
                "errorMessage": "Must contain an array of objects with the 'service_name' and 'event_input' properties",
                "additionalProperties": false
            }
        },
        "tags": {
            "type": "object",
            "description": "An arbitrary list of key/value pairs to be added as tags to the service",
            "patternProperties": {
                "^.*$": {
                    "anyOf": [
                        {"type": "string"},
                        {"type": "number"}
                    ]
                }
            },
            "errorMessage": "Must contain 1 or more simple key/value pairs where the values are strings or numbers",
            "additionalProperties": false
        }
    },
    "required": [
        "type"
    ],
    "additionalProperties": false,
    "errorMessage": {
        "additionalProperties": "Invalid/unknown property specified",
        "required": {
            "type": "The 'type' property is required"
        }
    }
}