-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrequest.go
106 lines (94 loc) · 3.03 KB
/
request.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package alexa
const (
LocaleGerman = "de-DE"
LocaleEnAustralia = "en-AU"
LocaleEnCanada = "en-CA"
LocaleEnUK = "en-GB"
LocaleEnIndia = "en-IN"
LocaleEnUS = "en-US"
LocaleFrench = "fr-FR"
LocaleJapanese = "ja-JP"
)
type Request struct {
Version string `json:"version"`
Session Session `json:"session"`
Context Context `json:"context"`
RequestBody RequestBody `json:"request"`
}
type Session struct {
New bool `json:"new"`
SessionId string `json:"sessionId"`
Attributes map[string]interface{} `json:"attributes"`
Application struct {
ApplicationId string `json:"applicationId"`
} `json:"application"`
User struct {
UserId string `json:"userId"`
AccessToken string `json:"accessToken,omitempty"`
Permissions struct {
ConsentToken string `json:"consentToken,omitempty"`
} `json:"permissions,omitempty"`
} `json:"user"`
}
type Context struct {
System System `json:"system"`
AudioPlayer AudioPlayer `json:"audioPlayer"`
}
type System struct {
ApiAccessToken string `json:"apiAccessToken"`
ApiEndpoint string `json:"apiEndpoint"`
Application struct {
ApplicationId string `json:"applicationId"`
} `json:"application"`
Device struct {
DeviceId string `json:"deviceId"`
SupportedInterfaces SupportedInterfaces `json:"supportedInterfaces,omitempty"`
} `json:"device"`
User struct {
UserId string `json:"userId"`
AccessToken string `json:"accessToken,omitempty"`
Permissions struct {
ConsentToken string `json:"consentToken,omitempty"`
} `json:"permissions,omitempty"`
} `json:"user"`
}
type SupportedInterfaces struct {
Display Display `json:"display,omitempty"`
AudioPlayer AudioPlayer `json:"audioPlayer,omitempty"`
VideoApp VideoApp `json:"videoApp,omitempty"`
}
type Display struct {
TemplateVersion string `json:"templateVersion,omitempty"`
MarkupVersion string `json:"markupVersion,omitempty"`
}
type VideoApp struct {
}
type AudioPlayer struct {
Token string `json:"token"`
OffsetInMilliseconds int64 `json:"offsetInMilliseconds"`
PlayerActivity string `json:"playerActivity"`
}
type RequestBody struct {
Type string `json:"type"`
Timestamp string `json:"timestamp"`
RequestId string `json:"requestId"`
Locale string `json:"locale"`
DialogState string `json:"dialogState,omitempty"`
Intent Intent `json:"intent,omitempty"`
Reason string `json:"reason,omitempty"`
Error struct {
Type string `json:"type"`
Message string `json:"message"`
} `json:"error,omitempty"`
}
type Intent struct {
Name string `json:"name"`
ConfirmationStatus string `json:"confirmationStatus"`
Slots map[string]Slot `json:"slots"`
}
type Slot struct {
Name string `json:"name"`
Value string `json:"value"`
ConfirmationStatus string `json:"confirmationStatus"`
Resolutions interface{} `json:"resolutions,omitempty"`
}