-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
AddParticipantFailed.cs
47 lines (41 loc) · 1.9 KB
/
AddParticipantFailed.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Text.Json;
namespace Azure.Communication.CallAutomation
{
/// <summary>
/// The add participant failed event.
/// </summary>
public class AddParticipantFailed : CallAutomationEventBase
{
/// <summary> Initializes a new instance of AddParticipantsFailedEvent. </summary>
internal AddParticipantFailed()
{
}
/// <summary> Initializes a new instance of AddParticipantFailedEvent. </summary>
/// <param name="internalEvent">Internal Representation of the AddParticipantFailedEvent. </param>
internal AddParticipantFailed(AddParticipantFailedInternal internalEvent)
{
OperationContext = internalEvent.OperationContext;
ResultInformation = internalEvent.ResultInformation;
Participant = CommunicationIdentifierSerializer.Deserialize(internalEvent.Participant);
CallConnectionId = internalEvent.CallConnectionId;
ServerCallId = internalEvent.ServerCallId;
CorrelationId = internalEvent.CorrelationId;
}
/// <summary> Participant failed to be added. </summary>
public CommunicationIdentifier Participant { get; }
/// <summary>
/// Deserialize <see cref="AddParticipantFailed"/> event.
/// </summary>
/// <param name="content">The json content.</param>
/// <returns>The new <see cref="AddParticipantFailed"/> object.</returns>
public static AddParticipantFailed Deserialize(string content)
{
using var document = JsonDocument.Parse(content);
JsonElement element = document.RootElement;
var internalEvent = AddParticipantFailedInternal.DeserializeAddParticipantFailedInternal(element);
return new AddParticipantFailed(internalEvent);
}
}
}