{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "type": "object",
  "title": "MessagesResponse",
  "description": "Status of a posted message.",
  "additionalProperties": false,
  "required": [
    "messages"
  ],
  "properties": {
    "allSuccess": {
      "title": "Indicates if message was successfully sent to all recipients.",
      "type": "boolean"
    },
    "allFailed": {
      "title": "Indicates if message failed to be sent to all recipients.",
      "type": "boolean"
    },
    "allArrived": {
      "title": "Indicates if message arrived at all recipients.",
      "type": "boolean"
    },
    "messages": {
      "type": "array",
      "description": "Messages sent to recipients.",
      "items": {
        "$ref": "#/definitions/MessageResponse"
      }
    }
  },
  "definitions": {
    "MessageResponse": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "title": "Status",
          "type": "string",
          "enum": [
            "failed",
            "success",
            "unknown"
          ]
        },
        "statusDescription": {
          "title": "Optional description of the status.",
          "type": "string"
        },
        "id": {
          "title": "Optional id of the message that was sent to a recipient.",
          "type": "string"
        },
        "arrived": {
          "title": "Date the message arrived at the recipient in UTC format.",
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}
