{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/opoint/json-schema/opoint-list-notifications-schema.json",
  "title": "ListNotifications",
  "description": "Serves for describing the /notifications response. forced_singular_serializer can't work with inline_serializer",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/opoint-notifications-api-openapi.yml#/components/schemas/ListNotifications",
  "type": "object",
  "properties": {
    "count": {
      "type": "integer"
    },
    "next": {
      "type": [
        "string",
        "null"
      ]
    },
    "previous": {
      "type": [
        "string",
        "null"
      ]
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Notification"
      }
    }
  },
  "required": [
    "count",
    "next",
    "previous",
    "results"
  ],
  "$defs": {
    "BaseReport": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "download": {
          "type": "string",
          "readOnly": true
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer",
          "readOnly": true
        },
        "timeFinished": {
          "type": "integer"
        },
        "type": {
          "type": "integer",
          "readOnly": true
        },
        "articles": {
          "type": "integer",
          "readOnly": true
        },
        "timestampFrom": {
          "type": "integer",
          "readOnly": true
        },
        "timestampTo": {
          "type": "integer",
          "readOnly": true
        }
      },
      "required": [
        "articles",
        "download",
        "id",
        "status",
        "timeFinished",
        "timestampFrom",
        "timestampTo",
        "title",
        "type"
      ]
    },
    "Export": {
      "type": "object",
      "description": "Serializer for returning statistics export data from notifications",
      "properties": {
        "id": {
          "type": "integer"
        },
        "download": {
          "type": "string",
          "readOnly": true
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer",
          "readOnly": true
        },
        "timeFinished": {
          "type": "integer"
        },
        "type": {
          "type": "integer",
          "readOnly": true
        },
        "articles": {
          "type": "integer",
          "readOnly": true
        },
        "timestampFrom": {
          "type": "integer",
          "readOnly": true
        },
        "timestampTo": {
          "type": "integer",
          "readOnly": true
        }
      },
      "required": [
        "articles",
        "download",
        "id",
        "status",
        "timeFinished",
        "timestampFrom",
        "timestampTo",
        "title",
        "type"
      ]
    },
    "Notification": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "title": {
          "type": "string",
          "maxLength": 255
        },
        "read": {
          "type": "boolean",
          "default": false
        },
        "object": {
          "oneOf": [
            {
              "$ref": "#/$defs/NotificationFieldValue"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "title"
      ]
    },
    "NotificationFieldExport": {
      "type": "object",
      "description": "Single purpose serializer: Servers only to correctly describe a NotificationRelatedField field\nwhere the value is ExportSerializer.",
      "properties": {
        "type": {
          "type": "string"
        },
        "value": {
          "oneOf": [
            {
              "$ref": "#/$defs/Export"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "type",
        "value"
      ]
    },
    "NotificationFieldReport": {
      "type": "object",
      "description": "Single purpose serializer: Servers only to correctly describe a NotificationRelatedField field\nwhere the value is ReportSerializer.",
      "properties": {
        "type": {
          "type": "string"
        },
        "value": {
          "oneOf": [
            {
              "$ref": "#/$defs/Report"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "type",
        "value"
      ]
    },
    "NotificationFieldSiteExport": {
      "type": "object",
      "description": "Single purpose serializer: Servers only to correctly describe a NotificationRelatedField field\nwhere the value is BaseReportSerializer.",
      "properties": {
        "type": {
          "type": "string"
        },
        "value": {
          "oneOf": [
            {
              "$ref": "#/$defs/BaseReport"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "type",
        "value"
      ]
    },
    "NotificationFieldTrackingExport": {
      "type": "object",
      "description": "Single purpose serializer: Servers only to correctly describe a NotificationRelatedField field\nwhere the value is ReportSerializer.",
      "properties": {
        "type": {
          "type": "string"
        },
        "value": {
          "oneOf": [
            {
              "$ref": "#/$defs/BaseReport"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "type",
        "value"
      ]
    },
    "NotificationFieldValue": {
      "oneOf": [
        {
          "$ref": "#/$defs/NotificationFieldExport"
        },
        {
          "$ref": "#/$defs/NotificationFieldReport"
        },
        {
          "$ref": "#/$defs/NotificationFieldTrackingExport"
        },
        {
          "$ref": "#/$defs/NotificationFieldSiteExport"
        }
      ]
    },
    "Report": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "download": {
          "type": "string",
          "readOnly": true
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer",
          "readOnly": true
        },
        "timeFinished": {
          "type": "integer"
        },
        "type": {
          "type": "integer",
          "readOnly": true
        },
        "articles": {
          "type": "integer",
          "readOnly": true
        },
        "timestampFrom": {
          "type": "integer",
          "readOnly": true
        },
        "timestampTo": {
          "type": "integer",
          "readOnly": true
        },
        "pdfPages": {
          "type": "integer"
        },
        "pdfBytes": {
          "type": "integer"
        }
      },
      "required": [
        "articles",
        "download",
        "id",
        "pdfBytes",
        "pdfPages",
        "status",
        "timeFinished",
        "timestampFrom",
        "timestampTo",
        "title",
        "type"
      ]
    }
  }
}