{
  "$id": "https://opendatafabric.org/schemas/resources/v1alpha1/ResourceHeaders",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Container for identity and ownership information of a resource.",
  "type": "object",
  "required": [
    "id",
    "name",
    "account",
    "labels",
    "annotations",
    "generation",
    "statusGeneration",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "resource-id",
      "description": "Unique identifier of a resource within entire ODF node. Automatically assigned upon resource creation."
    },
    "name": {
      "type": "string",
      "format": "resource-name",
      "description": "Symbolic name of a resource that identifies it within a scope of an onwing account."
    },
    "account": {
      "$ref": "https://opendatafabric.org/schemas/auth/v1alpha1/ResourceOwnerHandle",
      "description": "Link to the account that owns the resource.",
      "unevaluatedProperties": false
    },
    "labels": {
      "$ref": "https://opendatafabric.org/schemas/resources/v1alpha1/ResourceLabels",
      "description": "Map of string keys and values that can be used to organize, categorize, and query resources.",
      "unevaluatedProperties": false
    },
    "annotations": {
      "$ref": "https://opendatafabric.org/schemas/resources/v1alpha1/ResourceAnnotations",
      "description": "Annotations is a key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. Unlike labels, annotations are not indexed and cannot be queried by.",
      "unevaluatedProperties": false
    },
    "ownerReferences": {
      "type": "array",
      "items": {
        "$ref": "https://opendatafabric.org/schemas/resources/v1alpha1/ResourceHandle",
        "unevaluatedProperties": false
      },
      "description": "References to resources that created this resource. Used for lineage tracking and cascading cleanup."
    },
    "generation": {
      "type": "integer",
      "format": "uint64",
      "description": "A sequential number that changes every time the resource header and spec are updated. Does not increment on status changes, thus signifying changes to the desired state. Populated by the system. Starts with `1`."
    },
    "statusGeneration": {
      "type": "integer",
      "format": "uint64",
      "description": "A sequential number that changes every time the resource status is updated. Can be passed back as a precondition of a status update to make sure the status was not modified since it was read. Populated by the system. Starts with `1`."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time when the resource was first applied and assigned an identity."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time when the resource was last updated, including header, spec, and status updates."
    },
    "deletionRequestedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time when deletion of the resource was requested. The resource remains visible until its controllers finish cleaning up and the deletion completes."
    },
    "deletedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time when the resource was deleted."
    }
  }
}
