{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudtruth/json-schema/cloudtruth-backup-data-snapshot-schema.json",
  "title": "BackupDataSnapshot",
  "description": "Environment, parameter-type, and project (including parameters and values) data at a point in time.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudtruth-backup-api-openapi.yml#/components/schemas/BackupDataSnapshot",
  "type": "object",
  "properties": {
    "environments": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/BackupEnvironment"
      }
    },
    "types": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/BackupParameterType"
      }
    },
    "projects": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/BackupProject"
      }
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "environments",
    "projects",
    "timestamp",
    "types"
  ],
  "$defs": {
    "BackupEnvironment": {
      "type": "object",
      "description": "Basic environment data at a point in time.",
      "properties": {
        "name": {
          "type": "string"
        },
        "parent": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name"
      ]
    },
    "BackupExternalReference": {
      "type": "object",
      "description": "External reference data at a point in time.",
      "properties": {
        "fqn": {
          "type": "string"
        },
        "jmes_path": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "fqn"
      ]
    },
    "BackupParameter": {
      "type": "object",
      "description": "Parameter, rule, and value data at a point in time.",
      "properties": {
        "rules": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/BackupParameterRule"
          }
        },
        "values": {
          "type": "object",
          "additionalProperties": {
            "allOf": [
              {
                "$ref": "#/$defs/BackupParameterValue"
              }
            ]
          }
        },
        "name": {
          "type": "string"
        },
        "param_type": {
          "type": "string"
        },
        "project": {
          "type": "string"
        },
        "secret": {
          "type": "boolean"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "param_type",
        "project",
        "rules",
        "secret",
        "values"
      ]
    },
    "BackupParameterRule": {
      "type": "object",
      "description": "Rule that is applied to a parameter or parameter-type at a point in time.",
      "properties": {
        "rule_type": {
          "type": "string"
        },
        "constraints": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "constraints",
        "rule_type"
      ]
    },
    "BackupParameterType": {
      "type": "object",
      "description": "Parameter type (and rule) data at a point in time.",
      "properties": {
        "rules": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/BackupParameterRule"
          }
        },
        "name": {
          "type": "string"
        },
        "parent": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "parent",
        "rules"
      ]
    },
    "BackupParameterValue": {
      "type": "object",
      "description": "Parameter value data at a point in time.",
      "properties": {
        "external": {
          "allOf": [
            {
              "$ref": "#/$defs/BackupExternalReference"
            }
          ]
        },
        "environment": {
          "type": "string"
        },
        "evaluated": {
          "type": "boolean"
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "project": {
          "type": [
            "string",
            "null"
          ]
        },
        "value": {
          "type": [
            "string",
            "null"
          ]
        },
        "raw": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "environment",
        "evaluated",
        "external"
      ]
    },
    "BackupProject": {
      "type": "object",
      "description": "Environment, parameter-type, and project (including parameters and values) data at a point in time.",
      "properties": {
        "parameters": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/BackupParameter"
          }
        },
        "templates": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/BackupTemplate"
          }
        },
        "name": {
          "type": "string"
        },
        "parent": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "parameters",
        "templates"
      ]
    },
    "BackupTemplate": {
      "type": "object",
      "description": "Template data at a given point in time.",
      "properties": {
        "name": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "description",
        "name",
        "text"
      ]
    }
  }
}