Skip to content

Commit 1d96144

Browse files
author
awstools
committed
feat(client-connectcases): This feature releases DeleteField, DeletedLayout, and DeleteTemplate API's
1 parent 5ce5600 commit 1d96144

13 files changed

+1004
-5
lines changed

clients/client-connectcases/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,30 @@ DeleteDomain
278278

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

281+
</details>
282+
<details>
283+
<summary>
284+
DeleteField
285+
</summary>
286+
287+
[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/)
288+
289+
</details>
290+
<details>
291+
<summary>
292+
DeleteLayout
293+
</summary>
294+
295+
[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/)
296+
297+
</details>
298+
<details>
299+
<summary>
300+
DeleteTemplate
301+
</summary>
302+
303+
[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/)
304+
281305
</details>
282306
<details>
283307
<summary>

clients/client-connectcases/src/ConnectCases.ts

+50
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ import {
3939
DeleteDomainCommandInput,
4040
DeleteDomainCommandOutput,
4141
} from "./commands/DeleteDomainCommand";
42+
import { DeleteFieldCommand, DeleteFieldCommandInput, DeleteFieldCommandOutput } from "./commands/DeleteFieldCommand";
43+
import {
44+
DeleteLayoutCommand,
45+
DeleteLayoutCommandInput,
46+
DeleteLayoutCommandOutput,
47+
} from "./commands/DeleteLayoutCommand";
48+
import {
49+
DeleteTemplateCommand,
50+
DeleteTemplateCommandInput,
51+
DeleteTemplateCommandOutput,
52+
} from "./commands/DeleteTemplateCommand";
4253
import {
4354
GetCaseAuditEventsCommand,
4455
GetCaseAuditEventsCommandInput,
@@ -117,6 +128,9 @@ const commands = {
117128
CreateRelatedItemCommand,
118129
CreateTemplateCommand,
119130
DeleteDomainCommand,
131+
DeleteFieldCommand,
132+
DeleteLayoutCommand,
133+
DeleteTemplateCommand,
120134
GetCaseCommand,
121135
GetCaseAuditEventsCommand,
122136
GetCaseEventConfigurationCommand,
@@ -256,6 +270,42 @@ export interface ConnectCases {
256270
cb: (err: any, data?: DeleteDomainCommandOutput) => void
257271
): void;
258272

273+
/**
274+
* @see {@link DeleteFieldCommand}
275+
*/
276+
deleteField(args: DeleteFieldCommandInput, options?: __HttpHandlerOptions): Promise<DeleteFieldCommandOutput>;
277+
deleteField(args: DeleteFieldCommandInput, cb: (err: any, data?: DeleteFieldCommandOutput) => void): void;
278+
deleteField(
279+
args: DeleteFieldCommandInput,
280+
options: __HttpHandlerOptions,
281+
cb: (err: any, data?: DeleteFieldCommandOutput) => void
282+
): void;
283+
284+
/**
285+
* @see {@link DeleteLayoutCommand}
286+
*/
287+
deleteLayout(args: DeleteLayoutCommandInput, options?: __HttpHandlerOptions): Promise<DeleteLayoutCommandOutput>;
288+
deleteLayout(args: DeleteLayoutCommandInput, cb: (err: any, data?: DeleteLayoutCommandOutput) => void): void;
289+
deleteLayout(
290+
args: DeleteLayoutCommandInput,
291+
options: __HttpHandlerOptions,
292+
cb: (err: any, data?: DeleteLayoutCommandOutput) => void
293+
): void;
294+
295+
/**
296+
* @see {@link DeleteTemplateCommand}
297+
*/
298+
deleteTemplate(
299+
args: DeleteTemplateCommandInput,
300+
options?: __HttpHandlerOptions
301+
): Promise<DeleteTemplateCommandOutput>;
302+
deleteTemplate(args: DeleteTemplateCommandInput, cb: (err: any, data?: DeleteTemplateCommandOutput) => void): void;
303+
deleteTemplate(
304+
args: DeleteTemplateCommandInput,
305+
options: __HttpHandlerOptions,
306+
cb: (err: any, data?: DeleteTemplateCommandOutput) => void
307+
): void;
308+
259309
/**
260310
* @see {@link GetCaseCommand}
261311
*/

clients/client-connectcases/src/ConnectCasesClient.ts

+9
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ import { CreateLayoutCommandInput, CreateLayoutCommandOutput } from "./commands/
6565
import { CreateRelatedItemCommandInput, CreateRelatedItemCommandOutput } from "./commands/CreateRelatedItemCommand";
6666
import { CreateTemplateCommandInput, CreateTemplateCommandOutput } from "./commands/CreateTemplateCommand";
6767
import { DeleteDomainCommandInput, DeleteDomainCommandOutput } from "./commands/DeleteDomainCommand";
68+
import { DeleteFieldCommandInput, DeleteFieldCommandOutput } from "./commands/DeleteFieldCommand";
69+
import { DeleteLayoutCommandInput, DeleteLayoutCommandOutput } from "./commands/DeleteLayoutCommand";
70+
import { DeleteTemplateCommandInput, DeleteTemplateCommandOutput } from "./commands/DeleteTemplateCommand";
6871
import { GetCaseAuditEventsCommandInput, GetCaseAuditEventsCommandOutput } from "./commands/GetCaseAuditEventsCommand";
6972
import { GetCaseCommandInput, GetCaseCommandOutput } from "./commands/GetCaseCommand";
7073
import {
@@ -123,6 +126,9 @@ export type ServiceInputTypes =
123126
| CreateRelatedItemCommandInput
124127
| CreateTemplateCommandInput
125128
| DeleteDomainCommandInput
129+
| DeleteFieldCommandInput
130+
| DeleteLayoutCommandInput
131+
| DeleteTemplateCommandInput
126132
| GetCaseAuditEventsCommandInput
127133
| GetCaseCommandInput
128134
| GetCaseEventConfigurationCommandInput
@@ -159,6 +165,9 @@ export type ServiceOutputTypes =
159165
| CreateRelatedItemCommandOutput
160166
| CreateTemplateCommandOutput
161167
| DeleteDomainCommandOutput
168+
| DeleteFieldCommandOutput
169+
| DeleteLayoutCommandOutput
170+
| DeleteTemplateCommandOutput
162171
| GetCaseAuditEventsCommandOutput
163172
| GetCaseCommandOutput
164173
| GetCaseEventConfigurationCommandOutput

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

+3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export interface BatchGetFieldCommandOutput extends BatchGetFieldResponse, __Met
5656
* // tags: { // Tags
5757
* // "<keys>": "STRING_VALUE",
5858
* // },
59+
* // deleted: true || false,
60+
* // createdTime: new Date("TIMESTAMP"),
61+
* // lastModifiedTime: new Date("TIMESTAMP"),
5962
* // },
6063
* // ],
6164
* // errors: [ // BatchGetFieldErrorList // required
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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 { DeleteFieldRequest, DeleteFieldResponse } from "../models/models_0";
10+
import { de_DeleteFieldCommand, se_DeleteFieldCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link DeleteFieldCommand}.
20+
*/
21+
export interface DeleteFieldCommandInput extends DeleteFieldRequest {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link DeleteFieldCommand}.
26+
*/
27+
export interface DeleteFieldCommandOutput extends DeleteFieldResponse, __MetadataBearer {}
28+
29+
/**
30+
* <p>Deletes a field from a cases template. You can delete up to 100 fields per domain.</p>
31+
* <p>After a field is deleted:</p>
32+
* <ul>
33+
* <li>
34+
* <p>You can still retrieve the field by calling <code>BatchGetField</code>.</p>
35+
* </li>
36+
* <li>
37+
* <p>You cannot update a deleted field by calling <code>UpdateField</code>; it throws a
38+
* <code>ValidationException</code>.</p>
39+
* </li>
40+
* <li>
41+
* <p>Deleted fields are not included in the <code>ListFields</code> response.</p>
42+
* </li>
43+
* <li>
44+
* <p>Calling <code>CreateCase</code> with a deleted field throws a <code>ValidationException</code> denoting
45+
* which field IDs in the request have been deleted.</p>
46+
* </li>
47+
* <li>
48+
* <p>Calling <code>GetCase</code> with a deleted field ID returns the deleted field's value if one
49+
* exists.</p>
50+
* </li>
51+
* <li>
52+
* <p>Calling <code>UpdateCase</code> with a deleted field ID throws a <code>ValidationException</code> if the
53+
* case does not already contain a value for the deleted field. Otherwise it succeeds,
54+
* allowing you to update or remove (using <code>emptyValue: \{\}</code>) the field's value from the
55+
* case.</p>
56+
* </li>
57+
* <li>
58+
* <p>
59+
* <code>GetTemplate</code> does not return field IDs for deleted fields.</p>
60+
* </li>
61+
* <li>
62+
* <p>
63+
* <code>GetLayout</code> does not return field IDs for deleted fields.</p>
64+
* </li>
65+
* <li>
66+
* <p>Calling <code>SearchCases</code> with the deleted field ID as a filter returns any cases that
67+
* have a value for the deleted field that matches the filter criteria.</p>
68+
* </li>
69+
* <li>
70+
* <p>Calling <code>SearchCases</code> with a <code>searchTerm</code> value that matches a deleted field's value on a
71+
* case returns the case in the response.</p>
72+
* </li>
73+
* <li>
74+
* <p>Calling <code>BatchPutFieldOptions</code> with a deleted field ID throw a <code>ValidationException</code>.</p>
75+
* </li>
76+
* <li>
77+
* <p>Calling <code>GetCaseEventConfiguration</code> does not return field IDs for deleted fields.</p>
78+
* </li>
79+
* </ul>
80+
* @example
81+
* Use a bare-bones client and the command you need to make an API call.
82+
* ```javascript
83+
* import { ConnectCasesClient, DeleteFieldCommand } from "@aws-sdk/client-connectcases"; // ES Modules import
84+
* // const { ConnectCasesClient, DeleteFieldCommand } = require("@aws-sdk/client-connectcases"); // CommonJS import
85+
* const client = new ConnectCasesClient(config);
86+
* const input = { // DeleteFieldRequest
87+
* domainId: "STRING_VALUE", // required
88+
* fieldId: "STRING_VALUE", // required
89+
* };
90+
* const command = new DeleteFieldCommand(input);
91+
* const response = await client.send(command);
92+
* // {};
93+
*
94+
* ```
95+
*
96+
* @param DeleteFieldCommandInput - {@link DeleteFieldCommandInput}
97+
* @returns {@link DeleteFieldCommandOutput}
98+
* @see {@link DeleteFieldCommandInput} for command's `input` shape.
99+
* @see {@link DeleteFieldCommandOutput} for command's `response` shape.
100+
* @see {@link ConnectCasesClientResolvedConfig | config} for ConnectCasesClient's `config` shape.
101+
*
102+
* @throws {@link AccessDeniedException} (client fault)
103+
* <p>You do not have sufficient access to perform this action.</p>
104+
*
105+
* @throws {@link ConflictException} (client fault)
106+
* <p>The requested operation would cause a conflict with the current state of a service
107+
* resource associated with the request. Resolve the conflict before retrying this request. See
108+
* the accompanying error message for details.</p>
109+
*
110+
* @throws {@link InternalServerException} (server fault)
111+
* <p>We couldn't process your request because of an issue with the server. Try again
112+
* later.</p>
113+
*
114+
* @throws {@link ResourceNotFoundException} (client fault)
115+
* <p>We couldn't find the requested resource. Check that your resources exists and were created
116+
* in the same Amazon Web Services Region as your request, and try your request again.</p>
117+
*
118+
* @throws {@link ServiceQuotaExceededException} (client fault)
119+
* <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
120+
* Administrator Guide</i>.</p>
121+
*
122+
* @throws {@link ThrottlingException} (client fault)
123+
* <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
124+
*
125+
* @throws {@link ValidationException} (client fault)
126+
* <p>The request isn't valid. Check the syntax and try again.</p>
127+
*
128+
* @throws {@link ConnectCasesServiceException}
129+
* <p>Base exception class for all service exceptions from ConnectCases service.</p>
130+
*
131+
* @public
132+
*/
133+
export class DeleteFieldCommand extends $Command
134+
.classBuilder<
135+
DeleteFieldCommandInput,
136+
DeleteFieldCommandOutput,
137+
ConnectCasesClientResolvedConfig,
138+
ServiceInputTypes,
139+
ServiceOutputTypes
140+
>()
141+
.ep({
142+
...commonParams,
143+
})
144+
.m(function (this: any, Command: any, cs: any, config: ConnectCasesClientResolvedConfig, o: any) {
145+
return [
146+
getSerdePlugin(config, this.serialize, this.deserialize),
147+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
148+
];
149+
})
150+
.s("AmazonConnectCases", "DeleteField", {})
151+
.n("ConnectCasesClient", "DeleteFieldCommand")
152+
.f(void 0, void 0)
153+
.ser(se_DeleteFieldCommand)
154+
.de(de_DeleteFieldCommand)
155+
.build() {}

0 commit comments

Comments
 (0)