{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/akeda-ru/json-schema/akeda-ru-chat-attachment-page-schema.json",
  "title": "ChatAttachmentPage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akeda-ru-chat-api-openapi.yml#/components/schemas/ChatAttachmentPage",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "items",
    "has_more"
  ],
  "properties": {
    "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/$defs/ChatForwardedAttachment"
      }
    },
    "has_more": {
      "type": "boolean",
      "description": "Следующая страница доказана прочитанной строкой за границей текущей, а не тем, что страница оказалась полной."
    },
    "next_cursor": {
      "type": "string",
      "description": "Курсор следующей страницы; присутствует только вместе с has_more=true."
    }
  },
  "$defs": {
    "ChatForwardedAttachment": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "conversation_id",
        "message_id",
        "original_name",
        "content_type",
        "size_bytes",
        "sha256_hex",
        "media_kind",
        "duration_ms",
        "waveform",
        "status",
        "scan_status",
        "created_at",
        "content_url"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/UUID"
        },
        "conversation_id": {
          "$ref": "#/$defs/UUID"
        },
        "message_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "original_name": {
          "type": "string"
        },
        "content_type": {
          "type": "string"
        },
        "size_bytes": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        },
        "sha256_hex": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "media_kind": {
          "type": "string",
          "enum": [
            "voice",
            "video_circle",
            "image",
            "video",
            "file"
          ]
        },
        "duration_ms": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64",
          "minimum": 0,
          "maximum": 600000
        },
        "waveform": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "quarantined",
            "ready",
            "failed",
            "deleted"
          ]
        },
        "scan_status": {
          "type": "string",
          "enum": [
            "pending",
            "clean",
            "infected",
            "unavailable",
            "skipped"
          ]
        },
        "scan_error_code": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "content_url": {
          "type": "string"
        }
      }
    },
    "UUID": {
      "type": "string",
      "format": "uuid"
    }
  }
}