{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/airflow-desired-state-reconcile.schema.json",
  "title": "dpone GitOps Airflow desired-state reconcile evidence",
  "type": "object",
  "required": [
    "schema",
    "passed",
    "status",
    "environment",
    "observed_revision",
    "desired_state_sha256",
    "registry_scope_id",
    "source_project",
    "source_ref",
    "release_id",
    "deployment_id",
    "occurrence_id",
    "source_git_sha",
    "airflow_index_sha256",
    "runtime_image_digest",
    "expected_dag_ids",
    "activation_id",
    "previous_deployment_id",
    "predecessor_status",
    "materialized",
    "activated"
  ],
  "additionalProperties": false,
  "properties": {
    "schema": {
      "const": "dpone.airflow-desired-state-reconcile.v1"
    },
    "passed": {
      "const": true
    },
    "status": {
      "enum": [
        "activated",
        "recovered",
        "unchanged"
      ]
    },
    "environment": {
      "type": "string",
      "pattern": "^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$",
      "not": {
        "enum": [
          "current",
          "latest"
        ]
      }
    },
    "observed_revision": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "desired_state_sha256": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "registry_scope_id": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "source_project": {
      "type": "string",
      "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,126}[A-Za-z0-9])?(?:/[A-Za-z0-9](?:[A-Za-z0-9._-]{0,126}[A-Za-z0-9])?)+$",
      "maxLength": 512
    },
    "source_ref": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "release_id": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "deployment_id": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "occurrence_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "source_git_sha": {
      "type": "string",
      "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
    },
    "airflow_index_sha256": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "runtime_image_digest": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "expected_dag_ids": {
      "type": "array",
      "minItems": 1,
      "maxItems": 5000,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9_.-]{0,248}[A-Za-z0-9])?$"
      }
    },
    "activation_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "previous_deployment_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "predecessor_status": {
      "enum": [
        "bootstrap",
        "continuous",
        "recovered",
        "skipped",
        "unchanged"
      ]
    },
    "materialized": {
      "type": "boolean"
    },
    "activated": {
      "type": "boolean"
    }
  },
  "oneOf": [
    {
      "properties": {
        "status": {
          "const": "activated"
        },
        "materialized": {
          "const": true
        },
        "activated": {
          "const": true
        }
      }
    },
    {
      "properties": {
        "status": {
          "const": "unchanged"
        },
        "materialized": {
          "const": false
        },
        "activated": {
          "const": false
        }
      }
    },
    {
      "properties": {
        "status": {
          "const": "recovered"
        },
        "materialized": {
          "const": false
        },
        "activated": {
          "const": false
        },
        "predecessor_status": {
          "const": "recovered"
        }
      }
    }
  ]
}
