Skip to content

Commit c0c724a

Browse files
author
awstools
committed
feat(client-connectcases): This release adds the ability to disable templates through the UpdateTemplate API. Disabling templates prevents customers from creating cases using the template. For more information see https://docs.aws.amazon.com/cases/latest/APIReference/Welcome.html
1 parent 004d6c0 commit c0c724a

File tree

7 files changed

+187
-74
lines changed

7 files changed

+187
-74
lines changed

clients/client-connectcases/src/ConnectCases.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,12 @@ export class ConnectCases extends ConnectCasesClient {
347347
}
348348

349349
/**
350-
* <p>Creates a template in the Cases domain. This template is used to define the case
351-
* object model (that is, define what data can be captured on cases) in a Cases domain. A
352-
* template must have a unique name within a domain, and it must reference existing field IDs and layout
353-
* IDs. Additionally, multiple fields with same IDs are not allowed within the same Template.</p>
350+
* <p>Creates a template in the Cases domain. This template is used to define the case object
351+
* model (that is, to define what data can be captured on cases) in a Cases domain. A template
352+
* must have a unique name within a domain, and it must reference existing field IDs and layout
353+
* IDs. Additionally, multiple fields with same IDs are not allowed within the same Template. A
354+
* template can be either Active or Inactive, as indicated by its status. Inactive templates
355+
* cannot be used to create cases.</p>
354356
*/
355357
public createTemplate(
356358
args: CreateTemplateCommandInput,
@@ -880,8 +882,8 @@ export class ConnectCases extends ConnectCasesClient {
880882
}
881883

882884
/**
883-
* <p>Updates the values of fields on a case. Fields to be updated are
884-
* received as an array of id/value pairs identical to the <code>CreateCase</code> input .</p>
885+
* <p>Updates the values of fields on a case. Fields to be updated are received as an array of
886+
* id/value pairs identical to the <code>CreateCase</code> input .</p>
885887
* <p>If the action is successful, the service sends back an HTTP 200 response with an empty
886888
* HTTP body.</p>
887889
*/
@@ -973,10 +975,10 @@ export class ConnectCases extends ConnectCasesClient {
973975

974976
/**
975977
* <p>Updates the attributes of an existing template. The template attributes that can be
976-
* modified include <code>name</code>, <code>description</code>, <code>layouts</code>,
977-
* and <code>requiredFields</code>. At least one of these
978-
* attributes must not be null. If a null value is provided for a given attribute, that attribute
979-
* is ignored and its current value is preserved.</p>
978+
* modified include <code>name</code>, <code>description</code>,
979+
* <code>layoutConfiguration</code>, <code>requiredFields</code>, and <code>status</code>. At
980+
* least one of these attributes must not be null. If a null value is provided for a given
981+
* attribute, that attribute is ignored and its current value is preserved.</p>
980982
*/
981983
public updateTemplate(
982984
args: UpdateTemplateCommandInput,

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ export interface CreateTemplateCommandInput extends CreateTemplateRequest {}
2929
export interface CreateTemplateCommandOutput extends CreateTemplateResponse, __MetadataBearer {}
3030

3131
/**
32-
* <p>Creates a template in the Cases domain. This template is used to define the case
33-
* object model (that is, define what data can be captured on cases) in a Cases domain. A
34-
* template must have a unique name within a domain, and it must reference existing field IDs and layout
35-
* IDs. Additionally, multiple fields with same IDs are not allowed within the same Template.</p>
32+
* <p>Creates a template in the Cases domain. This template is used to define the case object
33+
* model (that is, to define what data can be captured on cases) in a Cases domain. A template
34+
* must have a unique name within a domain, and it must reference existing field IDs and layout
35+
* IDs. Additionally, multiple fields with same IDs are not allowed within the same Template. A
36+
* template can be either Active or Inactive, as indicated by its status. Inactive templates
37+
* cannot be used to create cases.</p>
3638
* @example
3739
* Use a bare-bones client and the command you need to make an API call.
3840
* ```javascript

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export interface UpdateCaseCommandInput extends UpdateCaseRequest {}
2929
export interface UpdateCaseCommandOutput extends UpdateCaseResponse, __MetadataBearer {}
3030

3131
/**
32-
* <p>Updates the values of fields on a case. Fields to be updated are
33-
* received as an array of id/value pairs identical to the <code>CreateCase</code> input .</p>
32+
* <p>Updates the values of fields on a case. Fields to be updated are received as an array of
33+
* id/value pairs identical to the <code>CreateCase</code> input .</p>
3434
* <p>If the action is successful, the service sends back an HTTP 200 response with an empty
3535
* HTTP body.</p>
3636
* @example

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export interface UpdateTemplateCommandOutput extends UpdateTemplateResponse, __M
3030

3131
/**
3232
* <p>Updates the attributes of an existing template. The template attributes that can be
33-
* modified include <code>name</code>, <code>description</code>, <code>layouts</code>,
34-
* and <code>requiredFields</code>. At least one of these
35-
* attributes must not be null. If a null value is provided for a given attribute, that attribute
36-
* is ignored and its current value is preserved.</p>
33+
* modified include <code>name</code>, <code>description</code>,
34+
* <code>layoutConfiguration</code>, <code>requiredFields</code>, and <code>status</code>. At
35+
* least one of these attributes must not be null. If a null value is provided for a given
36+
* attribute, that attribute is ignored and its current value is preserved.</p>
3737
* @example
3838
* Use a bare-bones client and the command you need to make an API call.
3939
* ```javascript

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

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export interface CreateCaseRequest {
140140

141141
/**
142142
* <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the
143-
* request.</p>
143+
* request. If not provided, the Amazon Web Services
144+
* SDK populates this field. For more information about idempotency, see
145+
* <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
144146
*/
145147
clientToken?: string;
146148
}
@@ -1474,7 +1476,8 @@ export namespace Section {
14741476
}
14751477

14761478
/**
1477-
* <p>Ordered list containing different kinds of sections that can be added. A LayoutSections object can only contain one section.</p>
1479+
* <p>Ordered list containing different kinds of sections that can be added. A LayoutSections
1480+
* object can only contain one section.</p>
14781481
*/
14791482
export interface LayoutSections {
14801483
/**
@@ -1721,6 +1724,11 @@ export interface RequiredField {
17211724
fieldId: string | undefined;
17221725
}
17231726

1727+
export enum TemplateStatus {
1728+
ACTIVE = "Active",
1729+
INACTIVE = "Inactive",
1730+
}
1731+
17241732
export interface CreateTemplateRequest {
17251733
/**
17261734
* <p>The unique identifier of the Cases domain. </p>
@@ -1747,6 +1755,11 @@ export interface CreateTemplateRequest {
17471755
* template.</p>
17481756
*/
17491757
requiredFields?: RequiredField[];
1758+
1759+
/**
1760+
* <p>The status of the template.</p>
1761+
*/
1762+
status?: TemplateStatus | string;
17501763
}
17511764

17521765
export interface CreateTemplateResponse {
@@ -1809,6 +1822,11 @@ export interface GetTemplateResponse {
18091822
* <p>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.</p>
18101823
*/
18111824
tags?: Record<string, string>;
1825+
1826+
/**
1827+
* <p>The status of the template.</p>
1828+
*/
1829+
status: TemplateStatus | string | undefined;
18121830
}
18131831

18141832
export interface ListTemplatesRequest {
@@ -1827,6 +1845,11 @@ export interface ListTemplatesRequest {
18271845
* response in the next request to retrieve the next set of results.</p>
18281846
*/
18291847
nextToken?: string;
1848+
1849+
/**
1850+
* <p>A list of status values to filter on.</p>
1851+
*/
1852+
status?: (TemplateStatus | string)[];
18301853
}
18311854

18321855
/**
@@ -1839,14 +1862,19 @@ export interface TemplateSummary {
18391862
templateId: string | undefined;
18401863

18411864
/**
1842-
* <p>The Amazon Resource Name (ARN) of the template.</p>
1865+
* <p>The Amazon Resource Name (ARN) of the template.</p>
18431866
*/
18441867
templateArn: string | undefined;
18451868

18461869
/**
18471870
* <p>The template name.</p>
18481871
*/
18491872
name: string | undefined;
1873+
1874+
/**
1875+
* <p>The status of the template.</p>
1876+
*/
1877+
status: TemplateStatus | string | undefined;
18501878
}
18511879

18521880
export interface ListTemplatesResponse {
@@ -1892,6 +1920,11 @@ export interface UpdateTemplateRequest {
18921920
* template.</p>
18931921
*/
18941922
requiredFields?: RequiredField[];
1923+
1924+
/**
1925+
* <p>The status of the template.</p>
1926+
*/
1927+
status?: TemplateStatus | string;
18951928
}
18961929

18971930
export interface UpdateTemplateResponse {}

clients/client-connectcases/src/protocols/Aws_restJson1.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ export const serializeAws_restJson1CreateTemplateCommand = async (
326326
...(input.requiredFields != null && {
327327
requiredFields: serializeAws_restJson1RequiredFieldList(input.requiredFields, context),
328328
}),
329+
...(input.status != null && { status: input.status }),
329330
});
330331
return new __HttpRequest({
331332
protocol,
@@ -619,6 +620,7 @@ export const serializeAws_restJson1ListTemplatesCommand = async (
619620
const query: any = map({
620621
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
621622
nextToken: [, input.nextToken!],
623+
status: [() => input.status !== void 0, () => (input.status! || []).map((_entry) => _entry as any)],
622624
});
623625
let body: any;
624626
return new __HttpRequest({
@@ -878,6 +880,7 @@ export const serializeAws_restJson1UpdateTemplateCommand = async (
878880
...(input.requiredFields != null && {
879881
requiredFields: serializeAws_restJson1RequiredFieldList(input.requiredFields, context),
880882
}),
883+
...(input.status != null && { status: input.status }),
881884
});
882885
return new __HttpRequest({
883886
protocol,
@@ -1639,6 +1642,9 @@ export const deserializeAws_restJson1GetTemplateCommand = async (
16391642
if (data.requiredFields != null) {
16401643
contents.requiredFields = deserializeAws_restJson1RequiredFieldList(data.requiredFields, context);
16411644
}
1645+
if (data.status != null) {
1646+
contents.status = __expectString(data.status);
1647+
}
16421648
if (data.tags != null) {
16431649
contents.tags = deserializeAws_restJson1Tags(data.tags, context);
16441650
}
@@ -2474,6 +2480,9 @@ const deserializeAws_restJson1UpdateLayoutCommandError = async (
24742480
case "ResourceNotFoundException":
24752481
case "com.amazonaws.connectcases#ResourceNotFoundException":
24762482
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2483+
case "ServiceQuotaExceededException":
2484+
case "com.amazonaws.connectcases#ServiceQuotaExceededException":
2485+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
24772486
case "ThrottlingException":
24782487
case "com.amazonaws.connectcases#ThrottlingException":
24792488
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
@@ -3404,6 +3413,7 @@ const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): Rec
34043413
const deserializeAws_restJson1TemplateSummary = (output: any, context: __SerdeContext): TemplateSummary => {
34053414
return {
34063415
name: __expectString(output.name),
3416+
status: __expectString(output.status),
34073417
templateArn: __expectString(output.templateArn),
34083418
templateId: __expectString(output.templateId),
34093419
} as any;

0 commit comments

Comments
 (0)