# Interface IconOrBuilder (2.72.0)

2.72.0 (latest) 2.70.0 2.67.0 2.66.0 2.65.1 2.64.1 2.63.2 2.62.0 2.61.3 2.60.0 2.59.2 2.58.0 2.57.0 2.56.0 2.54.1 2.53.0 2.52.0 2.51.0 2.50.1 2.49.0 2.48.0 2.46.0 2.45.1 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.1 2.38.0 2.37.1 2.36.0 2.34.0 2.33.0 2.32.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.1 2.22.1 2.21.1 2.15.0 2.14.3 2.13.0 2.12.0 2.11.0 2.10.0 2.9.6 2.8.4 2.7.4

    public interface IconOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getAltText()

    public abstract 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/workspace/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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The altText. |

### getAltTextBytes()

    public abstract 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/workspace/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** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for altText. |

### getIconUrl()

    public abstract String getIconUrl()

Display a custom icon hosted at an HTTPS URL.

For example:

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

`
`

` Supported file types include `.png` and `.jpg\`.

`string icon_url = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The iconUrl. |

### getIconUrlBytes()

    public abstract ByteString getIconUrlBytes()

Display a custom icon hosted at an HTTPS URL.

For example:

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

`
`

` Supported file types include `.png` and `.jpg\`.

`string icon_url = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for iconUrl. |

### getIconsCase()

    public abstract Icon.IconsCase getIconsCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Icon.IconsCase` |   |

### getImageType()

    public abstract 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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Widget.ImageType` | The imageType. |

### getImageTypeValue()

    public abstract 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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for imageType. |

### getKnownIcon()

    public abstract 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](https://developers.google.com/workspace/chat/format-messages#builtinicons).

`string known_icon = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The knownIcon. |

### getKnownIconBytes()

    public abstract 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](https://developers.google.com/workspace/chat/format-messages#builtinicons).

`string known_icon = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for knownIcon. |

### getMaterialIcon()

    public abstract MaterialIcon getMaterialIcon()

Display one of the [Google Material
Icons](https://fonts.google.com/icons).

For example, to display a [checkbox
icon](https://fonts.google.com/icons?selected=Material+Symbols+Outlined:check_box:FILL@0;wght@400;GRAD@0;opsz@48),
use
`<code><code>
"material_icon": {
"name": "check_box"
}
</code></code>`

[Google Chat apps](https://developers.google.com/workspace/chat):

`.google.apps.card.v1.MaterialIcon material_icon = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.MaterialIcon` | The materialIcon. |

### getMaterialIconOrBuilder()

    public abstract MaterialIconOrBuilder getMaterialIconOrBuilder()

Display one of the [Google Material
Icons](https://fonts.google.com/icons).

For example, to display a [checkbox
icon](https://fonts.google.com/icons?selected=Material+Symbols+Outlined:check_box:FILL@0;wght@400;GRAD@0;opsz@48),
use
`<code><code>
"material_icon": {
"name": "check_box"
}
</code></code>`

[Google Chat apps](https://developers.google.com/workspace/chat):

`.google.apps.card.v1.MaterialIcon material_icon = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.MaterialIconOrBuilder` |   |

### hasIconUrl()

    public abstract boolean hasIconUrl()

Display a custom icon hosted at an HTTPS URL.

For example:

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

`
`

` Supported file types include `.png` and `.jpg\`.

`string icon_url = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the iconUrl field is set. |

### hasKnownIcon()

    public abstract 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](https://developers.google.com/workspace/chat/format-messages#builtinicons).

`string known_icon = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the knownIcon field is set. |

### hasMaterialIcon()

    public abstract boolean hasMaterialIcon()

Display one of the [Google Material
Icons](https://fonts.google.com/icons).

For example, to display a [checkbox
icon](https://fonts.google.com/icons?selected=Material+Symbols+Outlined:check_box:FILL@0;wght@400;GRAD@0;opsz@48),
use
`<code><code>
"material_icon": {
"name": "check_box"
}
</code></code>`

[Google Chat apps](https://developers.google.com/workspace/chat):

`.google.apps.card.v1.MaterialIcon material_icon = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the materialIcon field is set. |