Microsoft.Bot.Builder.Calling/Models/Contracts/Conversation.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
5 using Newtonsoft.Json;
6 using Newtonsoft.Json.Linq;
7 
8 namespace Microsoft.Bot.Builder.Calling.ObjectModel.Contracts
9 {
17  [JsonObject(MemberSerialization.OptOut)]
19  {
23  [JsonProperty(Required = Required.Always)]
24  public IEnumerable<Participant> Participants { get; set; }
25 
29  [JsonProperty(Required = Required.Default)]
30  public bool IsMultiparty { get; set; }
31 
35  [JsonProperty(Required = Required.Default)]
36  public string ThreadId { get; set; }
37 
41  [JsonProperty(Required = Required.Always)]
42  public IEnumerable<ModalityType> PresentedModalityTypes { get; set; }
43 
47  [JsonProperty(Required = Required.Always)]
48  public CallState CallState { get; set; }
49 
53  [JsonProperty(Required = Required.Default)]
54  public string Subject { get; set; }
55 
56  [JsonExtensionData]
57  private IDictionary<string, JToken> _additionalData;
58 
59  [JsonIgnore]
60  public IDictionary<string, JToken> AdditionalData
61  {
62  get
63  {
64  if (_additionalData == null)
65  {
66  _additionalData = new Dictionary<string, JToken>();
67  }
68 
69  return _additionalData;
70  }
71  set
72  {
73  _additionalData = value;
74  }
75  }
76 
77  public override void Validate()
78  {
79  base.Validate();
80  Participant.Validate(this.Participants);
81  if (IsMultiparty)
82  {
83  Utils.AssertArgument(!String.IsNullOrWhiteSpace(ThreadId), "ThreadId has to be specified for a multiparty call.");
84  }
85  Utils.AssertArgument(this.PresentedModalityTypes != null && this.PresentedModalityTypes.Any(), "Call must be presented with atleast one modality");
86  }
87  }
88 }
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
This defines the set of the properties that define a conversation. A conversation includes participan...
CallState
The various possible states of a AudioVideoCall.
Definition: CallState.cs:8
Root namespace for the Microsoft Bot Builder Calling SDK.
This base class defines a subset of properties which define a conversation. Conversation class derive...
Namespace for utilities and helpers in the Microsoft Bot Builder Calling SDK.
Root namespace for the Microsoft Bot Builder SDK.