{
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/airflow-desired-state-publish-preparation.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "candidate": {
      "additionalProperties": false,
      "properties": {
        "airflow_index_sha256": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "authority_sha256": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "deployment_id": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "environment": {
          "not": {
            "enum": [
              "current",
              "latest"
            ]
          },
          "pattern": "^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$",
          "type": "string"
        },
        "expected_dag_ids": {
          "items": {
            "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9_.-]{0,248}[A-Za-z0-9])?$",
            "type": "string"
          },
          "maxItems": 5000,
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        },
        "expected_revision": {
          "anyOf": [
            {
              "maxLength": 1024,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "git_sha": {
          "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$",
          "type": "string"
        },
        "job_id": {
          "pattern": "^[0-9]{1,32}$",
          "type": "string"
        },
        "pipeline_id": {
          "pattern": "^[0-9]{1,32}$",
          "type": "string"
        },
        "project": {
          "maxLength": 512,
          "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])?)+$",
          "type": "string"
        },
        "publication_evidence_sha256": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "registry_scope_id": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "release_id": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "runtime_image_dbt_digest": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "runtime_image_digest": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "source_ref": {
          "maxLength": 256,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "environment",
        "authority_sha256",
        "project",
        "source_ref",
        "pipeline_id",
        "job_id",
        "git_sha",
        "registry_scope_id",
        "release_id",
        "deployment_id",
        "airflow_index_sha256",
        "runtime_image_digest",
        "expected_dag_ids",
        "publication_evidence_sha256",
        "expected_revision"
      ],
      "type": "object"
    },
    "intent": {
      "additionalProperties": false,
      "properties": {
        "candidate_sha256": {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        "occurrence_id": {
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
          "type": "string"
        },
        "promoted_at": {
          "format": "date-time",
          "maxLength": 40,
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]{1,6})?Z$",
          "type": "string"
        },
        "schema": {
          "const": "dpone.airflow-desired-state-publish-intent.v1"
        }
      },
      "required": [
        "schema",
        "candidate_sha256",
        "occurrence_id",
        "promoted_at"
      ],
      "type": "object"
    },
    "schema": {
      "const": "dpone.airflow-desired-state-publish-preparation.v1"
    }
  },
  "required": [
    "schema",
    "candidate",
    "intent"
  ],
  "title": "dpone GitOps immutable cross-job desired-state publish preparation",
  "type": "object"
}
