Part

Part represents a container for a section of communication content. Parts can be purely textual, some sort of file (image, video, etc) or a structured data blob (i.e. JSON).

JSON representation
{
  "metadata": {
    object
  },
  "filename": string,
  "mediaType": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "text": string,
  "raw": string,
  "url": string,
  "data": value
  // End of mutually exclusive fields.
}
Fields
metadata

object (Struct format)

Optional. metadata associated with this part.

filename

string

An optional filename for the file (e.g., "document.pdf").

mediaType

string

The mediaType (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.

The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
text

string

The string content of the text part.

raw

string (bytes format)

The raw byte content of a file. In JSON serialization, this is encoded as a base64 string.

A base64-encoded string.

url

string

A url pointing to the file's content.

data

value (Value format)

Arbitrary structured data as a JSON value (object, array, string, number, boolean, or null).

End of mutually exclusive fields.