Skip to content

Commit ae0500b

Browse files
author
awstools
committed
feat(client-customer-profiles): This release enhances the SearchProfiles API by providing functionality to search for profiles using multiple keys and logical operators.
1 parent 1b96437 commit ae0500b

File tree

6 files changed

+169
-23
lines changed

6 files changed

+169
-23
lines changed

clients/client-customer-profiles/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@ AWS SDK for JavaScript CustomerProfiles Client for Node.js, Browser and React Na
1111

1212
<fullname>Amazon Connect Customer Profiles</fullname>
1313

14-
<p>Welcome to the Amazon Connect Customer Profiles API Reference. This guide provides information
15-
about the Amazon Connect Customer Profiles API, including supported operations, data types,
16-
parameters, and schemas.</p>
1714
<p>Amazon Connect Customer Profiles is a unified customer profile for your contact center that has
1815
pre-built connectors powered by AppFlow that make it easy to combine customer information
1916
from third party applications, such as Salesforce (CRM), ServiceNow (ITSM), and your
20-
enterprise resource planning (ERP), with contact history from your Amazon Connect contact
21-
center.</p>
22-
<p>If you're new to Amazon Connect , you might find it helpful to also review the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html">Amazon Connect Administrator Guide</a>.</p>
17+
enterprise resource planning (ERP), with contact history from your Amazon Connect contact center.
18+
If you're new to Amazon Connect, you might find it helpful to review the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/">Amazon Connect Administrator Guide</a>.</p>
2319

2420
## Installing
2521

clients/client-customer-profiles/src/CustomerProfiles.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,11 @@ import { CustomerProfilesClient } from "./CustomerProfilesClient";
175175

176176
/**
177177
* <fullname>Amazon Connect Customer Profiles</fullname>
178-
* <p>Welcome to the Amazon Connect Customer Profiles API Reference. This guide provides information
179-
* about the Amazon Connect Customer Profiles API, including supported operations, data types,
180-
* parameters, and schemas.</p>
181178
* <p>Amazon Connect Customer Profiles is a unified customer profile for your contact center that has
182179
* pre-built connectors powered by AppFlow that make it easy to combine customer information
183180
* from third party applications, such as Salesforce (CRM), ServiceNow (ITSM), and your
184-
* enterprise resource planning (ERP), with contact history from your Amazon Connect contact
185-
* center.</p>
186-
* <p>If you're new to Amazon Connect , you might find it helpful to also review the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html">Amazon Connect Administrator Guide</a>.</p>
181+
* enterprise resource planning (ERP), with contact history from your Amazon Connect contact center.
182+
* If you're new to Amazon Connect, you might find it helpful to review the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/">Amazon Connect Administrator Guide</a>.</p>
187183
*/
188184
export class CustomerProfiles extends CustomerProfilesClient {
189185
/**
@@ -1358,8 +1354,11 @@ export class CustomerProfiles extends CustomerProfilesClient {
13581354
}
13591355

13601356
/**
1361-
* <p>Searches for profiles within a specific domain name using name, phone number, email
1362-
* address, account number, or a custom defined index.</p>
1357+
* <p>Searches for profiles within a specific domain using one or more predefined search keys
1358+
* (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined search keys. A search key
1359+
* is a data type pair that consists of a <code>KeyName</code> and <code>Values</code> list.</p>
1360+
* <p>This operation supports searching for profiles with a minimum of 1 key-value(s) pair and up to
1361+
* 5 key-value(s) pairs using either <code>AND</code> or <code>OR</code> logic.</p>
13631362
*/
13641363
public searchProfiles(
13651364
args: SearchProfilesCommandInput,

clients/client-customer-profiles/src/CustomerProfilesClient.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,11 @@ export interface CustomerProfilesClientResolvedConfig extends CustomerProfilesCl
363363

364364
/**
365365
* <fullname>Amazon Connect Customer Profiles</fullname>
366-
* <p>Welcome to the Amazon Connect Customer Profiles API Reference. This guide provides information
367-
* about the Amazon Connect Customer Profiles API, including supported operations, data types,
368-
* parameters, and schemas.</p>
369366
* <p>Amazon Connect Customer Profiles is a unified customer profile for your contact center that has
370367
* pre-built connectors powered by AppFlow that make it easy to combine customer information
371368
* from third party applications, such as Salesforce (CRM), ServiceNow (ITSM), and your
372-
* enterprise resource planning (ERP), with contact history from your Amazon Connect contact
373-
* center.</p>
374-
* <p>If you're new to Amazon Connect , you might find it helpful to also review the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html">Amazon Connect Administrator Guide</a>.</p>
369+
* enterprise resource planning (ERP), with contact history from your Amazon Connect contact center.
370+
* If you're new to Amazon Connect, you might find it helpful to review the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/">Amazon Connect Administrator Guide</a>.</p>
375371
*/
376372
export class CustomerProfilesClient extends __Client<
377373
__HttpHandlerOptions,

clients/client-customer-profiles/src/commands/SearchProfilesCommand.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ export interface SearchProfilesCommandInput extends SearchProfilesRequest {}
2929
export interface SearchProfilesCommandOutput extends SearchProfilesResponse, __MetadataBearer {}
3030

3131
/**
32-
* <p>Searches for profiles within a specific domain name using name, phone number, email
33-
* address, account number, or a custom defined index.</p>
32+
* <p>Searches for profiles within a specific domain using one or more predefined search keys
33+
* (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined search keys. A search key
34+
* is a data type pair that consists of a <code>KeyName</code> and <code>Values</code> list.</p>
35+
* <p>This operation supports searching for profiles with a minimum of 1 key-value(s) pair and up to
36+
* 5 key-value(s) pairs using either <code>AND</code> or <code>OR</code> logic.</p>
3437
* @example
3538
* Use a bare-bones client and the command you need to make an API call.
3639
* ```javascript

clients/client-customer-profiles/src/models/models_0.ts

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@ export class AccessDeniedException extends __BaseException {
2424
}
2525
}
2626

27+
/**
28+
* <p>A data type pair that consists of a <code>KeyName</code> and <code>Values</code> list that is
29+
* used in conjunction with the
30+
* <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html#customerprofiles-SearchProfiles-request-KeyName">KeyName</a>
31+
* and
32+
* <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html#customerprofiles-SearchProfiles-request-Values">Values</a>
33+
* parameters to search for profiles using the <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html">SearchProfiles</a> API.</p>
34+
*/
35+
export interface AdditionalSearchKey {
36+
/**
37+
* <p>A searchable identifier of a customer profile.</p>
38+
*/
39+
KeyName: string | undefined;
40+
41+
/**
42+
* <p>A list of key values.</p>
43+
*/
44+
Values: string[] | undefined;
45+
}
46+
2747
export interface AddProfileKeyRequest {
2848
/**
2949
* <p>The unique identifier of a customer profile.</p>
@@ -3109,6 +3129,11 @@ export interface PutProfileObjectTypeResponse {
31093129
Tags?: Record<string, string>;
31103130
}
31113131

3132+
export enum LogicalOperator {
3133+
AND = "AND",
3134+
OR = "OR",
3135+
}
3136+
31123137
export interface SearchProfilesRequest {
31133138
/**
31143139
* <p>The pagination token from the previous SearchProfiles API call.</p>
@@ -3117,6 +3142,7 @@ export interface SearchProfilesRequest {
31173142

31183143
/**
31193144
* <p>The maximum number of objects returned per page.</p>
3145+
* <p>The default is 20 if this parameter is not included in the request.</p>
31203146
*/
31213147
MaxResults?: number;
31223148

@@ -3139,6 +3165,51 @@ export interface SearchProfilesRequest {
31393165
* <p>A list of key values.</p>
31403166
*/
31413167
Values: string[] | undefined;
3168+
3169+
/**
3170+
* <p>A list of <code>AdditionalSearchKey</code> objects that are each searchable identifiers of a
3171+
* profile. Each <code>AdditionalSearchKey</code> object contains a <code>KeyName</code> and a
3172+
* list of <code>Values</code> associated with that specific key (i.e., a key-value(s) pair).
3173+
* These additional search keys will be used in conjunction with the <code>LogicalOperator</code> and the
3174+
* required <code>KeyName</code> and <code>Values</code> parameters to search for profiles
3175+
* that satisfy the search criteria. </p>
3176+
*/
3177+
AdditionalSearchKeys?: AdditionalSearchKey[];
3178+
3179+
/**
3180+
* <p>Relationship between all specified search keys that will be used to search for
3181+
* profiles. This includes the required <code>KeyName</code> and <code>Values</code> parameters
3182+
* as well as any key-value(s) pairs specified in the <code>AdditionalSearchKeys</code> list.</p>
3183+
* <p>This parameter influences which profiles will be returned in the response in the following manner:</p>
3184+
* <ul>
3185+
* <li>
3186+
* <p>
3187+
* <code>AND</code> - The response only includes profiles that match all of the search keys.</p>
3188+
* </li>
3189+
* <li>
3190+
* <p>
3191+
* <code>OR</code> - The response includes profiles that match at least one of the search keys.</p>
3192+
* </li>
3193+
* </ul>
3194+
* <p>The <code>OR</code> relationship is the default behavior if this parameter is not included in the request.</p>
3195+
*/
3196+
LogicalOperator?: LogicalOperator | string;
3197+
}
3198+
3199+
/**
3200+
* <p>A data type pair that consists of a <code>KeyName</code> and <code>Values</code> list that were used
3201+
* to find a profile returned in response to a <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html">SearchProfiles</a> request. </p>
3202+
*/
3203+
export interface FoundByKeyValue {
3204+
/**
3205+
* <p>A searchable identifier of a customer profile.</p>
3206+
*/
3207+
KeyName?: string;
3208+
3209+
/**
3210+
* <p>A list of key values.</p>
3211+
*/
3212+
Values?: string[];
31423213
}
31433214

31443215
/**
@@ -3257,11 +3328,36 @@ export interface Profile {
32573328
* <p>A key value pair of attributes of a customer profile.</p>
32583329
*/
32593330
Attributes?: Record<string, string>;
3331+
3332+
/**
3333+
* <p>A list of items used to find a profile returned in a <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html">SearchProfiles</a> response.
3334+
* An item is a key-value(s) pair that matches an attribute in the profile.</p>
3335+
* <p>If the optional <code>AdditionalSearchKeys</code> parameter was included in the
3336+
* <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html">SearchProfiles</a> request, the <code>FoundByItems</code> list should be
3337+
* interpreted based on the <code>LogicalOperator</code> used in the request:</p>
3338+
* <ul>
3339+
* <li>
3340+
* <p>
3341+
* <code>AND</code> - The profile included in the response matched all of the search keys
3342+
* specified in the request. The <code>FoundByItems</code> will include all of the key-value(s)
3343+
* pairs that were specified in the request (as this is a requirement of <code>AND</code> search logic).</p>
3344+
* </li>
3345+
* <li>
3346+
* <p>
3347+
* <code>OR</code> - The profile included in the response matched at least one of the
3348+
* search keys specified in the request. The <code>FoundByItems</code> will
3349+
* include each of the key-value(s) pairs that the profile was found by.</p>
3350+
* </li>
3351+
* </ul>
3352+
* <p>The <code>OR</code> relationship is the default behavior if the <code>LogicalOperator</code> parameter is
3353+
* not included in the <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html">SearchProfiles</a> request.</p>
3354+
*/
3355+
FoundByItems?: FoundByKeyValue[];
32603356
}
32613357

32623358
export interface SearchProfilesResponse {
32633359
/**
3264-
* <p>The list of SearchProfiles instances.</p>
3360+
* <p>The list of Profiles matching the search criteria.</p>
32653361
*/
32663362
Items?: Profile[];
32673363

@@ -3577,6 +3673,13 @@ export interface UpdateProfileResponse {
35773673
ProfileId: string | undefined;
35783674
}
35793675

3676+
/**
3677+
* @internal
3678+
*/
3679+
export const AdditionalSearchKeyFilterSensitiveLog = (obj: AdditionalSearchKey): any => ({
3680+
...obj,
3681+
});
3682+
35803683
/**
35813684
* @internal
35823685
*/
@@ -4392,6 +4495,13 @@ export const SearchProfilesRequestFilterSensitiveLog = (obj: SearchProfilesReque
43924495
...obj,
43934496
});
43944497

4498+
/**
4499+
* @internal
4500+
*/
4501+
export const FoundByKeyValueFilterSensitiveLog = (obj: FoundByKeyValue): any => ({
4502+
...obj,
4503+
});
4504+
43954505
/**
43964506
* @internal
43974507
*/

clients/client-customer-profiles/src/protocols/Aws_restJson1.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ import { UpdateProfileCommandInput, UpdateProfileCommandOutput } from "../comman
103103
import { CustomerProfilesServiceException as __BaseException } from "../models/CustomerProfilesServiceException";
104104
import {
105105
AccessDeniedException,
106+
AdditionalSearchKey,
106107
Address,
107108
AppflowIntegration,
108109
AppflowIntegrationWorkflowAttributes,
@@ -119,6 +120,7 @@ import {
119120
ExportingLocation,
120121
FieldSourceProfileIds,
121122
FlowDefinition,
123+
FoundByKeyValue,
122124
IdentityResolutionJob,
123125
IncrementalPullConfig,
124126
IntegrationConfig,
@@ -1120,7 +1122,11 @@ export const serializeAws_restJson1SearchProfilesCommand = async (
11201122
});
11211123
let body: any;
11221124
body = JSON.stringify({
1125+
...(input.AdditionalSearchKeys != null && {
1126+
AdditionalSearchKeys: serializeAws_restJson1additionalSearchKeysList(input.AdditionalSearchKeys, context),
1127+
}),
11231128
...(input.KeyName != null && { KeyName: input.KeyName }),
1129+
...(input.LogicalOperator != null && { LogicalOperator: input.LogicalOperator }),
11241130
...(input.Values != null && { Values: serializeAws_restJson1requestValueList(input.Values, context) }),
11251131
});
11261132
return new __HttpRequest({
@@ -3643,6 +3649,21 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (
36433649
return __decorateServiceException(exception, parsedOutput.body);
36443650
};
36453651

3652+
const serializeAws_restJson1AdditionalSearchKey = (input: AdditionalSearchKey, context: __SerdeContext): any => {
3653+
return {
3654+
...(input.KeyName != null && { KeyName: input.KeyName }),
3655+
...(input.Values != null && { Values: serializeAws_restJson1requestValueList(input.Values, context) }),
3656+
};
3657+
};
3658+
3659+
const serializeAws_restJson1additionalSearchKeysList = (input: AdditionalSearchKey[], context: __SerdeContext): any => {
3660+
return input
3661+
.filter((e: any) => e != null)
3662+
.map((entry) => {
3663+
return serializeAws_restJson1AdditionalSearchKey(entry, context);
3664+
});
3665+
};
3666+
36463667
const serializeAws_restJson1Address = (input: Address, context: __SerdeContext): any => {
36473668
return {
36483669
...(input.Address1 != null && { Address1: input.Address1 }),
@@ -4310,6 +4331,25 @@ const deserializeAws_restJson1FieldNameList = (output: any, context: __SerdeCont
43104331
return retVal;
43114332
};
43124333

4334+
const deserializeAws_restJson1FoundByKeyValue = (output: any, context: __SerdeContext): FoundByKeyValue => {
4335+
return {
4336+
KeyName: __expectString(output.KeyName),
4337+
Values: output.Values != null ? deserializeAws_restJson1requestValueList(output.Values, context) : undefined,
4338+
} as any;
4339+
};
4340+
4341+
const deserializeAws_restJson1foundByList = (output: any, context: __SerdeContext): FoundByKeyValue[] => {
4342+
const retVal = (output || [])
4343+
.filter((e: any) => e != null)
4344+
.map((entry: any) => {
4345+
if (entry === null) {
4346+
return null as any;
4347+
}
4348+
return deserializeAws_restJson1FoundByKeyValue(entry, context);
4349+
});
4350+
return retVal;
4351+
};
4352+
43134353
const deserializeAws_restJson1IdentityResolutionJob = (output: any, context: __SerdeContext): IdentityResolutionJob => {
43144354
return {
43154355
DomainName: __expectString(output.DomainName),
@@ -4588,6 +4628,8 @@ const deserializeAws_restJson1Profile = (output: any, context: __SerdeContext):
45884628
BusinessPhoneNumber: __expectString(output.BusinessPhoneNumber),
45894629
EmailAddress: __expectString(output.EmailAddress),
45904630
FirstName: __expectString(output.FirstName),
4631+
FoundByItems:
4632+
output.FoundByItems != null ? deserializeAws_restJson1foundByList(output.FoundByItems, context) : undefined,
45914633
Gender: __expectString(output.Gender),
45924634
HomePhoneNumber: __expectString(output.HomePhoneNumber),
45934635
LastName: __expectString(output.LastName),

0 commit comments

Comments
 (0)