OperationOutcomeBase.cs
1 using System;
3 using Newtonsoft.Json;
4 
5 namespace Microsoft.Bot.Builder.Calling.ObjectModel.Contracts
6 {
10  [JsonObject(MemberSerialization.OptOut)]
11  public abstract class OperationOutcomeBase
12  {
17  [JsonProperty(Required = Required.Always, Order = -3)]
18  public string Type { get; set; }
19 
23  [JsonProperty(Required = Required.Always, Order = -2)]
24  public string Id { get; set; }
25 
29  [JsonProperty(Required = Required.Always)]
30  public Outcome Outcome { get; set; }
31 
35  [JsonProperty(Required = Required.Default)]
36  public string FailureReason { get; set; }
37 
38  public virtual void Validate()
39  {
40  Utils.AssertArgument(!String.IsNullOrWhiteSpace(this.Id), "Id cannot be null or empty");
41  ValidOutcomes.Validate(this.Type);
42  }
43  }
44 }
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...
Root namespace for the Microsoft Bot Builder Calling SDK.
Namespace for utilities and helpers in the Microsoft Bot Builder Calling SDK.
Root namespace for the Microsoft Bot Builder SDK.