{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "UpdateResponse",
  "type": "object",
  "description": "An instance returned by the remote update API.\n            ",
  "additionalProperties": false,
  "required": [
    "releases"
  ],
  "properties": {
    "instance": {
      "description": "Update instance configuration. Parameters applying to the entire product/tenant.\n            ",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/UpdateConfig"
        }
      ]
    },
    "shared": {
      "description": "Parameters that might be provided by both the server and the local configuration.\n            ",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/SharedConfig"
        }
      ]
    },
    "releases": {
      "type": "array",
      "description": "The available update releases.\n            ",
      "items": {
        "$ref": "#/definitions/UpdateRelease"
      }
    }
  },
  "definitions": {
    "UpdateConfig": {
      "type": "object",
      "description": "Update instance configuration. Parameters applying to the entire product/tenant.\n            ",
      "additionalProperties": false,
      "properties": {
        "updatesDisabled": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Updates are currently disabled, do not do anything, even if new versions are found.\n            "
        },
        "latestVersion": {
          "type": [
            "null",
            "string"
          ],
          "description": "The latest version of the updater binary.\n            "
        },
        "latestUrl": {
          "type": [
            "null",
            "string"
          ],
          "description": "The URL to the latest updater binary. Redirects are supported.\n            "
        },
        "latestMirrorUrls": {
          "type": [
            "array",
            "null"
          ],
          "description": "Optional list of mirror/fallback URLs for the self-updater binary, tried in order when\nLatestUrl is unreachable. All URLs must use HTTPS.\n            ",
          "items": {
            "type": "string"
          }
        },
        "latestChecksum": {
          "description": "Optional checksum of the self-updater binary at LatestUrl.\nPassed to the self-updater DLL so it can verify the download before swapping.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ChecksumParameters"
            }
          ]
        },
        "emergencyUrl": {
          "type": [
            "null",
            "string"
          ],
          "description": "The emergency URL. See https://docs.nefarius.at/projects/Vicius/Emergency-Feature/\n            "
        },
        "exitCode": {
          "description": "Setup exit code parameters.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ExitCodeCheck"
            }
          ]
        },
        "helpUrl": {
          "type": [
            "null",
            "string"
          ],
          "description": "URL pointing to a help article opening when the user clicks the help button.\n            "
        },
        "errorFallbackUrl": {
          "type": [
            "null",
            "string"
          ],
          "description": "URL pointing to a help article opening when the user was presented with an error dialog.\n            "
        },
        "runAsAdmin": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When true, the downloaded setup is launched elevated (As Administrator) via the \"runas\" verb.\n            "
        }
      }
    },
    "ChecksumParameters": {
      "type": "object",
      "description": "Parameters for checksum/hash calculation.\n            ",
      "additionalProperties": false,
      "required": [
        "checksum",
        "checksumAlg"
      ],
      "properties": {
        "checksum": {
          "type": "string",
          "description": "The checksum/hash value to compare against.\n            ",
          "minLength": 1
        },
        "checksumAlg": {
          "description": "The algorithm to use to calculate the checksum/hash.\n            ",
          "oneOf": [
            {
              "$ref": "#/definitions/ChecksumAlgorithm"
            }
          ]
        }
      }
    },
    "ChecksumAlgorithm": {
      "type": "string",
      "description": "The supported checksum/hashing algorithms.\n            ",
      "x-enumNames": [
        "MD5",
        "SHA1",
        "SHA256"
      ],
      "enum": [
        "MD5",
        "SHA1",
        "SHA256"
      ]
    },
    "ExitCodeCheck": {
      "type": "object",
      "description": "Setup exit code parameters.\n            ",
      "additionalProperties": false,
      "required": [
        "skipCheck",
        "successCodes"
      ],
      "properties": {
        "skipCheck": {
          "type": "boolean",
          "description": "Ignore whatever exit code we got if true.\n            "
        },
        "successCodes": {
          "type": "array",
          "description": "One or more exit codes that signify success.\n            ",
          "items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "messages": {
          "type": [
            "null",
            "object"
          ],
          "description": "Optional per-exit-code UI messages, keyed by decimal exit code string (e.g. \"3010\").\nAn entry with IsSuccess set to true also promotes that\ncode to a success condition without requiring it to appear in SuccessCodes.\n            ",
          "additionalProperties": {
            "$ref": "#/definitions/ExitCodeMessage"
          }
        }
      }
    },
    "ExitCodeMessage": {
      "type": "object",
      "description": "Per-exit-code UI message entry used in Messages.\n            ",
      "additionalProperties": false,
      "required": [
        "message"
      ],
      "properties": {
        "message": {
          "type": "string",
          "description": "The message displayed in the updater UI when this exit code is encountered.\n            ",
          "minLength": 1
        },
        "isSuccess": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When true, this exit code is treated as a success condition even if it is\nabsent from SuccessCodes.\n            "
        },
        "helpUrl": {
          "type": [
            "null",
            "string"
          ],
          "description": "Optional URL opened by the help/more-info button shown alongside the message.\n            "
        },
        "buttonText": {
          "type": [
            "null",
            "string"
          ],
          "description": "Optional custom label for the help/more-info button.\nDefaults to \"Open help page\" when omitted.\n            "
        }
      }
    },
    "SharedConfig": {
      "type": "object",
      "description": "Parameters that might be provided by both the server and the local configuration.\n            ",
      "additionalProperties": false,
      "properties": {
        "windowTitle": {
          "type": [
            "null",
            "string"
          ],
          "description": "The process window title visible in the taskbar.\n            "
        },
        "productName": {
          "type": [
            "null",
            "string"
          ],
          "description": "The product name displayed in the UI and dialogs.\n            "
        },
        "detectionMethod": {
          "description": "The implementation to use to detect the locally installed product version to compare release versions against.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ProductVersionDetectionMethod"
            }
          ]
        },
        "detection": {
          "description": "The details of the selected DetectionMethod.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ProductVersionDetectionImplementation"
            }
          ]
        },
        "installationErrorUrl": {
          "type": [
            "null",
            "string"
          ],
          "description": "URL pointing to a help article opening when an update error occurred.\n            "
        },
        "downloadLocation": {
          "description": "The preferred setup download directory.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/DownloadLocationConfig"
            }
          ]
        },
        "runAsTemporaryCopy": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Gets or sets whether the updater should run as a temporary copy instead from the origin directory.\n            ",
          "x-example": "This feature is useful when the updater is shipped with a product using Windows Installer, which detects open\nprocesses that block an upgrade. Enabling this setting re-launches the updater process from a temporary copy so\non-the-fly upgrades in the origin directory become possible.\n            "
        },
        "signatureVerificationMode": {
          "description": "Global Authenticode verification mode for downloaded setups.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/SignatureVerificationMode"
            }
          ]
        },
        "signaturePolicy": {
          "description": "Global Authenticode comparison policy.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/SignatureComparisonPolicy"
            }
          ]
        },
        "signatureStrategy": {
          "description": "Global Authenticode pin strategy.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/SignatureVerificationStrategy"
            }
          ]
        },
        "signatureConfig": {
          "description": "Explicit certificate pin (used with FromConfiguration).\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/SignatureConfig"
            }
          ]
        },
        "hideRemindButton": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When true, the \"Remind me tomorrow\" button is hidden in the update UI.\n            "
        },
        "allowUserToDisableUpdates": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When true, the update UI offers a \"Disable update notifications\" action.\nThe action is hidden unless this is explicitly enabled. Default when omitted: false.\n            "
        },
        "iconBase64": {
          "type": [
            "null",
            "string"
          ],
          "description": "Base64-encoded Windows .ico data used as the window and taskbar icon at runtime.\n            "
        },
        "productBusyDetection": {
          "description": "When set, the update notification dialog is deferred until none of the configured\nprocesses are running. The agent waits in a message-pumping loop (gracefully\nresponsive to logoff/shutdown) and retries on the next scheduled run if the\nmaximum wait duration elapses.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ProductBusyDetectionConfig"
            }
          ]
        }
      }
    },
    "ProductVersionDetectionMethod": {
      "type": "string",
      "description": "The detection method of the installed software to use on the client.\n            ",
      "x-enumNames": [
        "RegistryValue",
        "FileVersion",
        "FileSize",
        "FileChecksum",
        "CustomExpression",
        "FixedVersion"
      ],
      "enum": [
        "RegistryValue",
        "FileVersion",
        "FileSize",
        "FileChecksum",
        "CustomExpression",
        "FixedVersion"
      ]
    },
    "ProductVersionDetectionImplementation": {
      "type": "object",
      "discriminator": {
        "propertyName": "$type",
        "mapping": {
          "RegistryValueConfig": "#/definitions/RegistryValueConfig",
          "FileVersionConfig": "#/definitions/FileVersionConfig",
          "FileSizeConfig": "#/definitions/FileSizeConfig",
          "FileChecksumConfig": "#/definitions/FileChecksumConfig",
          "CustomExpressionConfig": "#/definitions/CustomExpressionConfig",
          "FixedVersionConfig": "#/definitions/FixedVersionConfig"
        }
      },
      "description": "Possible product version detection parameters.\n            ",
      "x-abstract": true,
      "additionalProperties": false,
      "required": [
        "$type"
      ],
      "properties": {
        "$type": {
          "type": "string"
        }
      }
    },
    "RegistryValueConfig": {
      "allOf": [
        {
          "$ref": "#/definitions/ProductVersionDetectionImplementation"
        },
        {
          "type": "object",
          "description": "Queries a specific registry value and matches it against the selected UpdateRelease version.\n            ",
          "additionalProperties": false,
          "required": [
            "view",
            "hive",
            "key",
            "value"
          ],
          "properties": {
            "view": {
              "description": "The alternate view.\n            ",
              "oneOf": [
                {
                  "$ref": "#/definitions/RegistryView"
                }
              ]
            },
            "hive": {
              "description": "The hive.\n            ",
              "oneOf": [
                {
                  "$ref": "#/definitions/RegistryHive"
                }
              ]
            },
            "key": {
              "type": "string",
              "description": "The (sub-)key.\n            ",
              "minLength": 1
            },
            "value": {
              "type": "string",
              "description": "The value name.\n            ",
              "minLength": 1
            }
          }
        }
      ]
    },
    "RegistryView": {
      "type": "string",
      "description": "The alternate registry view to apply.\n            ",
      "x-enumNames": [
        "Default",
        "WOW64_64KEY",
        "WOW64_32KEY"
      ],
      "enum": [
        "Default",
        "WOW64_64KEY",
        "WOW64_32KEY"
      ]
    },
    "RegistryHive": {
      "type": "string",
      "description": "The registry hive to search for keys/values under.\n            ",
      "x-enumNames": [
        "HKCU",
        "HKLM",
        "HKCR"
      ],
      "enum": [
        "HKCU",
        "HKLM",
        "HKCR"
      ]
    },
    "FileVersionConfig": {
      "allOf": [
        {
          "$ref": "#/definitions/ProductVersionDetectionImplementation"
        },
        {
          "type": "object",
          "description": "Reads the version resource of the specified local file and matches it against the selected\nUpdateRelease version.\n            ",
          "additionalProperties": false,
          "required": [
            "input"
          ],
          "properties": {
            "input": {
              "type": "string",
              "description": "The absolute local path to the file to read or an inja template.\n            ",
              "minLength": 1
            },
            "statement": {
              "description": "The VersionResource to read.\n            ",
              "oneOf": [
                {
                  "$ref": "#/definitions/VersionResource"
                }
              ]
            },
            "data": {
              "type": [
                "null",
                "object"
              ],
              "description": "Optional inja template data.\n            ",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      ]
    },
    "VersionResource": {
      "type": "string",
      "description": "Describes which version resource fixed-value to read.\n            ",
      "x-enumNames": [
        "FILEVERSION",
        "PRODUCTVERSION"
      ],
      "enum": [
        "FILEVERSION",
        "PRODUCTVERSION"
      ]
    },
    "FileSizeConfig": {
      "allOf": [
        {
          "$ref": "#/definitions/ProductVersionDetectionImplementation"
        },
        {
          "type": "object",
          "description": "Compares the size of a given file against the provided value.\n            ",
          "additionalProperties": false,
          "required": [
            "input"
          ],
          "properties": {
            "input": {
              "type": "string",
              "description": "The absolute local path to the file to read or an inja template.\n            ",
              "minLength": 1
            },
            "data": {
              "type": [
                "null",
                "object"
              ],
              "description": "Optional inja template data.\n            ",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      ]
    },
    "FileChecksumConfig": {
      "allOf": [
        {
          "$ref": "#/definitions/ProductVersionDetectionImplementation"
        },
        {
          "type": "object",
          "description": "Calculates and compares the checksum/hash of a given file.\n            ",
          "additionalProperties": false,
          "required": [
            "input"
          ],
          "properties": {
            "input": {
              "type": "string",
              "description": "The absolute local path to the file to read or an inja template.\n            ",
              "minLength": 1
            },
            "data": {
              "type": [
                "null",
                "object"
              ],
              "description": "Optional inja template data.\n            ",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      ]
    },
    "CustomExpressionConfig": {
      "allOf": [
        {
          "$ref": "#/definitions/ProductVersionDetectionImplementation"
        },
        {
          "type": "object",
          "description": "A custom expression to evaluate.\n            ",
          "additionalProperties": false,
          "required": [
            "input"
          ],
          "properties": {
            "input": {
              "type": "string",
              "description": "The inja template.\n            ",
              "minLength": 1
            },
            "data": {
              "type": [
                "null",
                "object"
              ],
              "description": "Optional inja template data.\n            ",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      ]
    },
    "FixedVersionConfig": {
      "allOf": [
        {
          "$ref": "#/definitions/ProductVersionDetectionImplementation"
        },
        {
          "type": "object",
          "description": "A fixed version string.\n            ",
          "additionalProperties": false,
          "required": [
            "version"
          ],
          "properties": {
            "version": {
              "type": "string",
              "description": "The version string.\n            ",
              "minLength": 1
            }
          }
        }
      ]
    },
    "DownloadLocationConfig": {
      "type": "object",
      "description": "Inja template details about the download location path.\n            ",
      "additionalProperties": false,
      "required": [
        "input"
      ],
      "properties": {
        "input": {
          "type": "string",
          "description": "The absolute path or inja template.\n            ",
          "minLength": 1
        },
        "data": {
          "type": [
            "null",
            "object"
          ],
          "description": "Optional inja template data.\n            ",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "SignatureVerificationMode": {
      "type": "string",
      "description": "Controls whether Authenticode signature verification of the setup binary is enforced.\n            ",
      "x-enumNames": [
        "Disabled",
        "WhenPresent",
        "Required"
      ],
      "enum": [
        "Disabled",
        "WhenPresent",
        "Required"
      ]
    },
    "SignatureComparisonPolicy": {
      "type": "string",
      "description": "The policy to abide by when comparing signatures.\n            ",
      "x-enumNames": [
        "Relaxed",
        "Strict"
      ],
      "enum": [
        "Relaxed",
        "Strict"
      ]
    },
    "SignatureVerificationStrategy": {
      "type": "string",
      "description": "The strategy on how to verify if the setup signature is trusted.\n            ",
      "x-enumNames": [
        "FromUpdaterBinary",
        "FromConfiguration"
      ],
      "enum": [
        "FromUpdaterBinary",
        "FromConfiguration"
      ]
    },
    "SignatureConfig": {
      "type": "object",
      "description": "Authenticode certificate pin details.\n            ",
      "additionalProperties": false,
      "properties": {
        "issuerName": {
          "type": [
            "null",
            "string"
          ],
          "description": "The issuer name (CA display name). Semi-stable — use with caution across renewals.\n            "
        },
        "subjectName": {
          "type": [
            "null",
            "string"
          ],
          "description": "The subject / organization name. Stable across renewals; default FromUpdaterBinary pin field.\n            "
        },
        "serialNumber": {
          "type": [
            "null",
            "string"
          ],
          "description": "The certificate serial number as a hex string. Volatile — only safe via signed manifest (FromConfiguration).\n            "
        },
        "thumbprintSha1": {
          "type": [
            "null",
            "string"
          ],
          "description": "The SHA-1 thumbprint (hex). Volatile — only safe via signed manifest (FromConfiguration).\n            "
        },
        "thumbprintSha256": {
          "type": [
            "null",
            "string"
          ],
          "description": "The SHA-256 thumbprint (hex). Volatile — only safe via signed manifest (FromConfiguration).\n            "
        }
      }
    },
    "ProductBusyDetectionConfig": {
      "type": "object",
      "description": "Configuration for detecting whether the watched product is currently running,\nused to defer the update notification dialog until the product has been closed.\n            ",
      "additionalProperties": false,
      "required": [
        "imageNames"
      ],
      "properties": {
        "imageNames": {
          "type": "array",
          "description": "Process image base names matched case-insensitively against running processes.\n            ",
          "x-example": [
            "HidHide.exe",
            "HidHideMon.exe"
          ],
          "items": {
            "type": "string"
          }
        },
        "executablePaths": {
          "type": [
            "array",
            "null"
          ],
          "description": "Optional absolute paths (or inja templates) for exact full-path matching against\nrunning processes. Rendered via the inja template engine before comparison.\n            ",
          "items": {
            "type": "string"
          }
        },
        "pollIntervalSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Seconds between successive in-use re-checks. Default: 60.\n            ",
          "format": "int32"
        },
        "maxWaitMinutes": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Maximum minutes to wait before giving up and deferring to the next scheduled run.\nDefault: 180 (3 hours). The agent hard-clamps this value to 180 regardless of what\nis configured here.\n            ",
          "format": "int32"
        }
      }
    },
    "UpdateRelease": {
      "type": "object",
      "description": "Represents an update release.\n            ",
      "additionalProperties": false,
      "required": [
        "name",
        "version",
        "summary",
        "publishedAt",
        "downloadUrl"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Simple display name of the release.\n            ",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "description": "Semantic version of the release.\n            ",
          "minLength": 1
        },
        "summary": {
          "type": "string",
          "description": "Summary/changelog/description of the release. Supports Markdown syntax.\n            ",
          "minLength": 1
        },
        "publishedAt": {
          "type": "string",
          "description": "The release publish timestamp.\n            ",
          "format": "date-time"
        },
        "downloadUrl": {
          "type": "string",
          "description": "The URL to the new product setup. Redirects are supported.\n            ",
          "minLength": 1
        },
        "mirrorUrls": {
          "type": [
            "array",
            "null"
          ],
          "description": "Optional list of mirror/alternative download URLs tried in order when DownloadUrl is\nunreachable (e.g. blocked by a firewall or censorship). All URLs must use HTTPS.\n            ",
          "items": {
            "type": "string"
          }
        },
        "downloadSize": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Optional size (in bytes) of the download target. If this is not set, the UI will display \"N/A\" until download\nstarts.\n            ",
          "format": "int64"
        },
        "launchArguments": {
          "type": [
            "null",
            "string"
          ],
          "description": "Optional arguments to pass to the setup process.\n            "
        },
        "exitCode": {
          "description": "Setup exit code parameters.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ExitCodeCheck"
            }
          ]
        },
        "checksum": {
          "description": "Optional checksum/hashing settings to perform after download.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ChecksumParameters"
            }
          ]
        },
        "disabled": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Skips/disables this release on the client if set.\n            "
        },
        "signature": {
          "description": "Optional per-release Authenticode certificate pin.\nWhen present, the downloaded setup's signing cert is compared against these values.\nImplies FromConfiguration.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/SignatureConfig"
            }
          ]
        },
        "signaturePolicy": {
          "description": "Override the global Authenticode verification policy for this specific release.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/SignatureComparisonPolicy"
            }
          ]
        },
        "signatureStrategy": {
          "description": "Override the global Authenticode pin strategy for this specific release.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/SignatureVerificationStrategy"
            }
          ]
        },
        "detectionChecksum": {
          "description": "The file hash to use in product detection. This can differ from Checksum.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ChecksumParameters"
            }
          ]
        },
        "detectionSize": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The size value (in bytes) used in product detection. This can differ from DownloadSize.\n            ",
          "format": "int64"
        },
        "detectionVersion": {
          "type": [
            "null",
            "string"
          ],
          "description": "The version used in product detection. This can differ from Version.\n            "
        },
        "zipExtractDefaultFileDisposition": {
          "description": "Specifies how to handle files in a zip update, unless overridden via\nZipExtractFileDispositionOverrides.\n            ",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ZipExtractFileDisposition"
            }
          ]
        },
        "zipExtractFileDispositionOverrides": {
          "type": [
            "null",
            "object"
          ],
          "description": "Overrides the behavior for specific files in a zip update. Trumps\nZipExtractDefaultFileDisposition if set.\n            ",
          "additionalProperties": {
            "$ref": "#/definitions/ZipExtractFileDisposition"
          }
        },
        "runAsAdmin": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When true, the downloaded setup is launched elevated (As Administrator) via the \"runas\" verb.\n            "
        }
      }
    },
    "ZipExtractFileDisposition": {
      "type": "string",
      "description": "How to treat files when installing a .zip file.\n            ",
      "x-enumNames": [
        "CreateIfAbsent",
        "CreateOrReplace",
        "DeleteIfPresent"
      ],
      "enum": [
        "CreateIfAbsent",
        "CreateOrReplace",
        "DeleteIfPresent"
      ]
    }
  }
}