-
Notifications
You must be signed in to change notification settings - Fork 0
/
response_body.go
58 lines (51 loc) · 2.13 KB
/
response_body.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package fsmalexa
// ResponseBody Object
// https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#response-format
type ResponseBody struct {
Version string `json:"version,omitempty"`
SessionAttributes map[string]interface{} `json:"sessionAttrributes,omitempty"`
Response *Response `json:"response,omitempty"`
}
// Response Object
// https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#response-parameters
type Response struct {
OutputSpeech *OutputSpeech `json:"outputSpeech"`
Card *Card `json:"card"`
Reprompt *Reprompt `json:"reprompt"`
ShouldEndSession bool `json:"shouldEndSession"`
Directives *[]Directive `json:"directives"`
}
// OutputSpeech Object
// https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#outputspeech-object
type OutputSpeech struct {
Type string `json:"type"`
Text string `json:"text"`
SSML string `json:"ssml"`
}
// Card Object
// https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#card-object
type Card struct {
Type string `json:"type"`
Title string `json:"title"`
Content string `json:"content"`
Text string `json:"text"`
Image CardImage `json:"image"`
}
// CardImage is an object within a Card
// https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#card-object
type CardImage struct {
SmallImageURL string `json:"smallImageUrl"`
LargeImageURL string `json:"largeImageUrl"`
}
// Reprompt Object
// https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#reprompt-object
type Reprompt struct {
OutputSpeech OutputSpeech `json:"outputSpeech"`
}
// Directive is an object nested within the Response Object
// There are many possible directives, follow the links included in the description:
// https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#response-object
type Directive struct {
Type string `json:"type"`
// TODO, implement specific directives
}