Skip to content

Commit 2adc9d0

Browse files
author
awstools
committed
feat(client-connect): This release adds a new MonitorContact API for initiating monitoring of ongoing Voice and Chat contacts.
1 parent 6aa6b3a commit 2adc9d0

File tree

9 files changed

+418
-43
lines changed

9 files changed

+418
-43
lines changed

clients/client-connect/src/Connect.ts

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,11 @@ import {
499499
ListUserHierarchyGroupsCommandOutput,
500500
} from "./commands/ListUserHierarchyGroupsCommand";
501501
import { ListUsersCommand, ListUsersCommandInput, ListUsersCommandOutput } from "./commands/ListUsersCommand";
502+
import {
503+
MonitorContactCommand,
504+
MonitorContactCommandInput,
505+
MonitorContactCommandOutput,
506+
} from "./commands/MonitorContactCommand";
502507
import {
503508
PutUserStatusCommand,
504509
PutUserStatusCommandInput,
@@ -3043,8 +3048,9 @@ export class Connect extends ConnectClient {
30433048
/**
30443049
* <p>Dismisses contacts from an agent’s CCP and returns the agent to an available state, which
30453050
* allows the agent to receive a new routed contact. Contacts can only be dismissed if they are in a
3046-
* <code>MISSED</code>, <code>ERROR</code>, <code>ENDED</code>, or <code>REJECTED</code> state in the
3047-
* <a href="https://docs.aws.amazon.com/connect/latest/adminguide/about-contact-states.html">Agent Event Stream</a>.</p>
3051+
* <code>MISSED</code>, <code>ERROR</code>, <code>ENDED</code>, or <code>REJECTED</code> state in
3052+
* the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/about-contact-states.html">Agent
3053+
* Event Stream</a>.</p>
30483054
*/
30493055
public dismissUserContact(
30503056
args: DismissUserContactCommandInput,
@@ -4337,6 +4343,39 @@ export class Connect extends ConnectClient {
43374343
}
43384344
}
43394345

4346+
/**
4347+
* <p>Initiates silent monitoring of a contact. The Contact Control Panel (CCP) of the user specified by
4348+
* <i>userId</i> will be set to silent monitoring mode on the contact.</p>
4349+
*/
4350+
public monitorContact(
4351+
args: MonitorContactCommandInput,
4352+
options?: __HttpHandlerOptions
4353+
): Promise<MonitorContactCommandOutput>;
4354+
public monitorContact(
4355+
args: MonitorContactCommandInput,
4356+
cb: (err: any, data?: MonitorContactCommandOutput) => void
4357+
): void;
4358+
public monitorContact(
4359+
args: MonitorContactCommandInput,
4360+
options: __HttpHandlerOptions,
4361+
cb: (err: any, data?: MonitorContactCommandOutput) => void
4362+
): void;
4363+
public monitorContact(
4364+
args: MonitorContactCommandInput,
4365+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: MonitorContactCommandOutput) => void),
4366+
cb?: (err: any, data?: MonitorContactCommandOutput) => void
4367+
): Promise<MonitorContactCommandOutput> | void {
4368+
const command = new MonitorContactCommand(args);
4369+
if (typeof optionsOrCb === "function") {
4370+
this.send(command, optionsOrCb);
4371+
} else if (typeof cb === "function") {
4372+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
4373+
this.send(command, optionsOrCb || {}, cb);
4374+
} else {
4375+
return this.send(command, optionsOrCb);
4376+
}
4377+
}
4378+
43404379
/**
43414380
* <p>Changes the current status of a user or agent in Amazon Connect. If the agent is
43424381
* currently handling a contact, this sets the agent's next status.</p>

clients/client-connect/src/ConnectClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ import {
336336
ListUserHierarchyGroupsCommandOutput,
337337
} from "./commands/ListUserHierarchyGroupsCommand";
338338
import { ListUsersCommandInput, ListUsersCommandOutput } from "./commands/ListUsersCommand";
339+
import { MonitorContactCommandInput, MonitorContactCommandOutput } from "./commands/MonitorContactCommand";
339340
import { PutUserStatusCommandInput, PutUserStatusCommandOutput } from "./commands/PutUserStatusCommand";
340341
import { ReleasePhoneNumberCommandInput, ReleasePhoneNumberCommandOutput } from "./commands/ReleasePhoneNumberCommand";
341342
import { ReplicateInstanceCommandInput, ReplicateInstanceCommandOutput } from "./commands/ReplicateInstanceCommand";
@@ -621,6 +622,7 @@ export type ServiceInputTypes =
621622
| ListUseCasesCommandInput
622623
| ListUserHierarchyGroupsCommandInput
623624
| ListUsersCommandInput
625+
| MonitorContactCommandInput
624626
| PutUserStatusCommandInput
625627
| ReleasePhoneNumberCommandInput
626628
| ReplicateInstanceCommandInput
@@ -785,6 +787,7 @@ export type ServiceOutputTypes =
785787
| ListUseCasesCommandOutput
786788
| ListUserHierarchyGroupsCommandOutput
787789
| ListUsersCommandOutput
790+
| MonitorContactCommandOutput
788791
| PutUserStatusCommandOutput
789792
| ReleasePhoneNumberCommandOutput
790793
| ReplicateInstanceCommandOutput

clients/client-connect/src/commands/DismissUserContactCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ export interface DismissUserContactCommandOutput extends DismissUserContactRespo
3131
/**
3232
* <p>Dismisses contacts from an agent’s CCP and returns the agent to an available state, which
3333
* allows the agent to receive a new routed contact. Contacts can only be dismissed if they are in a
34-
* <code>MISSED</code>, <code>ERROR</code>, <code>ENDED</code>, or <code>REJECTED</code> state in the
35-
* <a href="https://docs.aws.amazon.com/connect/latest/adminguide/about-contact-states.html">Agent Event Stream</a>.</p>
34+
* <code>MISSED</code>, <code>ERROR</code>, <code>ENDED</code>, or <code>REJECTED</code> state in
35+
* the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/about-contact-states.html">Agent
36+
* Event Stream</a>.</p>
3637
* @example
3738
* Use a bare-bones client and the command you need to make an API call.
3839
* ```javascript

clients/client-connect/src/commands/ListLambdaFunctionsCommand.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ import {
1414
} from "@aws-sdk/types";
1515

1616
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
17-
import { ListLambdaFunctionsRequest, ListLambdaFunctionsRequestFilterSensitiveLog } from "../models/models_0";
18-
import { ListLambdaFunctionsResponse, ListLambdaFunctionsResponseFilterSensitiveLog } from "../models/models_1";
17+
import {
18+
ListLambdaFunctionsRequest,
19+
ListLambdaFunctionsRequestFilterSensitiveLog,
20+
ListLambdaFunctionsResponse,
21+
ListLambdaFunctionsResponseFilterSensitiveLog,
22+
} from "../models/models_1";
1923
import {
2024
deserializeAws_restJson1ListLambdaFunctionsCommand,
2125
serializeAws_restJson1ListLambdaFunctionsCommand,
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
5+
import { Command as $Command } from "@aws-sdk/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@aws-sdk/types";
15+
16+
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
17+
import {
18+
MonitorContactRequest,
19+
MonitorContactRequestFilterSensitiveLog,
20+
MonitorContactResponse,
21+
MonitorContactResponseFilterSensitiveLog,
22+
} from "../models/models_1";
23+
import {
24+
deserializeAws_restJson1MonitorContactCommand,
25+
serializeAws_restJson1MonitorContactCommand,
26+
} from "../protocols/Aws_restJson1";
27+
28+
export interface MonitorContactCommandInput extends MonitorContactRequest {}
29+
export interface MonitorContactCommandOutput extends MonitorContactResponse, __MetadataBearer {}
30+
31+
/**
32+
* <p>Initiates silent monitoring of a contact. The Contact Control Panel (CCP) of the user specified by
33+
* <i>userId</i> will be set to silent monitoring mode on the contact.</p>
34+
* @example
35+
* Use a bare-bones client and the command you need to make an API call.
36+
* ```javascript
37+
* import { ConnectClient, MonitorContactCommand } from "@aws-sdk/client-connect"; // ES Modules import
38+
* // const { ConnectClient, MonitorContactCommand } = require("@aws-sdk/client-connect"); // CommonJS import
39+
* const client = new ConnectClient(config);
40+
* const command = new MonitorContactCommand(input);
41+
* const response = await client.send(command);
42+
* ```
43+
*
44+
* @see {@link MonitorContactCommandInput} for command's `input` shape.
45+
* @see {@link MonitorContactCommandOutput} for command's `response` shape.
46+
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
47+
*
48+
*/
49+
export class MonitorContactCommand extends $Command<
50+
MonitorContactCommandInput,
51+
MonitorContactCommandOutput,
52+
ConnectClientResolvedConfig
53+
> {
54+
// Start section: command_properties
55+
// End section: command_properties
56+
57+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
58+
return {
59+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
60+
Endpoint: { type: "builtInParams", name: "endpoint" },
61+
Region: { type: "builtInParams", name: "region" },
62+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
63+
};
64+
}
65+
66+
constructor(readonly input: MonitorContactCommandInput) {
67+
// Start section: command_constructor
68+
super();
69+
// End section: command_constructor
70+
}
71+
72+
/**
73+
* @internal
74+
*/
75+
resolveMiddleware(
76+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
77+
configuration: ConnectClientResolvedConfig,
78+
options?: __HttpHandlerOptions
79+
): Handler<MonitorContactCommandInput, MonitorContactCommandOutput> {
80+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
81+
this.middlewareStack.use(
82+
getEndpointPlugin(configuration, MonitorContactCommand.getEndpointParameterInstructions())
83+
);
84+
85+
const stack = clientStack.concat(this.middlewareStack);
86+
87+
const { logger } = configuration;
88+
const clientName = "ConnectClient";
89+
const commandName = "MonitorContactCommand";
90+
const handlerExecutionContext: HandlerExecutionContext = {
91+
logger,
92+
clientName,
93+
commandName,
94+
inputFilterSensitiveLog: MonitorContactRequestFilterSensitiveLog,
95+
outputFilterSensitiveLog: MonitorContactResponseFilterSensitiveLog,
96+
};
97+
const { requestHandler } = configuration;
98+
return stack.resolve(
99+
(request: FinalizeHandlerArguments<any>) =>
100+
requestHandler.handle(request.request as __HttpRequest, options || {}),
101+
handlerExecutionContext
102+
);
103+
}
104+
105+
private serialize(input: MonitorContactCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
106+
return serializeAws_restJson1MonitorContactCommand(input, context);
107+
}
108+
109+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<MonitorContactCommandOutput> {
110+
return deserializeAws_restJson1MonitorContactCommand(output, context);
111+
}
112+
113+
// Start section: command_body_extra
114+
// End section: command_body_extra
115+
}

clients/client-connect/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export * from "./ListTrafficDistributionGroupsCommand";
105105
export * from "./ListUseCasesCommand";
106106
export * from "./ListUserHierarchyGroupsCommand";
107107
export * from "./ListUsersCommand";
108+
export * from "./MonitorContactCommand";
108109
export * from "./PutUserStatusCommand";
109110
export * from "./ReleasePhoneNumberCommand";
110111
export * from "./ReplicateInstanceCommand";

clients/client-connect/src/models/models_0.ts

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ export interface AgentStatusSummary {
218218
Type?: AgentStatusType | string;
219219
}
220220

221+
export enum MonitorCapability {
222+
BARGE = "BARGE",
223+
SILENT_MONITOR = "SILENT_MONITOR",
224+
}
225+
221226
export interface AssociateApprovedOriginRequest {
222227
/**
223228
* <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.</p>
@@ -824,6 +829,7 @@ export interface ClaimPhoneNumberRequest {
824829
* request. If not provided, the Amazon Web Services
825830
* SDK populates this field. For more information about idempotency, see
826831
* <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
832+
*
827833
* <p>Pattern: <code>^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$</code>
828834
* </p>
829835
*/
@@ -4119,7 +4125,8 @@ export interface DismissUserContactRequest {
41194125
UserId: string | undefined;
41204126

41214127
/**
4122-
* <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.</p>
4128+
* <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the
4129+
* instance.</p>
41234130
*/
41244131
InstanceId: string | undefined;
41254132

@@ -4226,10 +4233,20 @@ export interface GetCurrentMetricDataRequest {
42264233
/**
42274234
* <p>The grouping applied to the metrics returned. For example, when grouped by
42284235
* <code>QUEUE</code>, the metrics returned apply to each queue rather than aggregated for all
4229-
* queues. If you group by <code>CHANNEL</code>, you should include a Channels filter.
4230-
* VOICE, CHAT, and TASK channels are supported.</p>
4231-
* <p>If no <code>Grouping</code> is included in the request, a summary of metrics is
4232-
* returned.</p>
4236+
* queues. </p>
4237+
* <ul>
4238+
* <li>
4239+
* <p>If you group by <code>CHANNEL</code>, you should include a Channels filter.
4240+
* VOICE, CHAT, and TASK channels are supported.</p>
4241+
* </li>
4242+
* <li>
4243+
* <p>If you group by <code>ROUTING_PROFILE</code>, you must include either a queue or routing profile filter.</p>
4244+
* </li>
4245+
* <li>
4246+
* <p>If no <code>Grouping</code> is included in the request, a summary of metrics is
4247+
* returned.</p>
4248+
* </li>
4249+
* </ul>
42334250
*/
42344251
Groupings?: (Grouping | string)[];
42354252

@@ -6002,24 +6019,6 @@ export interface ListIntegrationAssociationsResponse {
60026019
NextToken?: string;
60036020
}
60046021

6005-
export interface ListLambdaFunctionsRequest {
6006-
/**
6007-
* <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.</p>
6008-
*/
6009-
InstanceId: string | undefined;
6010-
6011-
/**
6012-
* <p>The token for the next set of results. Use the value returned in the previous
6013-
* response in the next request to retrieve the next set of results.</p>
6014-
*/
6015-
NextToken?: string;
6016-
6017-
/**
6018-
* <p>The maximum number of results to return per page.</p>
6019-
*/
6020-
MaxResults?: number;
6021-
}
6022-
60236022
/**
60246023
* @internal
60256024
*/
@@ -7764,10 +7763,3 @@ export const ListIntegrationAssociationsResponseFilterSensitiveLog = (
77647763
): any => ({
77657764
...obj,
77667765
});
7767-
7768-
/**
7769-
* @internal
7770-
*/
7771-
export const ListLambdaFunctionsRequestFilterSensitiveLog = (obj: ListLambdaFunctionsRequest): any => ({
7772-
...obj,
7773-
});

0 commit comments

Comments
 (0)