Class Image

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public abstract class Image.Builder

      Builder for Image.

    • Constructor Summary

      Constructors 
      Constructor Description
      Image()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Optional<String> gcsUri() The Cloud Storage URI of the image.
      abstract Optional<Array<byte>> imageBytes() The image bytes data.
      abstract Optional<String> mimeType() The MIME type of the image.
      static Image.Builder builder() Instantiates a builder for Image.
      abstract Image.Builder toBuilder() Creates a builder with the same values as this instance.
      static Image fromJson(String jsonString) Deserializes a JSON string to a Image object.
      static Image fromFile(String location) Creates an Image object from a local file.
      static Image fromFile(String location, String mimeType) Creates an Image object from a local file and mime type.
      • Methods inherited from class com.google.genai.JsonSerializable

        fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Image

        Image()
    • Method Detail

      • gcsUri

         abstract Optional<String> gcsUri()

        The Cloud Storage URI of the image. ``Image`` can contain a value for this field or the ``image_bytes`` field but not both.

      • imageBytes

         abstract Optional<Array<byte>> imageBytes()

        The image bytes data. ``Image`` can contain a value for this field or the ``gcs_uri`` field but not both.

      • fromJson

         static Image fromJson(String jsonString)

        Deserializes a JSON string to a Image object.

      • fromFile

         static Image fromFile(String location)

        Creates an Image object from a local file.

        If mimeType is not specified, it will be inferred from the file extension.

      • fromFile

         static Image fromFile(String location, String mimeType)

        Creates an Image object from a local file and mime type.