Reference documentation and code samples for the Google Apps Chat V1 Client class Icon.
An icon displayed in a widget on a card. For an example in Google Chat apps, see Add an icon .
Supports built-in and custom icons. Google Workspace Add-ons and Chat apps :
Generated from protobuf message google.apps.card.v1.Icon
Namespace
Google \ Apps \ Card \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ known_icon
string
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
.
↳ icon_url
string
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
.
↳ material_icon
Google\Apps\Card\V1\MaterialIcon
Display one of the Google Material Icons
. For example, to display a checkbox icon
, use "material_icon": { "name": "check_box" }
Google Chat apps
:
↳ alt_text
string
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.
↳ image_type
int
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.
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
hasKnownIcon
setKnownIcon
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
.
var
string
$this
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
hasIconUrl
setIconUrl
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
.
var
string
$this
getMaterialIcon
Display one of the Google Material Icons .
For example, to display a checkbox icon , use
"material_icon": {
"name": "check_box"
}
hasMaterialIcon
setMaterialIcon
Display one of the Google Material Icons .
For example, to display a checkbox icon , use
"material_icon": {
"name": "check_box"
}
$this
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
setAltText
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.
var
string
$this
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.
int
setImageType
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.
var
int
$this
getIcons
string