Search in sources :

Example 1 with DeliveryAddress

use of com.google.actions.api.response.helperintent.DeliveryAddress in project dialogflow-transactions-java by actions-on-google.

the class TransactionsApp method deliveryAddress.

// Asks for a delivery address to associate with the transaction
@ForIntent("Delivery Address")
public ActionResponse deliveryAddress(ActionRequest request) {
    ResourceBundle rb = ResourceBundle.getBundle("resources", request.getLocale());
    // Create options containing reason for asking for delivery address
    DeliveryAddressValueSpecAddressOptions addressOptions = new DeliveryAddressValueSpecAddressOptions().setReason(rb.getString("reason"));
    return getResponseBuilder(request).add("Placeholder for delivery address text").add(new DeliveryAddress().setAddressOptions(addressOptions)).build();
}
Also used : DeliveryAddress(com.google.actions.api.response.helperintent.DeliveryAddress) ResourceBundle(java.util.ResourceBundle) DeliveryAddressValueSpecAddressOptions(com.google.api.services.actions_fulfillment.v2.model.DeliveryAddressValueSpecAddressOptions) ForIntent(com.google.actions.api.ForIntent)

Aggregations

ForIntent (com.google.actions.api.ForIntent)1 DeliveryAddress (com.google.actions.api.response.helperintent.DeliveryAddress)1 DeliveryAddressValueSpecAddressOptions (com.google.api.services.actions_fulfillment.v2.model.DeliveryAddressValueSpecAddressOptions)1 ResourceBundle (java.util.ResourceBundle)1