Class File

  • All Implemented Interfaces:

    
    public abstract class File
    extends JsonSerializable
                        

    A file uploaded to the API.

    • Constructor Detail

      • File

        File()
    • Method Detail

      • name

         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

         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'

      • expirationTime

         abstract Optional<Instant> expirationTime()

        Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.

      • sha256Hash

         abstract Optional<String> sha256Hash()

        Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.

      • downloadUri

         abstract Optional<String> downloadUri()

        Output only. The URI of the `File`, only set for downloadable (generated) files.

      • fromJson

         static File fromJson(String jsonString)

        Deserializes a JSON string to a File object.