Skip to content

Commit 15544b5

Browse files
author
awstools
committed
feat(client-connect): This release adds SearchUsers API which can be used to search for users with a Connect Instance
1 parent 0660dd0 commit 15544b5

File tree

10 files changed

+1194
-19
lines changed

10 files changed

+1194
-19
lines changed

clients/client-connect/src/Connect.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ import {
458458
SearchAvailablePhoneNumbersCommandInput,
459459
SearchAvailablePhoneNumbersCommandOutput,
460460
} from "./commands/SearchAvailablePhoneNumbersCommand";
461+
import { SearchUsersCommand, SearchUsersCommandInput, SearchUsersCommandOutput } from "./commands/SearchUsersCommand";
461462
import {
462463
SearchVocabulariesCommand,
463464
SearchVocabulariesCommandInput,
@@ -3901,6 +3902,32 @@ export class Connect extends ConnectClient {
39013902
}
39023903
}
39033904

3905+
/**
3906+
* <p>Searches users in an Amazon Connect instance, with optional filtering.</p>
3907+
*/
3908+
public searchUsers(args: SearchUsersCommandInput, options?: __HttpHandlerOptions): Promise<SearchUsersCommandOutput>;
3909+
public searchUsers(args: SearchUsersCommandInput, cb: (err: any, data?: SearchUsersCommandOutput) => void): void;
3910+
public searchUsers(
3911+
args: SearchUsersCommandInput,
3912+
options: __HttpHandlerOptions,
3913+
cb: (err: any, data?: SearchUsersCommandOutput) => void
3914+
): void;
3915+
public searchUsers(
3916+
args: SearchUsersCommandInput,
3917+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: SearchUsersCommandOutput) => void),
3918+
cb?: (err: any, data?: SearchUsersCommandOutput) => void
3919+
): Promise<SearchUsersCommandOutput> | void {
3920+
const command = new SearchUsersCommand(args);
3921+
if (typeof optionsOrCb === "function") {
3922+
this.send(command, optionsOrCb);
3923+
} else if (typeof cb === "function") {
3924+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
3925+
this.send(command, optionsOrCb || {}, cb);
3926+
} else {
3927+
return this.send(command, optionsOrCb);
3928+
}
3929+
}
3930+
39043931
/**
39053932
* <p>Searches for vocabularies within a specific Amazon Connect instance using <code>State</code>, <code>NameStartsWith</code>, and <code>LanguageCode</code>.</p>
39063933
*/

clients/client-connect/src/ConnectClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ import {
323323
SearchAvailablePhoneNumbersCommandInput,
324324
SearchAvailablePhoneNumbersCommandOutput,
325325
} from "./commands/SearchAvailablePhoneNumbersCommand";
326+
import { SearchUsersCommandInput, SearchUsersCommandOutput } from "./commands/SearchUsersCommand";
326327
import { SearchVocabulariesCommandInput, SearchVocabulariesCommandOutput } from "./commands/SearchVocabulariesCommand";
327328
import { StartChatContactCommandInput, StartChatContactCommandOutput } from "./commands/StartChatContactCommand";
328329
import {
@@ -567,6 +568,7 @@ export type ServiceInputTypes =
567568
| ReleasePhoneNumberCommandInput
568569
| ResumeContactRecordingCommandInput
569570
| SearchAvailablePhoneNumbersCommandInput
571+
| SearchUsersCommandInput
570572
| SearchVocabulariesCommandInput
571573
| StartChatContactCommandInput
572574
| StartContactRecordingCommandInput
@@ -711,6 +713,7 @@ export type ServiceOutputTypes =
711713
| ReleasePhoneNumberCommandOutput
712714
| ResumeContactRecordingCommandOutput
713715
| SearchAvailablePhoneNumbersCommandOutput
716+
| SearchUsersCommandOutput
714717
| SearchVocabulariesCommandOutput
715718
| StartChatContactCommandOutput
716719
| StartContactRecordingCommandOutput
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
3+
import { Command as $Command } from "@aws-sdk/smithy-client";
4+
import {
5+
FinalizeHandlerArguments,
6+
Handler,
7+
HandlerExecutionContext,
8+
HttpHandlerOptions as __HttpHandlerOptions,
9+
MetadataBearer as __MetadataBearer,
10+
MiddlewareStack,
11+
SerdeContext as __SerdeContext,
12+
} from "@aws-sdk/types";
13+
14+
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
15+
import { SearchUsersRequest, SearchUsersResponse } from "../models/models_1";
16+
import {
17+
deserializeAws_restJson1SearchUsersCommand,
18+
serializeAws_restJson1SearchUsersCommand,
19+
} from "../protocols/Aws_restJson1";
20+
21+
export interface SearchUsersCommandInput extends SearchUsersRequest {}
22+
export interface SearchUsersCommandOutput extends SearchUsersResponse, __MetadataBearer {}
23+
24+
/**
25+
* <p>Searches users in an Amazon Connect instance, with optional filtering.</p>
26+
* @example
27+
* Use a bare-bones client and the command you need to make an API call.
28+
* ```javascript
29+
* import { ConnectClient, SearchUsersCommand } from "@aws-sdk/client-connect"; // ES Modules import
30+
* // const { ConnectClient, SearchUsersCommand } = require("@aws-sdk/client-connect"); // CommonJS import
31+
* const client = new ConnectClient(config);
32+
* const command = new SearchUsersCommand(input);
33+
* const response = await client.send(command);
34+
* ```
35+
*
36+
* @see {@link SearchUsersCommandInput} for command's `input` shape.
37+
* @see {@link SearchUsersCommandOutput} for command's `response` shape.
38+
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
39+
*
40+
*/
41+
export class SearchUsersCommand extends $Command<
42+
SearchUsersCommandInput,
43+
SearchUsersCommandOutput,
44+
ConnectClientResolvedConfig
45+
> {
46+
// Start section: command_properties
47+
// End section: command_properties
48+
49+
constructor(readonly input: SearchUsersCommandInput) {
50+
// Start section: command_constructor
51+
super();
52+
// End section: command_constructor
53+
}
54+
55+
/**
56+
* @internal
57+
*/
58+
resolveMiddleware(
59+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
60+
configuration: ConnectClientResolvedConfig,
61+
options?: __HttpHandlerOptions
62+
): Handler<SearchUsersCommandInput, SearchUsersCommandOutput> {
63+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
64+
65+
const stack = clientStack.concat(this.middlewareStack);
66+
67+
const { logger } = configuration;
68+
const clientName = "ConnectClient";
69+
const commandName = "SearchUsersCommand";
70+
const handlerExecutionContext: HandlerExecutionContext = {
71+
logger,
72+
clientName,
73+
commandName,
74+
inputFilterSensitiveLog: SearchUsersRequest.filterSensitiveLog,
75+
outputFilterSensitiveLog: SearchUsersResponse.filterSensitiveLog,
76+
};
77+
const { requestHandler } = configuration;
78+
return stack.resolve(
79+
(request: FinalizeHandlerArguments<any>) =>
80+
requestHandler.handle(request.request as __HttpRequest, options || {}),
81+
handlerExecutionContext
82+
);
83+
}
84+
85+
private serialize(input: SearchUsersCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
86+
return serializeAws_restJson1SearchUsersCommand(input, context);
87+
}
88+
89+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<SearchUsersCommandOutput> {
90+
return deserializeAws_restJson1SearchUsersCommand(output, context);
91+
}
92+
93+
// Start section: command_body_extra
94+
// End section: command_body_extra
95+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export * from "./ListUsersCommand";
9696
export * from "./ReleasePhoneNumberCommand";
9797
export * from "./ResumeContactRecordingCommand";
9898
export * from "./SearchAvailablePhoneNumbersCommand";
99+
export * from "./SearchUsersCommand";
99100
export * from "./SearchVocabulariesCommand";
100101
export * from "./StartChatContactCommand";
101102
export * from "./StartContactRecordingCommand";

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ export namespace ClaimPhoneNumberRequest {
978978

979979
export interface ClaimPhoneNumberResponse {
980980
/**
981-
* <p>The identifier of the phone number.</p>
981+
* <p>A unique identifier for the phone number.</p>
982982
*/
983983
PhoneNumberId?: string;
984984

@@ -3408,7 +3408,7 @@ export namespace DescribeInstanceStorageConfigResponse {
34083408

34093409
export interface DescribePhoneNumberRequest {
34103410
/**
3411-
* <p>The identifier of the phone number.</p>
3411+
* <p>A unique identifier for the phone number.</p>
34123412
*/
34133413
PhoneNumberId: string | undefined;
34143414
}
@@ -3702,7 +3702,7 @@ export enum PhoneNumberType {
37023702
*/
37033703
export interface ClaimedPhoneNumberSummary {
37043704
/**
3705-
* <p>The identifier of the phone number.</p>
3705+
* <p>A unique identifier for the phone number.</p>
37063706
*/
37073707
PhoneNumberId?: string;
37083708

@@ -3758,8 +3758,7 @@ export namespace ClaimedPhoneNumberSummary {
37583758

37593759
export interface DescribePhoneNumberResponse {
37603760
/**
3761-
* <p>Information about a phone number that's been claimed to your Amazon Connect instance.
3762-
* </p>
3761+
* <p>Information about a phone number that's been claimed to your Amazon Connect instance.</p>
37633762
*/
37643763
ClaimedPhoneNumberSummary?: ClaimedPhoneNumberSummary;
37653764
}
@@ -4705,7 +4704,7 @@ export namespace DisassociateLexBotRequest {
47054704

47064705
export interface DisassociatePhoneNumberContactFlowRequest {
47074706
/**
4708-
* <p>The identifier of the phone number.</p>
4707+
* <p>A unique identifier for the phone number.</p>
47094708
*/
47104709
PhoneNumberId: string | undefined;
47114710

@@ -6921,7 +6920,7 @@ export namespace ListPhoneNumbersV2Request {
69216920
*/
69226921
export interface ListPhoneNumbersSummary {
69236922
/**
6924-
* <p>The identifier of the phone number.</p>
6923+
* <p>A unique identifier for the phone number.</p>
69256924
*/
69266925
PhoneNumberId?: string;
69276926

@@ -7925,7 +7924,7 @@ export namespace ListUsersResponse {
79257924

79267925
export interface ReleasePhoneNumberRequest {
79277926
/**
7928-
* <p>The identifier of the phone number.</p>
7927+
* <p>A unique identifier for the phone number.</p>
79297928
*/
79307929
PhoneNumberId: string | undefined;
79317930

0 commit comments

Comments
 (0)