Class SuggestionsResponseBuilder
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เครื่องมือสร้างคำตอบตามคำแนะนำ
ตัวสร้างสำหรับออบเจ็กต์ SuggestionsResponse
พร้อมใช้งานสำหรับส่วนเสริมของ Google Workspace และแอป Google Chat
เอกสารประกอบโดยละเอียด
build()
สร้างคำตอบคำแนะนำปัจจุบันและตรวจสอบ
รีเทิร์น
SuggestionsResponse
— SuggestionsResponse ที่ตรวจสอบแล้ว
โยน
Error
— หากคำตอบคำแนะนำที่สร้างขึ้นไม่ถูกต้อง
setSuggestions(suggestions)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eSuggestionsResponseBuilder\u003c/code\u003e helps create suggestion responses for auto-complete in Google Workspace Add-ons and Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to set suggestions and build the response object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method creates the final response and validates it, while \u003ccode\u003esetSuggestions()\u003c/code\u003e adds the desired suggestions.\u003c/p\u003e\n"],["\u003cp\u003eCalling \u003ccode\u003ebuild()\u003c/code\u003e without setting suggestions might result in an error, ensuring the response's validity.\u003c/p\u003e\n"]]],[],null,["# Class SuggestionsResponseBuilder\n\nSuggestionsResponseBuilder\n\nA builder for [SuggestionsResponse](/apps-script/reference/card-service/suggestions-response) objects.\n\nAvailable for Google Workspace add-ons and Google Chat apps. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------------------|---------------------------------------------------------------------------------|------------------------------------------------------------|\n| [build()](#build()) | [SuggestionsResponse](/apps-script/reference/card-service/suggestions-response) | Builds the current suggestions response and validates it. |\n| [setSuggestions(suggestions)](#setSuggestions(Suggestions)) | [SuggestionsResponseBuilder](#) | Sets the suggestions used in auto complete in text fields. |\n\nDetailed documentation\n----------------------\n\n### `build()`\n\nBuilds the current suggestions response and validates it.\n\n#### Return\n\n\n[SuggestionsResponse](/apps-script/reference/card-service/suggestions-response) --- A validated SuggestionsResponse.\n\n#### Throws\n\n\n[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) --- if the constructed suggestions response isn't valid.\n\n*** ** * ** ***\n\n### `set``Suggestions(suggestions)`\n\nSets the suggestions used in auto complete in text fields.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------|----------------------------------------------------------------|----------------------------------------------------------------------------|\n| `suggestions` | [Suggestions](/apps-script/reference/card-service/suggestions) | The [Suggestions](/apps-script/reference/card-service/suggestions) to use. |\n\n#### Return\n\n\n[SuggestionsResponseBuilder](#) --- This object."]]