forked from timheuer/alexa-skills-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- built-in intents (helpful for audio player skills) - audio player request types - enqueued token property into the AudioPlayerRequest - ClearQueue directive and enums
- Loading branch information
1 parent
323bde8
commit a8114ab
Showing
7 changed files
with
248 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.Threading.Tasks; | ||
|
||
namespace Alexa.NET.Request.Type | ||
{ | ||
public enum AudioRequestType | ||
{ | ||
[EnumMember(Value = "PlaybackStarted")] | ||
PlaybackStarted, | ||
[EnumMember(Value = "PlaybackFinished")] | ||
PlaybackFinished, | ||
[EnumMember(Value = "PlaybackStopped")] | ||
PlaybackStopped, | ||
[EnumMember(Value = "PlaybackNearlyFinished")] | ||
PlaybackNearlyFinished, | ||
[EnumMember(Value = "PlaybackFailed")] | ||
PlaybackFailed, | ||
[EnumMember(Value = "Unknown")] | ||
Unknown | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace Alexa.NET.Request.Type | ||
{ | ||
/// <summary> | ||
/// Standard Built-In Intents detailed here: | ||
/// https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents | ||
/// </summary> | ||
|
||
public class BuiltInIntent | ||
{ | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Let the user cancel a transaction or task (but remain in the skill) | ||
/// - Let the user completely exit the skill | ||
/// | ||
/// Common Utterances: cancel, never mind, forget it | ||
/// </summary> | ||
public const string Cancel = "AMAZON.CancelIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// Provide help about how to use the skill. | ||
/// | ||
/// Common Utterances: help, help me, can you help me | ||
/// </summary> | ||
public const string Help = "AMAZON.HelpIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Let the user stop an action (but remain in the skill) | ||
/// - Let the user completely exit the skill | ||
/// | ||
/// Common Utterances: stop, off, shut up | ||
/// </summary> | ||
public const string Stop = "AMAZON.StopIntent"; | ||
|
||
public const string Yes = "AMAZON.YesIntent"; | ||
|
||
public const string No = "AMAZON.NoIntent"; | ||
|
||
/// <summary> | ||
/// Audio Intents | ||
/// - These intents are for use with a skill that plays audio | ||
/// </summary> | ||
/// | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Lets user turn on or off an audio loop | ||
/// - can be used without the skill invocation name (ie: "Alexa, loop on") | ||
/// | ||
/// Common Utterances: loop off, loop on | ||
/// </summary> | ||
public const string LoopOff = "AMAZON.LoopOffIntent"; | ||
|
||
public const string LoopOn = "AMAZON.LoopOnIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Lets user turn on or off shuffle mode, usually for audio skills that | ||
/// stream a playlist of tracks | ||
/// - can be used without the skill invocation name (ie: "Alexa, loop on") | ||
/// | ||
/// Common Utterances: loop off, loop on | ||
/// </summary> | ||
public const string ShuffleOn = "AMAZON.ShuffleOnIntent"; | ||
|
||
public const string ShuffleOff = "AMAZON.ShuffleOffIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Let the user navigate to the next item in a list | ||
/// - typically used for skills that stream audio | ||
/// - can be used without the skill invocation name (ie: "Alexa, next") | ||
/// | ||
/// Common Utterances: next, skip, skip forward | ||
/// </summary> | ||
public const string Next = "AMAZON.NextIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Let the user navigate to the previous item in a list | ||
/// - typically used for skills that stream audio | ||
/// - can be used without the skill invocation name (ie: "Alexa, go back") | ||
/// | ||
/// Common Utterances: go back, skip back, back up | ||
/// </summary> | ||
public const string Previous = "AMAZON.PreviousIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Let the user pause the action in progress (such as a game or audio track) | ||
/// - MUST be implemented for skills that stream audio | ||
/// - can be used without the skill invocation name (ie: "Alexa, pause") | ||
/// | ||
/// Common Utterances: pause, pause that | ||
/// </summary> | ||
public const string Pause = "AMAZON.PauseIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Let the user navigate repeat the last action | ||
/// - can be used without the skill invocation name (ie: "Alexa, repeat") | ||
/// | ||
/// Common Utterances: repeat, say that again | ||
/// </summary> | ||
public const string Repeat = "AMAZON.RepeatIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Let the user resume or continue an action | ||
/// - MUST be implemented for skills that stream audio | ||
/// - can be used without the skill invocation name (ie: "Alexa, resume ") | ||
/// | ||
/// Common Utterances: resume, continue, keep going | ||
/// </summary> | ||
public const string Resume = "AMAZON.ResumeIntent"; | ||
|
||
/// <summary> | ||
/// Purpose: | ||
/// - Let the user to restart an action, such as restarting a game, | ||
/// transaction, or audio track. | ||
/// - typically used for skills that stream audio | ||
/// - can be used without the skill invocation name (ie: "Alexa, restart") | ||
/// | ||
/// Common Utterances: start over, restart, start again | ||
/// </summary> | ||
public const string StartOver = "AMAZON.StartOverIntent"; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.Threading.Tasks; | ||
|
||
namespace Alexa.NET.Response.Directive | ||
{ | ||
public enum ClearBehavior | ||
{ | ||
[EnumMember(Value = "CLEAR_ENQUEUED")] | ||
ClearEnqueued, | ||
[EnumMember(Value = "CLEAR_ALL")] | ||
ClearAll, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace Alexa.NET.Response.Directive | ||
{ | ||
public class ClearQueueDirective : IDirective | ||
{ | ||
[JsonProperty("type")] | ||
public string Type => "AudioPlayer.ClearQueue"; | ||
|
||
[JsonProperty("clearBehavior")] | ||
[JsonRequired] | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public PlayBehavior ClearBehavior { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters