actions_on_google

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2019 License: MIT Imports: 2 Imported by: 0

README

actions on google (dialogflow third party)

참고

-  https://developers.google.com/actions/reference/rest/Shared.Types/AppResponse
- https://developers.google.com/actions/build/json/dialogflow-webhook-json
- https://developers.google.com/actions/assistant/responses
- https://developers.google.com/actions/assistant/helpers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string
const (
	AT_UNKNOWN          ActionType = "UNKNOWN"
	AT_VIEW_DETAILS     ActionType = "VIEW_DETAILS"
	AT_MODIFY           ActionType = "MODIFY"
	AT_CANCEL           ActionType = "CANCEL"
	AT_RETURN           ActionType = "RETURN"
	AT_EXCHANGE         ActionType = "EXCHANGE"
	AT_EMAIL            ActionType = "EMAIL"
	AT_CALL             ActionType = "CALL"
	AT_REORDER          ActionType = "REORDER"
	AT_REVIEW           ActionType = "REVIEW"
	AT_CUSTOMER_SERVICE ActionType = "CUSTOMER_SERVICE"
	AT_FIX_ISSUE        ActionType = "FIX_ISSUE"
)

type AddressOptions

type AddressOptions struct {
	Reason string `json:"reason,omitempty"`
}

type AndroidApp

type AndroidApp struct {
	PackageName string           `json:"packageName,omitempty"`
	Versions    []*VersionFilter `json:"versions,omitempty"`
}

type Argument

type Argument struct {
}

type BasicCard

type BasicCard struct {
	Title               string              `json:"title,omitempty"`
	Subtitle            string              `json:"subtitle,omitempty"`
	FormattedText       string              `json:"formattedText,omitempty"`
	Image               *Image              `json:"image,omitempty"`
	Buttons             []*Button           `json:"buttons,omitempty"`
	ImageDisplayOptions ImageDisplayOptions `json:"imageDisplayOptions,omitempty"`
}

type Button

type Button struct {
	Title         string         `json:"title,omitempty"`
	OpenUrlAction *OpenUrlAction `json:"openUrlAction,omitempty"`
}

type CarouselBrowse

type CarouselBrowse struct {
	Items               []*CarouselBrowseItem `json:"items,omitempty"`
	ImageDisplayOptions ImageDisplayOptions   `json:"imageDisplayOptions,omitempty"`
}

type CarouselBrowseItem

type CarouselBrowseItem struct {
	Title         string         `json:"title,omitempty"`
	Description   string         `json:"description,omitempty"`
	Footer        string         `json:"footer,omitempty"`
	Image         *Image         `json:"image,omitempty"`
	OpenUrlAction *OpenUrlAction `json:"openUrlAction,omitempty"`
}

type CarouselItem

type CarouselItem struct {
	OptionInfo  *OptionInfo `json:"optionInfo,omitempty"`
	Title       string      `json:"title,omitempty"`
	Description string      `json:"description,omitempty"`
	Image       *Image      `json:"image,omitempty"`
}

type CarouselSelect

type CarouselSelect struct {
	Items               []*CarouselItem     `json:"items,omitempty"`
	ImageDisplayOptions ImageDisplayOptions `json:"imageDisplayOptions,omitempty"`
}

type Cell

type Cell struct {
	Text string `json:"text,omitempty"`
}

type ColumnProperty

type ColumnProperty struct {
	Header              string              `json:"header,omitempty"`
	HorizontalAlignment HorizontalAlignment `json:"horizontalAlignment,omitempty"`
}

type ConfirmationData

type ConfirmationData struct {
	DialogSpec *ConfirmationDialogSpec `json:"dialogSpec,omitempty"`
}

type ConfirmationDialogSpec

type ConfirmationDialogSpec struct {
	RequestConfirmationText string `json:"requestConfirmationText,omitempty"`
}

type Context

type Context struct {
	Name          string
	LifespanCount int
	Params        map[string]interface{}
}

func GetContextsFromRequest

func GetContextsFromRequest(req *dialogflowpb.WebhookRequest) ([]*Context, error)

func (*Context) IsEmpty

func (u *Context) IsEmpty() bool

type DateTimeData

type DateTimeData struct {
	DialogSpec *DateTimeDialogSpec `json:"dialogSpec,omitempty"`
}

type DateTimeDialogSpec

type DateTimeDialogSpec struct {
	RequestDatetimeText string `json:"requestDatetimeText,omitempty"`
	RequestDateText     string `json:"requestDateText,omitempty"`
	RequestTimeText     string `json:"requestTimeText,omitempty"`
}

type DeliveryAddressData

type DeliveryAddressData struct {
	AddressOptions *AddressOptions `json:"addressOptions,omitempty"`
}

type HorizontalAlignment

type HorizontalAlignment string
const (
	HA_LEADING  HorizontalAlignment = "LEADING"
	HA_CENTER   HorizontalAlignment = "CENTER"
	HA_TRAILING HorizontalAlignment = "TRAILING"
)

type Image

type Image struct {
	Url               string `json:"url,omitempty"`
	AccessibilityText string `json:"accessibilityText,omitempty"`
	Height            int    `json:"height,omitempty"`
	Width             int    `json:"width,omitempty"`
}

type ImageDisplayOptions

type ImageDisplayOptions string
const (
	IDO_DEFAULT ImageDisplayOptions = "DEFAULT"
	IDO_WHITE   ImageDisplayOptions = "WHITE"
	IDO_CROPPED ImageDisplayOptions = "CROPPED"
)

type IntentValueType

type IntentValueType string
const (
	IVT_CONFIRMATION     IntentValueType = "type.googleapis.com/google.actions.v2.ConfirmationValueSpec"
	IVT_DATETIME         IntentValueType = "type.googleapis.com/google.actions.v2.DateTimeValueSpec"
	IVT_DELIVERY_ADDRESS IntentValueType = "type.googleapis.com/google.actions.v2.DeliveryAddressValueSpec"
	IVT_LINK             IntentValueType = "type.googleapis.com/google.actions.v2.LinkValueSpec"
	IVT_OPTION           IntentValueType = "type.googleapis.com/google.actions.v2.OptionValueSpec"
	IVT_PERMISSION       IntentValueType = "type.googleapis.com/google.actions.v2.PermissionValueSpec"
	IVT_SIGN_IN          IntentValueType = "type.googleapis.com/google.actions.v2.SignInValueSpec"
)

func (IntentValueType) Context

func (ivt IntentValueType) Context() string

func (IntentValueType) Event

func (ivt IntentValueType) Event() string

func (IntentValueType) Intent

func (ivt IntentValueType) Intent() string

type Item

type Item struct {
	SimpleResponse     *SimpleResponse     `json:"simpleResponse,omitempty"`
	BasicCard          *BasicCard          `json:"basicCard,omitempty"`
	StructuredResponse *StructuredResponse `json:"structuredResponse,omitempty"`
	MediaResponse      *MediaResponse      `json:"mediaResponse,omitempty"`
	CarouselBrowse     *CarouselBrowse     `json:"carouselBrowse,omitempty"`
	TableCard          *TableCard          `json:"tableCard,omitempty"`
}

type LinkData

type LinkData struct {
	LinkValueSpec
}

type LinkOutSuggestion

type LinkOutSuggestion struct {
	DestinationName string         `json:"destinationName,omitempty"`
	OpenUrlAction   *OpenUrlAction `json:"openUrlAction,omitempty"`
}

type LinkValueSpec

type LinkValueSpec struct {
}

type ListItem

type ListItem struct {
	OptionInfo  *OptionInfo `json:"optionInfo,omitempty"`
	Title       string      `json:"title,omitempty"`
	Description string      `json:"description,omitempty"`
	Image       *Image      `json:"image,omitempty"`
}

type ListSelect

type ListSelect struct {
	Title string      `json:"title,omitempty"`
	Items []*ListItem `json:"items,omitempty"`
}

type MediaObject

type MediaObject struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	ContentUrl  string `json:"contentUrl,omitempty"`
	LargeImage  *Image `json:"largeImage,omitempty"`
	Icon        *Image `json:"icon,omitempty"`
}

type MediaResponse

type MediaResponse struct {
	MediaType    MediaType      `json:"mediaType,omitempty"`
	MediaObjects []*MediaObject `json:"mediaObjects,omitempty"`
}

type MediaType

type MediaType string
const (
	MT_MEDIA_TYPE_UNSPECIFIED MediaType = "MEDIA_TYPE_UNSPECIFIED"
	MT_AUDIO                  MediaType = "AUDIO"
)

type OpenUrlAction

type OpenUrlAction struct {
	Url         string      `json:"url,omitempty"`
	AndroidApp  *AndroidApp `json:"androidApp,omitempty"`
	UrlTypeHint UrlTypeHint `json:"urlTypeHint,omitempty"`
}

type OptionData

type OptionData struct {
	SimpleSelect   *SimpleSelect   `json:"simpleSelect,omitempty"`
	ListSelect     *ListSelect     `json:"listSelect,omitempty"`
	CarouselSelect *CarouselSelect `json:"carouselSelect,omitempty"`
}

type OptionInfo

type OptionInfo struct {
	Key      string   `json:"key,omitempty"`
	Synonyms []string `json:"synonyms,omitempty"`
}

type Permission

type Permission string
const (
	PM_UNSPECIFIED_PERMISSION  Permission = "UNSPECIFIED_PERMISSION"
	PM_NAME                    Permission = "NAME"
	PM_DEVICE_PRECISE_LOCATION Permission = "DEVICE_PRECISE_LOCATION"
	PM_DEVICE_COARSE_LOCATION  Permission = "DEVICE_COARSE_LOCATION"
	PM_UPDATE                  Permission = "UPDATE"
)

type PermissionData

type PermissionData struct {
	PermissionValueSpec
}

type PermissionValueSpec

type PermissionValueSpec struct {
	OptContext                string                     `json:"optContext,omitempty"`
	Permissions               []Permission               `json:"permissions,omitempty"`
	UpdatePermissionValueSpec *UpdatePermissionValueSpec `json:"updatePermissionValueSpec,omitempty"`
}

type PriceType

type PriceType string
const (
	PT_UNKNOWN  PriceType = "UNKNOWN"
	PT_ESTIMATE PriceType = "ESTIMATE"
	PT_ACTUAL   PriceType = "ACTUAL"
)

type RichResponse

type RichResponse struct {
	Items             []*Item            `json:"items,omitempty"`
	Suggestions       []*Suggestion      `json:"suggestions,omitempty"`
	LinkOutSuggestion *LinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
}

type Row

type Row struct {
	Cells        []*Cell `json:"cells,omitempty"`
	DividerAfter bool    `json:"dividerAfter"`
}

type SignInData

type SignInData struct {
	SignInValueSpec
}

type SignInValueSpec

type SignInValueSpec struct {
	OptContext string `json:"optContext,omitempty"`
}

type SimpleResponse

type SimpleResponse struct {
	TextToSpeech string `json:"textToSpeech,omitempty"`
	Ssml         string `json:"ssml,omitempty"`
	DisplayText  string `json:"displayText,omitempty"`
}

type SimpleSelect

type SimpleSelect struct {
	Items []*SimpleSelectItem `json:"items,omitempty"`
}

type SimpleSelectItem

type SimpleSelectItem struct {
	OptionInfo *OptionInfo `json:"optionInfo,omitempty"`
	Title      string      `json:"title,omitempty"`
}

type StructuredResponse

type StructuredResponse struct {
}

type Suggestion

type Suggestion struct {
	Title string `json:"title,omitempty"`
}

type SystemIntent

type SystemIntent struct {
	Intent string            `json:"intent,omitempty"`
	Data   *SystemIntentData `json:"data,omitempty"`
}

type SystemIntentData

type SystemIntentData struct {
	Type IntentValueType `json:"@type,omitempty"`
	*ConfirmationData
	*DateTimeData
	*DeliveryAddressData
	*OptionData
	*PermissionData
	*SignInData
	*LinkData
}

type TableCard

type TableCard struct {
	Title            string            `json:"title,omitempty"`
	Subtitle         string            `json:"Subtitle,omitempty"`
	Image            *Image            `json:"image,omitempty"`
	ColumnProperties []*ColumnProperty `json:"columnProperties"`
	Rows             []*Row            `json:"rows,omitempty"`
	Buttons          []*Button         `json:"buttons,omitempty"`
}

type UpdatePermissionValueSpec

type UpdatePermissionValueSpec struct {
	Intent    string      `json:"intent,omitempty"`
	Arguments []*Argument `json:"arguments,omitempty"`
}

type UrlTypeHint

type UrlTypeHint string
const (
	UTH_URL_TYPE_HINT_UNSPECIFIED UrlTypeHint = "URL_TYPE_HINT_UNSPECIFIED"
	UTH_AMP_CONTENT               UrlTypeHint = "AMP_CONTENT"
)

type User

type User struct {
	UserId      string
	LastSeen    string
	UserStorage string
	Locale      string
}

func GetUserFromRequest

func GetUserFromRequest(req *dialogflowpb.WebhookRequest) (*User, error)

func (*User) IsEmpty

func (u *User) IsEmpty() bool

type VersionFilter

type VersionFilter struct {
	MinVersion int `json:"minVersion,omitempty"`
	MaxVersion int `json:"maxVersion,omitempty"`
}

type WebhookResponse

type WebhookResponse struct {
	ExpectUserResponse bool          `json:"expectUserResponse"`
	UserStorage        string        `json:"userStorage,omitempty"`
	RichResponse       *RichResponse `json:"richResponse,omitempty"`
	SystemIntent       *SystemIntent `json:"systemIntent,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL