-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added join call, add-remove participant for out-call (#22040)
- Loading branch information
1 parent
aed0e44
commit bed61a0
Showing
4 changed files
with
283 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...azure/communication/callingserver/implementation/converters/JoinCallRequestConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.communication.callingserver.implementation.converters; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.azure.communication.callingserver.implementation.models.CallModality; | ||
import com.azure.communication.callingserver.implementation.models.EventSubscriptionType; | ||
import com.azure.communication.callingserver.implementation.models.JoinCallRequestInternal; | ||
|
||
/** | ||
* A converter between {@link com.azure.communication.callingserver.models.JoinCallRequest} and | ||
* {@link JoinCallRequestInternal}. | ||
*/ | ||
public final class JoinCallRequestConverter { | ||
/** | ||
* Maps from {com.azure.communication.callingserver.models.JoinCallRequest} to {@link JoinCallRequestInternal}. | ||
*/ | ||
public static JoinCallRequestInternal convert(com.azure.communication.callingserver.models.JoinCallRequest obj) { | ||
if (obj == null) { | ||
return null; | ||
} | ||
|
||
List<CallModality> requestedModalities = new ArrayList<>(); | ||
for (CallModality callModality : obj.getRequestedModalities()) { | ||
requestedModalities.add(callModality); | ||
} | ||
|
||
List<EventSubscriptionType> requestedCallEvents = new ArrayList<>(); | ||
for (EventSubscriptionType eventSubscription : obj.getRequestedCallEvents()){ | ||
requestedCallEvents.add(eventSubscription); | ||
} | ||
|
||
JoinCallRequestInternal joinCallRequestInternal = new JoinCallRequestInternal() | ||
.setSource(CommunicationIdentifierConverter.convert(obj.getSource())) | ||
.setSubject(obj.getSubject()) | ||
.setCallbackUri(obj.getCallbackUri()) | ||
.setRequestedModalities(requestedModalities) | ||
.setRequestedCallEvents(requestedCallEvents); | ||
|
||
return joinCallRequestInternal; | ||
} | ||
|
||
private JoinCallRequestConverter() { | ||
} | ||
} |