{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cachethq/json-schema/cachethq-component-schema.json",
  "title": "Component",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cachethq-openapi.json#/components/schemas/Component",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "components"
      ]
    },
    "attributes": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "link": {
          "type": [
            "string",
            "null"
          ]
        },
        "order": {
          "type": [
            "integer",
            "null"
          ]
        },
        "status": {
          "type": "object",
          "properties": {
            "human": {
              "type": "string",
              "enum": [
                "Operational",
                "Performance issues",
                "Partial outage",
                "Major outage",
                "Under maintenance",
                "Unknown"
              ]
            },
            "value": {
              "type": "integer",
              "enum": [
                1,
                2,
                3,
                4,
                5,
                6
              ]
            }
          },
          "required": [
            "human",
            "value"
          ]
        },
        "latest_status": {
          "type": "object",
          "properties": {
            "human": {
              "type": "string",
              "enum": [
                "Operational",
                "Performance issues",
                "Partial outage",
                "Major outage",
                "Under maintenance",
                "Unknown"
              ]
            },
            "value": {
              "type": "integer",
              "enum": [
                1,
                2,
                3,
                4,
                5,
                6
              ]
            }
          },
          "required": [
            "human",
            "value"
          ]
        },
        "enabled": {
          "type": "boolean"
        },
        "meta": {
          "type": "array",
          "items": {}
        },
        "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"
          ]
        },
        "pivot": {
          "type": "object",
          "properties": {
            "component_status": {
              "type": "object",
              "properties": {
                "human": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "Operational",
                    "Performance issues",
                    "Partial outage",
                    "Major outage",
                    "Under maintenance",
                    "Unknown",
                    null
                  ]
                },
                "value": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "enum": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    null
                  ]
                }
              },
              "required": [
                "human",
                "value"
              ]
            }
          },
          "required": [
            "component_status"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "description",
        "link",
        "order",
        "status",
        "latest_status",
        "enabled",
        "created",
        "updated"
      ]
    },
    "relationships": {
      "type": "object",
      "properties": {
        "group": {
          "type": "object",
          "properties": {
            "data": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ComponentGroupIdentifier"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        },
        "incidents": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/IncidentIdentifier"
              }
            }
          },
          "required": [
            "data"
          ]
        },
        "tags": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/TagIdentifier"
              }
            }
          },
          "required": [
            "data"
          ]
        }
      }
    }
  },
  "required": [
    "id",
    "type"
  ],
  "$defs": {
    "ComponentGroupIdentifier": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "componentGroups"
          ]
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "title": "ComponentGroupIdentifier"
    },
    "IncidentIdentifier": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "incidents"
          ]
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "title": "IncidentIdentifier"
    },
    "TagIdentifier": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "tags"
          ]
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "id"
      ],
      "title": "TagIdentifier"
    }
  }
}