Skip to content

Commit

Permalink
Revert "Add support for custom objects within the dialogContext (#37947
Browse files Browse the repository at this point in the history
…)"

This reverts commit 16adec4.
  • Loading branch information
calvinkwtang authored Nov 15, 2023
1 parent 315e26a commit 7062657
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Azure.Core;
Expand Down Expand Up @@ -110,7 +109,7 @@ private static StartDialogRequestInternal CreateStartDialogRequest(StartDialogOp
{
DialogOptionsInternal dialogOptionsInternal = new DialogOptionsInternal(
startDialogOptions.BotAppId,
startDialogOptions.DialogContext.ToDictionary(entry => entry.Key, entry => (object)JsonSerializer.Serialize(entry.Value)));
startDialogOptions.DialogContext);
StartDialogRequestInternal startDialogRequestInternal = new StartDialogRequestInternal(dialogOptionsInternal, startDialogOptions.DialogInputType)
{
OperationContext = startDialogOptions.OperationContext == default ? Guid.NewGuid().ToString() : startDialogOptions.OperationContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,11 @@ namespace Azure.Communication.CallAutomation.Tests.CallDialogs
public class CallDialogTests : CallAutomationTestBase
{
private const string dialogId = "92e08834-b6ee-4ede-8956-9fefa27a691c";
private static readonly Dictionary<string, object> dialogContextWithObject = new Dictionary<string, object>()
{
{
"context",
new
{
contextName = "name",
secondProperty = 1
}
}
};
private static readonly Dictionary<string, object> dialogContextWithString = new Dictionary<string, object>()
{
{
"context",
"context"
}
};
private static readonly StartDialogOptions _startDialogOptions = new StartDialogOptions(DialogInputType.PowerVirtualAgents, "botAppId", new Dictionary<string, object>())
{
OperationContext = "context"
};

private static readonly StartDialogOptions _startDialogWithCustomObjectOptions = new StartDialogOptions(DialogInputType.PowerVirtualAgents, "botAppId", dialogContextWithObject)
{
OperationContext = "context"
};

private static readonly StartDialogOptions _startDialogWithStringOptions = new StartDialogOptions(DialogInputType.PowerVirtualAgents, "botAppId", dialogContextWithString)
{
OperationContext = "context"
};

private static readonly StartDialogOptions _startDialogWithIdOptions = new StartDialogOptions(dialogId, DialogInputType.PowerVirtualAgents, "botAppId", new Dictionary<string, object>())
{
OperationContext = "context"
Expand Down Expand Up @@ -129,14 +101,6 @@ public void StopDialog_Return204NoContent(Func<CallDialog, Response<DialogResult
callDialog => callDialog.StartDialogAsync(_startDialogOptions)
},
new Func<CallDialog, Task<Response<DialogResult>>>?[]
{
callDialog => callDialog.StartDialogAsync(_startDialogWithCustomObjectOptions)
},
new Func<CallDialog, Task<Response<DialogResult>>>?[]
{
callDialog => callDialog.StartDialogAsync(_startDialogWithStringOptions)
},
new Func<CallDialog, Task<Response<DialogResult>>>?[]
{
callDialog => callDialog.StartDialogAsync(_startDialogWithIdOptions)
},
Expand All @@ -152,14 +116,6 @@ public void StopDialog_Return204NoContent(Func<CallDialog, Response<DialogResult
callDialog => callDialog.StartDialog(_startDialogOptions)
},
new Func<CallDialog, Response<DialogResult>>?[]
{
callDialog => callDialog.StartDialog(_startDialogWithCustomObjectOptions)
},
new Func<CallDialog, Response<DialogResult>>?[]
{
callDialog => callDialog.StartDialog(_startDialogWithStringOptions)
},
new Func<CallDialog, Response<DialogResult>>?[]
{
callDialog => callDialog.StartDialog(_startDialogWithIdOptions)
},
Expand Down

0 comments on commit 7062657

Please sign in to comment.