{
  "$schema": "http://json-schema.org/draft-04/schema",
  "id": "campaign.json",
  "type": "object",
  "properties": {
    "campaignId": {
      "readOnly": true,
      "type": "integer"
    },
    "recipientsRequired": {
      "readOnly": true,
      "type": [ "boolean", "null" ]
    },
    "contentRequired": {
      "readOnly": true,
      "type": [ "boolean", "null" ]
    },
    "name": {
      "type": "string",
      "maxLength": 100,
      "pattern": "[^ \t\r\n]"
    },
    "fromName": {
      "type": "string",
      "maxLength": 100,
      "pattern": "[^ \t\r\n]"
    },
    "fromEmail": {
      "type": "string",
      "format": "email",
      "maxLength": 100
    },
    "subject": {
      "type": "string",
      "maxLength": 100,
      "pattern": "[^ \t\r\n]"
    },
    "preheader": {
      "type": [ "string", "null" ],
      "maxLength": 100
    },
    "replyTo": {
      "type": [ "string", "null" ],
      "format": "email",
      "maxLength": 100
    },
    "status": {
      "readOnly": true,
      "type": "string",
      "enum": [
        "draft",
        "scheduled",
        "shipping",
        "shipped"
      ]
    },
    "textCampaign": {
      "readOnly": true,
      "type": [ "boolean", "null" ]
    },
    "scheduledDate": {
      "readOnly": true,
      "type": [ "string", "null" ],
      "format": "date-time"
    },    
    "_links": {
      "$ref": "link-collection.json"
    }
  },
  "required": [ "name", "fromName", "fromEmail", "subject" ]
}
