{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cachethq/json-schema/cachethq-update-schema.json",
  "title": "Update",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cachethq-openapi.json#/components/schemas/Update",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "updates"
      ]
    },
    "attributes": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "updateable_id": {
          "type": "integer"
        },
        "updateable_type": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "status": {
          "type": "object",
          "properties": {
            "human": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "Investigating",
                "Identified",
                "Watching",
                "Fixed",
                "Reported",
                null
              ]
            },
            "value": {
              "type": [
                "integer",
                "null"
              ],
              "enum": [
                0,
                1,
                2,
                3,
                4,
                null
              ]
            }
          },
          "required": [
            "human",
            "value"
          ]
        },
        "created": {
          "type": "object",
          "properties": {
            "human": {
              "type": [
                "string",
                "null"
              ]
            },
            "string": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "human",
            "string"
          ]
        },
        "updated": {
          "type": "object",
          "properties": {
            "human": {
              "type": [
                "string",
                "null"
              ]
            },
            "string": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "human",
            "string"
          ]
        }
      },
      "required": [
        "id",
        "updateable_id",
        "updateable_type",
        "message",
        "created",
        "updated"
      ]
    },
    "relationships": {
      "type": "object",
      "properties": {
        "incident": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "$ref": "#/$defs/IncidentIdentifier"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        },
        "schedule": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ScheduleIdentifier"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      }
    }
  },
  "required": [
    "id",
    "type"
  ],
  "$defs": {
    "IncidentIdentifier": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "incidents"
          ]
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "title": "IncidentIdentifier"
    },
    "ScheduleIdentifier": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "schedules"
          ]
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "title": "ScheduleIdentifier"
    }
  }
}