這個物件會定義所附加小工具的驗證規則。
適用於 Google Chat 擴充應用程式和 Google Workspace 外掛程式。
const validation = CardService.newValidation().setCharacterLimit('10').setInputType( CardService.InputType.TEXT);
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
set | Validation | 設定小工具的字元限制。 |
set | Validation | 設定小工具的輸入類型。 |
內容詳盡的說明文件
setCharacterLimit(characterLimit)
設定小工具的字元限制。
適用於 Google Chat 擴充應用程式和 Google Workspace 外掛程式。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
character | Integer | 設定的字元限制。請注意,這項限制只會對 Text 生效,其他小工具則會忽略這項限制。 |
回攻員
Validation - 這個物件,用於鏈結。
setInputType(inputType)
設定小工具的輸入類型。
適用於 Google Chat 擴充應用程式和 Google Workspace 外掛程式。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
input | Input | 要設定的 Input。 |
回攻員
Validation - 這個物件,用於鏈結。