Generated from protobuf messagegoogle.apps.card.v1.Icon
Namespace
Google \ Apps \ Card \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
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, specifyAIRPLANE. For a bus, specifyBUS. For a full list of supported icons, seebuilt-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.pngand.jpg.
Optional. A description of the icon used for accessibility. If unspecified, the default valueButtonis 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, orOpens 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 aButton, thealtTextappears as helper text when the user hovers over the button. However, if the button also setstext, the icon'saltTextis ignored.
↳ image_type
int
The crop style applied to the image. In some cases, applying aCIRCLEcrop 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, specifyAIRPLANE.
For a bus, specifyBUS.
For a full list of supported icons, seebuilt-in
icons.
Returns
Type
Description
string
hasKnownIcon
setKnownIcon
Display one of the built-in icons provided by Google Workspace.
For example, to display an airplane icon, specifyAIRPLANE.
For a bus, specifyBUS.
For a full list of supported icons, seebuilt-in
icons.
Optional. A description of the icon used for accessibility.
If unspecified, the default valueButtonis 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, orOpens 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 aButton, thealtTextappears as helper text when the user hovers over the button.
However, if the button also setstext, the icon'saltTextis ignored.
Returns
Type
Description
string
setAltText
Optional. A description of the icon used for accessibility.
If unspecified, the default valueButtonis 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, orOpens 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 aButton, thealtTextappears as helper text when the user hovers over the button.
However, if the button also setstext, the icon'saltTextis ignored.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getImageType
The crop style applied to the image. In some cases, applying aCIRCLEcrop causes the image to be drawn larger than a built-in
icon.
Returns
Type
Description
int
setImageType
The crop style applied to the image. In some cases, applying aCIRCLEcrop causes the image to be drawn larger than a built-in
icon.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class Icon (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Card.V1.Icon)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Card.V1.Icon)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Card.V1.Icon)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Card.V1.Icon)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Card.V1.Icon)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Card.V1.Icon)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Card.V1.Icon)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Card.V1.Icon)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Card.V1.Icon)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Card.V1.Icon)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Card.V1.Icon)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Card.V1.Icon) \nReference documentation and code samples for the Google Apps Chat V1 Client class Icon.\n\nAn icon displayed in a widget on a card. For an example in Google Chat apps,\nsee [Add an\nicon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon).\n\nSupports\n[built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons)\nand\n[custom](https://developers.google.com/workspace/chat/format-messages#customicons)\nicons.\n[Google Workspace Add-ons and Chat\napps](https://developers.google.com/workspace/extend):\n\nGenerated from protobuf message `google.apps.card.v1.Icon`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Card \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getKnownIcon\n\nDisplay one of the built-in icons provided by Google Workspace.\n\nFor example, to display an airplane icon, specify `AIRPLANE`.\nFor a bus, specify `BUS`.\nFor a full list of supported icons, see [built-in\nicons](https://developers.google.com/workspace/chat/format-messages#builtinicons).\n\n### hasKnownIcon\n\n### setKnownIcon\n\nDisplay one of the built-in icons provided by Google Workspace.\n\nFor example, to display an airplane icon, specify `AIRPLANE`.\nFor a bus, specify `BUS`.\nFor a full list of supported icons, see [built-in\nicons](https://developers.google.com/workspace/chat/format-messages#builtinicons).\n\n### getIconUrl\n\nDisplay a custom icon hosted at an HTTPS URL.\n\nFor example: \n\n \"iconUrl\":\n \"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png\"\n\nSupported file types include `.png` and `.jpg`.\n\n### hasIconUrl\n\n### setIconUrl\n\nDisplay a custom icon hosted at an HTTPS URL.\n\nFor example: \n\n \"iconUrl\":\n \"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png\"\n\nSupported file types include `.png` and `.jpg`.\n\n### getMaterialIcon\n\nDisplay one of the [Google Material\nIcons](https://fonts.google.com/icons).\n\nFor example, to display a [checkbox\nicon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),\nuse \n\n \"material_icon\": {\n \"name\": \"check_box\"\n }\n\n[Google Chat apps](https://developers.google.com/workspace/chat):\n\n### hasMaterialIcon\n\n### setMaterialIcon\n\nDisplay one of the [Google Material\nIcons](https://fonts.google.com/icons).\n\nFor example, to display a [checkbox\nicon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),\nuse \n\n \"material_icon\": {\n \"name\": \"check_box\"\n }\n\n[Google Chat apps](https://developers.google.com/workspace/chat):\n\n### getAltText\n\nOptional. A description of the icon used for accessibility.\n\nIf unspecified, the default value `Button` is provided. As a best practice,\nyou should set a helpful description for what the icon displays, and if\napplicable, what it does. For example, `A user's account portrait`, or\n`Opens a new browser tab and navigates to the Google Chat developer\ndocumentation at https://developers.google.com/workspace/chat`.\nIf the icon is set in a [`Button`](/php/docs/reference/apps-chat/latest/Card.V1.Button), the\n`altText` appears as helper text when the user hovers over the button.\nHowever, if the button also sets `text`, the icon's `altText` is ignored.\n\n### setAltText\n\nOptional. A description of the icon used for accessibility.\n\nIf unspecified, the default value `Button` is provided. As a best practice,\nyou should set a helpful description for what the icon displays, and if\napplicable, what it does. For example, `A user's account portrait`, or\n`Opens a new browser tab and navigates to the Google Chat developer\ndocumentation at https://developers.google.com/workspace/chat`.\nIf the icon is set in a [`Button`](/php/docs/reference/apps-chat/latest/Card.V1.Button), the\n`altText` appears as helper text when the user hovers over the button.\nHowever, if the button also sets `text`, the icon's `altText` is ignored.\n\n### getImageType\n\nThe crop style applied to the image. In some cases, applying a\n`CIRCLE` crop causes the image to be drawn larger than a built-in\nicon.\n\n### setImageType\n\nThe crop style applied to the image. In some cases, applying a\n`CIRCLE` crop causes the image to be drawn larger than a built-in\nicon.\n\n### getIcons"]]