Skip to content

Commit fccaad1

Browse files
committed
Adress comments
1 parent fee45f8 commit fccaad1

File tree

6 files changed

+83
-49
lines changed

6 files changed

+83
-49
lines changed

articles/communication-services/how-tos/router-sdk/azure-function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Inspect your deployed function in the Azure portal and locate the function Uri a
6767
await client.CreateClassificationPolicyAsync(
6868
options: new CreateClassificationPolicyOptions("policy-1")
6969
{
70-
PrioritizationRule = new AzureFunctionRule("<insert function uri>", new AzureFunctionRuleCredential("<insert function key>"))
70+
PrioritizationRule = new FunctionRule("<insert function uri>", new FunctionRuleCredential("<insert function key>"))
7171
}
7272
);
7373
```

articles/communication-services/how-tos/router-sdk/escalate-job.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,25 @@ Create an exception policy, which you will attach to the regular queue, which is
3838
await routerClient.CreateExceptionPolicyAsync(
3939
new CreateExceptionPolicyOptions(
4040
exceptionPolicyId: "Escalate_XBOX_Policy",
41-
exceptionRules: new List<ExceptionRule>()
41+
exceptionRules: new Dictionary<string, ExceptionRule>()
4242
{
4343
new (
44-
id: "Escalated_Rule",
45-
trigger: new WaitTimeExceptionTrigger(TimeSpan.FromMinutes(5)),
46-
actions: new List<ExceptionAction>()
4744
{
48-
new ReclassifyExceptionAction("EscalateReclassifyExceptionAction")
45+
["Escalated_Rule"] =
4946
{
50-
LabelsToUpsert = new LabelCollection(
51-
new Dictionary<string, object>
47+
id: "Escalated_Rule",
48+
trigger: new WaitTimeExceptionTrigger(TimeSpan.FromMinutes(5)),
49+
actions: new List<ExceptionAction>()
5250
{
53-
["Escalated"] = true,
54-
})
51+
new ReclassifyExceptionAction("EscalateReclassifyExceptionAction")
52+
{
53+
LabelsToUpsert = new LabelCollection(
54+
new Dictionary<string, object>
55+
{
56+
["Escalated"] = true,
57+
})
58+
}
59+
}
5560
}
5661
}
5762
)
@@ -73,9 +78,14 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
7378
PrioritizationRule = new ExpressionRule("If(job.Escalated = true, 10, 1)"),
7479
QueueSelectors = new List<QueueSelectorAttachment>()
7580
{
76-
new QueueIdSelector(
77-
new ExpressionRule(
78-
"If(job.Escalated = true, \"XBOX_Queue\", \"XBOX_Escalation_Queue\")"))
81+
new QueueLabelSelector()
82+
{
83+
LabelSelectors = new List<LabelSelectorAttachment>
84+
{
85+
new ExpressionRule(
86+
"If(job.Escalated = true, \"XBOX_Queue\", \"XBOX_Escalation_Queue\")"))
87+
}
88+
}
7989
},
8090
FallbackQueueId = "Default"
8191
});
@@ -112,11 +122,11 @@ When you submit the Job, specify the Classification Policy ID as follows. For th
112122
```csharp
113123
await routerClient.CreateJobAsync(
114124
options: new CreateJobWithClassificationPolicyOptions(
115-
jobId: "75c5612e-afb4-4e65-a0bf-3d1b950fad7b",
125+
jobId: "<jobId>",
116126
channelId: ManagedChannels.AcsVoiceChannel,
117127
classificationPolicyId: "Classify_XBOX_Voice_Jobs")
118128
{
119-
WorkerSelectors = new List<WorkerSelectorAttachment>
129+
RequestedWorkerSelectors = new List<WorkerSelector>
120130
{
121131
new WorkerSelector()
122132
{

articles/communication-services/how-tos/router-sdk/job-classification.md

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
3939
PrioritizationRule = new ExpressionRule("If(job.Hardware_VIP = true, 10, 1)"),
4040
QueueSelectors = new List<QueueSelectorAttachment>()
4141
{
42-
new QueueIdSelector(
43-
new ExpressionRule("If(job.Region = \"NA\", \"XBOX_NA_QUEUE\", \"XBOX_DEFAULT_QUEUE\")")
44-
),
42+
new QueueLabelSelector()
43+
{
44+
LabelSelectors = new List<LabelSelectorAttachment>
45+
{
46+
new ExpressionRule("If(job.Region = \"NA\", \"XBOX_NA_QUEUE\", \"XBOX_DEFAULT_QUEUE\")")
47+
}
48+
}
4549
}
4650
});
4751
```
@@ -78,7 +82,7 @@ The following example will cause the classification policy to evaluate the Job l
7882
```csharp
7983
var job = await routerClient.CreateJobAsync(
8084
options: new CreateJobWithClassificationPolicyOptions(
81-
jobId: "4ad7f4b9-a0ff-458d-b3ec-9f84be26012b",
85+
jobId: "<job id>",
8286
channelId: "voice",
8387
classificationPolicyId: "XBOX_NA_QUEUE_Priority_1_10")
8488
{
@@ -127,9 +131,15 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
127131
{
128132
WorkerSelectors = new List<WorkerSelectorAttachment>()
129133
{
130-
new StaticLabelSelector(
131-
new LabelSelector("Foo", LabelOperator.Equal, "Bar")
132-
)
134+
new StaticWorkerSelectorAttachment()
135+
{
136+
LabelSelector = new WorkerSelector()
137+
{
138+
Key = "Foo",
139+
LabelOperator = LabelOperator.Equal,
140+
Value = "Bar"
141+
}
142+
}
133143
}
134144
});
135145
```
@@ -164,12 +174,19 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
164174
{
165175
WorkerSelectors = new List<WorkerSelectorAttachment>()
166176
{
167-
new ConditionalLabelSelector(
168-
condition: new ExpressionRule("job.Urgent = true"),
169-
labelSelectors: new List<LabelSelector>
177+
new ConditionalWorkerSelectorAttachment()
178+
{
179+
Condition = new ExpressionRule("job.Urgent = true"),
180+
LabelSelectors = new List<WorkerSelector>
170181
{
171-
new LabelSelector("Foo", LabelOperator.Equal, "Bar")
182+
new WorkerSelector()
183+
{
184+
Key = "Foo",
185+
LabelOperator = LabelOperator.Equal,
186+
Value = "Bar"
187+
}
172188
})
189+
}
173190
}
174191
});
175192
```
@@ -246,18 +263,22 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
246263
{
247264
WorkerSelectors = new List<WorkerSelectorAttachment>()
248265
{
249-
new WeightedAllocation(
250-
weight: 0.3,
251-
labelSelectors: new List<LabelSelector>
266+
new WeightedAllocationWorkerSelectorAttachment()
267+
{
268+
Weight = 0.3,
269+
LabelSelectors = new List<WorkerSelector>
252270
{
253-
new LabelSelector("Vendor", LabelOperator.Equal, "A")
254-
}),
255-
new WeightedAllocation(
256-
weight: 0.7,
257-
labelSelectors: new List<LabelSelector>
271+
new WorkerSelector("Vendor", LabelOperator.Equal, "A")
272+
})
273+
},
274+
new WeightedAllocationWorkerSelectorAttachment()
275+
{
276+
Weight = 0.7,
277+
LabelSelectors = new List<WorkerSelector>
258278
{
259-
new LabelSelector("Vendor", LabelOperator.Equal, "B")
279+
new WorkerSelector("Vendor", LabelOperator.Equal, "B")
260280
})
281+
}
261282
}
262283
});
263284
```
@@ -297,15 +318,15 @@ Once the Job Router has received, and classified a Job using a policy, you have
297318
::: zone pivot="programming-language-csharp"
298319
299320
```csharp
300-
var reclassifiedJob = await routerClient.ReclassifyJobAsync("4ad7f4b9-a0ff-458d-b3ec-9f84be26012b");
321+
var reclassifiedJob = await routerClient.ReclassifyJobAsync("<job id>");
301322
```
302323
303324
::: zone-end
304325
305326
::: zone pivot="programming-language-javascript"
306327
307328
```typescript
308-
await client.reclassifyJob("4ad7f4b9-a0ff-458d-b3ec-9f84be26012b", {
329+
await client.reclassifyJob("<jobId>", {
309330
classificationPolicyId: null,
310331
labelsToUpdate: {
311332
Hardware_VIP: true

articles/communication-services/how-tos/router-sdk/manage-queue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ var distributionPolicy = await administrationClient.CreateDistributionPolicyAsyn
3737
minConcurrentOffers: 1,
3838
maxConcurrentOffers: 10)
3939
{
40-
Name = ""Longest Idle matching with a 45s offer expiration; min 1, max 10 offers"
40+
Name = "Longest Idle matching with a 45s offer expiration; min 1, max 10 offers"
4141
}
4242
);
4343

44-
var queue = await administrationClient.CreateQueue(
44+
var queue = await administrationClient.CreateQueueAsync(
4545
options: new CreateQueueOptions("XBOX_DEFAULT_QUEUE", "Longest_Idle_45s_Min1Max10")
4646
{
4747
Name = "XBOX Default Queue"

articles/communication-services/how-tos/router-sdk/preferred-worker.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ await routerClient.CreateJobAsync(
4040
channelId: "<channel id>",
4141
queueId: "<queue id>")
4242
{
43-
RequestedWorkerSelectors = new List<WorkerSelectorAttachment>
43+
RequestedWorkerSelectors = new List<WorkerSelector>
4444
{
45-
new LabelSelector(
46-
key: "Id",
47-
@operator: LabelOperator.Equal,
48-
value: "<preferred worker id>",
49-
ttl: TimeSpan.FromMinutes(1))
50-
})
45+
new WorkerSelector()
46+
{
47+
Key = "Id",
48+
Operator = LabelOperator.Equal,
49+
Value = "<preferred worker id>",
50+
TTL = TimeSpan.FromMinutes(1)
51+
}
52+
}
5153
});
5254
```
5355

articles/communication-services/quickstarts/router/get-started-router.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ var job = await routerClient.CreateJobAsync(
111111
options: new CreateJobOptions(
112112
jobId: jobId,
113113
channelId: "my-channel",
114-
queueId: queue.Value.Id) // this is optional
114+
queueId: queue.Value.Id)
115115
{
116116
Priority = 1,
117117
RequestedWorkerSelectors = new List<WorkerSelector>
@@ -127,7 +127,7 @@ var job = await routerClient.CreateJobAsync(
127127

128128
## Create a worker
129129

130-
Now, we create a worker to receive work from that queue, with a label of `Some-Skill` equal to 11 and capacity on `my-channel`.
130+
Now, we create a worker to receive work from that queue, with a label of `Some-Skill` equal to 11 and capacity on `my-channel`. Inorder for the worker to receive offers make sure that the property **AvailableForOffers** is set to **true**.
131131

132132
```csharp
133133
var worker = await routerClient.CreateWorkerAsync(
@@ -146,7 +146,8 @@ var worker = await routerClient.CreateWorkerAsync(
146146
Labels = new Dictionary<string, LabelValue>()
147147
{
148148
["Some-Skill"] = new LabelValue(11)
149-
}
149+
},
150+
AvailableForOffers = true
150151
}
151152
);
152153
```

0 commit comments

Comments
 (0)