{
  "version": 0,
  "entry": "explain",
  "blocks": {
    "explain": {
      "type": "uiShowMessage",
      "inputs": {
        "message": "Read Content Credentials from a media file and optionally save Adobe's JSON. A manifest is not proof of authenticity. Adobe may access sidecars, cloud services and certificate caches outside Automation Agent's file permissions; this is not an offline operation."
      },
      "next": "choose"
    },
    "choose": {
      "type": "setVar",
      "inputs": {
        "name": "mediaPath",
        "value": {
          "type": "openFileDialog",
          "inputs": {
            "cancelBehavior": "STOP"
          }
        }
      },
      "next": "read"
    },
    "read": {
      "type": "prReadC2paManifest",
      "inputs": {
        "path": {
          "var": "mediaPath"
        },
        "withValidation": true,
        "storeManifestJsonIn": "manifestJson",
        "storeManifestLocationsIn": "locations",
        "storeStatusIn": "status",
        "storeResultIn": "found",
        "onError": "STOP"
      },
      "next": "export"
    },
    "export": {
      "type": "if",
      "inputs": {
        "branches": [
          {
            "condition": {
              "var": "found"
            },
            "body": [
              {
                "type": "setVar",
                "inputs": {
                  "name": "exportPath",
                  "value": {
                    "type": "saveFileDialog",
                    "inputs": {
                      "suggestedName": "content-credentials.json",
                      "types": [
                        "json"
                      ],
                      "cancelBehavior": "STOP"
                    }
                  }
                }
              },
              {
                "type": "writeTextFile",
                "inputs": {
                  "path": {
                    "var": "exportPath"
                  },
                  "text": {
                    "var": "manifestJson"
                  },
                  "append": false
                }
              },
              {
                "type": "uiShowMessage",
                "inputs": {
                  "message": "Manifest JSON exported. Review Adobe's validation diagnostics before drawing conclusions about authenticity."
                }
              }
            ]
          }
        ],
        "elseBody": [
          {
            "type": "uiShowMessage",
            "inputs": {
              "message": "Premiere returned no manifest. No export was written."
            }
          }
        ]
      }
    }
  }
}
