public class SelectionList implements HelperIntent
Helper intent response to collect user's input with a list.
List
The following code demonstrates how to get the user's selection:
@ForIntent("item selected")
public CompletableFuture itemSelected(ActionRequest request) {
ResponseBuilder responseBuilder = getResponseBuilder();
String selectedItem = request.getArgument("OPTION").getTextValue();
responseBuilder
.add("You selected: " + selectedItem);
return CompletableFuture.completedFuture(responseBuilder.build());
}
Constructor and Description |
---|
SelectionList()
Helper intent response to collect user's input with a list.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
java.util.Map<java.lang.String,java.lang.Object> |
getParameters() |
SelectionList |
setItems(java.util.List<com.google.api.services.actions_fulfillment.v2.model.ListSelectListItem> items) |
SelectionList |
setTitle(java.lang.String title) |
getName, getParameters
public SelectionList()
Helper intent response to collect user's input with a list.
List
The following code demonstrates how to get the user's selection:
@ForIntent("item selected")
public CompletableFuture itemSelected(ActionRequest request) {
ResponseBuilder responseBuilder = getResponseBuilder();
String selectedItem = request.getArgument("OPTION").getTextValue();
responseBuilder
.add("You selected: " + selectedItem);
return CompletableFuture.completedFuture(responseBuilder.build());
}
public SelectionList setTitle(java.lang.String title)
public SelectionList setItems(java.util.List<com.google.api.services.actions_fulfillment.v2.model.ListSelectListItem> items)
public java.lang.String getName()
public java.util.Map<java.lang.String,java.lang.Object> getParameters()