Skip to content

Commit 47e52de

Browse files
author
awstools
committed
feat(client-connect): This release adds a new API, GetCurrentUserData, which returns real-time details about users' current activity.
1 parent 9a97d29 commit 47e52de

14 files changed

+1993
-702
lines changed

clients/client-connect/src/Connect.ts

+37
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ import {
319319
GetCurrentMetricDataCommandInput,
320320
GetCurrentMetricDataCommandOutput,
321321
} from "./commands/GetCurrentMetricDataCommand";
322+
import {
323+
GetCurrentUserDataCommand,
324+
GetCurrentUserDataCommandInput,
325+
GetCurrentUserDataCommandOutput,
326+
} from "./commands/GetCurrentUserDataCommand";
322327
import {
323328
GetFederationTokenCommand,
324329
GetFederationTokenCommandInput,
@@ -2887,6 +2892,38 @@ export class Connect extends ConnectClient {
28872892
}
28882893
}
28892894

2895+
/**
2896+
* <p>Gets the real-time active user data from the specified Amazon Connect instance. </p>
2897+
*/
2898+
public getCurrentUserData(
2899+
args: GetCurrentUserDataCommandInput,
2900+
options?: __HttpHandlerOptions
2901+
): Promise<GetCurrentUserDataCommandOutput>;
2902+
public getCurrentUserData(
2903+
args: GetCurrentUserDataCommandInput,
2904+
cb: (err: any, data?: GetCurrentUserDataCommandOutput) => void
2905+
): void;
2906+
public getCurrentUserData(
2907+
args: GetCurrentUserDataCommandInput,
2908+
options: __HttpHandlerOptions,
2909+
cb: (err: any, data?: GetCurrentUserDataCommandOutput) => void
2910+
): void;
2911+
public getCurrentUserData(
2912+
args: GetCurrentUserDataCommandInput,
2913+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetCurrentUserDataCommandOutput) => void),
2914+
cb?: (err: any, data?: GetCurrentUserDataCommandOutput) => void
2915+
): Promise<GetCurrentUserDataCommandOutput> | void {
2916+
const command = new GetCurrentUserDataCommand(args);
2917+
if (typeof optionsOrCb === "function") {
2918+
this.send(command, optionsOrCb);
2919+
} else if (typeof cb === "function") {
2920+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2921+
this.send(command, optionsOrCb || {}, cb);
2922+
} else {
2923+
return this.send(command, optionsOrCb);
2924+
}
2925+
}
2926+
28902927
/**
28912928
* <p>Retrieves a token for federation.</p>
28922929
* <note>

clients/client-connect/src/ConnectClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ import {
239239
GetCurrentMetricDataCommandInput,
240240
GetCurrentMetricDataCommandOutput,
241241
} from "./commands/GetCurrentMetricDataCommand";
242+
import { GetCurrentUserDataCommandInput, GetCurrentUserDataCommandOutput } from "./commands/GetCurrentUserDataCommand";
242243
import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "./commands/GetFederationTokenCommand";
243244
import { GetMetricDataCommandInput, GetMetricDataCommandOutput } from "./commands/GetMetricDataCommand";
244245
import { GetTaskTemplateCommandInput, GetTaskTemplateCommandOutput } from "./commands/GetTaskTemplateCommand";
@@ -545,6 +546,7 @@ export type ServiceInputTypes =
545546
| DisassociateSecurityKeyCommandInput
546547
| GetContactAttributesCommandInput
547548
| GetCurrentMetricDataCommandInput
549+
| GetCurrentUserDataCommandInput
548550
| GetFederationTokenCommandInput
549551
| GetMetricDataCommandInput
550552
| GetTaskTemplateCommandInput
@@ -697,6 +699,7 @@ export type ServiceOutputTypes =
697699
| DisassociateSecurityKeyCommandOutput
698700
| GetContactAttributesCommandOutput
699701
| GetCurrentMetricDataCommandOutput
702+
| GetCurrentUserDataCommandOutput
700703
| GetFederationTokenCommandOutput
701704
| GetMetricDataCommandOutput
702705
| GetTaskTemplateCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
16+
import { GetCurrentUserDataRequest, GetCurrentUserDataResponse } from "../models/models_0";
17+
import {
18+
deserializeAws_restJson1GetCurrentUserDataCommand,
19+
serializeAws_restJson1GetCurrentUserDataCommand,
20+
} from "../protocols/Aws_restJson1";
21+
22+
export interface GetCurrentUserDataCommandInput extends GetCurrentUserDataRequest {}
23+
export interface GetCurrentUserDataCommandOutput extends GetCurrentUserDataResponse, __MetadataBearer {}
24+
25+
/**
26+
* <p>Gets the real-time active user data from the specified Amazon Connect instance. </p>
27+
* @example
28+
* Use a bare-bones client and the command you need to make an API call.
29+
* ```javascript
30+
* import { ConnectClient, GetCurrentUserDataCommand } from "@aws-sdk/client-connect"; // ES Modules import
31+
* // const { ConnectClient, GetCurrentUserDataCommand } = require("@aws-sdk/client-connect"); // CommonJS import
32+
* const client = new ConnectClient(config);
33+
* const command = new GetCurrentUserDataCommand(input);
34+
* const response = await client.send(command);
35+
* ```
36+
*
37+
* @see {@link GetCurrentUserDataCommandInput} for command's `input` shape.
38+
* @see {@link GetCurrentUserDataCommandOutput} for command's `response` shape.
39+
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
40+
*
41+
*/
42+
export class GetCurrentUserDataCommand extends $Command<
43+
GetCurrentUserDataCommandInput,
44+
GetCurrentUserDataCommandOutput,
45+
ConnectClientResolvedConfig
46+
> {
47+
// Start section: command_properties
48+
// End section: command_properties
49+
50+
constructor(readonly input: GetCurrentUserDataCommandInput) {
51+
// Start section: command_constructor
52+
super();
53+
// End section: command_constructor
54+
}
55+
56+
/**
57+
* @internal
58+
*/
59+
resolveMiddleware(
60+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
61+
configuration: ConnectClientResolvedConfig,
62+
options?: __HttpHandlerOptions
63+
): Handler<GetCurrentUserDataCommandInput, GetCurrentUserDataCommandOutput> {
64+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
65+
66+
const stack = clientStack.concat(this.middlewareStack);
67+
68+
const { logger } = configuration;
69+
const clientName = "ConnectClient";
70+
const commandName = "GetCurrentUserDataCommand";
71+
const handlerExecutionContext: HandlerExecutionContext = {
72+
logger,
73+
clientName,
74+
commandName,
75+
inputFilterSensitiveLog: GetCurrentUserDataRequest.filterSensitiveLog,
76+
outputFilterSensitiveLog: GetCurrentUserDataResponse.filterSensitiveLog,
77+
};
78+
const { requestHandler } = configuration;
79+
return stack.resolve(
80+
(request: FinalizeHandlerArguments<any>) =>
81+
requestHandler.handle(request.request as __HttpRequest, options || {}),
82+
handlerExecutionContext
83+
);
84+
}
85+
86+
private serialize(input: GetCurrentUserDataCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
87+
return serializeAws_restJson1GetCurrentUserDataCommand(input, context);
88+
}
89+
90+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetCurrentUserDataCommandOutput> {
91+
return deserializeAws_restJson1GetCurrentUserDataCommand(output, context);
92+
}
93+
94+
// Start section: command_body_extra
95+
// End section: command_body_extra
96+
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
16-
import { ListQueuesRequest, ListQueuesResponse } from "../models/models_0";
16+
import { ListQueuesRequest, ListQueuesResponse } from "../models/models_1";
1717
import {
1818
deserializeAws_restJson1ListQueuesCommand,
1919
serializeAws_restJson1ListQueuesCommand,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
16-
import { ListQuickConnectsRequest, ListQuickConnectsResponse } from "../models/models_0";
16+
import { ListQuickConnectsRequest, ListQuickConnectsResponse } from "../models/models_1";
1717
import {
1818
deserializeAws_restJson1ListQuickConnectsCommand,
1919
serializeAws_restJson1ListQuickConnectsCommand,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
16-
import { ListRoutingProfileQueuesRequest, ListRoutingProfileQueuesResponse } from "../models/models_0";
16+
import { ListRoutingProfileQueuesRequest, ListRoutingProfileQueuesResponse } from "../models/models_1";
1717
import {
1818
deserializeAws_restJson1ListRoutingProfileQueuesCommand,
1919
serializeAws_restJson1ListRoutingProfileQueuesCommand,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
16-
import { ListRoutingProfilesRequest, ListRoutingProfilesResponse } from "../models/models_0";
16+
import { ListRoutingProfilesRequest, ListRoutingProfilesResponse } from "../models/models_1";
1717
import {
1818
deserializeAws_restJson1ListRoutingProfilesCommand,
1919
serializeAws_restJson1ListRoutingProfilesCommand,

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

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export * from "./DisassociateRoutingProfileQueuesCommand";
6565
export * from "./DisassociateSecurityKeyCommand";
6666
export * from "./GetContactAttributesCommand";
6767
export * from "./GetCurrentMetricDataCommand";
68+
export * from "./GetCurrentUserDataCommand";
6869
export * from "./GetFederationTokenCommand";
6970
export * from "./GetMetricDataCommand";
7071
export * from "./GetTaskTemplateCommand";

0 commit comments

Comments
 (0)