Skip to content

Commit

Permalink
feat(client-connectcases): This feature supports the release of Files…
Browse files Browse the repository at this point in the history
… related items
  • Loading branch information
awstools committed May 3, 2024
1 parent c4eb11d commit 89b45ab
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export interface CreateRelatedItemCommandOutput extends CreateRelatedItemRespons
* body: "STRING_VALUE", // required
* contentType: "STRING_VALUE", // required
* },
* file: { // FileContent
* fileArn: "STRING_VALUE", // required
* },
* },
* performedBy: { // UserUnion Union: only one key present
* userArn: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export interface SearchRelatedItemsCommandOutput extends SearchRelatedItemsRespo
* contactArn: "STRING_VALUE",
* },
* comment: {},
* file: { // FileFilter
* fileArn: "STRING_VALUE",
* },
* },
* ],
* };
Expand All @@ -74,6 +77,9 @@ export interface SearchRelatedItemsCommandOutput extends SearchRelatedItemsRespo
* // body: "STRING_VALUE", // required
* // contentType: "STRING_VALUE", // required
* // },
* // file: { // FileContent
* // fileArn: "STRING_VALUE", // required
* // },
* // },
* // tags: { // Tags
* // "<keys>": "STRING_VALUE",
Expand Down
102 changes: 89 additions & 13 deletions clients/client-connectcases/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ export interface AuditEventPerformedBy {
export const RelatedItemType = {
COMMENT: "Comment",
CONTACT: "Contact",
FILE: "File",
} as const;

/**
Expand Down Expand Up @@ -845,13 +846,26 @@ export interface Contact {
contactArn: string | undefined;
}

/**
* <p>An object that represents a content of an Amazon Connect file object.</p>
* @public
*/
export interface FileContent {
/**
* <p>The Amazon Resource Name (ARN) of a File in Amazon Connect.</p>
* @public
*/
fileArn: string | undefined;
}

/**
* <p>Represents the content of a related item to be created.</p>
* @public
*/
export type RelatedItemInputContent =
| RelatedItemInputContent.CommentMember
| RelatedItemInputContent.ContactMember
| RelatedItemInputContent.FileMember
| RelatedItemInputContent.$UnknownMember;

/**
Expand All @@ -865,6 +879,7 @@ export namespace RelatedItemInputContent {
export interface ContactMember {
contact: Contact;
comment?: never;
file?: never;
$unknown?: never;
}

Expand All @@ -875,6 +890,18 @@ export namespace RelatedItemInputContent {
export interface CommentMember {
contact?: never;
comment: CommentContent;
file?: never;
$unknown?: never;
}

/**
* <p>A file of related items.</p>
* @public
*/
export interface FileMember {
contact?: never;
comment?: never;
file: FileContent;
$unknown?: never;
}

Expand All @@ -884,18 +911,21 @@ export namespace RelatedItemInputContent {
export interface $UnknownMember {
contact?: never;
comment?: never;
file?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
contact: (value: Contact) => T;
comment: (value: CommentContent) => T;
file: (value: FileContent) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: RelatedItemInputContent, visitor: Visitor<T>): T => {
if (value.contact !== undefined) return visitor.contact(value.contact);
if (value.comment !== undefined) return visitor.comment(value.comment);
if (value.file !== undefined) return visitor.file(value.file);
return visitor._(value.$unknown[0], value.$unknown[1]);
};
}
Expand Down Expand Up @@ -997,13 +1027,26 @@ export interface ContactFilter {
contactArn?: string;
}

/**
* <p>A filter for related items of type <code>File</code>.</p>
* @public
*/
export interface FileFilter {
/**
* <p>The Amazon Resource Name (ARN) of the file.</p>
* @public
*/
fileArn?: string;
}

/**
* <p>The list of types of related items and their parameters to use for filtering.</p>
* @public
*/
export type RelatedItemTypeFilter =
| RelatedItemTypeFilter.CommentMember
| RelatedItemTypeFilter.ContactMember
| RelatedItemTypeFilter.FileMember
| RelatedItemTypeFilter.$UnknownMember;

/**
Expand All @@ -1017,6 +1060,7 @@ export namespace RelatedItemTypeFilter {
export interface ContactMember {
contact: ContactFilter;
comment?: never;
file?: never;
$unknown?: never;
}

Expand All @@ -1027,6 +1071,18 @@ export namespace RelatedItemTypeFilter {
export interface CommentMember {
contact?: never;
comment: CommentFilter;
file?: never;
$unknown?: never;
}

/**
* <p>A filter for related items of this type of <code>File</code>.</p>
* @public
*/
export interface FileMember {
contact?: never;
comment?: never;
file: FileFilter;
$unknown?: never;
}

Expand All @@ -1036,18 +1092,21 @@ export namespace RelatedItemTypeFilter {
export interface $UnknownMember {
contact?: never;
comment?: never;
file?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
contact: (value: ContactFilter) => T;
comment: (value: CommentFilter) => T;
file: (value: FileFilter) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: RelatedItemTypeFilter, visitor: Visitor<T>): T => {
if (value.contact !== undefined) return visitor.contact(value.contact);
if (value.comment !== undefined) return visitor.comment(value.comment);
if (value.file !== undefined) return visitor.file(value.file);
return visitor._(value.$unknown[0], value.$unknown[1]);
};
}
Expand Down Expand Up @@ -1120,6 +1179,7 @@ export interface ContactContent {
export type RelatedItemContent =
| RelatedItemContent.CommentMember
| RelatedItemContent.ContactMember
| RelatedItemContent.FileMember
| RelatedItemContent.$UnknownMember;

/**
Expand All @@ -1133,6 +1193,7 @@ export namespace RelatedItemContent {
export interface ContactMember {
contact: ContactContent;
comment?: never;
file?: never;
$unknown?: never;
}

Expand All @@ -1143,6 +1204,18 @@ export namespace RelatedItemContent {
export interface CommentMember {
contact?: never;
comment: CommentContent;
file?: never;
$unknown?: never;
}

/**
* <p>Represents the content of a File to be returned to agents.</p>
* @public
*/
export interface FileMember {
contact?: never;
comment?: never;
file: FileContent;
$unknown?: never;
}

Expand All @@ -1152,18 +1225,21 @@ export namespace RelatedItemContent {
export interface $UnknownMember {
contact?: never;
comment?: never;
file?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
contact: (value: ContactContent) => T;
comment: (value: CommentContent) => T;
file: (value: FileContent) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: RelatedItemContent, visitor: Visitor<T>): T => {
if (value.contact !== undefined) return visitor.contact(value.contact);
if (value.comment !== undefined) return visitor.comment(value.comment);
if (value.file !== undefined) return visitor.file(value.file);
return visitor._(value.$unknown[0], value.$unknown[1]);
};
}
Expand Down Expand Up @@ -1885,19 +1961,19 @@ export interface GetFieldResponse {
tags?: Record<string, string>;

/**
* <p>Indicates whether the resource has been deleted.</p>
* <p>Denotes whether or not the resource has been deleted.</p>
* @public
*/
deleted?: boolean;

/**
* <p>The timestamp for when the resource was created.</p>
* <p>Timestamp at which the resource was created.</p>
* @public
*/
createdTime?: Date;

/**
* <p>The timestamp for when the resource was created or last modified.</p>
* <p>Timestamp at which the resource was created or last modified.</p>
* @public
*/
lastModifiedTime?: Date;
Expand Down Expand Up @@ -2056,13 +2132,13 @@ export interface CreateFieldResponse {
*/
export interface DeleteFieldRequest {
/**
* <p>The unique identifier of the Cases domain. </p>
* <p>The unique identifier of the Cases domain.</p>
* @public
*/
domainId: string | undefined;

/**
* <p>The unique identifier of a field.</p>
* <p>Unique identifier of the field.</p>
* @public
*/
fieldId: string | undefined;
Expand Down Expand Up @@ -2423,7 +2499,7 @@ export interface CreateLayoutResponse {
*/
export interface DeleteLayoutRequest {
/**
* <p>The unique identifier of the Cases domain. </p>
* <p>The unique identifier of the Cases domain.</p>
* @public
*/
domainId: string | undefined;
Expand Down Expand Up @@ -2493,19 +2569,19 @@ export interface GetLayoutResponse {
tags?: Record<string, string>;

/**
* <p>Indicates whether the resource has been deleted.</p>
* <p>Denotes whether or not the resource has been deleted.</p>
* @public
*/
deleted?: boolean;

/**
* <p>The timestamp for when the resource was created.</p>
* <p>Timestamp at which the resource was created.</p>
* @public
*/
createdTime?: Date;

/**
* <p>The timestamp for when the resource was created or last modified.</p>
* <p>Timestamp at which the resource was created or last modified.</p>
* @public
*/
lastModifiedTime?: Date;
Expand Down Expand Up @@ -2752,7 +2828,7 @@ export interface CreateTemplateResponse {
*/
export interface DeleteTemplateRequest {
/**
* <p>The unique identifier of the Cases domain. </p>
* <p>The unique identifier of the Cases domain.</p>
* @public
*/
domainId: string | undefined;
Expand Down Expand Up @@ -2840,19 +2916,19 @@ export interface GetTemplateResponse {
status: TemplateStatus | undefined;

/**
* <p>Indicates whether the resource has been deleted.</p>
* <p>Denotes whether or not the resource has been deleted.</p>
* @public
*/
deleted?: boolean;

/**
* <p>The timestamp for when the resource was created.</p>
* <p>Timestamp at which the resource was created.</p>
* @public
*/
createdTime?: Date;

/**
* <p>The timestamp for when the resource was created or last modified.</p>
* <p>Timestamp at which the resource was created or last modified.</p>
* @public
*/
lastModifiedTime?: Date;
Expand Down
13 changes: 13 additions & 0 deletions clients/client-connectcases/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ import {
FieldOption,
FieldValue,
FieldValueUnion,
FileContent,
FileFilter,
GetFieldResponse,
InternalServerException,
LayoutConfiguration,
Expand Down Expand Up @@ -1874,6 +1876,10 @@ const se_FieldValueUnion = (input: FieldValueUnion, context: __SerdeContext): an
});
};

// se_FileContent omitted.

// se_FileFilter omitted.

// se_LayoutConfiguration omitted.

// se_LayoutContent omitted.
Expand Down Expand Up @@ -2108,6 +2114,8 @@ const de_FieldValueUnion = (output: any, context: __SerdeContext): FieldValueUni
return { $unknown: Object.entries(output)[0] };
};

// de_FileContent omitted.

/**
* deserializeAws_restJson1GetFieldResponse
*/
Expand Down Expand Up @@ -2150,6 +2158,11 @@ const de_RelatedItemContent = (output: any, context: __SerdeContext): RelatedIte
contact: de_ContactContent(output.contact, context),
};
}
if (output.file != null) {
return {
file: _json(output.file),
};
}
return { $unknown: Object.entries(output)[0] };
};

Expand Down
Loading

0 comments on commit 89b45ab

Please sign in to comment.