Skip to content

Commit

Permalink
Add SettingsUpdated event for Settings Interface
Browse files Browse the repository at this point in the history
  • Loading branch information
brentnd authored and Brent Dimmig committed Feb 17, 2017
1 parent f8a7820 commit 4d63b1f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,39 @@ func NewSpeechStarted(messageId, token string) *SpeechStarted {
return m
}

/********** Settings **********/

// The SettingsUpdated event.
type Setting struct {
Key string `json:"key"`
Value string `json:"value"`
}

type SettingsUpdated struct {
*Message
Payload struct {
Settings []Setting `json:"settings"`
} `json:"payload"`
}

type SettingLocale string
// Possible values for SettingLocale.
const (
SettingLocaleUS = SettingLocale("en-US")
SettingLocaleGB = SettingLocale("en-GB")
SettingLocaleDE = SettingLocale("de-DE")
)

func NewLocaleSettingsUpdated(messageId string, locale SettingLocale) *SettingsUpdated {
m := new(SettingsUpdated)
m.Message = newEvent("Settings", "SettingsUpdated", messageId, "")
m.Payload.Settings = append(m.Payload.Settings, Setting{
Key: "locale",
Value: string(locale),
})
return m
}

/********** System **********/

// The ExceptionEncountered event.
Expand Down

0 comments on commit 4d63b1f

Please sign in to comment.