Globals

Properties

ImageDisplays

constant   read-only

string

List of possible options to display the image in a BasicCard. When the aspect ratio of an image is not the same as the surface, this attribute changes how the image is displayed in the card.

Value

DEFAULT

Pads the gaps between the image and image frame with a blurred copy of the same image.

WHITE

Fill the gap between the image and image container with white bars.

CROPPED

Image is scaled such that the image width matches the container width. This may crop the top and bottom of the image if the scaled image height is greater than the container height. This is similar to "Zoom Mode" on a widescreen TV when playing a 4:3 video..

MediaValues

constant   read-only

Object

Values related to supporting media.

reverseOrderStateInfo

constant   read-only

string

Valid keys for the TransactionValues.OrderStateInfo enum.

TransactionValues

constant   read-only

Object

Values related to supporting transactions.

Methods

isPaddedSsml

isPaddedSsml(text) returns boolean

Check if given text contains SSML, allowing for whitespace padding.

Parameter

text

string

Text to check.

Returns

boolean True if text contains possibly whitespace padded SSML, false otherwise.

isSsml

isSsml(text) returns boolean

Check if given text contains SSML.

Parameter

text

string

Text to check.

Returns

boolean True if text contains SSML, false otherwise.

transform

transform(object, keyTransformation) returns Object

Generic deep object transformation utility. Recursively converts all object keys, including those of array elements, with some transformation function. Note that classes will get converted to objects.

Parameter

object

Object

Object to transform.

keyTransformation

function()

Function that applies the desired transformation.

Returns

Object The transformed object.

transformToCamelCase

transformToCamelCase(object) returns Object

Transforms incoming object to new camelCase-keyed object.

Parameter

object

Object

Object to transform.

Returns

Object Incoming object deeply mapped to camelCase keys.

Example

const snakeCaseObject = {
  key_one: {
    key_two: [
      {
        key: 'value'
      },
      'array_item_two'
    ]
  }
};
let camelCaseObject = transformToCamelCase(snakeCaseObject);
// camelCaseObject === {
//   keyOne: {
//     keyTwo: [
//       {
//         key: 'value'
//       },
//       'array_item_two'
//     ]
//   }
// };

transformToSnakeCase

transformToSnakeCase(object) returns Object

Transforms incoming object to new snake_case-keyed object.

Parameter

object

Object

Object to transform.

Returns

Object Incoming object deeply mapped to camelCase keys.

Example

const camelCaseObject = {
  keyOne: {
    keyTwo: [
      {
        key: 'value'
      },
      'arrayItemTwo'
    ]
  }
};
let snakeCaseObject = transformToSnakeCase(camelCaseObject);
// snakeCaseObject === {
//   key_one: {
//     key_two: [
//       {
//         key: 'value'
//       },
//       'arrayItemTwo'
//     ]
//   }
// };

Abstract types

ActionPaymentTransactionConfig

Object

Transaction config for transactions not involving a Google provided payment instrument.

Properties

Parameter

deliveryAddressRequired

boolean

True if delivery address is required for the transaction.

type

boolean

One of Transactions.PaymentType.

displayName

string

The name of the instrument displayed on receipt. For example, for card payment, could be "VISA-1234".

customerInfoOptions

Optional

CustomerInfoOptions

Button

Object

Basic Card Button. Shown below basic cards. Open a URL when selected.

Properties

Parameter

title

string

Text shown on the button.

openUrlAction

Object

Action to take when selected.

CancellationInfo

Object

Order cancellation info.

Property

Parameter

reason

string

Reason for the cancellation.

Capability

Object

Surface capability.

Property

Parameter

name

string

Name of the capability.

Context

Object

Dialogflow Context.

Properties

Parameter

name

string

Full name of the context.

parameters

Object

Parameters carried within this context. See here.

lifespan

number

Remaining number of intents

CustomerInfoOptions

Object

Customer information requested as part of the transaction

Property

Parameter

customerInfoProperties

Array of string

one of Transactions.CustomerInfoProperties

DateTime

Object

User provided date/time info.

Properties

Parameter

date

Object

time

Object

DeviceLocation

Location

User's permissioned device location.

Entitlement

Object

A user's digital entitlement.

Properties

Parameter

sku

string

Product SKU. Matches getSku() in Google Play InApp Billing API.

skuType

string

The type of SKU. One of EntitlementSkuType.

inAppDetails

Object

For in app purchases/subscriptions, relevant details.

FulfillmentInfo

Object

Order fulfillment info.

Property

Parameter

deliveryTime

string

UTC timestamp of the fulfillment update as an RFC 3339 string.

GooglePaymentTransactionConfig

Object

Transaction config for transactions involving a Google provided payment instrument.

Properties

Parameter

deliveryAddressRequired

boolean

True if delivery address is required for the transaction.

tokenizationParameters

Object

Tokenization parameters provided by payment gateway.

cardNetworks

Array of string

List of accepted card networks. Must be any number of Transactions.CardNetwork.

prepaidCardDisallowed

boolean

True if prepaid cards are not allowed for transaction.

tokenizationType

string

The type of tokenization. Default is {@see TransactionValues.PaymentMethodTokenizationType.PAYMENT_GATEWAY}.

customerInfoOptions

Optional

CustomerInfoOptions

Image

Object

Image type shown on visual elements.

Properties

Parameter

url

string

Image source URL.

accessibilityText

string

Text to replace for image for accessibility.

width

number

Width of the image.

height

number

Height of the image.

IntentArgument

Object

Intent Argument. For incoming intents, the argument value can be retrieved using AssistantApp#getArgument.

Properties

Parameter

name

string

Name of the argument.

textValue

string

Text value of the argument.

ItemBasicCard

Object

Property

Parameter

basicCard

BasicCard

ItemSimpleResponse

Object

Property

Parameter

simpleResponse

SimpleResponse

ItemStructuredResponse

Object

Property

Parameter

structuredResponse

StructuredResponse

LinkOutSuggestion

Object

Link Out Suggestion. Used in rich response as a suggestion chip which, when selected, links out to external URL.

Properties

Parameter

title

string

Text shown on the suggestion chip.

url

string

String URL to open.

Location

Object

Location information.

Properties

Parameter

coordinates

LocationCoordinates

{latitude, longitude}. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION.

address

string

Full, formatted street address. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION.

zipCode

string

Zip code. Requested with SupportedPermissions.DEVICE_COARSE_LOCATION.

city

string

Device city. Requested with SupportedPermissions.DEVICE_COARSE_LOCATION.

Location

Object

Generic Location type.

Properties

Parameter

postalAddress

Object

phoneNumber

string

notes

string

LocationCoordinates

Object

Properties

Parameter

latitude

number

longitude

number

OptionInfo

Object

Option info. Provides unique identifier for a given OptionItem.

Properties

Parameter

key

string

Unique string ID for this option.

synonyms

Array of string

Synonyms that can be used by the user to indicate this option if they do not use the key.

OptionItem

Object

Option item. Used in actions.intent.OPTION intent.

Properties

Parameter

optionInfo

OptionInfo

Option item identifier information.

title

string

Name of the item.

description

string

Optional text describing the item.

image

Image

Square image to show for this item.

PackageEntitlement

Object

Google Play Android App Package Entitlements

Properties

Parameter

packageName

string

Name of the Android app package.

entitlements

Array of Entitlement

List of entitlements for a given app.

Place

Location

Place information

Property

Parameter

placeId

string

Used with Places API to fetch details of a place. See https://developers.google.com/places/web-service/place-id

Price

Object

Price type.

Properties

Parameter

type

string

One of Transaction.PriceType.

amount

Object

ReceiptInfo

Object

Order receipt info.

Property

Parameter

confirmedActionOrderId

string

Action provided order ID. Used when the order has been received by the integrator.

RejectionInfo

Object

Order rejection info.

Properties

Parameter

type

string

One of Transaction.ReasonType.

reason

string

Reason for the order rejection.

ReturnInfo

Object

Order return info.

Property

Parameter

reason

string

Reason for the return.

RichResponseItem

(ItemBasicCard, ItemSimpleResponse, or ItemStructuredResponse)

SimpleResponse

Object

Simple Response type.

Properties

Parameter

speech

string

Speech to be spoken to user. SSML allowed.

displayText

string

Optional text to be shown to user

StructuredResponse

Object

Property

Parameter

orderUpdate

OrderUpdate

Suggestion

Object

Suggestions to show with response.

Property

Parameter

title

string

Text of the suggestion.

Surface

Object

Actions on Google Surface.

Property

Parameter

capabilities

Array of Capability

Capabilities of the surface.

TransactionDecision

Object

Decision and order information returned when calling getTransactionDecision().

Properties

Parameter

userDecision

string

One of Transactions.TransactionUserDecision.

checkResult

Object

order

Object

deliveryAddress

DeliveryAddress

The delivery address if user requested. Will appear if userDecision is Transactions.DELIVERY_ADDRESS_UPDATED.

TransitInfo

Object

Order transit info.

Property

Parameter

updatedTime

string

UTC timestamp of the transit update as an RFC 3339 string.

User

Object

User object.

Properties

Parameter

userId

string

Random string ID for Google user.

userName

UserName

User name information. Null if not requested with askForPermission(SupportedPermissions.NAME).

accessToken

string

Unique Oauth2 token. Only available with account linking.

lastSeen

Timestamp

Timestamp for the last access from the user. Retrieve using app.getLastSeen() to get a Date object or null if never seen.

userStorage

string

A string persistent across sessions. Retrieved and set using app.userStorage which allows you to store it like an JSON object which is abstracted for convenience by the client library.

UserName

Object

User's permissioned name info.

Properties

Parameter

displayName

string

User's display name.

givenName

string

User's given name.

familyName

string

User's family name.