Skip to content

Commit 9ee87df

Browse files
author
awstools
committed
feat(client-connectcases): Introduces CustomEntity as part of the UserUnion data type. This field is used to indicate the entity who is performing the API action.
1 parent 6197c7b commit 9ee87df

File tree

7 files changed

+108
-16
lines changed

7 files changed

+108
-16
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { ConnectCasesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectCasesClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { CreateCaseRequest, CreateCaseResponse } from "../models/models_0";
9+
import { CreateCaseRequest, CreateCaseRequestFilterSensitiveLog, CreateCaseResponse } from "../models/models_0";
1010
import { de_CreateCaseCommand, se_CreateCaseCommand } from "../protocols/Aws_restJson1";
1111

1212
/**
@@ -72,6 +72,7 @@ export interface CreateCaseCommandOutput extends CreateCaseResponse, __MetadataB
7272
* clientToken: "STRING_VALUE",
7373
* performedBy: { // UserUnion Union: only one key present
7474
* userArn: "STRING_VALUE",
75+
* customEntity: "STRING_VALUE",
7576
* },
7677
* };
7778
* const command = new CreateCaseCommand(input);
@@ -134,7 +135,7 @@ export class CreateCaseCommand extends $Command
134135
})
135136
.s("AmazonConnectCases", "CreateCase", {})
136137
.n("ConnectCasesClient", "CreateCaseCommand")
137-
.f(void 0, void 0)
138+
.f(CreateCaseRequestFilterSensitiveLog, void 0)
138139
.ser(se_CreateCaseCommand)
139140
.de(de_CreateCaseCommand)
140141
.build() {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export interface CreateRelatedItemCommandOutput extends CreateRelatedItemRespons
9393
* },
9494
* performedBy: { // UserUnion Union: only one key present
9595
* userArn: "STRING_VALUE",
96+
* customEntity: "STRING_VALUE",
9697
* },
9798
* };
9899
* const command = new CreateRelatedItemCommand(input);

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { ConnectCasesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectCasesClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { GetCaseAuditEventsRequest, GetCaseAuditEventsResponse } from "../models/models_0";
9+
import {
10+
GetCaseAuditEventsRequest,
11+
GetCaseAuditEventsResponse,
12+
GetCaseAuditEventsResponseFilterSensitiveLog,
13+
} from "../models/models_0";
1014
import { de_GetCaseAuditEventsCommand, se_GetCaseAuditEventsCommand } from "../protocols/Aws_restJson1";
1115

1216
/**
@@ -73,6 +77,7 @@ export interface GetCaseAuditEventsCommandOutput extends GetCaseAuditEventsRespo
7377
* // performedBy: { // AuditEventPerformedBy
7478
* // user: { // UserUnion Union: only one key present
7579
* // userArn: "STRING_VALUE",
80+
* // customEntity: "STRING_VALUE",
7681
* // },
7782
* // iamPrincipalArn: "STRING_VALUE", // required
7883
* // },
@@ -128,7 +133,7 @@ export class GetCaseAuditEventsCommand extends $Command
128133
})
129134
.s("AmazonConnectCases", "GetCaseAuditEvents", {})
130135
.n("ConnectCasesClient", "GetCaseAuditEventsCommand")
131-
.f(void 0, void 0)
136+
.f(void 0, GetCaseAuditEventsResponseFilterSensitiveLog)
132137
.ser(se_GetCaseAuditEventsCommand)
133138
.de(de_GetCaseAuditEventsCommand)
134139
.build() {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export interface SearchRelatedItemsCommandOutput extends SearchRelatedItemsRespo
115115
* // },
116116
* // performedBy: { // UserUnion Union: only one key present
117117
* // userArn: "STRING_VALUE",
118+
* // customEntity: "STRING_VALUE",
118119
* // },
119120
* // },
120121
* // ],

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { ConnectCasesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectCasesClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { UpdateCaseRequest, UpdateCaseResponse } from "../models/models_0";
9+
import { UpdateCaseRequest, UpdateCaseRequestFilterSensitiveLog, UpdateCaseResponse } from "../models/models_0";
1010
import { de_UpdateCaseCommand, se_UpdateCaseCommand } from "../protocols/Aws_restJson1";
1111

1212
/**
@@ -58,6 +58,7 @@ export interface UpdateCaseCommandOutput extends UpdateCaseResponse, __MetadataB
5858
* ],
5959
* performedBy: { // UserUnion Union: only one key present
6060
* userArn: "STRING_VALUE",
61+
* customEntity: "STRING_VALUE",
6162
* },
6263
* };
6364
* const command = new UpdateCaseCommand(input);
@@ -112,7 +113,7 @@ export class UpdateCaseCommand extends $Command
112113
})
113114
.s("AmazonConnectCases", "UpdateCase", {})
114115
.n("ConnectCasesClient", "UpdateCaseCommand")
115-
.f(void 0, void 0)
116+
.f(UpdateCaseRequestFilterSensitiveLog, void 0)
116117
.ser(se_UpdateCaseCommand)
117118
.de(de_UpdateCaseCommand)
118119
.build() {

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

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ export interface FieldValue {
190190
}
191191

192192
/**
193-
* <p>Represents the identity of the person who performed the action.</p>
193+
* <p>Represents the entity that performed the action.</p>
194194
* @public
195195
*/
196-
export type UserUnion = UserUnion.UserArnMember | UserUnion.$UnknownMember;
196+
export type UserUnion = UserUnion.CustomEntityMember | UserUnion.UserArnMember | UserUnion.$UnknownMember;
197197

198198
/**
199199
* @public
@@ -205,6 +205,17 @@ export namespace UserUnion {
205205
*/
206206
export interface UserArnMember {
207207
userArn: string;
208+
customEntity?: never;
209+
$unknown?: never;
210+
}
211+
212+
/**
213+
* <p>Any provided entity.</p>
214+
* @public
215+
*/
216+
export interface CustomEntityMember {
217+
userArn?: never;
218+
customEntity: string;
208219
$unknown?: never;
209220
}
210221

@@ -213,16 +224,19 @@ export namespace UserUnion {
213224
*/
214225
export interface $UnknownMember {
215226
userArn?: never;
227+
customEntity?: never;
216228
$unknown: [string, any];
217229
}
218230

219231
export interface Visitor<T> {
220232
userArn: (value: string) => T;
233+
customEntity: (value: string) => T;
221234
_: (name: string, value: any) => T;
222235
}
223236

224237
export const visit = <T>(value: UserUnion, visitor: Visitor<T>): T => {
225238
if (value.userArn !== undefined) return visitor.userArn(value.userArn);
239+
if (value.customEntity !== undefined) return visitor.customEntity(value.customEntity);
226240
return visitor._(value.$unknown[0], value.$unknown[1]);
227241
};
228242
}
@@ -260,7 +274,7 @@ export interface CreateCaseRequest {
260274
clientToken?: string | undefined;
261275

262276
/**
263-
* <p>Represents the identity of the person who performed the action.</p>
277+
* <p>Represents the entity that performed the action.</p>
264278
* @public
265279
*/
266280
performedBy?: UserUnion | undefined;
@@ -636,7 +650,7 @@ export interface AuditEventField {
636650
*/
637651
export interface AuditEventPerformedBy {
638652
/**
639-
* <p>Represents the identity of the person who performed the action.</p>
653+
* <p>Represents the entity that performed the action.</p>
640654
* @public
641655
*/
642656
user?: UserUnion | undefined;
@@ -1782,7 +1796,7 @@ export interface UpdateCaseRequest {
17821796
fields: FieldValue[] | undefined;
17831797

17841798
/**
1785-
* <p>Represents the identity of the person who performed the action.</p>
1799+
* <p>Represents the entity that performed the action.</p>
17861800
* @public
17871801
*/
17881802
performedBy?: UserUnion | undefined;
@@ -4134,6 +4148,49 @@ export interface SearchCasesRequest {
41344148
fields?: FieldIdentifier[] | undefined;
41354149
}
41364150

4151+
/**
4152+
* @internal
4153+
*/
4154+
export const UserUnionFilterSensitiveLog = (obj: UserUnion): any => {
4155+
if (obj.userArn !== undefined) return { userArn: obj.userArn };
4156+
if (obj.customEntity !== undefined) return { customEntity: SENSITIVE_STRING };
4157+
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
4158+
};
4159+
4160+
/**
4161+
* @internal
4162+
*/
4163+
export const CreateCaseRequestFilterSensitiveLog = (obj: CreateCaseRequest): any => ({
4164+
...obj,
4165+
...(obj.fields && { fields: obj.fields.map((item) => item) }),
4166+
...(obj.performedBy && { performedBy: UserUnionFilterSensitiveLog(obj.performedBy) }),
4167+
});
4168+
4169+
/**
4170+
* @internal
4171+
*/
4172+
export const AuditEventPerformedByFilterSensitiveLog = (obj: AuditEventPerformedBy): any => ({
4173+
...obj,
4174+
...(obj.user && { user: UserUnionFilterSensitiveLog(obj.user) }),
4175+
});
4176+
4177+
/**
4178+
* @internal
4179+
*/
4180+
export const AuditEventFilterSensitiveLog = (obj: AuditEvent): any => ({
4181+
...obj,
4182+
...(obj.fields && { fields: obj.fields.map((item) => item) }),
4183+
...(obj.performedBy && { performedBy: AuditEventPerformedByFilterSensitiveLog(obj.performedBy) }),
4184+
});
4185+
4186+
/**
4187+
* @internal
4188+
*/
4189+
export const GetCaseAuditEventsResponseFilterSensitiveLog = (obj: GetCaseAuditEventsResponse): any => ({
4190+
...obj,
4191+
...(obj.auditEvents && { auditEvents: obj.auditEvents.map((item) => AuditEventFilterSensitiveLog(item)) }),
4192+
});
4193+
41374194
/**
41384195
* @internal
41394196
*/
@@ -4169,7 +4226,7 @@ export const RelatedItemInputContentFilterSensitiveLog = (obj: RelatedItemInputC
41694226
export const CreateRelatedItemRequestFilterSensitiveLog = (obj: CreateRelatedItemRequest): any => ({
41704227
...obj,
41714228
...(obj.content && { content: RelatedItemInputContentFilterSensitiveLog(obj.content) }),
4172-
...(obj.performedBy && { performedBy: obj.performedBy }),
4229+
...(obj.performedBy && { performedBy: UserUnionFilterSensitiveLog(obj.performedBy) }),
41734230
});
41744231

41754232
/**
@@ -4233,7 +4290,7 @@ export const RelatedItemContentFilterSensitiveLog = (obj: RelatedItemContent): a
42334290
export const SearchRelatedItemsResponseItemFilterSensitiveLog = (obj: SearchRelatedItemsResponseItem): any => ({
42344291
...obj,
42354292
...(obj.content && { content: RelatedItemContentFilterSensitiveLog(obj.content) }),
4236-
...(obj.performedBy && { performedBy: obj.performedBy }),
4293+
...(obj.performedBy && { performedBy: UserUnionFilterSensitiveLog(obj.performedBy) }),
42374294
});
42384295

42394296
/**
@@ -4245,3 +4302,12 @@ export const SearchRelatedItemsResponseFilterSensitiveLog = (obj: SearchRelatedI
42454302
relatedItems: obj.relatedItems.map((item) => SearchRelatedItemsResponseItemFilterSensitiveLog(item)),
42464303
}),
42474304
});
4305+
4306+
/**
4307+
* @internal
4308+
*/
4309+
export const UpdateCaseRequestFilterSensitiveLog = (obj: UpdateCaseRequest): any => ({
4310+
...obj,
4311+
...(obj.fields && { fields: obj.fields.map((item) => item) }),
4312+
...(obj.performedBy && { performedBy: UserUnionFilterSensitiveLog(obj.performedBy) }),
4313+
});

codegen/sdk-codegen/aws-models/connectcases.json

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,17 @@
24722472
"smithy.api#timestampFormat": "date-time"
24732473
}
24742474
},
2475+
"com.amazonaws.connectcases#CustomEntity": {
2476+
"type": "string",
2477+
"traits": {
2478+
"smithy.api#length": {
2479+
"min": 1,
2480+
"max": 500
2481+
},
2482+
"smithy.api#pattern": "^[a-zA-Z0-9_\\-\\.@:/ ]*[a-zA-Z0-9_\\-\\.@:/]$",
2483+
"smithy.api#sensitive": {}
2484+
}
2485+
},
24752486
"com.amazonaws.connectcases#DeleteCaseRule": {
24762487
"type": "operation",
24772488
"input": {
@@ -5580,7 +5591,7 @@
55805591
"smithy.api#documentation": "<p>The maximum number of cases to return. The current maximum supported value is 25. This is\n also the default value when no other value is provided.</p>",
55815592
"smithy.api#range": {
55825593
"min": 1,
5583-
"max": 25
5594+
"max": 100
55845595
}
55855596
}
55865597
},
@@ -5642,7 +5653,7 @@
56425653
"traits": {
56435654
"smithy.api#documentation": "<p>A list of case documents where each case contains the properties <code>CaseId</code> and\n <code>Fields</code> where each field is a complex union structure. </p>",
56445655
"smithy.api#length": {
5645-
"max": 25
5656+
"max": 100
56465657
},
56475658
"smithy.api#required": {}
56485659
}
@@ -6907,10 +6918,16 @@
69076918
"traits": {
69086919
"smithy.api#documentation": "<p>Represents the Amazon Connect ARN of the user.</p>"
69096920
}
6921+
},
6922+
"customEntity": {
6923+
"target": "com.amazonaws.connectcases#CustomEntity",
6924+
"traits": {
6925+
"smithy.api#documentation": "<p>Any provided entity.</p>"
6926+
}
69106927
}
69116928
},
69126929
"traits": {
6913-
"smithy.api#documentation": "<p>Represents the identity of the person who performed the action.</p>"
6930+
"smithy.api#documentation": "<p>Represents the entity that performed the action.</p>"
69146931
}
69156932
},
69166933
"com.amazonaws.connectcases#ValidationException": {

0 commit comments

Comments
 (0)