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,

  // Union field content can be only one of the following:
  "text": string,
  "raw": string,
  "url": string,
  "data": value
  // End of list of possible types for union field content.
}
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.

Union field content.

content can be only one of the following:

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).