Skip to content

Commit 4535c43

Browse files
author
awstools
committed
feat(client-connectcases): New Search All Related Items API enables searching related items across cases
1 parent 3d2d565 commit 4535c43

File tree

10 files changed

+877
-44
lines changed

10 files changed

+877
-44
lines changed

clients/client-connectcases/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,14 @@ PutCaseEventConfiguration
458458

459459
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectcases/command/PutCaseEventConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/PutCaseEventConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/PutCaseEventConfigurationCommandOutput/)
460460

461+
</details>
462+
<details>
463+
<summary>
464+
SearchAllRelatedItems
465+
</summary>
466+
467+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectcases/command/SearchAllRelatedItemsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/SearchAllRelatedItemsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/SearchAllRelatedItemsCommandOutput/)
468+
461469
</details>
462470
<details>
463471
<summary>

clients/client-connectcases/src/ConnectCases.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ import {
118118
PutCaseEventConfigurationCommandInput,
119119
PutCaseEventConfigurationCommandOutput,
120120
} from "./commands/PutCaseEventConfigurationCommand";
121+
import {
122+
SearchAllRelatedItemsCommand,
123+
SearchAllRelatedItemsCommandInput,
124+
SearchAllRelatedItemsCommandOutput,
125+
} from "./commands/SearchAllRelatedItemsCommand";
121126
import { SearchCasesCommand, SearchCasesCommandInput, SearchCasesCommandOutput } from "./commands/SearchCasesCommand";
122127
import {
123128
SearchRelatedItemsCommand,
@@ -182,6 +187,7 @@ const commands = {
182187
ListTagsForResourceCommand,
183188
ListTemplatesCommand,
184189
PutCaseEventConfigurationCommand,
190+
SearchAllRelatedItemsCommand,
185191
SearchCasesCommand,
186192
SearchRelatedItemsCommand,
187193
TagResourceCommand,
@@ -619,6 +625,23 @@ export interface ConnectCases {
619625
cb: (err: any, data?: PutCaseEventConfigurationCommandOutput) => void
620626
): void;
621627

628+
/**
629+
* @see {@link SearchAllRelatedItemsCommand}
630+
*/
631+
searchAllRelatedItems(
632+
args: SearchAllRelatedItemsCommandInput,
633+
options?: __HttpHandlerOptions
634+
): Promise<SearchAllRelatedItemsCommandOutput>;
635+
searchAllRelatedItems(
636+
args: SearchAllRelatedItemsCommandInput,
637+
cb: (err: any, data?: SearchAllRelatedItemsCommandOutput) => void
638+
): void;
639+
searchAllRelatedItems(
640+
args: SearchAllRelatedItemsCommandInput,
641+
options: __HttpHandlerOptions,
642+
cb: (err: any, data?: SearchAllRelatedItemsCommandOutput) => void
643+
): void;
644+
622645
/**
623646
* @see {@link SearchCasesCommand}
624647
*/

clients/client-connectcases/src/ConnectCasesClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ import {
100100
PutCaseEventConfigurationCommandInput,
101101
PutCaseEventConfigurationCommandOutput,
102102
} from "./commands/PutCaseEventConfigurationCommand";
103+
import {
104+
SearchAllRelatedItemsCommandInput,
105+
SearchAllRelatedItemsCommandOutput,
106+
} from "./commands/SearchAllRelatedItemsCommand";
103107
import { SearchCasesCommandInput, SearchCasesCommandOutput } from "./commands/SearchCasesCommand";
104108
import { SearchRelatedItemsCommandInput, SearchRelatedItemsCommandOutput } from "./commands/SearchRelatedItemsCommand";
105109
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
@@ -156,6 +160,7 @@ export type ServiceInputTypes =
156160
| ListTagsForResourceCommandInput
157161
| ListTemplatesCommandInput
158162
| PutCaseEventConfigurationCommandInput
163+
| SearchAllRelatedItemsCommandInput
159164
| SearchCasesCommandInput
160165
| SearchRelatedItemsCommandInput
161166
| TagResourceCommandInput
@@ -202,6 +207,7 @@ export type ServiceOutputTypes =
202207
| ListTagsForResourceCommandOutput
203208
| ListTemplatesCommandOutput
204209
| PutCaseEventConfigurationCommandOutput
210+
| SearchAllRelatedItemsCommandOutput
205211
| SearchCasesCommandOutput
206212
| SearchRelatedItemsCommandOutput
207213
| TagResourceCommandOutput
Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { ConnectCasesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectCasesClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import {
10+
SearchAllRelatedItemsRequest,
11+
SearchAllRelatedItemsRequestFilterSensitiveLog,
12+
SearchAllRelatedItemsResponse,
13+
SearchAllRelatedItemsResponseFilterSensitiveLog,
14+
} from "../models/models_0";
15+
import { de_SearchAllRelatedItemsCommand, se_SearchAllRelatedItemsCommand } from "../protocols/Aws_restJson1";
16+
17+
/**
18+
* @public
19+
*/
20+
export type { __MetadataBearer };
21+
export { $Command };
22+
/**
23+
* @public
24+
*
25+
* The input for {@link SearchAllRelatedItemsCommand}.
26+
*/
27+
export interface SearchAllRelatedItemsCommandInput extends SearchAllRelatedItemsRequest {}
28+
/**
29+
* @public
30+
*
31+
* The output of {@link SearchAllRelatedItemsCommand}.
32+
*/
33+
export interface SearchAllRelatedItemsCommandOutput extends SearchAllRelatedItemsResponse, __MetadataBearer {}
34+
35+
/**
36+
* <p>Searches for related items across all cases within a domain. This is a global search operation that returns related items from multiple cases, unlike the case-specific <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_SearchRelatedItems.html">SearchRelatedItems</a> API.</p> <p> <b>Use cases</b> </p> <p>Following are common uses cases for this API:</p> <ul> <li> <p>Find cases with similar issues across the domain. For example, search for all cases containing comments about "product defect" to identify patterns and existing solutions.</p> </li> <li> <p>Locate all cases associated with specific contacts or orders. For example, find all cases linked to a contactArn to understand the complete customer journey. </p> </li> <li> <p>Monitor SLA compliance across cases. For example, search for all cases with "Active" SLA status to prioritize remediation efforts.</p> </li> </ul> <p> <b>Important things to know</b> </p> <ul> <li> <p>This API returns case IDs, not complete case objects. To retrieve full case details, you must make additional calls to the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_GetCase.html">GetCase</a> API for each returned case ID. </p> </li> <li> <p>This API searches across related items content, not case fields. Use the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_SearchCases.html">SearchCases</a> API to search within case field values.</p> </li> </ul> <p> <b>Endpoints</b>: See <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect endpoints and quotas</a>.</p>
37+
* @example
38+
* Use a bare-bones client and the command you need to make an API call.
39+
* ```javascript
40+
* import { ConnectCasesClient, SearchAllRelatedItemsCommand } from "@aws-sdk/client-connectcases"; // ES Modules import
41+
* // const { ConnectCasesClient, SearchAllRelatedItemsCommand } = require("@aws-sdk/client-connectcases"); // CommonJS import
42+
* // import type { ConnectCasesClientConfig } from "@aws-sdk/client-connectcases";
43+
* const config = {}; // type is ConnectCasesClientConfig
44+
* const client = new ConnectCasesClient(config);
45+
* const input = { // SearchAllRelatedItemsRequest
46+
* domainId: "STRING_VALUE", // required
47+
* maxResults: Number("int"),
48+
* nextToken: "STRING_VALUE",
49+
* filters: [ // RelatedItemFilterList
50+
* { // RelatedItemTypeFilter Union: only one key present
51+
* contact: { // ContactFilter
52+
* channel: [ // ChannelList
53+
* "STRING_VALUE",
54+
* ],
55+
* contactArn: "STRING_VALUE",
56+
* },
57+
* comment: {},
58+
* file: { // FileFilter
59+
* fileArn: "STRING_VALUE",
60+
* },
61+
* sla: { // SlaFilter
62+
* name: "STRING_VALUE",
63+
* status: "STRING_VALUE",
64+
* },
65+
* connectCase: { // ConnectCaseFilter
66+
* caseId: "STRING_VALUE",
67+
* },
68+
* custom: { // CustomFilter
69+
* fields: { // CustomFieldsFilter Union: only one key present
70+
* field: { // FieldFilter Union: only one key present
71+
* equalTo: { // FieldValue
72+
* id: "STRING_VALUE", // required
73+
* value: { // FieldValueUnion Union: only one key present
74+
* stringValue: "STRING_VALUE",
75+
* doubleValue: Number("double"),
76+
* booleanValue: true || false,
77+
* emptyValue: {},
78+
* userArnValue: "STRING_VALUE",
79+
* },
80+
* },
81+
* contains: {
82+
* id: "STRING_VALUE", // required
83+
* value: {// Union: only one key present
84+
* stringValue: "STRING_VALUE",
85+
* doubleValue: Number("double"),
86+
* booleanValue: true || false,
87+
* emptyValue: {},
88+
* userArnValue: "STRING_VALUE",
89+
* },
90+
* },
91+
* greaterThan: {
92+
* id: "STRING_VALUE", // required
93+
* value: {// Union: only one key present
94+
* stringValue: "STRING_VALUE",
95+
* doubleValue: Number("double"),
96+
* booleanValue: true || false,
97+
* emptyValue: {},
98+
* userArnValue: "STRING_VALUE",
99+
* },
100+
* },
101+
* greaterThanOrEqualTo: {
102+
* id: "STRING_VALUE", // required
103+
* value: {// Union: only one key present
104+
* stringValue: "STRING_VALUE",
105+
* doubleValue: Number("double"),
106+
* booleanValue: true || false,
107+
* emptyValue: {},
108+
* userArnValue: "STRING_VALUE",
109+
* },
110+
* },
111+
* lessThan: {
112+
* id: "STRING_VALUE", // required
113+
* value: {// Union: only one key present
114+
* stringValue: "STRING_VALUE",
115+
* doubleValue: Number("double"),
116+
* booleanValue: true || false,
117+
* emptyValue: {},
118+
* userArnValue: "STRING_VALUE",
119+
* },
120+
* },
121+
* lessThanOrEqualTo: "<FieldValue>",
122+
* },
123+
* not: {// Union: only one key present
124+
* field: {// Union: only one key present
125+
* equalTo: "<FieldValue>",
126+
* contains: "<FieldValue>",
127+
* greaterThan: "<FieldValue>",
128+
* greaterThanOrEqualTo: "<FieldValue>",
129+
* lessThan: "<FieldValue>",
130+
* lessThanOrEqualTo: "<FieldValue>",
131+
* },
132+
* not: "<CustomFieldsFilter>",
133+
* andAll: [ // CustomFieldsFilterList
134+
* "<CustomFieldsFilter>",
135+
* ],
136+
* orAll: [
137+
* "<CustomFieldsFilter>",
138+
* ],
139+
* },
140+
* andAll: [
141+
* "<CustomFieldsFilter>",
142+
* ],
143+
* orAll: [
144+
* "<CustomFieldsFilter>",
145+
* ],
146+
* },
147+
* },
148+
* },
149+
* ],
150+
* sorts: [ // SearchAllRelatedItemsSortList
151+
* { // SearchAllRelatedItemsSort
152+
* sortProperty: "STRING_VALUE", // required
153+
* sortOrder: "STRING_VALUE", // required
154+
* },
155+
* ],
156+
* };
157+
* const command = new SearchAllRelatedItemsCommand(input);
158+
* const response = await client.send(command);
159+
* // { // SearchAllRelatedItemsResponse
160+
* // nextToken: "STRING_VALUE",
161+
* // relatedItems: [ // SearchAllRelatedItemsResponseItemList // required
162+
* // { // SearchAllRelatedItemsResponseItem
163+
* // relatedItemId: "STRING_VALUE", // required
164+
* // caseId: "STRING_VALUE", // required
165+
* // type: "STRING_VALUE", // required
166+
* // associationTime: new Date("TIMESTAMP"), // required
167+
* // content: { // RelatedItemContent Union: only one key present
168+
* // contact: { // ContactContent
169+
* // contactArn: "STRING_VALUE", // required
170+
* // channel: "STRING_VALUE", // required
171+
* // connectedToSystemTime: new Date("TIMESTAMP"), // required
172+
* // },
173+
* // comment: { // CommentContent
174+
* // body: "STRING_VALUE", // required
175+
* // contentType: "STRING_VALUE", // required
176+
* // },
177+
* // file: { // FileContent
178+
* // fileArn: "STRING_VALUE", // required
179+
* // },
180+
* // sla: { // SlaContent
181+
* // slaConfiguration: { // SlaConfiguration
182+
* // name: "STRING_VALUE", // required
183+
* // type: "STRING_VALUE", // required
184+
* // status: "STRING_VALUE", // required
185+
* // fieldId: "STRING_VALUE",
186+
* // targetFieldValues: [ // SlaFieldValueUnionList
187+
* // { // FieldValueUnion Union: only one key present
188+
* // stringValue: "STRING_VALUE",
189+
* // doubleValue: Number("double"),
190+
* // booleanValue: true || false,
191+
* // emptyValue: {},
192+
* // userArnValue: "STRING_VALUE",
193+
* // },
194+
* // ],
195+
* // targetTime: new Date("TIMESTAMP"), // required
196+
* // completionTime: new Date("TIMESTAMP"),
197+
* // },
198+
* // },
199+
* // connectCase: { // ConnectCaseContent
200+
* // caseId: "STRING_VALUE", // required
201+
* // },
202+
* // custom: { // CustomContent
203+
* // fields: [ // FieldValueList // required
204+
* // { // FieldValue
205+
* // id: "STRING_VALUE", // required
206+
* // value: {// Union: only one key present
207+
* // stringValue: "STRING_VALUE",
208+
* // doubleValue: Number("double"),
209+
* // booleanValue: true || false,
210+
* // emptyValue: {},
211+
* // userArnValue: "STRING_VALUE",
212+
* // },
213+
* // },
214+
* // ],
215+
* // },
216+
* // },
217+
* // performedBy: { // UserUnion Union: only one key present
218+
* // userArn: "STRING_VALUE",
219+
* // customEntity: "STRING_VALUE",
220+
* // },
221+
* // tags: { // Tags
222+
* // "<keys>": "STRING_VALUE",
223+
* // },
224+
* // },
225+
* // ],
226+
* // };
227+
*
228+
* ```
229+
*
230+
* @param SearchAllRelatedItemsCommandInput - {@link SearchAllRelatedItemsCommandInput}
231+
* @returns {@link SearchAllRelatedItemsCommandOutput}
232+
* @see {@link SearchAllRelatedItemsCommandInput} for command's `input` shape.
233+
* @see {@link SearchAllRelatedItemsCommandOutput} for command's `response` shape.
234+
* @see {@link ConnectCasesClientResolvedConfig | config} for ConnectCasesClient's `config` shape.
235+
*
236+
* @throws {@link AccessDeniedException} (client fault)
237+
* <p>You do not have sufficient access to perform this action.</p>
238+
*
239+
* @throws {@link InternalServerException} (server fault)
240+
* <p>We couldn't process your request because of an issue with the server. Try again later.</p>
241+
*
242+
* @throws {@link ResourceNotFoundException} (client fault)
243+
* <p>We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.</p>
244+
*
245+
* @throws {@link ThrottlingException} (client fault)
246+
* <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
247+
*
248+
* @throws {@link ValidationException} (client fault)
249+
* <p>The request isn't valid. Check the syntax and try again.</p>
250+
*
251+
* @throws {@link ConnectCasesServiceException}
252+
* <p>Base exception class for all service exceptions from ConnectCases service.</p>
253+
*
254+
*
255+
* @public
256+
*/
257+
export class SearchAllRelatedItemsCommand extends $Command
258+
.classBuilder<
259+
SearchAllRelatedItemsCommandInput,
260+
SearchAllRelatedItemsCommandOutput,
261+
ConnectCasesClientResolvedConfig,
262+
ServiceInputTypes,
263+
ServiceOutputTypes
264+
>()
265+
.ep(commonParams)
266+
.m(function (this: any, Command: any, cs: any, config: ConnectCasesClientResolvedConfig, o: any) {
267+
return [
268+
getSerdePlugin(config, this.serialize, this.deserialize),
269+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
270+
];
271+
})
272+
.s("AmazonConnectCases", "SearchAllRelatedItems", {})
273+
.n("ConnectCasesClient", "SearchAllRelatedItemsCommand")
274+
.f(SearchAllRelatedItemsRequestFilterSensitiveLog, SearchAllRelatedItemsResponseFilterSensitiveLog)
275+
.ser(se_SearchAllRelatedItemsCommand)
276+
.de(de_SearchAllRelatedItemsCommand)
277+
.build() {
278+
/** @internal type navigation helper, not in runtime. */
279+
protected declare static __types: {
280+
api: {
281+
input: SearchAllRelatedItemsRequest;
282+
output: SearchAllRelatedItemsResponse;
283+
};
284+
sdk: {
285+
input: SearchAllRelatedItemsCommandInput;
286+
output: SearchAllRelatedItemsCommandOutput;
287+
};
288+
};
289+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export * from "./ListLayoutsCommand";
3131
export * from "./ListTagsForResourceCommand";
3232
export * from "./ListTemplatesCommand";
3333
export * from "./PutCaseEventConfigurationCommand";
34+
export * from "./SearchAllRelatedItemsCommand";
3435
export * from "./SearchCasesCommand";
3536
export * from "./SearchRelatedItemsCommand";
3637
export * from "./TagResourceCommand";

0 commit comments

Comments
 (0)