{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-get-file-info-response-schema.json",
  "title": "GetFileInfoResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-files-api-openapi.yml#/components/schemas/GetFileInfoResponse",
  "properties": {
    "file_id": {
      "type": "string",
      "title": "File Id",
      "description": "Unique file identifier"
    },
    "graph_id": {
      "type": "string",
      "title": "Graph Id",
      "description": "Graph database identifier"
    },
    "table_id": {
      "type": "string",
      "title": "Table Id",
      "description": "Table identifier"
    },
    "table_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Table Name",
      "description": "Table name"
    },
    "file_name": {
      "type": "string",
      "title": "File Name",
      "description": "Original file name"
    },
    "file_format": {
      "type": "string",
      "title": "File Format",
      "description": "File format (parquet, csv, etc.)"
    },
    "size_bytes": {
      "type": "integer",
      "title": "Size Bytes",
      "description": "File size in bytes"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Row Count",
      "description": "Estimated row count"
    },
    "upload_status": {
      "type": "string",
      "title": "Upload Status",
      "description": "Current upload status"
    },
    "upload_method": {
      "type": "string",
      "title": "Upload Method",
      "description": "Upload method used"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At",
      "description": "File creation timestamp"
    },
    "uploaded_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Uploaded At",
      "description": "File upload completion timestamp"
    },
    "s3_key": {
      "type": "string",
      "title": "S3 Key",
      "description": "S3 object key"
    },
    "layers": {
      "anyOf": [
        {
          "$ref": "#/$defs/EnhancedFileStatusLayers"
        },
        {
          "type": "null"
        }
      ],
      "description": "Multi-layer pipeline status (S3 → DuckDB → Graph). Shows status, timestamps, and row counts for each layer independently."
    }
  },
  "type": "object",
  "required": [
    "file_id",
    "graph_id",
    "table_id",
    "file_name",
    "file_format",
    "size_bytes",
    "upload_status",
    "upload_method",
    "s3_key"
  ],
  "$defs": {
    "EnhancedFileStatusLayers": {
      "properties": {
        "s3": {
          "$ref": "#/$defs/FileLayerStatus",
          "description": "S3 layer status (immutable source)"
        },
        "duckdb": {
          "$ref": "#/$defs/FileLayerStatus",
          "description": "DuckDB layer status (mutable staging)"
        },
        "graph": {
          "$ref": "#/$defs/FileLayerStatus",
          "description": "Graph layer status (immutable materialized view)"
        }
      },
      "type": "object",
      "required": [
        "s3",
        "duckdb",
        "graph"
      ],
      "title": "EnhancedFileStatusLayers"
    },
    "FileLayerStatus": {
      "properties": {
        "status": {
          "type": "string",
          "title": "Status",
          "description": "Layer status"
        },
        "timestamp": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timestamp",
          "description": "Status timestamp"
        },
        "row_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Row Count",
          "description": "Row count (if available)"
        },
        "size_bytes": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Size Bytes",
          "description": "Size in bytes (S3 layer only)"
        }
      },
      "type": "object",
      "required": [
        "status"
      ],
      "title": "FileLayerStatus"
    }
  }
}