Class SuggestionsResponseBuilder
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trình tạophản hồiđề xuất
Trình tạo cho các đối tượng SuggestionsResponse
.
Có sẵn cho các tiện ích bổ sung của Google Workspace và ứng dụng Google Chat.
Tài liệu chi tiết
build()
Tạo và xác thực phản hồi đề xuất hiện tại.
Cầu thủ trả bóng
SuggestionsResponse
– Một SuggestionsResponse đã được xác thực.
Gửi
Error
– nếu phản hồi đề xuất được tạo không hợp lệ.
setSuggestions(suggestions)
Đặt các đề xuất được dùng trong tính năng tự động hoàn thành trong các trường văn bản.
Thông số
Cầu thủ trả bóng
SuggestionsResponseBuilder
– Đối tượng này.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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."]]