alexa

package
v0.0.0-...-3dc9316 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	HelpIntent   = "AMAZON.HelpIntent"
	CancelIntent = "AMAZON.CancelIntent"
	StopIntent   = "AMAZON.StopIntent"
)

Variables

This section is empty.

Functions

func ParseString

func ParseString(text string) string

Types

type Context

type Context struct {
	System struct {
		APIAccessToken string `json:"apiAccessToken"`
		APIEndpoint    string `json:"apiEndpoint"`
		Device         struct {
			DeviceID string `json:"deviceId,omitempty"`
		} `json:"device,omitempty"`
		Application struct {
			ApplicationID string `json:"applicationId,omitempty"`
		} `json:"application,omitempty"`
	} `json:"System,omitempty"`
}

type DeviceLocationResponse

type DeviceLocationResponse struct {
	CountryCode string `json:"countryCode"`
	PostalCode  string `json:"postalCode"`
}

type Directives

type Directives struct {
	Type          string         `json:"type,omitempty"`
	SlotToElicit  string         `json:"slotToElicit,omitempty"`
	UpdatedIntent *UpdatedIntent `json:"UpdatedIntent,omitempty"`
	PlayBehavior  string         `json:"playBehavior,omitempty"`
	AudioItem     struct {
		Stream struct {
			Token                string `json:"token,omitempty"`
			URL                  string `json:"url,omitempty"`
			OffsetInMilliseconds int    `json:"offsetInMilliseconds,omitempty"`
		} `json:"stream,omitempty"`
	} `json:"audioItem,omitempty"`
}

type Image

type Image struct {
	SmallImageURL string `json:"smallImageUrl,omitempty"`
	LargeImageURL string `json:"largeImageUrl,omitempty"`
}

type Intent

type Intent struct {
	Name  string          `json:"name"`
	Slots map[string]Slot `json:"slots"`
}

type Payload

type Payload struct {
	Type        string   `json:"type,omitempty"`
	Title       string   `json:"title,omitempty"`
	Text        string   `json:"text,omitempty"`
	SSML        string   `json:"ssml,omitempty"`
	Content     string   `json:"content,omitempty"`
	Image       Image    `json:"image,omitempty"`
	Permissions []string `json:"permissions,omitempty"`
}

type Reprompt

type Reprompt struct {
	OutputSpeech Payload `json:"outputSpeech,omitempty"`
}

type ReqBody

type ReqBody struct {
	Type        string `json:"type"`
	RequestID   string `json:"requestId"`
	Timestamp   string `json:"timestamp"`
	Locale      string `json:"locale"`
	Intent      Intent `json:"intent,omitempty"`
	Reason      string `json:"reason,omitempty"`
	DialogState string `json:"dialogState,omitempty"`
}

type Request

type Request struct {
	Version string  `json:"version"`
	Session Session `json:"session"`
	Body    ReqBody `json:"request"`
	Context Context `json:"context"`
}

type ResBody

type ResBody struct {
	OutputSpeech     *Payload     `json:"outputSpeech,omitempty"`
	Card             *Payload     `json:"card,omitempty"`
	Reprompt         *Reprompt    `json:"reprompt,omitempty"`
	Directives       []Directives `json:"directives,omitempty"`
	ShouldEndSession bool         `json:"shouldEndSession"`
}

type Resolutions

type Resolutions struct {
	ResolutionPerAuthority []struct {
		Values []struct {
			Value struct {
				Name string `json:"name"`
				Id   string `json:"id"`
			} `json:"value"`
		} `json:"values"`
	} `json:"resolutionsPerAuthority"`
}

type Response

type Response struct {
	Version           string                 `json:"version"`
	SessionAttributes map[string]interface{} `json:"sessionAttributes,omitempty"`
	Body              ResBody                `json:"response"`
}

func NewDefaultErrorResponse

func NewDefaultErrorResponse() Response

func NewLaunchRequestGetPermissionsResponse

func NewLaunchRequestGetPermissionsResponse() Response

func NewPermissionsRequestResponse

func NewPermissionsRequestResponse() Response

func NewSSMLResponse

func NewSSMLResponse(title string, text string) Response

func NewSimpleResponse

func NewSimpleResponse(title string, text string) Response

func NewUnsupportedLocationResponse

func NewUnsupportedLocationResponse() Response

type SSML

type SSML struct {
	// contains filtered or unexported fields
}

type SSMLBuilder

type SSMLBuilder struct {
	SSML []SSML
}

func (*SSMLBuilder) Build

func (builder *SSMLBuilder) Build() string

func (*SSMLBuilder) Pause

func (builder *SSMLBuilder) Pause(pause string)

func (*SSMLBuilder) Say

func (builder *SSMLBuilder) Say(text string)

type Session

type Session struct {
	New         bool   `json:"new"`
	SessionID   string `json:"sessionId"`
	Application struct {
		ApplicationID string `json:"applicationId"`
	} `json:"application"`
	Attributes map[string]interface{} `json:"attributes"`
	User       struct {
		UserID      string `json:"userId"`
		AccessToken string `json:"accessToken,omitempty"`
	} `json:"user"`
}

type Slot

type Slot struct {
	Name        string      `json:"name"`
	Value       string      `json:"value"`
	Resolutions Resolutions `json:"resolutions"`
}

type UpdatedIntent

type UpdatedIntent struct {
	Name               string                 `json:"name,omitempty"`
	ConfirmationStatus string                 `json:"confirmationStatus,omitempty"`
	Slots              map[string]interface{} `json:"slots,omitempty"`
}

Jump to

Keyboard shortcuts

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