Icon

資訊卡小工具中顯示的圖示。如需 Google Chat 應用程式範例,請參閱「新增圖示」。

支援內建和自訂圖示。

適用於 Google Chat 擴充應用程式和 Google Workspace 外掛程式。

JSON 表示法
{
  "altText": string,
  "imageType": enum (ImageType),

  "knownIcon": string,
  "iconUrl": string,
  "materialIcon": {
    object (MaterialIcon)
  }
}
欄位
altText

string

(選用步驟) 無障礙功能圖示的說明。如未指定,則會提供預設值 Button。最佳做法是為圖示顯示的內容設定實用說明,並視情況說明其功能。例如 A user's account portrait 或 Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat。

如果圖示是在 Button 中設定,當使用者將滑鼠游標懸停在按鈕上時,altText 會顯示為輔助文字。不過,如果按鈕也設定 text,系統會忽略圖示的 altText。

imageType

enum (ImageType)

套用至圖片的裁剪樣式。在某些情況下,套用 CIRCLE 裁剪會導致圖片繪製得比內建圖示大。

資訊卡小工具中顯示的圖示。以下是互斥欄位清單。回應中最多會設定下列其中一個欄位:
knownIcon

string

顯示 Google Workspace 提供的其中一個內建圖示。

舉例來說,如要顯示飛機圖示,請指定 AIRPLANE。如果是公車,請指定 BUS。

如需完整的支援圖示清單,請參閱內建圖示。

iconUrl

string

顯示託管於 HTTPS 網址的自訂圖示。

例如:

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

支援的檔案類型包括 .png 和 .jpg。

materialIcon

object (MaterialIcon)

顯示其中一個 Google Material Design 圖示。

例如,如要顯示核取方塊圖示,請使用

"materialIcon": {
  "name": "check_box"
}

適用於 Google Chat 擴充應用程式,不適用於 Google Workspace 外掛程式。

互斥欄位結束。