Skip to content

Commit

Permalink
feat(client-connectcases): This feature releases DeleteField, Deleted…
Browse files Browse the repository at this point in the history
…Layout, and DeleteTemplate API's
  • Loading branch information
awstools committed Apr 29, 2024
1 parent 5ce5600 commit 1d96144
Show file tree
Hide file tree
Showing 13 changed files with 1,004 additions and 5 deletions.
24 changes: 24 additions & 0 deletions clients/client-connectcases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

</details>
<details>
<summary>
DeleteField
</summary>

[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/)

</details>
<details>
<summary>
DeleteLayout
</summary>

[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/)

</details>
<details>
<summary>
DeleteTemplate
</summary>

[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/)

</details>
<details>
<summary>
Expand Down
50 changes: 50 additions & 0 deletions clients/client-connectcases/src/ConnectCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -117,6 +128,9 @@ const commands = {
CreateRelatedItemCommand,
CreateTemplateCommand,
DeleteDomainCommand,
DeleteFieldCommand,
DeleteLayoutCommand,
DeleteTemplateCommand,
GetCaseCommand,
GetCaseAuditEventsCommand,
GetCaseEventConfigurationCommand,
Expand Down Expand Up @@ -256,6 +270,42 @@ export interface ConnectCases {
cb: (err: any, data?: DeleteDomainCommandOutput) => void
): void;

/**
* @see {@link DeleteFieldCommand}
*/
deleteField(args: DeleteFieldCommandInput, options?: __HttpHandlerOptions): Promise<DeleteFieldCommandOutput>;
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<DeleteLayoutCommandOutput>;
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<DeleteTemplateCommandOutput>;
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}
*/
Expand Down
9 changes: 9 additions & 0 deletions clients/client-connectcases/src/ConnectCasesClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -123,6 +126,9 @@ export type ServiceInputTypes =
| CreateRelatedItemCommandInput
| CreateTemplateCommandInput
| DeleteDomainCommandInput
| DeleteFieldCommandInput
| DeleteLayoutCommandInput
| DeleteTemplateCommandInput
| GetCaseAuditEventsCommandInput
| GetCaseCommandInput
| GetCaseEventConfigurationCommandInput
Expand Down Expand Up @@ -159,6 +165,9 @@ export type ServiceOutputTypes =
| CreateRelatedItemCommandOutput
| CreateTemplateCommandOutput
| DeleteDomainCommandOutput
| DeleteFieldCommandOutput
| DeleteLayoutCommandOutput
| DeleteTemplateCommandOutput
| GetCaseAuditEventsCommandOutput
| GetCaseCommandOutput
| GetCaseEventConfigurationCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export interface BatchGetFieldCommandOutput extends BatchGetFieldResponse, __Met
* // tags: { // Tags
* // "<keys>": "STRING_VALUE",
* // },
* // deleted: true || false,
* // createdTime: new Date("TIMESTAMP"),
* // lastModifiedTime: new Date("TIMESTAMP"),
* // },
* // ],
* // errors: [ // BatchGetFieldErrorList // required
Expand Down
155 changes: 155 additions & 0 deletions clients/client-connectcases/src/commands/DeleteFieldCommand.ts
Original file line number Diff line number Diff line change
@@ -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 {}

/**
* <p>Deletes a field from a cases template. You can delete up to 100 fields per domain.</p>
* <p>After a field is deleted:</p>
* <ul>
* <li>
* <p>You can still retrieve the field by calling <code>BatchGetField</code>.</p>
* </li>
* <li>
* <p>You cannot update a deleted field by calling <code>UpdateField</code>; it throws a
* <code>ValidationException</code>.</p>
* </li>
* <li>
* <p>Deleted fields are not included in the <code>ListFields</code> response.</p>
* </li>
* <li>
* <p>Calling <code>CreateCase</code> with a deleted field throws a <code>ValidationException</code> denoting
* which field IDs in the request have been deleted.</p>
* </li>
* <li>
* <p>Calling <code>GetCase</code> with a deleted field ID returns the deleted field's value if one
* exists.</p>
* </li>
* <li>
* <p>Calling <code>UpdateCase</code> with a deleted field ID throws a <code>ValidationException</code> if the
* case does not already contain a value for the deleted field. Otherwise it succeeds,
* allowing you to update or remove (using <code>emptyValue: \{\}</code>) the field's value from the
* case.</p>
* </li>
* <li>
* <p>
* <code>GetTemplate</code> does not return field IDs for deleted fields.</p>
* </li>
* <li>
* <p>
* <code>GetLayout</code> does not return field IDs for deleted fields.</p>
* </li>
* <li>
* <p>Calling <code>SearchCases</code> with the deleted field ID as a filter returns any cases that
* have a value for the deleted field that matches the filter criteria.</p>
* </li>
* <li>
* <p>Calling <code>SearchCases</code> with a <code>searchTerm</code> value that matches a deleted field's value on a
* case returns the case in the response.</p>
* </li>
* <li>
* <p>Calling <code>BatchPutFieldOptions</code> with a deleted field ID throw a <code>ValidationException</code>.</p>
* </li>
* <li>
* <p>Calling <code>GetCaseEventConfiguration</code> does not return field IDs for deleted fields.</p>
* </li>
* </ul>
* @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)
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>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.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>We couldn't process your request because of an issue with the server. Try again
* later.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <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>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>The service quota has been exceeded. For a list of service quotas, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html">Amazon Connect Service Quotas</a> in the <i>Amazon Connect
* Administrator Guide</i>.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The request isn't valid. Check the syntax and try again.</p>
*
* @throws {@link ConnectCasesServiceException}
* <p>Base exception class for all service exceptions from ConnectCases service.</p>
*
* @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() {}
Loading

0 comments on commit 1d96144

Please sign in to comment.