Skip to content

Commit 8e7361b

Browse files
author
awstools
committed
feat(client-connectcases): This release adds the ability to view audit history on a case and introduces a new parameter, performedBy, for CreateCase and UpdateCase API's.
1 parent ca7b896 commit 8e7361b

16 files changed

+1098
-74
lines changed

clients/client-connectcases/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ GetCase
286286

287287
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectcases/command/GetCaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/GetCaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/GetCaseCommandOutput/)
288288

289+
</details>
290+
<details>
291+
<summary>
292+
GetCaseAuditEvents
293+
</summary>
294+
295+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectcases/command/GetCaseAuditEventsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/GetCaseAuditEventsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/GetCaseAuditEventsCommandOutput/)
296+
289297
</details>
290298
<details>
291299
<summary>

clients/client-connectcases/src/ConnectCases.ts

+23
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ import {
3939
DeleteDomainCommandInput,
4040
DeleteDomainCommandOutput,
4141
} from "./commands/DeleteDomainCommand";
42+
import {
43+
GetCaseAuditEventsCommand,
44+
GetCaseAuditEventsCommandInput,
45+
GetCaseAuditEventsCommandOutput,
46+
} from "./commands/GetCaseAuditEventsCommand";
4247
import { GetCaseCommand, GetCaseCommandInput, GetCaseCommandOutput } from "./commands/GetCaseCommand";
4348
import {
4449
GetCaseEventConfigurationCommand,
@@ -113,6 +118,7 @@ const commands = {
113118
CreateTemplateCommand,
114119
DeleteDomainCommand,
115120
GetCaseCommand,
121+
GetCaseAuditEventsCommand,
116122
GetCaseEventConfigurationCommand,
117123
GetDomainCommand,
118124
GetLayoutCommand,
@@ -261,6 +267,23 @@ export interface ConnectCases {
261267
cb: (err: any, data?: GetCaseCommandOutput) => void
262268
): void;
263269

270+
/**
271+
* @see {@link GetCaseAuditEventsCommand}
272+
*/
273+
getCaseAuditEvents(
274+
args: GetCaseAuditEventsCommandInput,
275+
options?: __HttpHandlerOptions
276+
): Promise<GetCaseAuditEventsCommandOutput>;
277+
getCaseAuditEvents(
278+
args: GetCaseAuditEventsCommandInput,
279+
cb: (err: any, data?: GetCaseAuditEventsCommandOutput) => void
280+
): void;
281+
getCaseAuditEvents(
282+
args: GetCaseAuditEventsCommandInput,
283+
options: __HttpHandlerOptions,
284+
cb: (err: any, data?: GetCaseAuditEventsCommandOutput) => void
285+
): void;
286+
264287
/**
265288
* @see {@link GetCaseEventConfigurationCommand}
266289
*/

clients/client-connectcases/src/ConnectCasesClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import { CreateLayoutCommandInput, CreateLayoutCommandOutput } from "./commands/
6060
import { CreateRelatedItemCommandInput, CreateRelatedItemCommandOutput } from "./commands/CreateRelatedItemCommand";
6161
import { CreateTemplateCommandInput, CreateTemplateCommandOutput } from "./commands/CreateTemplateCommand";
6262
import { DeleteDomainCommandInput, DeleteDomainCommandOutput } from "./commands/DeleteDomainCommand";
63+
import { GetCaseAuditEventsCommandInput, GetCaseAuditEventsCommandOutput } from "./commands/GetCaseAuditEventsCommand";
6364
import { GetCaseCommandInput, GetCaseCommandOutput } from "./commands/GetCaseCommand";
6465
import {
6566
GetCaseEventConfigurationCommandInput,
@@ -117,6 +118,7 @@ export type ServiceInputTypes =
117118
| CreateRelatedItemCommandInput
118119
| CreateTemplateCommandInput
119120
| DeleteDomainCommandInput
121+
| GetCaseAuditEventsCommandInput
120122
| GetCaseCommandInput
121123
| GetCaseEventConfigurationCommandInput
122124
| GetDomainCommandInput
@@ -152,6 +154,7 @@ export type ServiceOutputTypes =
152154
| CreateRelatedItemCommandOutput
153155
| CreateTemplateCommandOutput
154156
| DeleteDomainCommandOutput
157+
| GetCaseAuditEventsCommandOutput
155158
| GetCaseCommandOutput
156159
| GetCaseEventConfigurationCommandOutput
157160
| GetDomainCommandOutput

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

+13-4
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,20 @@ export interface CreateCaseCommandOutput extends CreateCaseResponse, __MetadataB
2828

2929
/**
3030
* @public
31-
* <p>Creates a case in the specified Cases domain. Case system and custom fields are taken
31+
* <note>
32+
* <p>If you provide a value for <code>PerformedBy.UserArn</code> you must also have <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html">connect:DescribeUser</a> permission on the User ARN resource that you provide</p>
33+
* </note>
34+
*
35+
* <p>Creates a case in the specified Cases domain. Case system and custom fields are taken
3236
* as an array id/value pairs with a declared data types.</p>
33-
* <p>The following fields are required when creating a case:</p>
37+
* <p>The following fields are required when creating a case:</p>
3438
*
3539
* <ul>
3640
* <li>
3741
* <p>
38-
* <code>customer_id</code> - You must provide the full customer profile ARN in this
39-
* format: <code>arn:aws:profile:your_AWS_Region:your_AWS_account ID:domains/your_profiles_domain_name/profiles/profile_ID</code>
42+
* <code>customer_id</code> - You must provide the full customer profile ARN in this format:
43+
* <code>arn:aws:profile:your_AWS_Region:your_AWS_account
44+
* ID:domains/your_profiles_domain_name/profiles/profile_ID</code>
4045
* </p>
4146
* </li>
4247
* <li>
@@ -62,10 +67,14 @@ export interface CreateCaseCommandOutput extends CreateCaseResponse, __MetadataB
6267
* doubleValue: Number("double"),
6368
* booleanValue: true || false,
6469
* emptyValue: {},
70+
* userArnValue: "STRING_VALUE",
6571
* },
6672
* },
6773
* ],
6874
* clientToken: "STRING_VALUE",
75+
* performedBy: { // UserUnion Union: only one key present
76+
* userArn: "STRING_VALUE",
77+
* },
6978
* };
7079
* const command = new CreateCaseCommand(input);
7180
* const response = await client.send(command);

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ export interface CreateRelatedItemCommandOutput extends CreateRelatedItemRespons
3333
* <note>
3434
* <ul>
3535
* <li>
36-
* <p>A Related Item is a resource that is associated with a case. It may or may not have an
37-
* external identifier linking it to an external resource (for example, a
38-
* <code>contactArn</code>). All Related Items have their own internal identifier, the
39-
* <code>relatedItemArn</code>. Examples of related items include <code>comments</code> and
40-
* <code>contacts</code>.</p>
36+
* <p>A Related Item is a resource that is associated with a case. It may or may not have
37+
* an external identifier linking it to an external resource (for example, a
38+
* <code>contactArn</code>). All Related Items have their own internal identifier, the
39+
* <code>relatedItemArn</code>. Examples of related items include <code>comments</code>
40+
* and <code>contacts</code>.</p>
4141
* </li>
4242
* <li>
4343
* <p>If you provide a value for <code>performedBy.userArn</code> you must also have
44-
* <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html">DescribeUser</a>
45-
* permission on the ARN of the user that you provide.</p>
44+
* <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html">DescribeUser</a> permission on the ARN of the user that you provide.</p>
4645
* </li>
4746
* </ul>
4847
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
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 { GetCaseAuditEventsRequest, GetCaseAuditEventsResponse } from "../models/models_0";
10+
import { de_GetCaseAuditEventsCommand, se_GetCaseAuditEventsCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link GetCaseAuditEventsCommand}.
20+
*/
21+
export interface GetCaseAuditEventsCommandInput extends GetCaseAuditEventsRequest {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link GetCaseAuditEventsCommand}.
26+
*/
27+
export interface GetCaseAuditEventsCommandOutput extends GetCaseAuditEventsResponse, __MetadataBearer {}
28+
29+
/**
30+
* @public
31+
* <p>Returns the audit history about a specific case if it exists.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { ConnectCasesClient, GetCaseAuditEventsCommand } from "@aws-sdk/client-connectcases"; // ES Modules import
36+
* // const { ConnectCasesClient, GetCaseAuditEventsCommand } = require("@aws-sdk/client-connectcases"); // CommonJS import
37+
* const client = new ConnectCasesClient(config);
38+
* const input = { // GetCaseAuditEventsRequest
39+
* caseId: "STRING_VALUE", // required
40+
* domainId: "STRING_VALUE", // required
41+
* maxResults: Number("int"),
42+
* nextToken: "STRING_VALUE",
43+
* };
44+
* const command = new GetCaseAuditEventsCommand(input);
45+
* const response = await client.send(command);
46+
* // { // GetCaseAuditEventsResponse
47+
* // nextToken: "STRING_VALUE",
48+
* // auditEvents: [ // AuditEventsList // required
49+
* // { // AuditEvent
50+
* // eventId: "STRING_VALUE", // required
51+
* // type: "STRING_VALUE", // required
52+
* // relatedItemType: "STRING_VALUE",
53+
* // performedTime: new Date("TIMESTAMP"), // required
54+
* // fields: [ // AuditEventFieldList // required
55+
* // { // AuditEventField
56+
* // eventFieldId: "STRING_VALUE", // required
57+
* // oldValue: { // AuditEventFieldValueUnion Union: only one key present
58+
* // stringValue: "STRING_VALUE",
59+
* // doubleValue: Number("double"),
60+
* // booleanValue: true || false,
61+
* // emptyValue: {},
62+
* // userArnValue: "STRING_VALUE",
63+
* // },
64+
* // newValue: {// Union: only one key present
65+
* // stringValue: "STRING_VALUE",
66+
* // doubleValue: Number("double"),
67+
* // booleanValue: true || false,
68+
* // emptyValue: {},
69+
* // userArnValue: "STRING_VALUE",
70+
* // },
71+
* // },
72+
* // ],
73+
* // performedBy: { // AuditEventPerformedBy
74+
* // user: { // UserUnion Union: only one key present
75+
* // userArn: "STRING_VALUE",
76+
* // },
77+
* // iamPrincipalArn: "STRING_VALUE", // required
78+
* // },
79+
* // },
80+
* // ],
81+
* // };
82+
*
83+
* ```
84+
*
85+
* @param GetCaseAuditEventsCommandInput - {@link GetCaseAuditEventsCommandInput}
86+
* @returns {@link GetCaseAuditEventsCommandOutput}
87+
* @see {@link GetCaseAuditEventsCommandInput} for command's `input` shape.
88+
* @see {@link GetCaseAuditEventsCommandOutput} for command's `response` shape.
89+
* @see {@link ConnectCasesClientResolvedConfig | config} for ConnectCasesClient's `config` shape.
90+
*
91+
* @throws {@link AccessDeniedException} (client fault)
92+
* <p>You do not have sufficient access to perform this action.</p>
93+
*
94+
* @throws {@link InternalServerException} (server fault)
95+
* <p>We couldn't process your request because of an issue with the server. Try again
96+
* later.</p>
97+
*
98+
* @throws {@link ResourceNotFoundException} (client fault)
99+
* <p>We couldn't find the requested resource. Check that your resources exists and were created
100+
* in the same Amazon Web Services Region as your request, and try your request again.</p>
101+
*
102+
* @throws {@link ThrottlingException} (client fault)
103+
* <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
104+
*
105+
* @throws {@link ValidationException} (client fault)
106+
* <p>The request isn't valid. Check the syntax and try again.</p>
107+
*
108+
* @throws {@link ConnectCasesServiceException}
109+
* <p>Base exception class for all service exceptions from ConnectCases service.</p>
110+
*
111+
*/
112+
export class GetCaseAuditEventsCommand extends $Command
113+
.classBuilder<
114+
GetCaseAuditEventsCommandInput,
115+
GetCaseAuditEventsCommandOutput,
116+
ConnectCasesClientResolvedConfig,
117+
ServiceInputTypes,
118+
ServiceOutputTypes
119+
>()
120+
.ep({
121+
...commonParams,
122+
})
123+
.m(function (this: any, Command: any, cs: any, config: ConnectCasesClientResolvedConfig, o: any) {
124+
return [
125+
getSerdePlugin(config, this.serialize, this.deserialize),
126+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
127+
];
128+
})
129+
.s("AmazonConnectCases", "GetCaseAuditEvents", {})
130+
.n("ConnectCasesClient", "GetCaseAuditEventsCommand")
131+
.f(void 0, void 0)
132+
.ser(se_GetCaseAuditEventsCommand)
133+
.de(de_GetCaseAuditEventsCommand)
134+
.build() {}

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

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface GetCaseCommandOutput extends GetCaseResponse, __MetadataBearer
5656
* // doubleValue: Number("double"),
5757
* // booleanValue: true || false,
5858
* // emptyValue: {},
59+
* // userArnValue: "STRING_VALUE",
5960
* // },
6061
* // },
6162
* // ],

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export interface PutCaseEventConfigurationCommandOutput extends PutCaseEventConf
2828

2929
/**
3030
* @public
31-
* <p>Adds case event publishing configuration. For a complete list of
32-
* fields you can add to the event message, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-fields.html">Create case fields</a> in the
33-
* <i>Amazon Connect Administrator Guide</i>
31+
* <p>Adds case event publishing configuration. For a complete list of fields you can add to the
32+
* event message, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-fields.html">Create case fields</a> in the
33+
* <i>Amazon Connect Administrator Guide</i>
3434
* </p>
3535
* @example
3636
* Use a bare-bones client and the command you need to make an API call.

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

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export interface SearchCasesCommandOutput extends SearchCasesResponse, __Metadat
5555
* doubleValue: Number("double"),
5656
* booleanValue: true || false,
5757
* emptyValue: {},
58+
* userArnValue: "STRING_VALUE",
5859
* },
5960
* },
6061
* contains: {
@@ -64,6 +65,7 @@ export interface SearchCasesCommandOutput extends SearchCasesResponse, __Metadat
6465
* doubleValue: Number("double"),
6566
* booleanValue: true || false,
6667
* emptyValue: {},
68+
* userArnValue: "STRING_VALUE",
6769
* },
6870
* },
6971
* greaterThan: {
@@ -73,6 +75,7 @@ export interface SearchCasesCommandOutput extends SearchCasesResponse, __Metadat
7375
* doubleValue: Number("double"),
7476
* booleanValue: true || false,
7577
* emptyValue: {},
78+
* userArnValue: "STRING_VALUE",
7679
* },
7780
* },
7881
* greaterThanOrEqualTo: {
@@ -82,6 +85,7 @@ export interface SearchCasesCommandOutput extends SearchCasesResponse, __Metadat
8285
* doubleValue: Number("double"),
8386
* booleanValue: true || false,
8487
* emptyValue: {},
88+
* userArnValue: "STRING_VALUE",
8589
* },
8690
* },
8791
* lessThan: {
@@ -91,6 +95,7 @@ export interface SearchCasesCommandOutput extends SearchCasesResponse, __Metadat
9195
* doubleValue: Number("double"),
9296
* booleanValue: true || false,
9397
* emptyValue: {},
98+
* userArnValue: "STRING_VALUE",
9499
* },
95100
* },
96101
* lessThanOrEqualTo: "<FieldValue>",
@@ -147,6 +152,7 @@ export interface SearchCasesCommandOutput extends SearchCasesResponse, __Metadat
147152
* // doubleValue: Number("double"),
148153
* // booleanValue: true || false,
149154
* // emptyValue: {},
155+
* // userArnValue: "STRING_VALUE",
150156
* // },
151157
* // },
152158
* // ],

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export interface UpdateCaseCommandOutput extends UpdateCaseResponse, __MetadataB
2828

2929
/**
3030
* @public
31-
* <p>Updates the values of fields on a case. Fields to be updated are received as an array of
31+
* <note>
32+
* <p>If you provide a value for <code>PerformedBy.UserArn</code> you must also have <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html">connect:DescribeUser</a> permission on the User ARN resource that you provide</p>
33+
* </note>
34+
*
35+
* <p>Updates the values of fields on a case. Fields to be updated are received as an array of
3236
* id/value pairs identical to the <code>CreateCase</code> input .</p>
3337
* <p>If the action is successful, the service sends back an HTTP 200 response with an empty
3438
* HTTP body.</p>
@@ -49,9 +53,13 @@ export interface UpdateCaseCommandOutput extends UpdateCaseResponse, __MetadataB
4953
* doubleValue: Number("double"),
5054
* booleanValue: true || false,
5155
* emptyValue: {},
56+
* userArnValue: "STRING_VALUE",
5257
* },
5358
* },
5459
* ],
60+
* performedBy: { // UserUnion Union: only one key present
61+
* userArn: "STRING_VALUE",
62+
* },
5563
* };
5664
* const command = new UpdateCaseCommand(input);
5765
* const response = await client.send(command);

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

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from "./CreateLayoutCommand";
88
export * from "./CreateRelatedItemCommand";
99
export * from "./CreateTemplateCommand";
1010
export * from "./DeleteDomainCommand";
11+
export * from "./GetCaseAuditEventsCommand";
1112
export * from "./GetCaseCommand";
1213
export * from "./GetCaseEventConfigurationCommand";
1314
export * from "./GetDomainCommand";

0 commit comments

Comments
 (0)