Skip to content

Commit

Permalink
Renames StartDialog to StartDialogOptions (Azure#41757)
Browse files Browse the repository at this point in the history
* Renames StartDialog to StartDialogOptions

Renames StartDialog options bag to StartDialogOptions

* Run Export-API script
  • Loading branch information
calvinkwtang authored Feb 2, 2024
1 parent e0ebb9e commit d612867
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ public partial class CallDialog
{
protected CallDialog() { }
public virtual string CallConnectionId { get { throw null; } }
public virtual Azure.Response<Azure.Communication.CallAutomation.DialogResult> StartDialog(Azure.Communication.CallAutomation.StartDialog startDialog, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.DialogResult>> StartDialogAsync(Azure.Communication.CallAutomation.StartDialog startDialogOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.CallAutomation.DialogResult> StartDialog(Azure.Communication.CallAutomation.StartDialogOptions startDialog, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.DialogResult>> StartDialogAsync(Azure.Communication.CallAutomation.StartDialogOptions startDialogOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.CallAutomation.DialogResult> StopDialog(string dialogId, System.Uri operationCallbackUri = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.DialogResult>> StopDialogAsync(string dialogId, System.Uri operationCallbackUri = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response UpdateDialog(Azure.Communication.CallAutomation.UpdateDialogOptions updateDialogOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down Expand Up @@ -1319,10 +1319,10 @@ public SsmlSource(string ssmlText) { }
public string CustomVoiceEndpointId { get { throw null; } set { } }
public string SsmlText { get { throw null; } }
}
public partial class StartDialog
public partial class StartDialogOptions
{
public StartDialog(Azure.Communication.CallAutomation.BaseDialog dialog) { }
public StartDialog(string dialogId, Azure.Communication.CallAutomation.BaseDialog dialog) { }
public StartDialogOptions(Azure.Communication.CallAutomation.BaseDialog dialog) { }
public StartDialogOptions(string dialogId, Azure.Communication.CallAutomation.BaseDialog dialog) { }
public Azure.Communication.CallAutomation.BaseDialog Dialog { get { throw null; } }
public string DialogId { get { throw null; } }
public string OperationContext { get { throw null; } set { } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected CallDialog()
/// <param name="startDialogOptions">Configuration attributes for starting dialog.</param>
/// <param name="cancellationToken"></param>
/// <returns>Returns <see cref="DialogResult"/>, which can be used to wait for Dialog's related events.</returns>
public virtual async Task<Response<DialogResult>> StartDialogAsync(StartDialog startDialogOptions, CancellationToken cancellationToken = default)
public virtual async Task<Response<DialogResult>> StartDialogAsync(StartDialogOptions startDialogOptions, CancellationToken cancellationToken = default)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallDialog)}.{nameof(StartDialog)}");
scope.Start();
Expand Down Expand Up @@ -79,7 +79,7 @@ public virtual async Task<Response<DialogResult>> StartDialogAsync(StartDialog s
/// <param name="startDialog">Configuration attributes for starting dialog.</param>
/// <param name="cancellationToken"></param>
/// <returns>Returns <see cref="DialogResult"/>, which can be used to wait for Dialog's related events.</returns>
public virtual Response<DialogResult> StartDialog(StartDialog startDialog, CancellationToken cancellationToken = default)
public virtual Response<DialogResult> StartDialog(StartDialogOptions startDialog, CancellationToken cancellationToken = default)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallDialog)}.{nameof(StartDialog)}");
scope.Start();
Expand All @@ -105,7 +105,7 @@ public virtual Response<DialogResult> StartDialog(StartDialog startDialog, Cance
}
}

private static StartDialogRequestInternal CreateStartDialogRequest(StartDialog startDialog)
private static StartDialogRequestInternal CreateStartDialogRequest(StartDialogOptions startDialog)
{
StartDialogRequestInternal startDialogRequestInternal = new StartDialogRequestInternal(startDialog.Dialog)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ namespace Azure.Communication.CallAutomation
/// <summary>
/// The Dialog Options.
/// </summary>
public class StartDialog
public class StartDialogOptions
{
/// <summary>
/// Creates a new instance of the DialogOptions.
/// </summary>
/// <param name="dialog"></param>
public StartDialog(BaseDialog dialog)
public StartDialogOptions(BaseDialog dialog)
{
DialogId = Guid.NewGuid().ToString();
Dialog = dialog;
Expand All @@ -25,7 +25,7 @@ public StartDialog(BaseDialog dialog)
/// </summary>
/// <param name="dialogId"></param>
/// <param name="dialog"></param>
public StartDialog(string dialogId, BaseDialog dialog)
public StartDialogOptions(string dialogId, BaseDialog dialog)
{
DialogId = dialogId;
Dialog = dialog;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public async Task DialogOperationsTest()

// send the dialog to the target user
var dialogContext = new Dictionary<string, object>();
StartDialog dialogOptions = new StartDialog(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
StartDialogOptions dialogOptions = new StartDialogOptions(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
{
OperationContext = "context"
};
Expand Down Expand Up @@ -203,7 +203,7 @@ public async Task DifferingConcurrentDialogsTest()

// send the dialog to the target user
var dialogContext = new Dictionary<string, object>();
StartDialog dialogOptions = new StartDialog(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
StartDialogOptions dialogOptions = new StartDialogOptions(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
{
OperationContext = "context"
};
Expand All @@ -218,15 +218,15 @@ public async Task DifferingConcurrentDialogsTest()
Assert.IsTrue(dialogStartedReceived is DialogStarted);

// send a new dialog with same ID but different context, should fail
dialogOptions = new StartDialog(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
dialogOptions = new StartDialogOptions(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
{
OperationContext = "new context"
};
Assert.ThrowsAsync<RequestFailedException>(() => callDialog.StartDialogAsync(dialogOptions));

// send a new dialog with different ID, should fail
string secondDialogId = "de7fcbc8-1803-4ec1-80ed-2c9c087587f6";
dialogOptions = new StartDialog(secondDialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
dialogOptions = new StartDialogOptions(secondDialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
{
OperationContext = "context"
};
Expand Down Expand Up @@ -324,7 +324,7 @@ public async Task DialogOperationsTest_AzureOpenAI()

// send the dialog to the target user
var dialogContext = new Dictionary<string, object>();
StartDialog dialogOptions = new StartDialog(dialogId, new AzureOpenAIDialog(dialogContext))
StartDialogOptions dialogOptions = new StartDialogOptions(dialogId, new AzureOpenAIDialog(dialogContext))
{
OperationContext = "context"
};
Expand Down Expand Up @@ -435,7 +435,7 @@ public async Task IdenticalDialogsTest()

// send the dialog to the target user
var dialogContext = new Dictionary<string, object>();
StartDialog dialogOptions = new StartDialog(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
StartDialogOptions dialogOptions = new StartDialogOptions(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
{
OperationContext = "context"
};
Expand Down Expand Up @@ -545,7 +545,7 @@ public async Task SubsequentDialogsTest()

// send the dialog to the target user
var dialogContext = new Dictionary<string, object>();
StartDialog dialogOptions = new StartDialog(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
StartDialogOptions dialogOptions = new StartDialogOptions(dialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
{
OperationContext = "context"
};
Expand All @@ -569,7 +569,7 @@ public async Task SubsequentDialogsTest()
Assert.IsTrue(dialogStoppedReceived is DialogCompleted);

string secondDialogId = "de7fcbc8-1803-4ec1-80ed-2c9c087587fd";
dialogOptions = new StartDialog(secondDialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
dialogOptions = new StartDialogOptions(secondDialogId, new PowerVirtualAgentsDialog(botAppId, dialogContext))
{
OperationContext = "context"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ public class CallDialogTests : CallAutomationTestBase
}
};

private static readonly StartDialog _startDialogOptions = new StartDialog(new PowerVirtualAgentsDialog("botAppId", new Dictionary<string, object>()))
private static readonly StartDialogOptions _startDialogOptions = new StartDialogOptions(new PowerVirtualAgentsDialog("botAppId", new Dictionary<string, object>()))
{
OperationContext = "context"
};

private static readonly StartDialog _startDialogWithCustomObjectOptions = new StartDialog(new PowerVirtualAgentsDialog("botAppId", dialogContextWithObject))
private static readonly StartDialogOptions _startDialogWithCustomObjectOptions = new StartDialogOptions(new PowerVirtualAgentsDialog("botAppId", dialogContextWithObject))
{
OperationContext = "context"
};

private static readonly StartDialog _startDialogWithStringOptions = new StartDialog(new PowerVirtualAgentsDialog("botAppId", dialogContextWithString))
private static readonly StartDialogOptions _startDialogWithStringOptions = new StartDialogOptions(new PowerVirtualAgentsDialog("botAppId", dialogContextWithString))
{
OperationContext = "context"
};

private static readonly StartDialog _startDialogWithIdOptions = new StartDialog(dialogId, new PowerVirtualAgentsDialog("botAppId", new Dictionary<string, object>()))
private static readonly StartDialogOptions _startDialogWithIdOptions = new StartDialogOptions(dialogId, new PowerVirtualAgentsDialog("botAppId", new Dictionary<string, object>()))
{
OperationContext = "context"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public async Task StartDialogEventResultSuccessTest()
CallAutomationEventProcessor handler = callConnection.EventProcessor;

var dialogContext = new Dictionary<string, object>();
var startDialogOptions = new StartDialog(new PowerVirtualAgentsDialog("botAppId", dialogContext))
var startDialogOptions = new StartDialogOptions(new PowerVirtualAgentsDialog("botAppId", dialogContext))
{
OperationContext = OperationContext
};
Expand Down Expand Up @@ -563,7 +563,7 @@ public async Task StartDialogEventResultFailedTest()
CallAutomationEventProcessor handler = callConnection.EventProcessor;

var dialogContext = new Dictionary<string, object>();
var startDialogOptions = new StartDialog(new PowerVirtualAgentsDialog("botAppId", dialogContext))
var startDialogOptions = new StartDialogOptions(new PowerVirtualAgentsDialog("botAppId", dialogContext))
{
OperationContext = OperationContext
};
Expand Down

0 comments on commit d612867

Please sign in to comment.