diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/PlayOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/PlayOptions.cs index dacf8c5d0883b..bedd16463d123 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/PlayOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/PlayOptions.cs @@ -39,5 +39,14 @@ public PlayOptions(IEnumerable playSources, IEnumerable + /// Creates a new PlayOptions object. + /// + public PlayOptions(PlaySource playSource, IEnumerable playTo) + { + PlaySources = new List { playSource }; + PlayTo = playTo.ToList(); + } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/PlayToAllOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/PlayToAllOptions.cs index a7af51849e3ba..74fe4e4d3e04f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/PlayToAllOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/PlayToAllOptions.cs @@ -33,5 +33,12 @@ public PlayToAllOptions(IEnumerable playSources) { PlaySources = playSources.ToList(); } + + /// + /// Creates a new PlayToAllOptions object. + /// + public PlayToAllOptions(PlaySource playSource) + { + PlaySources = new List { playSource }; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs index 6a126d8e34c13..28ae7e7c6c3ef 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs @@ -18,13 +18,13 @@ public class CallMediaTests : CallAutomationTestBase }; private static readonly FileSource _fileSource = new FileSource(new System.Uri("file://path/to/file")); - private static readonly PlayOptions _fileOptions = new PlayOptions(new List { _fileSource }, _target) + private static readonly PlayOptions _fileOptions = new PlayOptions(_fileSource, _target) { Loop = false, OperationContext = "context" }; - private static readonly PlayToAllOptions _filePlayToAllOptions = new PlayToAllOptions(new List { _fileSource }) + private static readonly PlayToAllOptions _filePlayToAllOptions = new PlayToAllOptions(_fileSource ) { Loop = false, OperationContext = "context"