Class Icon.Builder (0.1.0)

public static final class Icon.Builder extends GeneratedMessageV3.Builder<Icon.Builder> implements IconOrBuilder

An icon displayed in a widget on a card. For an example in Google Chat apps, see Icon.

Supports built-in and custom icons.

Google Workspace Add-ons and Chat apps:

Protobuf type google.apps.card.v1.Icon

Implements

IconOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Icon.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Icon.Builder
Overrides

build()

public Icon build()
Returns
TypeDescription
Icon

buildPartial()

public Icon buildPartial()
Returns
TypeDescription
Icon

clear()

public Icon.Builder clear()
Returns
TypeDescription
Icon.Builder
Overrides

clearAltText()

public Icon.Builder clearAltText()

Optional. A description of the icon used for accessibility. If unspecified, the default value Button is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, A user's account portrait, or Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat.

If the icon is set in a Button, the altText appears as helper text when the user hovers over the button. However, if the button also sets text, the icon's altText is ignored.

string alt_text = 3;

Returns
TypeDescription
Icon.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Icon.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Icon.Builder
Overrides

clearIconUrl()

public Icon.Builder clearIconUrl()

Display a custom icon hosted at an HTTPS URL.

For example:

` "iconUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png"

Supported file types include .png and .jpg`.

string icon_url = 2;

Returns
TypeDescription
Icon.Builder

This builder for chaining.

clearIcons()

public Icon.Builder clearIcons()
Returns
TypeDescription
Icon.Builder

clearImageType()

public Icon.Builder clearImageType()

The crop style applied to the image. In some cases, applying a CIRCLE crop causes the image to be drawn larger than a built-in icon.

.google.apps.card.v1.Widget.ImageType image_type = 4;

Returns
TypeDescription
Icon.Builder

This builder for chaining.

clearKnownIcon()

public Icon.Builder clearKnownIcon()

Display one of the built-in icons provided by Google Workspace.

For example, to display an airplane icon, specify AIRPLANE. For a bus, specify BUS.

For a full list of supported icons, see built-in icons.

string known_icon = 1;

Returns
TypeDescription
Icon.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Icon.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Icon.Builder
Overrides

clone()

public Icon.Builder clone()
Returns
TypeDescription
Icon.Builder
Overrides

getAltText()

public String getAltText()

Optional. A description of the icon used for accessibility. If unspecified, the default value Button is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, A user's account portrait, or Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat.

If the icon is set in a Button, the altText appears as helper text when the user hovers over the button. However, if the button also sets text, the icon's altText is ignored.

string alt_text = 3;

Returns
TypeDescription
String

The altText.

getAltTextBytes()

public ByteString getAltTextBytes()

Optional. A description of the icon used for accessibility. If unspecified, the default value Button is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, A user's account portrait, or Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat.

If the icon is set in a Button, the altText appears as helper text when the user hovers over the button. However, if the button also sets text, the icon's altText is ignored.

string alt_text = 3;

Returns
TypeDescription
ByteString

The bytes for altText.

getDefaultInstanceForType()

public Icon getDefaultInstanceForType()
Returns
TypeDescription
Icon

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getIconUrl()

public String getIconUrl()

Display a custom icon hosted at an HTTPS URL.

For example:

` "iconUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png"

Supported file types include .png and .jpg`.

string icon_url = 2;

Returns
TypeDescription
String

The iconUrl.

getIconUrlBytes()

public ByteString getIconUrlBytes()

Display a custom icon hosted at an HTTPS URL.

For example:

` "iconUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png"

Supported file types include .png and .jpg`.

string icon_url = 2;

Returns
TypeDescription
ByteString

The bytes for iconUrl.

getIconsCase()

public Icon.IconsCase getIconsCase()
Returns
TypeDescription
Icon.IconsCase

getImageType()

public Widget.ImageType getImageType()

The crop style applied to the image. In some cases, applying a CIRCLE crop causes the image to be drawn larger than a built-in icon.

.google.apps.card.v1.Widget.ImageType image_type = 4;

Returns
TypeDescription
Widget.ImageType

The imageType.

getImageTypeValue()

public int getImageTypeValue()

The crop style applied to the image. In some cases, applying a CIRCLE crop causes the image to be drawn larger than a built-in icon.

.google.apps.card.v1.Widget.ImageType image_type = 4;

Returns
TypeDescription
int

The enum numeric value on the wire for imageType.

getKnownIcon()

public String getKnownIcon()

Display one of the built-in icons provided by Google Workspace.

For example, to display an airplane icon, specify AIRPLANE. For a bus, specify BUS.

For a full list of supported icons, see built-in icons.

string known_icon = 1;

Returns
TypeDescription
String

The knownIcon.

getKnownIconBytes()

public ByteString getKnownIconBytes()

Display one of the built-in icons provided by Google Workspace.

For example, to display an airplane icon, specify AIRPLANE. For a bus, specify BUS.

For a full list of supported icons, see built-in icons.

string known_icon = 1;

Returns
TypeDescription
ByteString

The bytes for knownIcon.

hasIconUrl()

public boolean hasIconUrl()

Display a custom icon hosted at an HTTPS URL.

For example:

` "iconUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png"

Supported file types include .png and .jpg`.

string icon_url = 2;

Returns
TypeDescription
boolean

Whether the iconUrl field is set.

hasKnownIcon()

public boolean hasKnownIcon()

Display one of the built-in icons provided by Google Workspace.

For example, to display an airplane icon, specify AIRPLANE. For a bus, specify BUS.

For a full list of supported icons, see built-in icons.

string known_icon = 1;

Returns
TypeDescription
boolean

Whether the knownIcon field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Icon other)

public Icon.Builder mergeFrom(Icon other)
Parameter
NameDescription
otherIcon
Returns
TypeDescription
Icon.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Icon.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Icon.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Icon.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Icon.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Icon.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Icon.Builder
Overrides

setAltText(String value)

public Icon.Builder setAltText(String value)

Optional. A description of the icon used for accessibility. If unspecified, the default value Button is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, A user's account portrait, or Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat.

If the icon is set in a Button, the altText appears as helper text when the user hovers over the button. However, if the button also sets text, the icon's altText is ignored.

string alt_text = 3;

Parameter
NameDescription
valueString

The altText to set.

Returns
TypeDescription
Icon.Builder

This builder for chaining.

setAltTextBytes(ByteString value)

public Icon.Builder setAltTextBytes(ByteString value)

Optional. A description of the icon used for accessibility. If unspecified, the default value Button is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, A user's account portrait, or Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat.

If the icon is set in a Button, the altText appears as helper text when the user hovers over the button. However, if the button also sets text, the icon's altText is ignored.

string alt_text = 3;

Parameter
NameDescription
valueByteString

The bytes for altText to set.

Returns
TypeDescription
Icon.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Icon.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Icon.Builder
Overrides

setIconUrl(String value)

public Icon.Builder setIconUrl(String value)

Display a custom icon hosted at an HTTPS URL.

For example:

` "iconUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png"

Supported file types include .png and .jpg`.

string icon_url = 2;

Parameter
NameDescription
valueString

The iconUrl to set.

Returns
TypeDescription
Icon.Builder

This builder for chaining.

setIconUrlBytes(ByteString value)

public Icon.Builder setIconUrlBytes(ByteString value)

Display a custom icon hosted at an HTTPS URL.

For example:

` "iconUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png"

Supported file types include .png and .jpg`.

string icon_url = 2;

Parameter
NameDescription
valueByteString

The bytes for iconUrl to set.

Returns
TypeDescription
Icon.Builder

This builder for chaining.

setImageType(Widget.ImageType value)

public Icon.Builder setImageType(Widget.ImageType value)

The crop style applied to the image. In some cases, applying a CIRCLE crop causes the image to be drawn larger than a built-in icon.

.google.apps.card.v1.Widget.ImageType image_type = 4;

Parameter
NameDescription
valueWidget.ImageType

The imageType to set.

Returns
TypeDescription
Icon.Builder

This builder for chaining.

setImageTypeValue(int value)

public Icon.Builder setImageTypeValue(int value)

The crop style applied to the image. In some cases, applying a CIRCLE crop causes the image to be drawn larger than a built-in icon.

.google.apps.card.v1.Widget.ImageType image_type = 4;

Parameter
NameDescription
valueint

The enum numeric value on the wire for imageType to set.

Returns
TypeDescription
Icon.Builder

This builder for chaining.

setKnownIcon(String value)

public Icon.Builder setKnownIcon(String value)

Display one of the built-in icons provided by Google Workspace.

For example, to display an airplane icon, specify AIRPLANE. For a bus, specify BUS.

For a full list of supported icons, see built-in icons.

string known_icon = 1;

Parameter
NameDescription
valueString

The knownIcon to set.

Returns
TypeDescription
Icon.Builder

This builder for chaining.

setKnownIconBytes(ByteString value)

public Icon.Builder setKnownIconBytes(ByteString value)

Display one of the built-in icons provided by Google Workspace.

For example, to display an airplane icon, specify AIRPLANE. For a bus, specify BUS.

For a full list of supported icons, see built-in icons.

string known_icon = 1;

Parameter
NameDescription
valueByteString

The bytes for knownIcon to set.

Returns
TypeDescription
Icon.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Icon.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Icon.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Icon.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Icon.Builder
Overrides