{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/uploads-sh/json-schema/uploads-sh-scope-files-schema.json",
  "title": "ScopeFiles",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/uploads-sh-openapi.json#/components/schemas/ScopeFiles",
  "type": "object",
  "required": [
    "repo",
    "number",
    "items",
    "nextCursor",
    "privateCount",
    "liveLink",
    "pull"
  ],
  "properties": {
    "repo": {
      "type": "string"
    },
    "number": {
      "type": [
        "integer",
        "null"
      ]
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FeedItem"
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "privateCount": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "description": "Private files in the scope, first page only. Null on later pages or when counting would be too costly."
    },
    "liveLink": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "id",
        "url",
        "source"
      ],
      "description": "The existing public feed for exactly this scope.",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "source": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "comment",
            "user",
            null
          ]
        }
      }
    },
    "pull": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "branch",
        "title",
        "state"
      ],
      "properties": {
        "branch": {
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "open",
            "closed",
            "merged",
            null
          ]
        }
      }
    }
  },
  "$defs": {
    "FeedItem": {
      "type": "object",
      "required": [
        "id",
        "filename",
        "status",
        "url",
        "embedUrl"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "objectKey": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "missing",
            "withheld"
          ]
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "embedUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "pageUrl": {
          "type": "string",
          "format": "uri",
          "description": "Owner-only item page (`/c/<id>/<item>`)."
        },
        "contentType": {
          "type": [
            "string",
            "null"
          ]
        },
        "size": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "uploaded": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "modified": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "path": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ]
        },
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "videoDimensions": {
          "$ref": "#/$defs/VideoDimensions"
        }
      }
    },
    "Metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "VideoDimensions": {
      "type": "object",
      "required": [
        "width",
        "height"
      ],
      "properties": {
        "width": {
          "type": "integer",
          "minimum": 1
        },
        "height": {
          "type": "integer",
          "minimum": 1
        }
      }
    }
  }
}