Class 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.GenericJson
    When 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
      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      SuggestedAction()  
    • Constructor Detail

      • SuggestedAction

        public SuggestedAction()
    • 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 null for 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 or null for none
      • getDialAction

        public DialAction getDialAction()
        Opens the user's default dialer app with the agent-specified phone number filled in.
        Returns:
        value or null for 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 or null for 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 null for 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 or null for 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 null for 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 or null for none
      • getPaymentRequestAction

        public PaymentRequestAction getPaymentRequestAction()
        Sends a payment request from the agent to the user.
        Returns:
        value or null for none
      • setPaymentRequestAction

        public SuggestedAction setPaymentRequestAction​(PaymentRequestAction paymentRequestAction)
        Sends a payment request from the agent to the user.
        Parameters:
        paymentRequestAction - paymentRequestAction or null for 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 null for 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 or null for 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 null for 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 or null for none
      • getText

        public java.lang.String getText()
        Text that is shown in the suggested action. Maximum 25 characters.
        Returns:
        value or null for none
      • setText

        public SuggestedAction setText​(java.lang.String text)
        Text that is shown in the suggested action. Maximum 25 characters.
        Parameters:
        text - text or null for 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 null for 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 or null for none
      • set

        public SuggestedAction set​(java.lang.String fieldName,
                                   java.lang.Object value)
        Overrides:
        set in class com.google.api.client.json.GenericJson
      • clone

        public SuggestedAction clone()
        Overrides:
        clone in class com.google.api.client.json.GenericJson