From 1d9614406fbebf2e7fca9e2ef58fc1930a934a8f Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 29 Apr 2024 18:15:10 +0000 Subject: [PATCH] feat(client-connectcases): This feature releases DeleteField, DeletedLayout, and DeleteTemplate API's --- clients/client-connectcases/README.md | 24 ++ .../client-connectcases/src/ConnectCases.ts | 50 +++ .../src/ConnectCasesClient.ts | 9 + .../src/commands/BatchGetFieldCommand.ts | 3 + .../src/commands/DeleteFieldCommand.ts | 155 ++++++++++ .../src/commands/DeleteLayoutCommand.ts | 116 +++++++ .../src/commands/DeleteTemplateCommand.ts | 118 +++++++ .../src/commands/GetLayoutCommand.ts | 3 + .../src/commands/GetTemplateCommand.ts | 3 + .../client-connectcases/src/commands/index.ts | 3 + .../src/models/models_0.ts | 124 +++++++- .../src/protocols/Aws_restJson1.ts | 114 +++++++ .../sdk-codegen/aws-models/connectcases.json | 287 +++++++++++++++++- 13 files changed, 1004 insertions(+), 5 deletions(-) create mode 100644 clients/client-connectcases/src/commands/DeleteFieldCommand.ts create mode 100644 clients/client-connectcases/src/commands/DeleteLayoutCommand.ts create mode 100644 clients/client-connectcases/src/commands/DeleteTemplateCommand.ts diff --git a/clients/client-connectcases/README.md b/clients/client-connectcases/README.md index 41babe712248c..44180559dc015 100644 --- a/clients/client-connectcases/README.md +++ b/clients/client-connectcases/README.md @@ -278,6 +278,30 @@ DeleteDomain [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectcases/command/DeleteDomainCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/DeleteDomainCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/DeleteDomainCommandOutput/) + +
+ +DeleteField + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectcases/command/DeleteFieldCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/DeleteFieldCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/DeleteFieldCommandOutput/) + +
+
+ +DeleteLayout + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectcases/command/DeleteLayoutCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/DeleteLayoutCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/DeleteLayoutCommandOutput/) + +
+
+ +DeleteTemplate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectcases/command/DeleteTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/DeleteTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connectcases/Interface/DeleteTemplateCommandOutput/) +
diff --git a/clients/client-connectcases/src/ConnectCases.ts b/clients/client-connectcases/src/ConnectCases.ts index 70444a484b0fe..f5c38c8f0263d 100644 --- a/clients/client-connectcases/src/ConnectCases.ts +++ b/clients/client-connectcases/src/ConnectCases.ts @@ -39,6 +39,17 @@ import { DeleteDomainCommandInput, DeleteDomainCommandOutput, } from "./commands/DeleteDomainCommand"; +import { DeleteFieldCommand, DeleteFieldCommandInput, DeleteFieldCommandOutput } from "./commands/DeleteFieldCommand"; +import { + DeleteLayoutCommand, + DeleteLayoutCommandInput, + DeleteLayoutCommandOutput, +} from "./commands/DeleteLayoutCommand"; +import { + DeleteTemplateCommand, + DeleteTemplateCommandInput, + DeleteTemplateCommandOutput, +} from "./commands/DeleteTemplateCommand"; import { GetCaseAuditEventsCommand, GetCaseAuditEventsCommandInput, @@ -117,6 +128,9 @@ const commands = { CreateRelatedItemCommand, CreateTemplateCommand, DeleteDomainCommand, + DeleteFieldCommand, + DeleteLayoutCommand, + DeleteTemplateCommand, GetCaseCommand, GetCaseAuditEventsCommand, GetCaseEventConfigurationCommand, @@ -256,6 +270,42 @@ export interface ConnectCases { cb: (err: any, data?: DeleteDomainCommandOutput) => void ): void; + /** + * @see {@link DeleteFieldCommand} + */ + deleteField(args: DeleteFieldCommandInput, options?: __HttpHandlerOptions): Promise; + deleteField(args: DeleteFieldCommandInput, cb: (err: any, data?: DeleteFieldCommandOutput) => void): void; + deleteField( + args: DeleteFieldCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteFieldCommandOutput) => void + ): void; + + /** + * @see {@link DeleteLayoutCommand} + */ + deleteLayout(args: DeleteLayoutCommandInput, options?: __HttpHandlerOptions): Promise; + deleteLayout(args: DeleteLayoutCommandInput, cb: (err: any, data?: DeleteLayoutCommandOutput) => void): void; + deleteLayout( + args: DeleteLayoutCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteLayoutCommandOutput) => void + ): void; + + /** + * @see {@link DeleteTemplateCommand} + */ + deleteTemplate( + args: DeleteTemplateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteTemplate(args: DeleteTemplateCommandInput, cb: (err: any, data?: DeleteTemplateCommandOutput) => void): void; + deleteTemplate( + args: DeleteTemplateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteTemplateCommandOutput) => void + ): void; + /** * @see {@link GetCaseCommand} */ diff --git a/clients/client-connectcases/src/ConnectCasesClient.ts b/clients/client-connectcases/src/ConnectCasesClient.ts index 70b50a3435e3b..7d6de5224bfd2 100644 --- a/clients/client-connectcases/src/ConnectCasesClient.ts +++ b/clients/client-connectcases/src/ConnectCasesClient.ts @@ -65,6 +65,9 @@ import { CreateLayoutCommandInput, CreateLayoutCommandOutput } from "./commands/ import { CreateRelatedItemCommandInput, CreateRelatedItemCommandOutput } from "./commands/CreateRelatedItemCommand"; import { CreateTemplateCommandInput, CreateTemplateCommandOutput } from "./commands/CreateTemplateCommand"; import { DeleteDomainCommandInput, DeleteDomainCommandOutput } from "./commands/DeleteDomainCommand"; +import { DeleteFieldCommandInput, DeleteFieldCommandOutput } from "./commands/DeleteFieldCommand"; +import { DeleteLayoutCommandInput, DeleteLayoutCommandOutput } from "./commands/DeleteLayoutCommand"; +import { DeleteTemplateCommandInput, DeleteTemplateCommandOutput } from "./commands/DeleteTemplateCommand"; import { GetCaseAuditEventsCommandInput, GetCaseAuditEventsCommandOutput } from "./commands/GetCaseAuditEventsCommand"; import { GetCaseCommandInput, GetCaseCommandOutput } from "./commands/GetCaseCommand"; import { @@ -123,6 +126,9 @@ export type ServiceInputTypes = | CreateRelatedItemCommandInput | CreateTemplateCommandInput | DeleteDomainCommandInput + | DeleteFieldCommandInput + | DeleteLayoutCommandInput + | DeleteTemplateCommandInput | GetCaseAuditEventsCommandInput | GetCaseCommandInput | GetCaseEventConfigurationCommandInput @@ -159,6 +165,9 @@ export type ServiceOutputTypes = | CreateRelatedItemCommandOutput | CreateTemplateCommandOutput | DeleteDomainCommandOutput + | DeleteFieldCommandOutput + | DeleteLayoutCommandOutput + | DeleteTemplateCommandOutput | GetCaseAuditEventsCommandOutput | GetCaseCommandOutput | GetCaseEventConfigurationCommandOutput diff --git a/clients/client-connectcases/src/commands/BatchGetFieldCommand.ts b/clients/client-connectcases/src/commands/BatchGetFieldCommand.ts index 46a2e39847ff4..4d6b66d2d232f 100644 --- a/clients/client-connectcases/src/commands/BatchGetFieldCommand.ts +++ b/clients/client-connectcases/src/commands/BatchGetFieldCommand.ts @@ -56,6 +56,9 @@ export interface BatchGetFieldCommandOutput extends BatchGetFieldResponse, __Met * // tags: { // Tags * // "": "STRING_VALUE", * // }, + * // deleted: true || false, + * // createdTime: new Date("TIMESTAMP"), + * // lastModifiedTime: new Date("TIMESTAMP"), * // }, * // ], * // errors: [ // BatchGetFieldErrorList // required diff --git a/clients/client-connectcases/src/commands/DeleteFieldCommand.ts b/clients/client-connectcases/src/commands/DeleteFieldCommand.ts new file mode 100644 index 0000000000000..258a7611ff5cd --- /dev/null +++ b/clients/client-connectcases/src/commands/DeleteFieldCommand.ts @@ -0,0 +1,155 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ConnectCasesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectCasesClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteFieldRequest, DeleteFieldResponse } from "../models/models_0"; +import { de_DeleteFieldCommand, se_DeleteFieldCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteFieldCommand}. + */ +export interface DeleteFieldCommandInput extends DeleteFieldRequest {} +/** + * @public + * + * The output of {@link DeleteFieldCommand}. + */ +export interface DeleteFieldCommandOutput extends DeleteFieldResponse, __MetadataBearer {} + +/** + *

Deletes a field from a cases template. You can delete up to 100 fields per domain.

+ *

After a field is deleted:

+ *
    + *
  • + *

    You can still retrieve the field by calling BatchGetField.

    + *
  • + *
  • + *

    You cannot update a deleted field by calling UpdateField; it throws a + * ValidationException.

    + *
  • + *
  • + *

    Deleted fields are not included in the ListFields response.

    + *
  • + *
  • + *

    Calling CreateCase with a deleted field throws a ValidationException denoting + * which field IDs in the request have been deleted.

    + *
  • + *
  • + *

    Calling GetCase with a deleted field ID returns the deleted field's value if one + * exists.

    + *
  • + *
  • + *

    Calling UpdateCase with a deleted field ID throws a ValidationException if the + * case does not already contain a value for the deleted field. Otherwise it succeeds, + * allowing you to update or remove (using emptyValue: \{\}) the field's value from the + * case.

    + *
  • + *
  • + *

    + * GetTemplate does not return field IDs for deleted fields.

    + *
  • + *
  • + *

    + * GetLayout does not return field IDs for deleted fields.

    + *
  • + *
  • + *

    Calling SearchCases with the deleted field ID as a filter returns any cases that + * have a value for the deleted field that matches the filter criteria.

    + *
  • + *
  • + *

    Calling SearchCases with a searchTerm value that matches a deleted field's value on a + * case returns the case in the response.

    + *
  • + *
  • + *

    Calling BatchPutFieldOptions with a deleted field ID throw a ValidationException.

    + *
  • + *
  • + *

    Calling GetCaseEventConfiguration does not return field IDs for deleted fields.

    + *
  • + *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ConnectCasesClient, DeleteFieldCommand } from "@aws-sdk/client-connectcases"; // ES Modules import + * // const { ConnectCasesClient, DeleteFieldCommand } = require("@aws-sdk/client-connectcases"); // CommonJS import + * const client = new ConnectCasesClient(config); + * const input = { // DeleteFieldRequest + * domainId: "STRING_VALUE", // required + * fieldId: "STRING_VALUE", // required + * }; + * const command = new DeleteFieldCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteFieldCommandInput - {@link DeleteFieldCommandInput} + * @returns {@link DeleteFieldCommandOutput} + * @see {@link DeleteFieldCommandInput} for command's `input` shape. + * @see {@link DeleteFieldCommandOutput} for command's `response` shape. + * @see {@link ConnectCasesClientResolvedConfig | config} for ConnectCasesClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

The requested operation would cause a conflict with the current state of a service + * resource associated with the request. Resolve the conflict before retrying this request. See + * the accompanying error message for details.

+ * + * @throws {@link InternalServerException} (server fault) + *

We couldn't process your request because of an issue with the server. Try again + * later.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

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.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The service quota has been exceeded. For a list of service quotas, see Amazon Connect Service Quotas in the Amazon Connect + * Administrator Guide.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The rate has been exceeded for this API. Please try again after a few minutes.

+ * + * @throws {@link ValidationException} (client fault) + *

The request isn't valid. Check the syntax and try again.

+ * + * @throws {@link ConnectCasesServiceException} + *

Base exception class for all service exceptions from ConnectCases service.

+ * + * @public + */ +export class DeleteFieldCommand extends $Command + .classBuilder< + DeleteFieldCommandInput, + DeleteFieldCommandOutput, + ConnectCasesClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ConnectCasesClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonConnectCases", "DeleteField", {}) + .n("ConnectCasesClient", "DeleteFieldCommand") + .f(void 0, void 0) + .ser(se_DeleteFieldCommand) + .de(de_DeleteFieldCommand) + .build() {} diff --git a/clients/client-connectcases/src/commands/DeleteLayoutCommand.ts b/clients/client-connectcases/src/commands/DeleteLayoutCommand.ts new file mode 100644 index 0000000000000..5a3d50b59436e --- /dev/null +++ b/clients/client-connectcases/src/commands/DeleteLayoutCommand.ts @@ -0,0 +1,116 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ConnectCasesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectCasesClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteLayoutRequest, DeleteLayoutResponse } from "../models/models_0"; +import { de_DeleteLayoutCommand, se_DeleteLayoutCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteLayoutCommand}. + */ +export interface DeleteLayoutCommandInput extends DeleteLayoutRequest {} +/** + * @public + * + * The output of {@link DeleteLayoutCommand}. + */ +export interface DeleteLayoutCommandOutput extends DeleteLayoutResponse, __MetadataBearer {} + +/** + *

Deletes a layout from a cases template. You can delete up to 100 layouts per domain.

+ * + *

After a layout is deleted:

+ *
    + *
  • + *

    You can still retrieve the layout by calling GetLayout.

    + *
  • + *
  • + *

    You cannot update a deleted layout by calling UpdateLayout; it throws a + * ValidationException.

    + *
  • + *
  • + *

    Deleted layouts are not included in the ListLayouts response.

    + *
  • + *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ConnectCasesClient, DeleteLayoutCommand } from "@aws-sdk/client-connectcases"; // ES Modules import + * // const { ConnectCasesClient, DeleteLayoutCommand } = require("@aws-sdk/client-connectcases"); // CommonJS import + * const client = new ConnectCasesClient(config); + * const input = { // DeleteLayoutRequest + * domainId: "STRING_VALUE", // required + * layoutId: "STRING_VALUE", // required + * }; + * const command = new DeleteLayoutCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteLayoutCommandInput - {@link DeleteLayoutCommandInput} + * @returns {@link DeleteLayoutCommandOutput} + * @see {@link DeleteLayoutCommandInput} for command's `input` shape. + * @see {@link DeleteLayoutCommandOutput} for command's `response` shape. + * @see {@link ConnectCasesClientResolvedConfig | config} for ConnectCasesClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

The requested operation would cause a conflict with the current state of a service + * resource associated with the request. Resolve the conflict before retrying this request. See + * the accompanying error message for details.

+ * + * @throws {@link InternalServerException} (server fault) + *

We couldn't process your request because of an issue with the server. Try again + * later.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

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.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The rate has been exceeded for this API. Please try again after a few minutes.

+ * + * @throws {@link ValidationException} (client fault) + *

The request isn't valid. Check the syntax and try again.

+ * + * @throws {@link ConnectCasesServiceException} + *

Base exception class for all service exceptions from ConnectCases service.

+ * + * @public + */ +export class DeleteLayoutCommand extends $Command + .classBuilder< + DeleteLayoutCommandInput, + DeleteLayoutCommandOutput, + ConnectCasesClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ConnectCasesClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonConnectCases", "DeleteLayout", {}) + .n("ConnectCasesClient", "DeleteLayoutCommand") + .f(void 0, void 0) + .ser(se_DeleteLayoutCommand) + .de(de_DeleteLayoutCommand) + .build() {} diff --git a/clients/client-connectcases/src/commands/DeleteTemplateCommand.ts b/clients/client-connectcases/src/commands/DeleteTemplateCommand.ts new file mode 100644 index 0000000000000..e87a30188e20d --- /dev/null +++ b/clients/client-connectcases/src/commands/DeleteTemplateCommand.ts @@ -0,0 +1,118 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ConnectCasesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectCasesClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteTemplateRequest, DeleteTemplateResponse } from "../models/models_0"; +import { de_DeleteTemplateCommand, se_DeleteTemplateCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteTemplateCommand}. + */ +export interface DeleteTemplateCommandInput extends DeleteTemplateRequest {} +/** + * @public + * + * The output of {@link DeleteTemplateCommand}. + */ +export interface DeleteTemplateCommandOutput extends DeleteTemplateResponse, __MetadataBearer {} + +/** + *

Deletes a cases template. You can delete up to 100 templates per domain.

+ * + *

After a cases template is deleted:

+ *
    + *
  • + *

    You can still retrieve the template by calling GetTemplate.

    + *
  • + *
  • + *

    You cannot update the template.

    + *
  • + *
  • + *

    You cannot create a case by using the deleted template.

    + *
  • + *
  • + *

    Deleted templates are not included in the ListTemplates response.

    + *
  • + *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ConnectCasesClient, DeleteTemplateCommand } from "@aws-sdk/client-connectcases"; // ES Modules import + * // const { ConnectCasesClient, DeleteTemplateCommand } = require("@aws-sdk/client-connectcases"); // CommonJS import + * const client = new ConnectCasesClient(config); + * const input = { // DeleteTemplateRequest + * domainId: "STRING_VALUE", // required + * templateId: "STRING_VALUE", // required + * }; + * const command = new DeleteTemplateCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteTemplateCommandInput - {@link DeleteTemplateCommandInput} + * @returns {@link DeleteTemplateCommandOutput} + * @see {@link DeleteTemplateCommandInput} for command's `input` shape. + * @see {@link DeleteTemplateCommandOutput} for command's `response` shape. + * @see {@link ConnectCasesClientResolvedConfig | config} for ConnectCasesClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

The requested operation would cause a conflict with the current state of a service + * resource associated with the request. Resolve the conflict before retrying this request. See + * the accompanying error message for details.

+ * + * @throws {@link InternalServerException} (server fault) + *

We couldn't process your request because of an issue with the server. Try again + * later.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

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.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The rate has been exceeded for this API. Please try again after a few minutes.

+ * + * @throws {@link ValidationException} (client fault) + *

The request isn't valid. Check the syntax and try again.

+ * + * @throws {@link ConnectCasesServiceException} + *

Base exception class for all service exceptions from ConnectCases service.

+ * + * @public + */ +export class DeleteTemplateCommand extends $Command + .classBuilder< + DeleteTemplateCommandInput, + DeleteTemplateCommandOutput, + ConnectCasesClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ConnectCasesClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonConnectCases", "DeleteTemplate", {}) + .n("ConnectCasesClient", "DeleteTemplateCommand") + .f(void 0, void 0) + .ser(se_DeleteTemplateCommand) + .de(de_DeleteTemplateCommand) + .build() {} diff --git a/clients/client-connectcases/src/commands/GetLayoutCommand.ts b/clients/client-connectcases/src/commands/GetLayoutCommand.ts index 900fc761b618a..9548eb099fccc 100644 --- a/clients/client-connectcases/src/commands/GetLayoutCommand.ts +++ b/clients/client-connectcases/src/commands/GetLayoutCommand.ts @@ -79,6 +79,9 @@ export interface GetLayoutCommandOutput extends GetLayoutResponse, __MetadataBea * // tags: { // Tags * // "": "STRING_VALUE", * // }, + * // deleted: true || false, + * // createdTime: new Date("TIMESTAMP"), + * // lastModifiedTime: new Date("TIMESTAMP"), * // }; * * ``` diff --git a/clients/client-connectcases/src/commands/GetTemplateCommand.ts b/clients/client-connectcases/src/commands/GetTemplateCommand.ts index 71c39aba6fa93..a38e5b5c0d07a 100644 --- a/clients/client-connectcases/src/commands/GetTemplateCommand.ts +++ b/clients/client-connectcases/src/commands/GetTemplateCommand.ts @@ -57,6 +57,9 @@ export interface GetTemplateCommandOutput extends GetTemplateResponse, __Metadat * // "": "STRING_VALUE", * // }, * // status: "STRING_VALUE", // required + * // deleted: true || false, + * // createdTime: new Date("TIMESTAMP"), + * // lastModifiedTime: new Date("TIMESTAMP"), * // }; * * ``` diff --git a/clients/client-connectcases/src/commands/index.ts b/clients/client-connectcases/src/commands/index.ts index fd6513e7143dc..4b037007e91c4 100644 --- a/clients/client-connectcases/src/commands/index.ts +++ b/clients/client-connectcases/src/commands/index.ts @@ -8,6 +8,9 @@ export * from "./CreateLayoutCommand"; export * from "./CreateRelatedItemCommand"; export * from "./CreateTemplateCommand"; export * from "./DeleteDomainCommand"; +export * from "./DeleteFieldCommand"; +export * from "./DeleteLayoutCommand"; +export * from "./DeleteTemplateCommand"; export * from "./GetCaseAuditEventsCommand"; export * from "./GetCaseCommand"; export * from "./GetCaseEventConfigurationCommand"; diff --git a/clients/client-connectcases/src/models/models_0.ts b/clients/client-connectcases/src/models/models_0.ts index 3eb5427384b96..b845a59167986 100644 --- a/clients/client-connectcases/src/models/models_0.ts +++ b/clients/client-connectcases/src/models/models_0.ts @@ -492,10 +492,6 @@ export interface GetCaseAuditEventsRequest { /** *

Object to store union of Field values.

- * - *

This data type is a UNION, so only one of the following members can be specified when - * used or returned.

- *
* @public */ export type AuditEventFieldValueUnion = @@ -1887,6 +1883,24 @@ export interface GetFieldResponse { * @public */ tags?: Record; + + /** + *

Indicates whether the resource has been deleted.

+ * @public + */ + deleted?: boolean; + + /** + *

The timestamp for when the resource was created.

+ * @public + */ + createdTime?: Date; + + /** + *

The timestamp for when the resource was created or last modified.

+ * @public + */ + lastModifiedTime?: Date; } /** @@ -2037,6 +2051,28 @@ export interface CreateFieldResponse { fieldArn: string | undefined; } +/** + * @public + */ +export interface DeleteFieldRequest { + /** + *

The unique identifier of the Cases domain.

+ * @public + */ + domainId: string | undefined; + + /** + *

The unique identifier of a field.

+ * @public + */ + fieldId: string | undefined; +} + +/** + * @public + */ +export interface DeleteFieldResponse {} + /** * @public */ @@ -2382,6 +2418,28 @@ export interface CreateLayoutResponse { layoutArn: string | undefined; } +/** + * @public + */ +export interface DeleteLayoutRequest { + /** + *

The unique identifier of the Cases domain.

+ * @public + */ + domainId: string | undefined; + + /** + *

The unique identifier of the layout.

+ * @public + */ + layoutId: string | undefined; +} + +/** + * @public + */ +export interface DeleteLayoutResponse {} + /** * @public */ @@ -2433,6 +2491,24 @@ export interface GetLayoutResponse { * @public */ tags?: Record; + + /** + *

Indicates whether the resource has been deleted.

+ * @public + */ + deleted?: boolean; + + /** + *

The timestamp for when the resource was created.

+ * @public + */ + createdTime?: Date; + + /** + *

The timestamp for when the resource was created or last modified.

+ * @public + */ + lastModifiedTime?: Date; } /** @@ -2671,6 +2747,28 @@ export interface CreateTemplateResponse { templateArn: string | undefined; } +/** + * @public + */ +export interface DeleteTemplateRequest { + /** + *

The unique identifier of the Cases domain.

+ * @public + */ + domainId: string | undefined; + + /** + *

A unique identifier of a template.

+ * @public + */ + templateId: string | undefined; +} + +/** + * @public + */ +export interface DeleteTemplateResponse {} + /** * @public */ @@ -2740,6 +2838,24 @@ export interface GetTemplateResponse { * @public */ status: TemplateStatus | undefined; + + /** + *

Indicates whether the resource has been deleted.

+ * @public + */ + deleted?: boolean; + + /** + *

The timestamp for when the resource was created.

+ * @public + */ + createdTime?: Date; + + /** + *

The timestamp for when the resource was created or last modified.

+ * @public + */ + lastModifiedTime?: Date; } /** diff --git a/clients/client-connectcases/src/protocols/Aws_restJson1.ts b/clients/client-connectcases/src/protocols/Aws_restJson1.ts index 4950c4a8d288b..a18e0e1eb6dc6 100644 --- a/clients/client-connectcases/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectcases/src/protocols/Aws_restJson1.ts @@ -44,6 +44,9 @@ import { CreateLayoutCommandInput, CreateLayoutCommandOutput } from "../commands import { CreateRelatedItemCommandInput, CreateRelatedItemCommandOutput } from "../commands/CreateRelatedItemCommand"; import { CreateTemplateCommandInput, CreateTemplateCommandOutput } from "../commands/CreateTemplateCommand"; import { DeleteDomainCommandInput, DeleteDomainCommandOutput } from "../commands/DeleteDomainCommand"; +import { DeleteFieldCommandInput, DeleteFieldCommandOutput } from "../commands/DeleteFieldCommand"; +import { DeleteLayoutCommandInput, DeleteLayoutCommandOutput } from "../commands/DeleteLayoutCommand"; +import { DeleteTemplateCommandInput, DeleteTemplateCommandOutput } from "../commands/DeleteTemplateCommand"; import { GetCaseAuditEventsCommandInput, GetCaseAuditEventsCommandOutput } from "../commands/GetCaseAuditEventsCommand"; import { GetCaseCommandInput, GetCaseCommandOutput } from "../commands/GetCaseCommand"; import { @@ -337,6 +340,57 @@ export const se_DeleteDomainCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1DeleteFieldCommand + */ +export const se_DeleteFieldCommand = async ( + input: DeleteFieldCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/domains/{domainId}/fields/{fieldId}"); + b.p("domainId", () => input.domainId!, "{domainId}", false); + b.p("fieldId", () => input.fieldId!, "{fieldId}", false); + let body: any; + b.m("DELETE").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DeleteLayoutCommand + */ +export const se_DeleteLayoutCommand = async ( + input: DeleteLayoutCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/domains/{domainId}/layouts/{layoutId}"); + b.p("domainId", () => input.domainId!, "{domainId}", false); + b.p("layoutId", () => input.layoutId!, "{layoutId}", false); + let body: any; + b.m("DELETE").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DeleteTemplateCommand + */ +export const se_DeleteTemplateCommand = async ( + input: DeleteTemplateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/domains/{domainId}/templates/{templateId}"); + b.p("domainId", () => input.domainId!, "{domainId}", false); + b.p("templateId", () => input.templateId!, "{templateId}", false); + let body: any; + b.m("DELETE").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1GetCaseCommand */ @@ -1014,6 +1068,57 @@ export const de_DeleteDomainCommand = async ( return contents; }; +/** + * deserializeAws_restJson1DeleteFieldCommand + */ +export const de_DeleteFieldCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteLayoutCommand + */ +export const de_DeleteLayoutCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteTemplateCommand + */ +export const de_DeleteTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + /** * deserializeAws_restJson1GetCaseCommand */ @@ -1123,6 +1228,9 @@ export const de_GetLayoutCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { content: (_) => _json(__expectUnion(_)), + createdTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + deleted: __expectBoolean, + lastModifiedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), layoutArn: __expectString, layoutId: __expectString, name: __expectString, @@ -1147,7 +1255,10 @@ export const de_GetTemplateCommand = async ( }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + createdTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + deleted: __expectBoolean, description: __expectString, + lastModifiedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), layoutConfiguration: _json, name: __expectString, requiredFields: _json, @@ -2002,9 +2113,12 @@ const de_FieldValueUnion = (output: any, context: __SerdeContext): FieldValueUni */ const de_GetFieldResponse = (output: any, context: __SerdeContext): GetFieldResponse => { return take(output, { + createdTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + deleted: __expectBoolean, description: __expectString, fieldArn: __expectString, fieldId: __expectString, + lastModifiedTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), name: __expectString, namespace: __expectString, tags: (_: any) => de_Tags(_, context), diff --git a/codegen/sdk-codegen/aws-models/connectcases.json b/codegen/sdk-codegen/aws-models/connectcases.json index 5b6f7e8985226..5c34bd663dcdd 100644 --- a/codegen/sdk-codegen/aws-models/connectcases.json +++ b/codegen/sdk-codegen/aws-models/connectcases.json @@ -892,7 +892,7 @@ } }, "traits": { - "smithy.api#documentation": "

Object to store union of Field values.

\n \n

This data type is a UNION, so only one of the following members can be specified when\n used or returned.

\n
" + "smithy.api#documentation": "

Object to store union of Field values.

" } }, "com.amazonaws.connectcases#AuditEventId": { @@ -2076,6 +2076,219 @@ "type": "structure", "members": {} }, + "com.amazonaws.connectcases#DeleteField": { + "type": "operation", + "input": { + "target": "com.amazonaws.connectcases#DeleteFieldRequest" + }, + "output": { + "target": "com.amazonaws.connectcases#DeleteFieldResponse" + }, + "errors": [ + { + "target": "com.amazonaws.connectcases#AccessDeniedException" + }, + { + "target": "com.amazonaws.connectcases#ConflictException" + }, + { + "target": "com.amazonaws.connectcases#InternalServerException" + }, + { + "target": "com.amazonaws.connectcases#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.connectcases#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.connectcases#ThrottlingException" + }, + { + "target": "com.amazonaws.connectcases#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a field from a cases template. You can delete up to 100 fields per domain.

\n

After a field is deleted:

\n
    \n
  • \n

    You can still retrieve the field by calling BatchGetField.

    \n
  • \n
  • \n

    You cannot update a deleted field by calling UpdateField; it throws a\n ValidationException.

    \n
  • \n
  • \n

    Deleted fields are not included in the ListFields response.

    \n
  • \n
  • \n

    Calling CreateCase with a deleted field throws a ValidationException denoting\n which field IDs in the request have been deleted.

    \n
  • \n
  • \n

    Calling GetCase with a deleted field ID returns the deleted field's value if one\n exists.

    \n
  • \n
  • \n

    Calling UpdateCase with a deleted field ID throws a ValidationException if the\n case does not already contain a value for the deleted field. Otherwise it succeeds,\n allowing you to update or remove (using emptyValue: {}) the field's value from the\n case.

    \n
  • \n
  • \n

    \n GetTemplate does not return field IDs for deleted fields.

    \n
  • \n
  • \n

    \n GetLayout does not return field IDs for deleted fields.

    \n
  • \n
  • \n

    Calling SearchCases with the deleted field ID as a filter returns any cases that\n have a value for the deleted field that matches the filter criteria.

    \n
  • \n
  • \n

    Calling SearchCases with a searchTerm value that matches a deleted field's value on a\n case returns the case in the response.

    \n
  • \n
  • \n

    Calling BatchPutFieldOptions with a deleted field ID throw a ValidationException.

    \n
  • \n
  • \n

    Calling GetCaseEventConfiguration does not return field IDs for deleted fields.

    \n
  • \n
", + "smithy.api#http": { + "uri": "/domains/{domainId}/fields/{fieldId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.connectcases#DeleteFieldRequest": { + "type": "structure", + "members": { + "domainId": { + "target": "com.amazonaws.connectcases#DomainId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the Cases domain.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "fieldId": { + "target": "com.amazonaws.connectcases#FieldId", + "traits": { + "smithy.api#documentation": "

The unique identifier of a field.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.connectcases#DeleteFieldResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.connectcases#DeleteLayout": { + "type": "operation", + "input": { + "target": "com.amazonaws.connectcases#DeleteLayoutRequest" + }, + "output": { + "target": "com.amazonaws.connectcases#DeleteLayoutResponse" + }, + "errors": [ + { + "target": "com.amazonaws.connectcases#AccessDeniedException" + }, + { + "target": "com.amazonaws.connectcases#ConflictException" + }, + { + "target": "com.amazonaws.connectcases#InternalServerException" + }, + { + "target": "com.amazonaws.connectcases#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.connectcases#ThrottlingException" + }, + { + "target": "com.amazonaws.connectcases#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a layout from a cases template. You can delete up to 100 layouts per domain.

\n\n

After a layout is deleted:

\n
    \n
  • \n

    You can still retrieve the layout by calling GetLayout.

    \n
  • \n
  • \n

    You cannot update a deleted layout by calling UpdateLayout; it throws a\n ValidationException.

    \n
  • \n
  • \n

    Deleted layouts are not included in the ListLayouts response.

    \n
  • \n
", + "smithy.api#http": { + "uri": "/domains/{domainId}/layouts/{layoutId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.connectcases#DeleteLayoutRequest": { + "type": "structure", + "members": { + "domainId": { + "target": "com.amazonaws.connectcases#DomainId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the Cases domain.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "layoutId": { + "target": "com.amazonaws.connectcases#LayoutId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the layout.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.connectcases#DeleteLayoutResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.connectcases#DeleteTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.connectcases#DeleteTemplateRequest" + }, + "output": { + "target": "com.amazonaws.connectcases#DeleteTemplateResponse" + }, + "errors": [ + { + "target": "com.amazonaws.connectcases#AccessDeniedException" + }, + { + "target": "com.amazonaws.connectcases#ConflictException" + }, + { + "target": "com.amazonaws.connectcases#InternalServerException" + }, + { + "target": "com.amazonaws.connectcases#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.connectcases#ThrottlingException" + }, + { + "target": "com.amazonaws.connectcases#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a cases template. You can delete up to 100 templates per domain.

\n\n

After a cases template is deleted:

\n
    \n
  • \n

    You can still retrieve the template by calling GetTemplate.

    \n
  • \n
  • \n

    You cannot update the template.

    \n
  • \n
  • \n

    You cannot create a case by using the deleted template.

    \n
  • \n
  • \n

    Deleted templates are not included in the ListTemplates response.

    \n
  • \n
", + "smithy.api#http": { + "uri": "/domains/{domainId}/templates/{templateId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.connectcases#DeleteTemplateRequest": { + "type": "structure", + "members": { + "domainId": { + "target": "com.amazonaws.connectcases#DomainId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the Cases domain.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "templateId": { + "target": "com.amazonaws.connectcases#TemplateId", + "traits": { + "smithy.api#documentation": "

A unique identifier of a template.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.connectcases#DeleteTemplateResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.connectcases#Deleted": { + "type": "boolean", + "traits": { + "smithy.api#default": false + } + }, "com.amazonaws.connectcases#Domain": { "type": "resource", "identifiers": { @@ -2255,6 +2468,9 @@ "update": { "target": "com.amazonaws.connectcases#UpdateField" }, + "delete": { + "target": "com.amazonaws.connectcases#DeleteField" + }, "list": { "target": "com.amazonaws.connectcases#ListFields" }, @@ -3127,6 +3343,25 @@ "traits": { "smithy.api#documentation": "

A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.

" } + }, + "deleted": { + "target": "com.amazonaws.connectcases#Deleted", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Indicates whether the resource has been deleted.

" + } + }, + "createdTime": { + "target": "com.amazonaws.connectcases#CreatedTime", + "traits": { + "smithy.api#documentation": "

The timestamp for when the resource was created.

" + } + }, + "lastModifiedTime": { + "target": "com.amazonaws.connectcases#LastModifiedTime", + "traits": { + "smithy.api#documentation": "

The timestamp for when the resource was created or last modified.

" + } } }, "traits": { @@ -3224,6 +3459,25 @@ "traits": { "smithy.api#documentation": "

A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.

" } + }, + "deleted": { + "target": "com.amazonaws.connectcases#Deleted", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Indicates whether the resource has been deleted.

" + } + }, + "createdTime": { + "target": "com.amazonaws.connectcases#CreatedTime", + "traits": { + "smithy.api#documentation": "

The timestamp for when the resource was created.

" + } + }, + "lastModifiedTime": { + "target": "com.amazonaws.connectcases#LastModifiedTime", + "traits": { + "smithy.api#documentation": "

The timestamp for when the resource was created or last modified.

" + } } } }, @@ -3336,6 +3590,25 @@ "smithy.api#documentation": "

The status of the template.

", "smithy.api#required": {} } + }, + "deleted": { + "target": "com.amazonaws.connectcases#Deleted", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Indicates whether the resource has been deleted.

" + } + }, + "createdTime": { + "target": "com.amazonaws.connectcases#CreatedTime", + "traits": { + "smithy.api#documentation": "

The timestamp for when the resource was created.

" + } + }, + "lastModifiedTime": { + "target": "com.amazonaws.connectcases#LastModifiedTime", + "traits": { + "smithy.api#documentation": "

The timestamp for when the resource was created or last modified.

" + } } } }, @@ -3372,6 +3645,12 @@ "smithy.api#retryable": {} } }, + "com.amazonaws.connectcases#LastModifiedTime": { + "type": "timestamp", + "traits": { + "smithy.api#timestampFormat": "date-time" + } + }, "com.amazonaws.connectcases#Layout": { "type": "resource", "identifiers": { @@ -3391,6 +3670,9 @@ "update": { "target": "com.amazonaws.connectcases#UpdateLayout" }, + "delete": { + "target": "com.amazonaws.connectcases#DeleteLayout" + }, "list": { "target": "com.amazonaws.connectcases#ListLayouts" }, @@ -4900,6 +5182,9 @@ "update": { "target": "com.amazonaws.connectcases#UpdateTemplate" }, + "delete": { + "target": "com.amazonaws.connectcases#DeleteTemplate" + }, "list": { "target": "com.amazonaws.connectcases#ListTemplates" },