{
  "$id": "https://www.atsc-schemas.org/atsc3.0/a362/20230220/org.atsc.notify-DRM.json",
  "$ref": "https://www.atsc-schemas.org/atsc3.0/a344/20210323/org.atsc.notify-DRM.json",
  "title": "DRM Notification API",
  "description": "DRM Notification API",
  "type": "object",
  "properties": {
    "params": {
      "properties": {
        "systemId": {
          "type": "string",
          "format": "uri",
          "pattern": "^urn:uuid:"
        },
        "service": {
          "type": "string",
          "format": "uri"
        },
        "message": {
          "$ref": "#/definitions/message"
        }
      },
      "required": [ "msgType", "systemId", "message" ]
    }
  },
  "required": [ "jsonrpc", "method", "params" ],
  "definitions": {
    "message": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "kid": {
              "type": "string"
            },
            "drmSessionId": {
              "type": "string"
            },
            "drmMsgType": {
              "type": "string",
              "enum": [
                "individualizationRequest",
                "serverCertificateRequest",
                "licenseRequest",
                "drmError"
              ]
            },
            "drmData": {
              "type": "string",
              "contentEncoding": "base64"
            },
            "drmErrorMessage": {
              "type": "string"
            },
            "drmErrorCode": {
              "type": "string"
            }
          },
          "allOf": [
            {
              "required": [
                "kid",
                "drmSessionId",
                "drmMsgType",
                "drmData"
              ]
            },
            {
              "if": {
                "properties": {
                  "drmMsgType": {
                    "const": "drmError"
                  }
                }
              },
              "then": {
                "required": [ "drmErrorMessage", "drmErrorCode" ]
              }
            }
          ]
        }
      ]
    }
  }
}