Skip to content

Commit

Permalink
feat(client-connect): This release adds a new API, GetCurrentUserData…
Browse files Browse the repository at this point in the history
…, which returns real-time details about users' current activity.
  • Loading branch information
awstools committed Jun 6, 2022
1 parent 9a97d29 commit 47e52de
Show file tree
Hide file tree
Showing 14 changed files with 1,993 additions and 702 deletions.
37 changes: 37 additions & 0 deletions clients/client-connect/src/Connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ import {
GetCurrentMetricDataCommandInput,
GetCurrentMetricDataCommandOutput,
} from "./commands/GetCurrentMetricDataCommand";
import {
GetCurrentUserDataCommand,
GetCurrentUserDataCommandInput,
GetCurrentUserDataCommandOutput,
} from "./commands/GetCurrentUserDataCommand";
import {
GetFederationTokenCommand,
GetFederationTokenCommandInput,
Expand Down Expand Up @@ -2887,6 +2892,38 @@ export class Connect extends ConnectClient {
}
}

/**
* <p>Gets the real-time active user data from the specified Amazon Connect instance. </p>
*/
public getCurrentUserData(
args: GetCurrentUserDataCommandInput,
options?: __HttpHandlerOptions
): Promise<GetCurrentUserDataCommandOutput>;
public getCurrentUserData(
args: GetCurrentUserDataCommandInput,
cb: (err: any, data?: GetCurrentUserDataCommandOutput) => void
): void;
public getCurrentUserData(
args: GetCurrentUserDataCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetCurrentUserDataCommandOutput) => void
): void;
public getCurrentUserData(
args: GetCurrentUserDataCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetCurrentUserDataCommandOutput) => void),
cb?: (err: any, data?: GetCurrentUserDataCommandOutput) => void
): Promise<GetCurrentUserDataCommandOutput> | void {
const command = new GetCurrentUserDataCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Retrieves a token for federation.</p>
* <note>
Expand Down
3 changes: 3 additions & 0 deletions clients/client-connect/src/ConnectClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ import {
GetCurrentMetricDataCommandInput,
GetCurrentMetricDataCommandOutput,
} from "./commands/GetCurrentMetricDataCommand";
import { GetCurrentUserDataCommandInput, GetCurrentUserDataCommandOutput } from "./commands/GetCurrentUserDataCommand";
import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "./commands/GetFederationTokenCommand";
import { GetMetricDataCommandInput, GetMetricDataCommandOutput } from "./commands/GetMetricDataCommand";
import { GetTaskTemplateCommandInput, GetTaskTemplateCommandOutput } from "./commands/GetTaskTemplateCommand";
Expand Down Expand Up @@ -545,6 +546,7 @@ export type ServiceInputTypes =
| DisassociateSecurityKeyCommandInput
| GetContactAttributesCommandInput
| GetCurrentMetricDataCommandInput
| GetCurrentUserDataCommandInput
| GetFederationTokenCommandInput
| GetMetricDataCommandInput
| GetTaskTemplateCommandInput
Expand Down Expand Up @@ -697,6 +699,7 @@ export type ServiceOutputTypes =
| DisassociateSecurityKeyCommandOutput
| GetContactAttributesCommandOutput
| GetCurrentMetricDataCommandOutput
| GetCurrentUserDataCommandOutput
| GetFederationTokenCommandOutput
| GetMetricDataCommandOutput
| GetTaskTemplateCommandOutput
Expand Down
96 changes: 96 additions & 0 deletions clients/client-connect/src/commands/GetCurrentUserDataCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// smithy-typescript generated code
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { GetCurrentUserDataRequest, GetCurrentUserDataResponse } from "../models/models_0";
import {
deserializeAws_restJson1GetCurrentUserDataCommand,
serializeAws_restJson1GetCurrentUserDataCommand,
} from "../protocols/Aws_restJson1";

export interface GetCurrentUserDataCommandInput extends GetCurrentUserDataRequest {}
export interface GetCurrentUserDataCommandOutput extends GetCurrentUserDataResponse, __MetadataBearer {}

/**
* <p>Gets the real-time active user data from the specified Amazon Connect instance. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ConnectClient, GetCurrentUserDataCommand } from "@aws-sdk/client-connect"; // ES Modules import
* // const { ConnectClient, GetCurrentUserDataCommand } = require("@aws-sdk/client-connect"); // CommonJS import
* const client = new ConnectClient(config);
* const command = new GetCurrentUserDataCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetCurrentUserDataCommandInput} for command's `input` shape.
* @see {@link GetCurrentUserDataCommandOutput} for command's `response` shape.
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
*
*/
export class GetCurrentUserDataCommand extends $Command<
GetCurrentUserDataCommandInput,
GetCurrentUserDataCommandOutput,
ConnectClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: GetCurrentUserDataCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ConnectClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetCurrentUserDataCommandInput, GetCurrentUserDataCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "ConnectClient";
const commandName = "GetCurrentUserDataCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: GetCurrentUserDataRequest.filterSensitiveLog,
outputFilterSensitiveLog: GetCurrentUserDataResponse.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: GetCurrentUserDataCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1GetCurrentUserDataCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetCurrentUserDataCommandOutput> {
return deserializeAws_restJson1GetCurrentUserDataCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
2 changes: 1 addition & 1 deletion clients/client-connect/src/commands/ListQueuesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@aws-sdk/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { ListQueuesRequest, ListQueuesResponse } from "../models/models_0";
import { ListQueuesRequest, ListQueuesResponse } from "../models/models_1";
import {
deserializeAws_restJson1ListQueuesCommand,
serializeAws_restJson1ListQueuesCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@aws-sdk/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { ListQuickConnectsRequest, ListQuickConnectsResponse } from "../models/models_0";
import { ListQuickConnectsRequest, ListQuickConnectsResponse } from "../models/models_1";
import {
deserializeAws_restJson1ListQuickConnectsCommand,
serializeAws_restJson1ListQuickConnectsCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@aws-sdk/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { ListRoutingProfileQueuesRequest, ListRoutingProfileQueuesResponse } from "../models/models_0";
import { ListRoutingProfileQueuesRequest, ListRoutingProfileQueuesResponse } from "../models/models_1";
import {
deserializeAws_restJson1ListRoutingProfileQueuesCommand,
serializeAws_restJson1ListRoutingProfileQueuesCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@aws-sdk/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { ListRoutingProfilesRequest, ListRoutingProfilesResponse } from "../models/models_0";
import { ListRoutingProfilesRequest, ListRoutingProfilesResponse } from "../models/models_1";
import {
deserializeAws_restJson1ListRoutingProfilesCommand,
serializeAws_restJson1ListRoutingProfilesCommand,
Expand Down
1 change: 1 addition & 0 deletions clients/client-connect/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export * from "./DisassociateRoutingProfileQueuesCommand";
export * from "./DisassociateSecurityKeyCommand";
export * from "./GetContactAttributesCommand";
export * from "./GetCurrentMetricDataCommand";
export * from "./GetCurrentUserDataCommand";
export * from "./GetFederationTokenCommand";
export * from "./GetMetricDataCommand";
export * from "./GetTaskTemplateCommand";
Expand Down
Loading

0 comments on commit 47e52de

Please sign in to comment.