Class SuggestedAction
- java.lang.Object
-
- java.util.AbstractMap<java.lang.String,java.lang.Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.rcsbusinessmessaging.v1.model.SuggestedAction
-
- All Implemented Interfaces:
java.lang.Cloneable,java.util.Map<java.lang.String,java.lang.Object>
public final class SuggestedAction extends com.google.api.client.json.GenericJsonWhen tapped, initiates the corresponding native action on the device.This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the RCS Business Messaging API. For a detailed explanation see: https://developers.google.com/api-client-library/java/google-http-java-client/json
- Author:
- Google, Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
-
-
Constructor Summary
Constructors Constructor Description SuggestedAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SuggestedActionclone()CreateCalendarEventActiongetCreateCalendarEventAction()Opens the user's default calendar app and starts the new calendar event flow with the agent- specified event data pre-filled.DialActiongetDialAction()Opens the user's default dialer app with the agent-specified phone number filled in.java.lang.StringgetFallbackUrl()(Optional) Fallback URL to use if a client doesn't support a suggested action.OpenUrlActiongetOpenUrlAction()Opens the user's default web browser app to the given URL.PaymentRequestActiongetPaymentRequestAction()Sends a payment request from the agent to the user.java.lang.StringgetPostbackData()Payload (base64 encoded) that will be sent to the agent in the user event that results when the user taps the suggested actionShareLocationActiongetShareLocationAction()Opens the RCS app's location chooser so the user can pick a location to send to the agent.java.lang.StringgetText()Text that is shown in the suggested action.ViewLocationActiongetViewLocationAction()Opens the user's default map app and selects the agent-specified location or searches around the user's location given an agent-specified query.SuggestedActionset(java.lang.String fieldName, java.lang.Object value)SuggestedActionsetCreateCalendarEventAction(CreateCalendarEventAction createCalendarEventAction)Opens the user's default calendar app and starts the new calendar event flow with the agent- specified event data pre-filled.SuggestedActionsetDialAction(DialAction dialAction)Opens the user's default dialer app with the agent-specified phone number filled in.SuggestedActionsetFallbackUrl(java.lang.String fallbackUrl)(Optional) Fallback URL to use if a client doesn't support a suggested action.SuggestedActionsetOpenUrlAction(OpenUrlAction openUrlAction)Opens the user's default web browser app to the given URL.SuggestedActionsetPaymentRequestAction(PaymentRequestAction paymentRequestAction)Sends a payment request from the agent to the user.SuggestedActionsetPostbackData(java.lang.String postbackData)Payload (base64 encoded) that will be sent to the agent in the user event that results when the user taps the suggested actionSuggestedActionsetShareLocationAction(ShareLocationAction shareLocationAction)Opens the RCS app's location chooser so the user can pick a location to send to the agent.SuggestedActionsetText(java.lang.String text)Text that is shown in the suggested action.SuggestedActionsetViewLocationAction(ViewLocationAction viewLocationAction)Opens the user's default map app and selects the agent-specified location or searches around the user's location given an agent-specified query.-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
-
-
-
-
Method Detail
-
getCreateCalendarEventAction
public CreateCalendarEventAction getCreateCalendarEventAction()
Opens the user's default calendar app and starts the new calendar event flow with the agent- specified event data pre-filled.- Returns:
- value or
nullfor none
-
setCreateCalendarEventAction
public SuggestedAction setCreateCalendarEventAction(CreateCalendarEventAction createCalendarEventAction)
Opens the user's default calendar app and starts the new calendar event flow with the agent- specified event data pre-filled.- Parameters:
createCalendarEventAction- createCalendarEventAction ornullfor none
-
getDialAction
public DialAction getDialAction()
Opens the user's default dialer app with the agent-specified phone number filled in.- Returns:
- value or
nullfor none
-
setDialAction
public SuggestedAction setDialAction(DialAction dialAction)
Opens the user's default dialer app with the agent-specified phone number filled in.- Parameters:
dialAction- dialAction ornullfor none
-
getFallbackUrl
public java.lang.String getFallbackUrl()
(Optional) Fallback URL to use if a client doesn't support a suggested action. Fallback URLs open in new browser windows.- Returns:
- value or
nullfor none
-
setFallbackUrl
public SuggestedAction setFallbackUrl(java.lang.String fallbackUrl)
(Optional) Fallback URL to use if a client doesn't support a suggested action. Fallback URLs open in new browser windows.- Parameters:
fallbackUrl- fallbackUrl ornullfor none
-
getOpenUrlAction
public OpenUrlAction getOpenUrlAction()
Opens the user's default web browser app to the given URL. If the user has an app installed that is registered as the default handler for the URL, then this app will be opened instead, and its icon will be used in the suggested action UI.- Returns:
- value or
nullfor none
-
setOpenUrlAction
public SuggestedAction setOpenUrlAction(OpenUrlAction openUrlAction)
Opens the user's default web browser app to the given URL. If the user has an app installed that is registered as the default handler for the URL, then this app will be opened instead, and its icon will be used in the suggested action UI.- Parameters:
openUrlAction- openUrlAction ornullfor none
-
getPaymentRequestAction
public PaymentRequestAction getPaymentRequestAction()
Sends a payment request from the agent to the user.- Returns:
- value or
nullfor none
-
setPaymentRequestAction
public SuggestedAction setPaymentRequestAction(PaymentRequestAction paymentRequestAction)
Sends a payment request from the agent to the user.- Parameters:
paymentRequestAction- paymentRequestAction ornullfor none
-
getPostbackData
public java.lang.String getPostbackData()
Payload (base64 encoded) that will be sent to the agent in the user event that results when the user taps the suggested action- Returns:
- value or
nullfor none
-
setPostbackData
public SuggestedAction setPostbackData(java.lang.String postbackData)
Payload (base64 encoded) that will be sent to the agent in the user event that results when the user taps the suggested action- Parameters:
postbackData- postbackData ornullfor none
-
getShareLocationAction
public ShareLocationAction getShareLocationAction()
Opens the RCS app's location chooser so the user can pick a location to send to the agent.- Returns:
- value or
nullfor none
-
setShareLocationAction
public SuggestedAction setShareLocationAction(ShareLocationAction shareLocationAction)
Opens the RCS app's location chooser so the user can pick a location to send to the agent.- Parameters:
shareLocationAction- shareLocationAction ornullfor none
-
getText
public java.lang.String getText()
Text that is shown in the suggested action. Maximum 25 characters.- Returns:
- value or
nullfor none
-
setText
public SuggestedAction setText(java.lang.String text)
Text that is shown in the suggested action. Maximum 25 characters.- Parameters:
text- text ornullfor none
-
getViewLocationAction
public ViewLocationAction getViewLocationAction()
Opens the user's default map app and selects the agent-specified location or searches around the user's location given an agent-specified query.- Returns:
- value or
nullfor none
-
setViewLocationAction
public SuggestedAction setViewLocationAction(ViewLocationAction viewLocationAction)
Opens the user's default map app and selects the agent-specified location or searches around the user's location given an agent-specified query.- Parameters:
viewLocationAction- viewLocationAction ornullfor none
-
set
public SuggestedAction set(java.lang.String fieldName, java.lang.Object value)
- Overrides:
setin classcom.google.api.client.json.GenericJson
-
clone
public SuggestedAction clone()
- Overrides:
clonein classcom.google.api.client.json.GenericJson
-
-