{
  "$id": "https://www.atsc-schemas.org/atsc3.0/a362/20230220/org.atsc.drmOperation-complex-response.json",
  "$ref": "https://www.atsc-schemas.org/atsc3.0/a344/20210323/org.atsc.drmOperation-response.json",
  "title": "DRM Operation API",
  "description": "DRM Operation API",
  "type": "object",
  "properties": {
    "result": {
      "type": "object",
      "properties": {
        "message": {
          "$ref": "#/definitions/message"
        }
      }
    }
  },
  "required": [ "jsonrpc", "id" ],
  "oneOf": [ { "required": [ "result" ] }, { "required": [ "error" ] } ],
  "definitions": {
    "message": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "kid": {
              "type": "string"
            },
            "drmSessionId": {
              "type": "string"
            },
            "drmMsgType": {
              "type": "string",
              "enum": [
                "individualizationResponse",
                "serverCertificateResponse",
                "licenseRequest"
              ]
            },
            "drmData": {
              "type": "string",
              "contentEncoding": "base64"
            }
          },
          "allOf": [
            {
              "required": [ "kid", "drmMsgType", "drmData" ]
            },
            {
              "if": {
                "not": {
                  "properties": {
                    "drmMsgType": {
                      "const": "serverCertificateResponse"
                    }
                  }
                }
              },
              "then": {
                "required": [ "drmSessionId" ]
              }
            }
          ]
        }
      ]
    }
  }
}