ValidOutcomes.cs
1 using System;
2 using System.Collections.Generic;
4 
5 namespace Microsoft.Bot.Builder.Calling.ObjectModel.Contracts
6 {
10  public static class ValidOutcomes
11  {
15  public const string AnswerOutcome = "answerOutcome";
16 
20  public const string AnswerAppHostedMediaOutcome = "answerAppHostedMediaOutcome";
21 
25  public const string HangupOutcome = "hangupOutcome";
26 
30  public const string RejectOutcome = "rejectOutcome";
31 
35  public const string PlayPromptOutcome = "playPromptOutcome";
36 
40  public const string PlaceCallOutcome = "placeCallOutcome";
41 
45  public const string RecordOutcome = "recordOutcome";
46 
50  public const string RecognizeOutcome = "recognizeOutcome";
51 
55  public const string WorkflowValidationOutcome = "worfklowValidationOutcome";
56 
60  public const string VideoSubscriptionOutcome = "videoSubscriptionOutcome";
61 
65  public const string TransferOutcome = "transferOutcome";
66 
70  private static HashSet<string> validOutcomes = new HashSet<string>()
71  {
72  AnswerOutcome,
73  AnswerAppHostedMediaOutcome,
74  HangupOutcome,
75  RejectOutcome,
76  PlaceCallOutcome,
77  PlayPromptOutcome,
78  RecordOutcome,
79  RecognizeOutcome,
80  WorkflowValidationOutcome,
81  VideoSubscriptionOutcome,
82  TransferOutcome,
83  };
84 
85  public static void Validate(string outcome)
86  {
87  Utils.AssertArgument(!String.IsNullOrWhiteSpace(outcome), "Outcome cannot be null or empty");
88  Utils.AssertArgument(validOutcomes.Contains(outcome), "{0} is not a valid outcome type", outcome);
89  }
90 
91  public static void Validate(OperationOutcomeBase operationOutcome)
92  {
93  Utils.AssertArgument(operationOutcome != null, "operationOutcome cannot be null");
94  operationOutcome.Validate();
95  }
96  }
97 }
This is the outcome of the "recognize" action. This is conveyed to the customer as POST to the custom...
If the customer&#39;s "response" fails validation, this is the outcome conveyed to the customer as POST t...
This is the outcome of the "playPrompt" action. This is conveyed to the customer as POST to the custo...
Root namespace for the Microsoft Bot Builder Calling SDK object model.
static void AssertArgument(bool condition, string format, params object[] args)
Argument checker
Definition: Utils.cs:17
This is a helper class for validating outcomes. This can be used by customers or by us (before we sen...
This is the outcome of the "record" action. This is conveyed to the customer as POST to the customer ...
This is the outcome of the "reject" action. This is conveyed to the customer as POST to the customer ...
Definition: RejectOutcome.cs:9
Root namespace for the Microsoft Bot Builder Calling SDK.
This is the outcome of the "answer" action. This is conveyed to the customer as POST to the customer ...
Definition: AnswerOutcome.cs:9
This is the outcome of the "hangup" action. This is conveyed to the customer as POST to the customer ...
Definition: HangupOutcome.cs:9
static void Validate(OperationOutcomeBase operationOutcome)
Namespace for utilities and helpers in the Microsoft Bot Builder Calling SDK.
Root namespace for the Microsoft Bot Builder SDK.