{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eurobase-dev/json-schema/eurobase-dev-notification-detail-response-schema.json",
  "title": "NotificationDetailResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eurobase-dev-notifications-api-openapi.yml#/components/schemas/NotificationDetailResponse",
  "type": "object",
  "required": [
    "notification",
    "detail",
    "threadEvents"
  ],
  "properties": {
    "notification": {
      "$ref": "#/$defs/Notification"
    },
    "detail": {
      "$ref": "#/$defs/NotificationDetailProjection"
    },
    "threadEvents": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/NotificationThreadEvent"
      }
    }
  },
  "$defs": {
    "Notification": {
      "type": "object",
      "required": [
        "id",
        "category",
        "severity",
        "title",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "organizationId": {
          "type": [
            "string",
            "null"
          ]
        },
        "projectId": {
          "type": [
            "string",
            "null"
          ]
        },
        "deploymentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "category": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "critical"
          ]
        },
        "tone": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "success",
            "warning",
            "error",
            "info"
          ]
        },
        "title": {
          "type": "string"
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        },
        "resourceType": {
          "type": [
            "string",
            "null"
          ]
        },
        "resourceId": {
          "type": [
            "string",
            "null"
          ]
        },
        "resourceLabel": {
          "type": [
            "string",
            "null"
          ]
        },
        "resourceState": {
          "type": "string",
          "enum": [
            "available",
            "pending_delete",
            "inaccessible",
            "none"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "primaryAction": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "label",
                "path",
                "enabled",
                "disabledReason"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                },
                "disabledReason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "readAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "archivedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "NotificationDetailProjection": {
      "type": "object",
      "required": [
        "threadId",
        "statusLabel",
        "sourceLabel",
        "resourceTypeLabel",
        "threadEventCount",
        "firstEventAt",
        "latestEventAt"
      ],
      "properties": {
        "threadId": {
          "type": "string"
        },
        "statusLabel": {
          "type": "string"
        },
        "sourceLabel": {
          "type": "string"
        },
        "resourceTypeLabel": {
          "type": "string"
        },
        "threadEventCount": {
          "type": "integer"
        },
        "firstEventAt": {
          "type": "string",
          "format": "date-time"
        },
        "latestEventAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "NotificationThreadEvent": {
      "type": "object",
      "required": [
        "id",
        "title",
        "severity",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "critical"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}