Skip to content

Commit aa4642b

Browse files
authored
revert evendata back to original name (Azure#36055)
* revert evendata back to original name * fix event parse
1 parent add187a commit aa4642b

File tree

94 files changed

+970
-976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+970
-976
lines changed

sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs

Lines changed: 114 additions & 114 deletions
Large diffs are not rendered by default.

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/CallAutomationEventProcessor.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public void ProcessEvents(IEnumerable<CloudEvent> events)
3939
/// <summary>
4040
/// Process incoming events. Pass incoming events to get it processed to have other method like WaitForEventProcessor to function.
4141
/// </summary>
42-
/// <param name="events">Incoming <see cref="CallAutomationEventData"/>.</param>
43-
public void ProcessEvents(IEnumerable<CallAutomationEventData> events)
42+
/// <param name="events">Incoming <see cref="CallAutomationEventBase"/>.</param>
43+
public void ProcessEvents(IEnumerable<CallAutomationEventBase> events)
4444
{
4545
// Note: There will always be only 1 event coming from the service
46-
CallAutomationEventData receivedEvent = events.FirstOrDefault();
46+
CallAutomationEventBase receivedEvent = events.FirstOrDefault();
4747

4848
if (receivedEvent != null)
4949
{
@@ -63,7 +63,7 @@ public void ProcessEvents(IEnumerable<CallAutomationEventData> events)
6363
}
6464

6565
// If this call is disconnect, remove all related items in memory
66-
if (receivedEvent is CallDisconnectedEventData)
66+
if (receivedEvent is CallDisconnected)
6767
{
6868
// remove from eventsbacklog
6969
_eventBacklog.TryRemoveEvent(internalEventId);
@@ -80,7 +80,7 @@ public void ProcessEvents(IEnumerable<CallAutomationEventData> events)
8080
/// <typeparam name="TEvent">Call Automation Event Type.</typeparam>
8181
/// <param name="callConnectionId">CallConnectionId of the call.</param>
8282
/// <param name="eventProcessor">EventProcessor to be fired when the specified event arrives.</param>
83-
public void AttachOngoingEventProcessor<TEvent>(string callConnectionId, Action<TEvent> eventProcessor) where TEvent : CallAutomationEventData
83+
public void AttachOngoingEventProcessor<TEvent>(string callConnectionId, Action<TEvent> eventProcessor) where TEvent : CallAutomationEventBase
8484
{
8585
var ongoingAwaiter = new EventAwaiterOngoing<TEvent>(callConnectionId, eventProcessor);
8686
EventHandler<EventProcessorArgs> handler = (o, arg) => ongoingAwaiter.OnEventReceived(o, arg);
@@ -96,18 +96,18 @@ public void AttachOngoingEventProcessor<TEvent>(string callConnectionId, Action<
9696
/// </summary>
9797
/// <typeparam name="TEvent">Call Automation Event Type.</typeparam>
9898
/// <param name="callConnectionId">CallConnectionId of the call.</param>
99-
public void DetachOngoingEventProcessor<TEvent>(string callConnectionId) where TEvent : CallAutomationEventData
99+
public void DetachOngoingEventProcessor<TEvent>(string callConnectionId) where TEvent : CallAutomationEventBase
100100
{
101101
RemoveFromOngoingEvent(callConnectionId, typeof(TEvent));
102102
}
103103

104104
/// <summary>
105-
/// Wait for matching incoming event. This is blocking Call. Returns the <see cref="CallAutomationEventData"/> once it arrives in ProcessEvent method.
105+
/// Wait for matching incoming event. This is blocking Call. Returns the <see cref="CallAutomationEventBase"/> once it arrives in ProcessEvent method.
106106
/// </summary>
107107
/// <param name="predicate">Predicate for waiting on event.</param>
108108
/// <param name="cancellationToken">Cancellation Token can be used to set timeout or cancel this WaitForEventProcessor.</param>
109-
/// <returns>Returns <see cref="CallAutomationEventData"/> once matching event arrives.</returns>
110-
public CallAutomationEventData WaitForEventProcessor(Func<CallAutomationEventData, bool> predicate, CancellationToken cancellationToken = default)
109+
/// <returns>Returns <see cref="CallAutomationEventBase"/> once matching event arrives.</returns>
110+
public CallAutomationEventBase WaitForEventProcessor(Func<CallAutomationEventBase, bool> predicate, CancellationToken cancellationToken = default)
111111
{
112112
// Initialize awaiter and get event handler of it
113113
var awaiter = new EventAwaiter(predicate, cancellationToken);
@@ -149,27 +149,27 @@ public CallAutomationEventData WaitForEventProcessor(Func<CallAutomationEventDat
149149
}
150150

151151
/// <summary>
152-
/// Wait for matching incoming event. This is blocking Call. Returns the <see cref="CallAutomationEventData"/> once it arrives in ProcessEvent method.
152+
/// Wait for matching incoming event. This is blocking Call. Returns the <see cref="CallAutomationEventBase"/> once it arrives in ProcessEvent method.
153153
/// </summary>
154154
/// <typeparam name="TEvent">Matching event type.</typeparam>
155155
/// <param name="connectionId">CallConnectionId of the call.</param>
156156
/// <param name="operationContext">OperationContext of the method.</param>
157157
/// <param name="cancellationToken">Cancellation Token can be used to set timeout or cancel this WaitForEventProcessor.</param>
158158
/// <returns>Returns the event once matching event arrives.</returns>
159-
public TEvent WaitForEventProcessor<TEvent>(string connectionId = default, string operationContext = default, CancellationToken cancellationToken = default) where TEvent : CallAutomationEventData
159+
public TEvent WaitForEventProcessor<TEvent>(string connectionId = default, string operationContext = default, CancellationToken cancellationToken = default) where TEvent : CallAutomationEventBase
160160
=> (TEvent)WaitForEventProcessor(predicate
161161
=> (predicate.CallConnectionId == connectionId || connectionId is null)
162162
&& (predicate.OperationContext == operationContext || operationContext is null)
163163
&& predicate is TEvent,
164164
cancellationToken);
165165

166166
/// <summary>
167-
/// Wait for matching incoming event. Returns the <see cref="CallAutomationEventData"/> once it arrives in ProcessEvent method.
167+
/// Wait for matching incoming event. Returns the <see cref="CallAutomationEventBase"/> once it arrives in ProcessEvent method.
168168
/// </summary>
169169
/// <param name="predicate">Predicate for waiting on event.</param>
170170
/// <param name="cancellationToken">Cancellation Token can be used to set timeout or cancel this WaitForEventProcessor.</param>
171-
/// <returns>Returns <see cref="CallAutomationEventData"/> once matching event arrives.</returns>
172-
public async Task<CallAutomationEventData> WaitForEventProcessorAsync(Func<CallAutomationEventData, bool> predicate, CancellationToken cancellationToken = default)
171+
/// <returns>Returns <see cref="CallAutomationEventBase"/> once matching event arrives.</returns>
172+
public async Task<CallAutomationEventBase> WaitForEventProcessorAsync(Func<CallAutomationEventBase, bool> predicate, CancellationToken cancellationToken = default)
173173
{
174174
// Initialize awaiter and get event handler of it
175175
var awaiter = new EventAwaiter(predicate, cancellationToken);
@@ -209,14 +209,14 @@ public async Task<CallAutomationEventData> WaitForEventProcessorAsync(Func<CallA
209209
}
210210

211211
/// <summary>
212-
/// Wait for matching incoming event. Returns the <see cref="CallAutomationEventData"/> once it arrives in ProcessEvent method.
212+
/// Wait for matching incoming event. Returns the <see cref="CallAutomationEventBase"/> once it arrives in ProcessEvent method.
213213
/// </summary>
214214
/// <typeparam name="TEvent">Matching event type.</typeparam>
215215
/// <param name="connectionId">CallConnectionId of the call.</param>
216216
/// <param name="operationContext">OperationContext of the method.</param>
217217
/// <param name="cancellationToken">Cancellation Token can be used to set timeout or cancel this WaitForEventProcessor.</param>
218218
/// <returns>Returns the event once matching event arrives.</returns>
219-
public async Task<TEvent> WaitForEventProcessorAsync<TEvent>(string connectionId = default, string operationContext = default, CancellationToken cancellationToken = default) where TEvent : CallAutomationEventData
219+
public async Task<TEvent> WaitForEventProcessorAsync<TEvent>(string connectionId = default, string operationContext = default, CancellationToken cancellationToken = default) where TEvent : CallAutomationEventBase
220220
=> (TEvent)await WaitForEventProcessorAsync(predicate
221221
=> (predicate.CallConnectionId == connectionId || connectionId is null)
222222
&& (predicate.OperationContext == operationContext || operationContext is null)

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventAwaiter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ internal class EventAwaiter : IDisposable
1414
private const int DEFAULT_EVENT_EXPIRATION_SECONDS = 240;
1515
private readonly CancellationToken _cancellationToken;
1616

17-
private Func<CallAutomationEventData, bool> _predicate;
17+
private Func<CallAutomationEventBase, bool> _predicate;
1818

1919
private bool _disposed;
2020

2121
internal TaskCompletionSource<EventProcessorArgs> taskSource { get; }
2222
internal Action<object, EventProcessorArgs> OnEventReceived => OnEventsReceived;
2323

24-
internal EventAwaiter(Func<CallAutomationEventData, bool> predicate, CancellationToken cancellationToken)
24+
internal EventAwaiter(Func<CallAutomationEventBase, bool> predicate, CancellationToken cancellationToken)
2525
{
2626
// With constructor, define predicate that matches the condition given.
2727
_predicate = predicate;

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventAwaiterOngoing.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Azure.Communication.CallAutomation
77
{
8-
internal class EventAwaiterOngoing<TEvent> where TEvent : CallAutomationEventData
8+
internal class EventAwaiterOngoing<TEvent> where TEvent : CallAutomationEventBase
99
{
1010
private string _callConnectionId;
1111
private Action<TEvent> _eventProcessor;

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventBacklog.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ internal class EventBacklog
1919

2020
private TimeSpan _expiringTimeout;
2121

22-
private ConcurrentDictionary<string, (CallAutomationEventData, Timer)> _eventBacklog;
22+
private ConcurrentDictionary<string, (CallAutomationEventBase, Timer)> _eventBacklog;
2323

2424
internal EventBacklog(TimeSpan defaultExpiringTimeout = default)
2525
{
2626
_expiringTimeout = defaultExpiringTimeout == default ? TimeSpan.FromSeconds(DEFAULT_TIMEOUT) : defaultExpiringTimeout;
27-
_eventBacklog = new ConcurrentDictionary<string, (CallAutomationEventData, Timer)>();
27+
_eventBacklog = new ConcurrentDictionary<string, (CallAutomationEventBase, Timer)>();
2828
}
2929

3030
/// <summary>
@@ -33,7 +33,7 @@ internal EventBacklog(TimeSpan defaultExpiringTimeout = default)
3333
/// <param name="backlogEventId">Internally used id for tracking the saved event.</param>
3434
/// <param name="eventsToBeSaved">Incoming Event to be saved.</param>
3535
/// <returns>Returns True if adding event is successful. False otherwise.</returns>
36-
internal bool TryAddEvent(string backlogEventId, CallAutomationEventData eventsToBeSaved)
36+
internal bool TryAddEvent(string backlogEventId, CallAutomationEventBase eventsToBeSaved)
3737
{
3838
if (_eventBacklog.Count < MAXIMUM_EVENTBACKLOGS_AT_ONCE)
3939
{
@@ -48,15 +48,15 @@ internal bool TryAddEvent(string backlogEventId, CallAutomationEventData eventsT
4848
}
4949
}
5050

51-
internal bool TryGetAndRemoveEvent(Func<CallAutomationEventData, bool> predicate, out KeyValuePair<string, CallAutomationEventData> matchingEvent)
51+
internal bool TryGetAndRemoveEvent(Func<CallAutomationEventBase, bool> predicate, out KeyValuePair<string, CallAutomationEventBase> matchingEvent)
5252
{
5353
// Match any event that matches in the events backlog
5454
var matchingKvp = _eventBacklog.FirstOrDefault(kvp => predicate(kvp.Value.Item1));
5555

5656
// Try remove the item - if successful, return it as keyValuePair
5757
if (matchingKvp.Key != default && _eventBacklog.TryRemove(matchingKvp.Key, out var returnedValue))
5858
{
59-
matchingEvent = new KeyValuePair<string, CallAutomationEventData>(matchingEvent.Key, returnedValue.Item1);
59+
matchingEvent = new KeyValuePair<string, CallAutomationEventBase>(matchingEvent.Key, returnedValue.Item1);
6060
return true;
6161
}
6262
else

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventProcessorArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ internal class EventProcessorArgs : EventArgs
99
{
1010
internal string EventArgsId { get; set; }
1111

12-
internal CallAutomationEventData CallAutomationEvent { get; set; }
12+
internal CallAutomationEventBase CallAutomationEvent { get; set; }
1313
}
1414
}

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/AddParticipantEventResult.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ public class AddParticipantEventResult
1212
public bool IsSuccess { get; internal set; }
1313

1414
/// <summary>
15-
/// <see cref="AddParticipantSucceededEventData"/> event will be returned when the participant joined the call successfully.
15+
/// <see cref="AddParticipantSucceeded"/> event will be returned when the participant joined the call successfully.
1616
/// </summary>
17-
public AddParticipantSucceededEventData SuccessResult { get; }
17+
public AddParticipantSucceeded SuccessResult { get; }
1818

1919
/// <summary>
20-
/// <see cref="AddParticipantFailedEventData"/> event will be returned when the participant did not join the call.
20+
/// <see cref="AddParticipantFailed"/> event will be returned when the participant did not join the call.
2121
/// </summary>
22-
public AddParticipantFailedEventData FailureResult { get; }
22+
public AddParticipantFailed FailureResult { get; }
2323

2424
/// <summary>
2525
/// <see cref="CommunicationIdentifier"/> Participant that was added or removed from the call.
2626
/// </summary>
2727
public CommunicationIdentifier Participant { get; }
2828

29-
internal AddParticipantEventResult(bool isSuccess, AddParticipantSucceededEventData successResult, AddParticipantFailedEventData failureResult, CommunicationIdentifier participant)
29+
internal AddParticipantEventResult(bool isSuccess, AddParticipantSucceeded successResult, AddParticipantFailed failureResult, CommunicationIdentifier participant)
3030
{
3131
IsSuccess = isSuccess;
3232
SuccessResult = successResult;

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/AnswerCallEventResult.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public class AnswerCallEventResult
1212
public bool IsSuccess { get; internal set; }
1313

1414
/// <summary>
15-
/// <see cref="CallConnectedEventData"/> event will be returned once the call is established with AnswerCall.
15+
/// <see cref="CallConnected"/> event will be returned once the call is established with AnswerCall.
1616
/// </summary>
17-
public CallConnectedEventData SuccessResult { get; }
17+
public CallConnected SuccessResult { get; }
1818

19-
internal AnswerCallEventResult(bool isSuccess, CallConnectedEventData successResult)
19+
internal AnswerCallEventResult(bool isSuccess, CallConnected successResult)
2020
{
2121
IsSuccess = isSuccess;
2222
SuccessResult = successResult;

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/CancelAllMediaOperationsEventResult.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ public class CancelAllMediaOperationsEventResult
1212
public bool IsSuccess { get; internal set; }
1313

1414
/// <summary>
15-
/// <see cref="PlayCanceledEventData"/> event will be returned when the play is successfully cancelled.
15+
/// <see cref="PlayCanceled"/> event will be returned when the play is successfully cancelled.
1616
/// </summary>
17-
public PlayCanceledEventData PlayCanceledSucessEvent { get; }
17+
public PlayCanceled PlayCanceledSucessEvent { get; }
1818

1919
/// <summary>
20-
/// <see cref="RecognizeCanceledEventData"/> event will be returned when the Recognize is successfully cancelled.
20+
/// <see cref="RecognizeCanceled"/> event will be returned when the Recognize is successfully cancelled.
2121
/// </summary>
22-
public RecognizeCanceledEventData RecognizeCanceledSucessEvent { get; }
22+
public RecognizeCanceled RecognizeCanceledSucessEvent { get; }
2323

24-
internal CancelAllMediaOperationsEventResult(bool isSuccess, PlayCanceledEventData playCanceledSucessEvent, RecognizeCanceledEventData recognizeCanceledSucessEvent)
24+
internal CancelAllMediaOperationsEventResult(bool isSuccess, PlayCanceled playCanceledSucessEvent, RecognizeCanceled recognizeCanceledSucessEvent)
2525
{
2626
IsSuccess = isSuccess;
2727
PlayCanceledSucessEvent = playCanceledSucessEvent;

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/CreateCallEventResult.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public class CreateCallEventResult
1212
public bool IsSuccess { get; internal set; }
1313

1414
/// <summary>
15-
/// <see cref="CallConnectedEventData"/> event will be returned once the call is established with CreateCall.
15+
/// <see cref="CallConnected"/> event will be returned once the call is established with CreateCall.
1616
/// </summary>
17-
public CallConnectedEventData SuccessResult { get; }
17+
public CallConnected SuccessResult { get; }
1818

19-
internal CreateCallEventResult(bool isSuccess, CallConnectedEventData successResult)
19+
internal CreateCallEventResult(bool isSuccess, CallConnected successResult)
2020
{
2121
IsSuccess = isSuccess;
2222
SuccessResult = successResult;

0 commit comments

Comments
 (0)