Class File


public abstract class File extends JsonSerializable
A file uploaded to the API.
  • Constructor Details

    • File

      public File()
  • Method Details

    • name

      public abstract Optional<String> name()
      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`
    • displayName

      public abstract Optional<String> displayName()
      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'
    • mimeType

      public abstract Optional<String> mimeType()
      Output only. MIME type of the file.
    • sizeBytes

      public abstract Optional<Long> sizeBytes()
      Output only. Size of the file in bytes.
    • createTime

      public abstract Optional<Instant> createTime()
      Output only. The timestamp of when the `File` was created.
    • expirationTime

      public abstract Optional<Instant> expirationTime()
      Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.
    • updateTime

      public abstract Optional<Instant> updateTime()
      Output only. The timestamp of when the `File` was last updated.
    • sha256Hash

      public abstract Optional<String> sha256Hash()
      Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.
    • uri

      public abstract Optional<String> uri()
      Output only. The URI of the `File`.
    • downloadUri

      public abstract Optional<String> downloadUri()
      Output only. The URI of the `File`, only set for downloadable (generated) files.
    • state

      public abstract Optional<FileState> state()
      Output only. Processing state of the File.
    • source

      public abstract Optional<FileSource> source()
      Output only. The source of the `File`.
    • videoMetadata

      public abstract Optional<Map<String,Object>> videoMetadata()
      Output only. Metadata for a video.
    • error

      public abstract Optional<FileStatus> error()
      Output only. Error status if File processing failed.
    • builder

      public static File.Builder builder()
      Instantiates a builder for File.
    • toBuilder

      public abstract File.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static File fromJson(String jsonString)
      Deserializes a JSON string to a File object.