diff --git a/sdk/communication/Azure.Communication.JobRouter/README.md b/sdk/communication/Azure.Communication.JobRouter/README.md index 781aa35921c7..af025da7195b 100644 --- a/sdk/communication/Azure.Communication.JobRouter/README.md +++ b/sdk/communication/Azure.Communication.JobRouter/README.md @@ -129,7 +129,7 @@ Now, we register a worker to receive work from that queue, with a label of `Some Response worker = await routerClient.CreateWorkerAsync( new CreateWorkerOptions(workerId: "worker-1", totalCapacity: 1) { - QueueIds = { [queue.Value.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [queue.Value.Id] = new RouterQueueAssignment() }, Labels = { ["Some-Skill"] = new LabelValue(11) }, ChannelConfigurations = { ["my-channel"] = new ChannelConfiguration(1) }, AvailableForOffers = true, diff --git a/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs b/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs index 76ab60434659..1fd65c400cba 100644 --- a/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs @@ -86,7 +86,7 @@ public CreateJobOptions(string jobId, string channelId, string queueId) { } public string JobId { get { throw null; } } public System.Collections.Generic.IDictionary Labels { get { throw null; } } public Azure.Communication.JobRouter.JobMatchingMode MatchingMode { get { throw null; } set { } } - public System.Collections.Generic.List Notes { get { throw null; } } + public System.Collections.Generic.List Notes { get { throw null; } } public int? Priority { get { throw null; } set { } } public string QueueId { get { throw null; } } public System.Collections.Generic.List RequestedWorkerSelectors { get { throw null; } } @@ -101,7 +101,7 @@ public CreateJobWithClassificationPolicyOptions(string jobId, string channelId, public string JobId { get { throw null; } } public System.Collections.Generic.IDictionary Labels { get { throw null; } } public Azure.Communication.JobRouter.JobMatchingMode MatchingMode { get { throw null; } set { } } - public System.Collections.Generic.List Notes { get { throw null; } } + public System.Collections.Generic.List Notes { get { throw null; } } public int? Priority { get { throw null; } set { } } public string QueueId { get { throw null; } set { } } public System.Collections.Generic.List RequestedWorkerSelectors { get { throw null; } } @@ -122,7 +122,7 @@ public CreateWorkerOptions(string workerId, int totalCapacity) { } public bool AvailableForOffers { get { throw null; } set { } } public System.Collections.Generic.IDictionary ChannelConfigurations { get { throw null; } } public System.Collections.Generic.IDictionary Labels { get { throw null; } } - public System.Collections.Generic.IDictionary QueueIds { get { throw null; } } + public System.Collections.Generic.IDictionary QueueAssignments { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public int TotalCapacity { get { throw null; } } public string WorkerId { get { throw null; } } @@ -385,23 +385,15 @@ public enum ServiceVersion public static bool operator !=(Azure.Communication.JobRouter.LabelOperator left, Azure.Communication.JobRouter.LabelOperator right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct LabelValue : System.IEquatable + public partial class LabelValue : System.IEquatable { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public LabelValue(bool value) { throw null; } - public LabelValue(char value) { throw null; } - public LabelValue(decimal value) { throw null; } - public LabelValue(double value) { throw null; } - public LabelValue(short value) { throw null; } - public LabelValue(int value) { throw null; } - public LabelValue(long value) { throw null; } - public LabelValue(float value) { throw null; } - public LabelValue(string value) { throw null; } - public LabelValue(ushort value) { throw null; } - public LabelValue(uint value) { throw null; } - public LabelValue(ulong value) { throw null; } + public LabelValue(bool value) { } + public LabelValue(decimal value) { } + public LabelValue(double value) { } + public LabelValue(int value) { } + public LabelValue(long value) { } + public LabelValue(float value) { } + public LabelValue(string value) { } public object Value { get { throw null; } } public bool Equals(Azure.Communication.JobRouter.LabelValue other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -472,6 +464,12 @@ public partial class RoundRobinMode : Azure.Communication.JobRouter.Distribution { public RoundRobinMode() { } } + public partial class RouterJobNote + { + public RouterJobNote() { } + public System.DateTimeOffset? AddedAt { get { throw null; } set { } } + public string Message { get { throw null; } set { } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RouterJobStatusSelector : System.IEquatable { @@ -580,15 +578,8 @@ public RuleEngineWorkerSelectorAttachment(Azure.Communication.JobRouter.RouterRu } public partial class ScheduleAndSuspendMode { - public ScheduleAndSuspendMode() { } - public System.DateTimeOffset? ScheduleAt { get { throw null; } set { } } - } - public partial class ScoringRuleOptions - { - internal ScoringRuleOptions() { } - public bool? AllowScoringBatchOfWorkers { get { throw null; } set { } } - public int? BatchSize { get { throw null; } set { } } - public bool? DescendingOrder { get { throw null; } set { } } + public ScheduleAndSuspendMode(System.DateTimeOffset scheduleAt) { } + public System.DateTimeOffset ScheduleAt { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ScoringRuleParameterSelector : System.IEquatable @@ -668,7 +659,7 @@ public UpdateJobOptions(string jobId) { } public string JobId { get { throw null; } } public System.Collections.Generic.IDictionary Labels { get { throw null; } } public Azure.Communication.JobRouter.JobMatchingMode MatchingMode { get { throw null; } set { } } - public System.Collections.Generic.List Notes { get { throw null; } } + public System.Collections.Generic.List Notes { get { throw null; } } public int? Priority { get { throw null; } set { } } public string QueueId { get { throw null; } set { } } public System.Collections.Generic.List RequestedWorkerSelectors { get { throw null; } } @@ -689,7 +680,7 @@ public UpdateWorkerOptions(string workerId) { } public bool? AvailableForOffers { get { throw null; } set { } } public System.Collections.Generic.IDictionary ChannelConfigurations { get { throw null; } } public System.Collections.Generic.IDictionary Labels { get { throw null; } } - public System.Collections.Generic.IDictionary QueueIds { get { throw null; } } + public System.Collections.Generic.IDictionary QueueAssignments { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public int? TotalCapacity { get { throw null; } set { } } public string WorkerId { get { throw null; } } @@ -802,7 +793,7 @@ internal RouterJob() { } public string Id { get { throw null; } } public System.Collections.Generic.Dictionary Labels { get { throw null; } } public Azure.Communication.JobRouter.JobMatchingMode MatchingMode { get { throw null; } } - public System.Collections.Generic.List Notes { get { throw null; } } + public System.Collections.Generic.List Notes { get { throw null; } } public int? Priority { get { throw null; } } public string QueueId { get { throw null; } } public System.Collections.Generic.List RequestedWorkerSelectors { get { throw null; } } @@ -825,12 +816,6 @@ internal RouterJobItem() { } public Azure.ETag ETag { get { throw null; } } public Azure.Communication.JobRouter.Models.RouterJob Job { get { throw null; } } } - public partial class RouterJobNote - { - public RouterJobNote() { } - public System.DateTimeOffset? AddedAt { get { throw null; } set { } } - public string Message { get { throw null; } set { } } - } public partial class RouterJobOffer { internal RouterJobOffer() { } @@ -947,6 +932,13 @@ internal RouterWorkerItem() { } public static bool operator !=(Azure.Communication.JobRouter.Models.RouterWorkerSelectorStatus left, Azure.Communication.JobRouter.Models.RouterWorkerSelectorStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class ScoringRuleOptions + { + internal ScoringRuleOptions() { } + public bool? AllowScoringBatchOfWorkers { get { throw null; } set { } } + public int? BatchSize { get { throw null; } set { } } + public bool? DescendingOrder { get { throw null; } set { } } + } public partial class UnassignJobResult { internal UnassignJobResult() { } diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md index e68cd503bbcf..ab15e90bc7a1 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrud.md @@ -122,7 +122,7 @@ Response worker = routerClient.CreateWorker( { AvailableForOffers = true, // if a worker is not registered, no offer will be issued ChannelConfigurations = { ["general"] = new ChannelConfiguration(100), }, - QueueIds = { [jobQueue.Value.Id] = new RouterQueueAssignment(), }, + QueueAssignments = { [jobQueue.Value.Id] = new RouterQueueAssignment(), }, }); // now that we have a registered worker, we can expect offer to be sent to the worker diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md index af8c6bcdd45f..c3796b3603d2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/RouterJobCrudAsync.md @@ -123,7 +123,7 @@ Response worker = await routerClient.CreateWorkerAsync( { AvailableForOffers = true, // if a worker is not registered, no offer will be issued ChannelConfigurations = { ["general"] = new ChannelConfiguration(100), }, - QueueIds = { [jobQueue.Value.Id] = new RouterQueueAssignment(), }, + QueueAssignments = { [jobQueue.Value.Id] = new RouterQueueAssignment(), }, }); // now that we have a registered worker, we can expect offer to be sent to the worker diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/RouterWorkerCrud.md b/sdk/communication/Azure.Communication.JobRouter/samples/RouterWorkerCrud.md index c08e552d8100..98f0d1876ff7 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/RouterWorkerCrud.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/RouterWorkerCrud.md @@ -24,7 +24,7 @@ string routerWorkerId = "my-router-worker"; Response worker = routerClient.CreateWorker( new CreateWorkerOptions(workerId: routerWorkerId, totalCapacity: 100) { - QueueIds = + QueueAssignments = { ["worker-q-1"] = new RouterQueueAssignment(), ["worker-q-2"] = new RouterQueueAssignment() @@ -75,7 +75,7 @@ Console.WriteLine($"Worker associated with queues: {queriedWorker.Value.QueueAss Response updateWorker = routerClient.UpdateWorker( new UpdateWorkerOptions(routerWorkerId) { - QueueIds = { ["worker-q-3"] = new RouterQueueAssignment() }, + QueueAssignments = { ["worker-q-3"] = new RouterQueueAssignment() }, ChannelConfigurations = { ["WebChatEscalated"] = new ChannelConfiguration(50), }, Labels = { diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/RouterWorkerCrudAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/RouterWorkerCrudAsync.md index b9b030e9d6af..34f6abbe19a4 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/RouterWorkerCrudAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/RouterWorkerCrudAsync.md @@ -26,7 +26,7 @@ Response worker = await routerClient.CreateWorkerAsync( workerId: routerWorkerId, totalCapacity: 100) { - QueueIds = + QueueAssignments = { ["worker-q-1"] = new RouterQueueAssignment(), ["worker-q-2"] = new RouterQueueAssignment() @@ -77,7 +77,7 @@ Console.WriteLine($"Worker associated with queues: {queriedWorker.Value.QueueAss Response updateWorker = await routerClient.UpdateWorkerAsync( new UpdateWorkerOptions(routerWorkerId) { - QueueIds = { ["worker-q-3"] = new RouterQueueAssignment() }, + QueueAssignments = { ["worker-q-3"] = new RouterQueueAssignment() }, ChannelConfigurations = { ["WebChatEscalated"] = new ChannelConfiguration(50), }, Labels = { diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorld.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorld.md index ffb619d910b2..3d3d8f257840 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorld.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorld.md @@ -71,7 +71,7 @@ Register a worker associated with the queue that was just created. We will assig Response worker = routerClient.CreateWorker( new CreateWorkerOptions(workerId: "worker-1", totalCapacity: 1) { - QueueIds = { [queue.Value.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [queue.Value.Id] = new RouterQueueAssignment() }, Labels = { ["Some-Skill"] = new LabelValue(11) }, ChannelConfigurations = { ["my-channel"] = new ChannelConfiguration(1) }, AvailableForOffers = true, diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorldAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorldAsync.md index b627df070259..f5a8e6656043 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorldAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorldAsync.md @@ -71,7 +71,7 @@ Register a worker associated with the queue that was just created. We will assig Response worker = await routerClient.CreateWorkerAsync( new CreateWorkerOptions(workerId: "worker-1", totalCapacity: 1) { - QueueIds = { [queue.Value.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [queue.Value.Id] = new RouterQueueAssignment() }, Labels = { ["Some-Skill"] = new LabelValue(11) }, ChannelConfigurations = { ["my-channel"] = new ChannelConfiguration(1) }, AvailableForOffers = true, diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample2_ClassificationWithWorkerSelectorAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample2_ClassificationWithWorkerSelectorAsync.md index 23e74747653a..ecea5bb37541 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample2_ClassificationWithWorkerSelectorAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample2_ClassificationWithWorkerSelectorAsync.md @@ -100,7 +100,7 @@ Response worker1 = await routerClient.CreateWorkerAsync( ["Geo"] = new LabelValue("NA"), ["Skill_English_Lvl"] = new LabelValue(7), }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); string workerId2 = "worker-id-2"; @@ -111,7 +111,7 @@ Response worker2 = await routerClient.CreateWorkerAsync( AvailableForOffers = true, // registering worker at the time of creation ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, Labels = { ["Skill_English_Lvl"] = new LabelValue(7) }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); @@ -230,7 +230,7 @@ Response worker1 = await routerClient.CreateWorkerAsync( ["Geo"] = new LabelValue("NA"), ["Skill_English_Lvl"] = new LabelValue(7) }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); string workerId2 = "worker-id-2"; @@ -245,7 +245,7 @@ Response worker2 = await routerClient.CreateWorkerAsync( ["Geo"] = new LabelValue("NA"), ["Skill_English_Lvl"] = new LabelValue(7) }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); @@ -373,7 +373,7 @@ Response worker1 = await routerClient.CreateWorkerAsync( ["Dept"] = new LabelValue("O365"), ["Skill_English_Lvl"] = new LabelValue(10), }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); string workerId2 = "worker-id-2"; @@ -391,7 +391,7 @@ Response worker2 = await routerClient.CreateWorkerAsync( ["Dept"] = new LabelValue("Xbox"), ["Skill_English_Lvl"] = new LabelValue(10), }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_AdvancedDistributionAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_AdvancedDistributionAsync.md index 8a05730cb0ef..24b2b4640cfd 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_AdvancedDistributionAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_AdvancedDistributionAsync.md @@ -52,7 +52,7 @@ Response worker1 = await routerClient.CreateWorkerAsync( AvailableForOffers = true, ChannelConfigurations = { [channelId] = new ChannelConfiguration(10), }, Labels = { ["HandleEscalation"] = new LabelValue(true), ["IT_Support"] = new LabelValue(true) }, - QueueIds = { [jobQueueId] = new RouterQueueAssignment(), } + QueueAssignments = { [jobQueueId] = new RouterQueueAssignment(), } }); // Worker 2 cannot handle escalation @@ -62,7 +62,7 @@ Response worker2 = await routerClient.CreateWorkerAsync( AvailableForOffers = true, ChannelConfigurations = { [channelId] = new ChannelConfiguration(10), }, Labels = { ["IT_Support"] = new LabelValue(true), }, - QueueIds = { [jobQueueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [jobQueueId] = new RouterQueueAssignment(), }, }); // Create job @@ -271,7 +271,7 @@ string workerId1 = "worker-Id-1"; Response worker1 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: workerId1, totalCapacity: 100) { - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["HighPrioritySupport"] = new LabelValue(true), @@ -290,7 +290,7 @@ string workerId2 = "worker-Id-2"; Response worker2 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: workerId2, totalCapacity: 100) { - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["HighPrioritySupport"] = new LabelValue(true), @@ -312,7 +312,7 @@ Dictionary worker3Labels = new Dictionary worker3 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: workerId3, totalCapacity: 100) { - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["HighPrioritySupport"] = new LabelValue(false), diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_SimpleDistributionAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_SimpleDistributionAsync.md index 005f7db6b37a..d72c5ff52f29 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_SimpleDistributionAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_SimpleDistributionAsync.md @@ -50,14 +50,14 @@ Response worker1 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker1Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, }); Response worker2 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker2Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, }); // Register worker1 @@ -118,7 +118,7 @@ Response worker1 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker1Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(5), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, AvailableForOffers = true }); @@ -126,7 +126,7 @@ Response worker2 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker2Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(5), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, AvailableForOffers = true, // register worker upon creation }); @@ -194,7 +194,7 @@ Response worker1 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker1Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["Location"] = new LabelValue("United States"), @@ -210,7 +210,7 @@ Response worker2 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker2Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["Location"] = new LabelValue("United States"), @@ -226,7 +226,7 @@ Response worker3 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker3Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["Location"] = new LabelValue("United States"), @@ -308,7 +308,7 @@ Response worker1 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker1Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, AvailableForOffers = true, }); @@ -316,7 +316,7 @@ Response worker2 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker2Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, AvailableForOffers = true, }); diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/BestWorkerMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/BestWorkerMode.Serialization.cs index c934efe32134..adc65b52b795 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/BestWorkerMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/BestWorkerMode.Serialization.cs @@ -6,6 +6,7 @@ #nullable disable using System.Text.Json; +using Azure.Communication.JobRouter.Models; using Azure.Core; namespace Azure.Communication.JobRouter @@ -74,7 +75,7 @@ internal static BestWorkerMode DeserializeBestWorkerMode(JsonElement element) { continue; } - scoringRuleOptions = JobRouter.ScoringRuleOptions.DeserializeScoringRuleOptions(property.Value); + scoringRuleOptions = Models.ScoringRuleOptions.DeserializeScoringRuleOptions(property.Value); continue; } if (property.NameEquals("kind"u8)) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/BestWorkerMode.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/BestWorkerMode.cs index 0672928777fa..3cb41b46f2a5 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/BestWorkerMode.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/BestWorkerMode.cs @@ -5,6 +5,8 @@ #nullable disable +using Azure.Communication.JobRouter.Models; + namespace Azure.Communication.JobRouter { /// Jobs are distributed to the worker with the strongest abilities available. diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScheduleAndSuspendMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScheduleAndSuspendMode.Serialization.cs index 360631ccc3b7..96abdd31f9f3 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScheduleAndSuspendMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScheduleAndSuspendMode.Serialization.cs @@ -19,7 +19,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) if (Optional.IsDefined(ScheduleAt)) { writer.WritePropertyName("scheduleAt"u8); - writer.WriteStringValue(ScheduleAt.Value, "O"); + writer.WriteStringValue(ScheduleAt, "O"); } writer.WriteEndObject(); } @@ -43,7 +43,7 @@ internal static ScheduleAndSuspendMode DeserializeScheduleAndSuspendMode(JsonEle continue; } } - return new ScheduleAndSuspendMode(Optional.ToNullable(scheduleAt)); + return new ScheduleAndSuspendMode(scheduleAt); } } } diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScheduleAndSuspendMode.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScheduleAndSuspendMode.cs index 6fa452d01d32..b4ab199fe3a0 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScheduleAndSuspendMode.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScheduleAndSuspendMode.cs @@ -12,19 +12,5 @@ namespace Azure.Communication.JobRouter /// The ScheduleAndSuspendMode. public partial class ScheduleAndSuspendMode { - /// Initializes a new instance of ScheduleAndSuspendMode. - public ScheduleAndSuspendMode() - { - } - - /// Initializes a new instance of ScheduleAndSuspendMode. - /// - internal ScheduleAndSuspendMode(DateTimeOffset? scheduleAt) - { - ScheduleAt = scheduleAt; - } - - /// Gets or sets the schedule at. - public DateTimeOffset? ScheduleAt { get; set; } } } diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScoringRuleOptions.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScoringRuleOptions.Serialization.cs index 967453d40c26..02012cc87f00 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScoringRuleOptions.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScoringRuleOptions.Serialization.cs @@ -7,9 +7,10 @@ using System.Collections.Generic; using System.Text.Json; +using Azure.Communication.JobRouter; using Azure.Core; -namespace Azure.Communication.JobRouter +namespace Azure.Communication.JobRouter.Models { public partial class ScoringRuleOptions : IUtf8JsonSerializable { diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScoringRuleOptions.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScoringRuleOptions.cs index cf98866575c6..e92ce48766ad 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScoringRuleOptions.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/Models/ScoringRuleOptions.cs @@ -6,9 +6,10 @@ #nullable disable using System.Collections.Generic; +using Azure.Communication.JobRouter; using Azure.Core; -namespace Azure.Communication.JobRouter +namespace Azure.Communication.JobRouter.Models { /// Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode. public partial class ScoringRuleOptions diff --git a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs index a520b61baa5a..3c813caf49e6 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/JobRouterClient.cs @@ -1163,7 +1163,7 @@ public virtual async Task> CreateWorkerAsync( AvailableForOffers = options?.AvailableForOffers }; - foreach (var queueAssignment in options.QueueIds) + foreach (var queueAssignment in options.QueueAssignments) { request.QueueAssignments[queueAssignment.Key] = new RouterQueueAssignment(); } @@ -1218,7 +1218,7 @@ public virtual Response CreateWorker( AvailableForOffers = options?.AvailableForOffers }; - foreach (var queueAssignment in options.QueueIds) + foreach (var queueAssignment in options.QueueAssignments) { request.QueueAssignments[queueAssignment.Key] = new RouterQueueAssignment(); } @@ -1272,7 +1272,7 @@ public virtual async Task> UpdateWorkerAsync( AvailableForOffers = options?.AvailableForOffers }; - foreach (var queueAssignment in options.QueueIds) + foreach (var queueAssignment in options.QueueAssignments) { request.QueueAssignments[queueAssignment.Key] = new RouterQueueAssignment(); } @@ -1327,7 +1327,7 @@ public virtual Response UpdateWorker( AvailableForOffers = options?.AvailableForOffers }; - foreach (var queueAssignment in options.QueueIds) + foreach (var queueAssignment in options.QueueAssignments) { request.QueueAssignments[queueAssignment.Key] = new RouterQueueAssignment(); } diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/BestWorkerMode.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/BestWorkerMode.cs index d749232c4b39..d8081322f9f0 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Models/BestWorkerMode.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/BestWorkerMode.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Azure.Communication.JobRouter.Models; using Azure.Core; namespace Azure.Communication.JobRouter diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/CreateJobOptions.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/CreateJobOptions.cs index 934e61ec50fc..9d2191028d7a 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Models/CreateJobOptions.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/CreateJobOptions.cs @@ -52,7 +52,7 @@ public CreateJobOptions(string jobId, string channelId, string queueId) /// Reference to an external parent context, eg. call ID. public string ChannelReference { get; set; } - /// The priority of this job. + /// The priority of this job (range from -100 to 100). public int? Priority { get; set; } /// A collection of manually specified label selectors, which a worker must satisfy in order to process this job. diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/CreateWorkerOptions.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/CreateWorkerOptions.cs index eaa2b07ef92c..c3939cc91c37 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Models/CreateWorkerOptions.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/CreateWorkerOptions.cs @@ -55,6 +55,6 @@ public CreateWorkerOptions(string workerId, int totalCapacity) public IDictionary ChannelConfigurations { get; } = new Dictionary(); /// The queue(s) that this worker can receive work from. - public IDictionary QueueIds { get; } = new Dictionary(); + public IDictionary QueueAssignments { get; } = new Dictionary(); } } diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/LabelValue.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/LabelValue.cs index 199ac0c73385..25fda7775272 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Models/LabelValue.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/LabelValue.cs @@ -12,31 +12,13 @@ namespace Azure.Communication.JobRouter /// /// Generic value wrapper. /// - public readonly struct LabelValue : IEquatable + public class LabelValue : IEquatable { /// /// Primitive value. /// public object Value { get; } - /// - /// Set value of type. - /// - /// - public LabelValue(short value) - { - Value = value; - } - - /// - /// Set value of type. - /// - /// - public LabelValue(ushort value) - { - Value = value; - } - /// /// Set value of type. /// @@ -46,15 +28,6 @@ public LabelValue(int value) Value = value; } - /// - /// Set value of type. - /// - /// - public LabelValue(uint value) - { - Value = value; - } - /// /// Set value of type. /// @@ -64,15 +37,6 @@ public LabelValue(long value) Value = value; } - /// - /// Set value of type. - /// - /// - public LabelValue(ulong value) - { - Value = value; - } - /// /// Set value of type. /// @@ -91,15 +55,6 @@ public LabelValue(double value) Value = value; } - /// - /// Set value of type. - /// - /// - public LabelValue(char value) - { - Value = value; - } - /// /// Set value of type. /// diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/RouterJobNote.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/RouterJobNote.cs index 18daee2ca86c..143642052564 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Models/RouterJobNote.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/RouterJobNote.cs @@ -3,7 +3,7 @@ using System; -namespace Azure.Communication.JobRouter.Models +namespace Azure.Communication.JobRouter { /// /// A note attached to a job diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/ScheduleAndSuspendMode.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/ScheduleAndSuspendMode.cs new file mode 100644 index 000000000000..2b4756efab8f --- /dev/null +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/ScheduleAndSuspendMode.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Security.Cryptography; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.JobRouter +{ + [CodeGenSuppress("ScheduleAndSuspendMode")] + [CodeGenSuppress("ScheduleAndSuspendMode", typeof(DateTimeOffset?))] + public partial class ScheduleAndSuspendMode + { + /// Initializes a new instance of ScheduleAndSuspendMode. + /// The time at which the job will be scheduled. + /// is null. + public ScheduleAndSuspendMode(DateTimeOffset scheduleAt) + { + Argument.AssertNotNull(scheduleAt, nameof(scheduleAt)); + ScheduleAt = scheduleAt; + } + + /// Gets or sets the schedule at. + public DateTimeOffset ScheduleAt { get; } + } +} diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/ScoringRuleOptions.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/ScoringRuleOptions.cs index 5a75c39b15ca..482706f846a2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Models/ScoringRuleOptions.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/ScoringRuleOptions.cs @@ -6,8 +6,9 @@ using System.Text; using Azure.Core; -namespace Azure.Communication.JobRouter +namespace Azure.Communication.JobRouter.Models { + [CodeGenModel("ScoringRuleOptions")] public partial class ScoringRuleOptions { internal ScoringRuleOptions() diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/UpdateJobOptions.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/UpdateJobOptions.cs index 2d9c07e1ce42..632deb83f938 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Models/UpdateJobOptions.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/UpdateJobOptions.cs @@ -48,7 +48,7 @@ public UpdateJobOptions(string jobId) /// The channel identifier. eg. voice, chat, etc. public string ChannelId { get; set; } - /// The priority of this job. + /// The priority of this job (range from -100 to 100). public int? Priority { get; set; } /// Reason code for cancelled or closed jobs. diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Models/UpdateWorkerOptions.cs b/sdk/communication/Azure.Communication.JobRouter/src/Models/UpdateWorkerOptions.cs index 83789b46a2fb..d7973ed31035 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Models/UpdateWorkerOptions.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Models/UpdateWorkerOptions.cs @@ -51,6 +51,6 @@ public UpdateWorkerOptions(string workerId) public IDictionary ChannelConfigurations { get; } = new Dictionary(); /// The queue(s) that this worker can receive work from. - public IDictionary QueueIds { get; } = new Dictionary(); + public IDictionary QueueAssignments { get; } = new Dictionary(); } } diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/LabelValueTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/LabelValueTests.cs index d6b9e17fe68c..8d1306de9e09 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/LabelValueTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/LabelValueTests.cs @@ -14,7 +14,7 @@ public void LabelValueAcceptsNull() Assert.IsNotNull(labelValue); var testValue1 = new LabelValue(null); Assert.AreEqual(labelValue, testValue1); - var testValue2 = new LabelValue(); + var testValue2 = new LabelValue(null); Assert.AreEqual(labelValue, testValue2); } @@ -28,16 +28,6 @@ public void LabelValueAcceptsInt16() Assert.AreEqual(labelValue, testValue); } - [Test] - public void LabelValueAcceptsUInt16() - { - ushort input = 1; - var labelValue = new LabelValue(input); - Assert.IsNotNull(labelValue); - var testValue = new LabelValue(input); - Assert.AreEqual(labelValue, testValue); - } - [Test] public void LabelValueAcceptsInt32() { @@ -48,16 +38,6 @@ public void LabelValueAcceptsInt32() Assert.AreEqual(labelValue, testValue); } - [Test] - public void LabelValueAcceptsUInt32() - { - uint input = 1; - var labelValue = new LabelValue(input); - Assert.IsNotNull(labelValue); - var testValue = new LabelValue(input); - Assert.AreEqual(labelValue, testValue); - } - [Test] public void LabelValueAcceptsInt64() { @@ -68,16 +48,6 @@ public void LabelValueAcceptsInt64() Assert.AreEqual(labelValue, testValue); } - [Test] - public void LabelValueAcceptsUInt64() - { - ulong input = 1; - var labelValue = new LabelValue(input); - Assert.IsNotNull(labelValue); - var testValue = new LabelValue(input); - Assert.AreEqual(labelValue, testValue); - } - [Test] public void LabelValueAcceptsFloat() { @@ -108,16 +78,6 @@ public void LabelValueAcceptsDecimal() Assert.AreEqual(labelValue, testValue); } - [Test] - public void LabelValueAcceptsChar() - { - char input = '1'; - var labelValue = new LabelValue(input); - Assert.IsNotNull(labelValue); - var testValue = new LabelValue(input); - Assert.AreEqual(labelValue, testValue); - } - [Test] public void LabelValueAcceptsString() { diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterWorkerLiveTests.cs b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterWorkerLiveTests.cs index 904aacaaff8a..4dcb31da9cb4 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterWorkerLiveTests.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/RouterClients/RouterWorkerLiveTests.cs @@ -49,7 +49,7 @@ public async Task CreateWorkerTest() var routerWorkerResponse = await routerClient.CreateWorkerAsync( new CreateWorkerOptions(workerId, totalCapacity) { - QueueIds = { { createQueueResponse.Value.Id, new RouterQueueAssignment() } }, + QueueAssignments = { { createQueueResponse.Value.Id, new RouterQueueAssignment() } }, Labels = { ["test_label_1"] = new LabelValue("testLabel"), @@ -103,7 +103,7 @@ public async Task GetWorkersTest() var registerWorker1Response = await routerClient.CreateWorkerAsync( new CreateWorkerOptions(workerId1, 10) { - QueueIds = { [createQueue1.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [createQueue1.Id] = new RouterQueueAssignment() }, ChannelConfigurations = { ["WebChat"] = new ChannelConfiguration(1), @@ -117,7 +117,7 @@ public async Task GetWorkersTest() var registerWorker2Response = await routerClient.CreateWorkerAsync( new CreateWorkerOptions(workerId2, 10) { - QueueIds = { [createQueue2.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [createQueue2.Id] = new RouterQueueAssignment() }, ChannelConfigurations = { ["WebChat"] = new ChannelConfiguration(5) { MaxNumberOfJobs = 1 }, @@ -131,7 +131,7 @@ public async Task GetWorkersTest() var registerWorker3Response = await routerClient.CreateWorkerAsync( new CreateWorkerOptions(workerId3, 12) { - QueueIds = + QueueAssignments = { [createQueue1.Id] = new RouterQueueAssignment(), [createQueue2.Id] = new RouterQueueAssignment() @@ -149,7 +149,7 @@ public async Task GetWorkersTest() var registerWorker4Response = await routerClient.CreateWorkerAsync( new CreateWorkerOptions(workerId4, 10) { - QueueIds = { [createQueue1.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [createQueue1.Id] = new RouterQueueAssignment() }, ChannelConfigurations = { ["WebChat"] = new ChannelConfiguration(1) }, AvailableForOffers = true, }); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs index fc8559d82ee9..ec9abe73fc1a 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOps.cs @@ -127,7 +127,7 @@ public void RouterCrudOps() { AvailableForOffers = true, // if a worker is not registered, no offer will be issued ChannelConfigurations = { ["general"] = new ChannelConfiguration(100), }, - QueueIds = { [jobQueue.Value.Id] = new RouterQueueAssignment(), }, + QueueAssignments = { [jobQueue.Value.Id] = new RouterQueueAssignment(), }, }); // now that we have a registered worker, we can expect offer to be sent to the worker diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs index 7f5dbac689aa..e3a75ee40482 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterJobCrudOpsAsync.cs @@ -128,7 +128,7 @@ await routerAdministrationClient.CreateDistributionPolicyAsync(new CreateDistrib { AvailableForOffers = true, // if a worker is not registered, no offer will be issued ChannelConfigurations = { ["general"] = new ChannelConfiguration(100), }, - QueueIds = { [jobQueue.Value.Id] = new RouterQueueAssignment(), }, + QueueAssignments = { [jobQueue.Value.Id] = new RouterQueueAssignment(), }, }); // now that we have a registered worker, we can expect offer to be sent to the worker diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterWorkerCrudOps.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterWorkerCrudOps.cs index d63105bc54f2..ed96471fda7e 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterWorkerCrudOps.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterWorkerCrudOps.cs @@ -29,7 +29,7 @@ public void RouterWorkerCrud() Response worker = routerClient.CreateWorker( new CreateWorkerOptions(workerId: routerWorkerId, totalCapacity: 100) { - QueueIds = + QueueAssignments = { ["worker-q-1"] = new RouterQueueAssignment(), ["worker-q-2"] = new RouterQueueAssignment() @@ -80,7 +80,7 @@ public void RouterWorkerCrud() Response updateWorker = routerClient.UpdateWorker( new UpdateWorkerOptions(routerWorkerId) { - QueueIds = { ["worker-q-3"] = new RouterQueueAssignment() }, + QueueAssignments = { ["worker-q-3"] = new RouterQueueAssignment() }, ChannelConfigurations = { ["WebChatEscalated"] = new ChannelConfiguration(50), }, Labels = { diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterWorkerCrudOpsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterWorkerCrudOpsAsync.cs index b61f68ca6807..c3ee8e19767d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterWorkerCrudOpsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/RouterWorkerCrudOpsAsync.cs @@ -31,7 +31,7 @@ public async Task RouterWorkerCrud() workerId: routerWorkerId, totalCapacity: 100) { - QueueIds = + QueueAssignments = { ["worker-q-1"] = new RouterQueueAssignment(), ["worker-q-2"] = new RouterQueueAssignment() @@ -82,7 +82,7 @@ public async Task RouterWorkerCrud() Response updateWorker = await routerClient.UpdateWorkerAsync( new UpdateWorkerOptions(routerWorkerId) { - QueueIds = { ["worker-q-3"] = new RouterQueueAssignment() }, + QueueAssignments = { ["worker-q-3"] = new RouterQueueAssignment() }, ChannelConfigurations = { ["WebChatEscalated"] = new ChannelConfiguration(50), }, Labels = { diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample1_KeyConcepts.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample1_KeyConcepts.cs index 86ee703af77f..5ee4a2ca37b8 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample1_KeyConcepts.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample1_KeyConcepts.cs @@ -68,7 +68,7 @@ public void BasicScenario() Response worker = routerClient.CreateWorker( new CreateWorkerOptions(workerId: "worker-1", totalCapacity: 1) { - QueueIds = { [queue.Value.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [queue.Value.Id] = new RouterQueueAssignment() }, Labels = { ["Some-Skill"] = new LabelValue(11) }, ChannelConfigurations = { ["my-channel"] = new ChannelConfiguration(1) }, AvailableForOffers = true, diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample1_KeyConceptsAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample1_KeyConceptsAsync.cs index 7569fa51c222..b3febe8982b0 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample1_KeyConceptsAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample1_KeyConceptsAsync.cs @@ -67,7 +67,7 @@ public async Task BasicScenario() Response worker = await routerClient.CreateWorkerAsync( new CreateWorkerOptions(workerId: "worker-1", totalCapacity: 1) { - QueueIds = { [queue.Value.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [queue.Value.Id] = new RouterQueueAssignment() }, Labels = { ["Some-Skill"] = new LabelValue(11) }, ChannelConfigurations = { ["my-channel"] = new ChannelConfiguration(1) }, AvailableForOffers = true, diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample2_ClassificationWithWorkerSelectorAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample2_ClassificationWithWorkerSelectorAsync.cs index cb16ea7ebec3..f02af78767a2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample2_ClassificationWithWorkerSelectorAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample2_ClassificationWithWorkerSelectorAsync.cs @@ -114,7 +114,7 @@ public async Task WorkerSelection_StaticSelectors() ["Geo"] = new LabelValue("NA"), ["Skill_English_Lvl"] = new LabelValue(7), }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); string workerId2 = "worker-id-2"; @@ -125,7 +125,7 @@ public async Task WorkerSelection_StaticSelectors() AvailableForOffers = true, // registering worker at the time of creation ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, Labels = { ["Skill_English_Lvl"] = new LabelValue(7) }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); #if !SNIPPET @@ -273,7 +273,7 @@ public async Task WorkerSelection_ByCondition() ["Geo"] = new LabelValue("NA"), ["Skill_English_Lvl"] = new LabelValue(7) }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); string workerId2 = "worker-id-2"; @@ -288,7 +288,7 @@ public async Task WorkerSelection_ByCondition() ["Geo"] = new LabelValue("NA"), ["Skill_English_Lvl"] = new LabelValue(7) }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); #if !SNIPPET @@ -445,7 +445,7 @@ public async Task WorkerSelection_ByPassThroughValues() ["Dept"] = new LabelValue("O365"), ["Skill_English_Lvl"] = new LabelValue(10), }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); string workerId2 = "worker-id-2"; @@ -463,7 +463,7 @@ public async Task WorkerSelection_ByPassThroughValues() ["Dept"] = new LabelValue("Xbox"), ["Skill_English_Lvl"] = new LabelValue(10), }, // attaching labels associated with worker - QueueIds = { [queueId] = new RouterQueueAssignment() } + QueueAssignments = { [queueId] = new RouterQueueAssignment() } }); #if !SNIPPET diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample3_AdvancedDistributionAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample3_AdvancedDistributionAsync.cs index 3e3c4fd92a5b..52d710099810 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample3_AdvancedDistributionAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample3_AdvancedDistributionAsync.cs @@ -55,7 +55,7 @@ public async Task BestWorkerDistribution_Advanced_ExpressionRouterRule() AvailableForOffers = true, ChannelConfigurations = { [channelId] = new ChannelConfiguration(10), }, Labels = { ["HandleEscalation"] = new LabelValue(true), ["IT_Support"] = new LabelValue(true) }, - QueueIds = { [jobQueueId] = new RouterQueueAssignment(), } + QueueAssignments = { [jobQueueId] = new RouterQueueAssignment(), } }); // Worker 2 cannot handle escalation @@ -65,7 +65,7 @@ public async Task BestWorkerDistribution_Advanced_ExpressionRouterRule() AvailableForOffers = true, ChannelConfigurations = { [channelId] = new ChannelConfiguration(10), }, Labels = { ["IT_Support"] = new LabelValue(true), }, - QueueIds = { [jobQueueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [jobQueueId] = new RouterQueueAssignment(), }, }); // Create job @@ -128,7 +128,7 @@ public async Task BestWorkerDistribution_Advanced_AzureFunctionRouterRule() Response worker1 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: workerId1, totalCapacity: 100) { - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["HighPrioritySupport"] = new LabelValue(true), @@ -147,7 +147,7 @@ public async Task BestWorkerDistribution_Advanced_AzureFunctionRouterRule() Response worker2 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: workerId2, totalCapacity: 100) { - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["HighPrioritySupport"] = new LabelValue(true), @@ -169,7 +169,7 @@ public async Task BestWorkerDistribution_Advanced_AzureFunctionRouterRule() Response worker3 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: workerId3, totalCapacity: 100) { - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["HighPrioritySupport"] = new LabelValue(false), diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample3_SimpleDistributionAsync.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample3_SimpleDistributionAsync.cs index 3432b0c62245..142a499d3a5a 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample3_SimpleDistributionAsync.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Samples/Sample3_SimpleDistributionAsync.cs @@ -53,14 +53,14 @@ public async Task SimpleDistribution_LongestIdle() options: new CreateWorkerOptions(workerId: worker1Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, }); Response worker2 = await routerClient.CreateWorkerAsync( options: new CreateWorkerOptions(workerId: worker2Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, }); // Register worker1 @@ -138,7 +138,7 @@ public async Task SimpleDistribution_RoundRobin() options: new CreateWorkerOptions(workerId: worker1Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(5), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, AvailableForOffers = true }); @@ -146,7 +146,7 @@ public async Task SimpleDistribution_RoundRobin() options: new CreateWorkerOptions(workerId: worker2Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(5), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, AvailableForOffers = true, // register worker upon creation }); @@ -233,7 +233,7 @@ public async Task SimpleDistribution_DefaultBestWorker() options: new CreateWorkerOptions(workerId: worker1Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["Location"] = new LabelValue("United States"), @@ -249,7 +249,7 @@ public async Task SimpleDistribution_DefaultBestWorker() options: new CreateWorkerOptions(workerId: worker2Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["Location"] = new LabelValue("United States"), @@ -265,7 +265,7 @@ public async Task SimpleDistribution_DefaultBestWorker() options: new CreateWorkerOptions(workerId: worker3Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, Labels = { ["Location"] = new LabelValue("United States"), @@ -364,7 +364,7 @@ await routerAdministrationClient.CreateDistributionPolicyAsync( options: new CreateWorkerOptions(workerId: worker1Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, AvailableForOffers = true, }); @@ -372,7 +372,7 @@ await routerAdministrationClient.CreateDistributionPolicyAsync( options: new CreateWorkerOptions(workerId: worker2Id, totalCapacity: 10) { ChannelConfigurations = { ["general"] = new ChannelConfiguration(10), }, - QueueIds = { [queueId] = new RouterQueueAssignment(), }, + QueueAssignments = { [queueId] = new RouterQueueAssignment(), }, AvailableForOffers = true, }); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Scenarios/AssignmentScenario.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Scenarios/AssignmentScenario.cs index efc58db27ecc..6ee6e4ee7f41 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Scenarios/AssignmentScenario.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Scenarios/AssignmentScenario.cs @@ -45,7 +45,7 @@ public async Task Scenario() var registerWorker = await client.CreateWorkerAsync( new CreateWorkerOptions(workerId: workerId1, totalCapacity: 1) { - QueueIds = { [queueResponse.Value.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [queueResponse.Value.Id] = new RouterQueueAssignment() }, ChannelConfigurations = { [channelResponse] = new ChannelConfiguration(1) }, AvailableForOffers = true, }); diff --git a/sdk/communication/Azure.Communication.JobRouter/tests/Scenarios/SchedulingScenario.cs b/sdk/communication/Azure.Communication.JobRouter/tests/Scenarios/SchedulingScenario.cs index 9eb8791fe76e..e242d0b6b7bf 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tests/Scenarios/SchedulingScenario.cs +++ b/sdk/communication/Azure.Communication.JobRouter/tests/Scenarios/SchedulingScenario.cs @@ -46,7 +46,7 @@ public async Task SimpleSchedulingScenario() var registerWorker = await client.CreateWorkerAsync( new CreateWorkerOptions(workerId: workerId1, totalCapacity: 1) { - QueueIds = { [queueResponse.Value.Id] = new RouterQueueAssignment() }, + QueueAssignments = { [queueResponse.Value.Id] = new RouterQueueAssignment() }, ChannelConfigurations = { [channelResponse] = new ChannelConfiguration(1) }, AvailableForOffers = true, });