Participant.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
5 using Newtonsoft.Json;
6 
7 namespace Microsoft.Bot.Builder.Calling.ObjectModel.Contracts
8 {
13  [JsonObject(MemberSerialization.OptOut)]
14  public class Participant
15  {
19  [JsonProperty(Required = Required.Always, Order = -2)]
20  public string Identity { get; set; }
21 
25  [JsonProperty(Required = Required.Default)]
26  public string DisplayName { get; set; }
27 
33  [JsonProperty(Required = Required.Default)]
34  public string LanguageId { get; set; }
35 
39  [JsonProperty(Required = Required.Always)]
40  public bool Originator { get; set; }
41 
42  public void Validate()
43  {
44  Utils.AssertArgument(!String.IsNullOrWhiteSpace(this.Identity), "Identity of participant must be specified");
45  }
46 
47  public static void Validate(IEnumerable<Participant> participants)
48  {
49  Utils.AssertArgument(participants != null, "participant list cannot be null");
50  Utils.AssertArgument(participants.Any(), "participant list cannot be empty");
51  foreach (Participant participant in participants)
52  {
53  Utils.AssertArgument(participant != null, "participant cannot be null");
54  participant.Validate();
55  }
56  }
57  }
58 }
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 class describes a participant. This can be a participant in any modality in a 2 or multi-party c...
Definition: Participant.cs:14
static void Validate(IEnumerable< Participant > participants)
Definition: Participant.cs:47
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.