{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-gemini/json-schema/google-gemini-file-schema.json",
  "title": "File",
  "description": "A file uploaded to the API.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-gemini-files-api-openapi.yml#/components/schemas/File",
  "properties": {
    "updateTime": {
      "format": "google-datetime",
      "type": "string",
      "description": "Output only. The timestamp of when the `File` was last updated.",
      "readOnly": true
    },
    "displayName": {
      "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\"",
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "Source of the File.",
      "enum": [
        "SOURCE_UNSPECIFIED",
        "UPLOADED",
        "GENERATED",
        "REGISTERED"
      ]
    },
    "createTime": {
      "readOnly": true,
      "format": "google-datetime",
      "description": "Output only. The timestamp of when the `File` was created.",
      "type": "string"
    },
    "expirationTime": {
      "type": "string",
      "format": "google-datetime",
      "readOnly": true,
      "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire."
    },
    "videoMetadata": {
      "$ref": "#/$defs/VideoFileMetadata",
      "description": "Output only. Metadata for a video."
    },
    "mimeType": {
      "description": "Output only. MIME type of the file.",
      "readOnly": true,
      "type": "string"
    },
    "sizeBytes": {
      "type": "string",
      "readOnly": true,
      "format": "int64",
      "description": "Output only. Size of the file in bytes."
    },
    "sha256Hash": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. SHA-256 hash of the uploaded bytes.",
      "format": "byte"
    },
    "error": {
      "$ref": "#/$defs/Status",
      "description": "Output only. Error status if File processing failed."
    },
    "state": {
      "description": "Output only. Processing state of the File.",
      "readOnly": true,
      "type": "string",
      "enum": [
        "STATE_UNSPECIFIED",
        "PROCESSING",
        "ACTIVE",
        "FAILED"
      ]
    },
    "uri": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. The uri of the `File`."
    },
    "downloadUri": {
      "description": "Output only. The download uri of the `File`.",
      "type": "string",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "description": "Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`"
    }
  },
  "type": "object",
  "$defs": {
    "Status": {
      "properties": {
        "details": {
          "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object. Contains field @type with type URL."
            }
          }
        },
        "message": {
          "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
          "type": "string"
        },
        "code": {
          "description": "The status code, which should be an enum value of google.rpc.Code.",
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object",
      "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors)."
    },
    "VideoFileMetadata": {
      "properties": {
        "videoDuration": {
          "description": "Duration of the video.",
          "format": "google-duration",
          "type": "string"
        }
      },
      "type": "object",
      "description": "Metadata for a video `File`."
    }
  }
}