@aws-sdk/client-connectcases 3.184.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +201 -0
- package/README.md +210 -0
- package/dist-cjs/ConnectCases.js +442 -0
- package/dist-cjs/ConnectCasesClient.js +37 -0
- package/dist-cjs/commands/BatchGetFieldCommand.js +36 -0
- package/dist-cjs/commands/BatchPutFieldOptionsCommand.js +36 -0
- package/dist-cjs/commands/CreateCaseCommand.js +36 -0
- package/dist-cjs/commands/CreateDomainCommand.js +36 -0
- package/dist-cjs/commands/CreateFieldCommand.js +36 -0
- package/dist-cjs/commands/CreateLayoutCommand.js +36 -0
- package/dist-cjs/commands/CreateRelatedItemCommand.js +36 -0
- package/dist-cjs/commands/CreateTemplateCommand.js +36 -0
- package/dist-cjs/commands/GetCaseCommand.js +36 -0
- package/dist-cjs/commands/GetCaseEventConfigurationCommand.js +36 -0
- package/dist-cjs/commands/GetDomainCommand.js +36 -0
- package/dist-cjs/commands/GetLayoutCommand.js +36 -0
- package/dist-cjs/commands/GetTemplateCommand.js +36 -0
- package/dist-cjs/commands/ListCasesForContactCommand.js +36 -0
- package/dist-cjs/commands/ListDomainsCommand.js +36 -0
- package/dist-cjs/commands/ListFieldOptionsCommand.js +36 -0
- package/dist-cjs/commands/ListFieldsCommand.js +36 -0
- package/dist-cjs/commands/ListLayoutsCommand.js +36 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
- package/dist-cjs/commands/ListTemplatesCommand.js +36 -0
- package/dist-cjs/commands/PutCaseEventConfigurationCommand.js +36 -0
- package/dist-cjs/commands/SearchCasesCommand.js +36 -0
- package/dist-cjs/commands/SearchRelatedItemsCommand.js +36 -0
- package/dist-cjs/commands/TagResourceCommand.js +36 -0
- package/dist-cjs/commands/UntagResourceCommand.js +36 -0
- package/dist-cjs/commands/UpdateCaseCommand.js +36 -0
- package/dist-cjs/commands/UpdateFieldCommand.js +36 -0
- package/dist-cjs/commands/UpdateLayoutCommand.js +36 -0
- package/dist-cjs/commands/UpdateTemplateCommand.js +36 -0
- package/dist-cjs/commands/index.js +32 -0
- package/dist-cjs/endpoints.js +132 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/ConnectCasesServiceException.js +11 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +661 -0
- package/dist-cjs/pagination/GetCasePaginator.js +35 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListCasesForContactPaginator.js +36 -0
- package/dist-cjs/pagination/ListDomainsPaginator.js +36 -0
- package/dist-cjs/pagination/ListFieldOptionsPaginator.js +36 -0
- package/dist-cjs/pagination/ListFieldsPaginator.js +36 -0
- package/dist-cjs/pagination/ListLayoutsPaginator.js +36 -0
- package/dist-cjs/pagination/ListTemplatesPaginator.js +36 -0
- package/dist-cjs/pagination/SearchCasesPaginator.js +36 -0
- package/dist-cjs/pagination/SearchRelatedItemsPaginator.js +36 -0
- package/dist-cjs/pagination/index.js +13 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2920 -0
- package/dist-cjs/runtimeConfig.browser.js +45 -0
- package/dist-cjs/runtimeConfig.js +52 -0
- package/dist-cjs/runtimeConfig.native.js +16 -0
- package/dist-cjs/runtimeConfig.shared.js +17 -0
- package/dist-es/ConnectCases.js +438 -0
- package/dist-es/ConnectCasesClient.js +33 -0
- package/dist-es/commands/BatchGetFieldCommand.js +32 -0
- package/dist-es/commands/BatchPutFieldOptionsCommand.js +32 -0
- package/dist-es/commands/CreateCaseCommand.js +32 -0
- package/dist-es/commands/CreateDomainCommand.js +32 -0
- package/dist-es/commands/CreateFieldCommand.js +32 -0
- package/dist-es/commands/CreateLayoutCommand.js +32 -0
- package/dist-es/commands/CreateRelatedItemCommand.js +32 -0
- package/dist-es/commands/CreateTemplateCommand.js +32 -0
- package/dist-es/commands/GetCaseCommand.js +32 -0
- package/dist-es/commands/GetCaseEventConfigurationCommand.js +32 -0
- package/dist-es/commands/GetDomainCommand.js +32 -0
- package/dist-es/commands/GetLayoutCommand.js +32 -0
- package/dist-es/commands/GetTemplateCommand.js +32 -0
- package/dist-es/commands/ListCasesForContactCommand.js +32 -0
- package/dist-es/commands/ListDomainsCommand.js +32 -0
- package/dist-es/commands/ListFieldOptionsCommand.js +32 -0
- package/dist-es/commands/ListFieldsCommand.js +32 -0
- package/dist-es/commands/ListLayoutsCommand.js +32 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +32 -0
- package/dist-es/commands/ListTemplatesCommand.js +32 -0
- package/dist-es/commands/PutCaseEventConfigurationCommand.js +32 -0
- package/dist-es/commands/SearchCasesCommand.js +32 -0
- package/dist-es/commands/SearchRelatedItemsCommand.js +32 -0
- package/dist-es/commands/TagResourceCommand.js +32 -0
- package/dist-es/commands/UntagResourceCommand.js +32 -0
- package/dist-es/commands/UpdateCaseCommand.js +32 -0
- package/dist-es/commands/UpdateFieldCommand.js +32 -0
- package/dist-es/commands/UpdateLayoutCommand.js +32 -0
- package/dist-es/commands/UpdateTemplateCommand.js +32 -0
- package/dist-es/commands/index.js +29 -0
- package/dist-es/endpoints.js +128 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/ConnectCasesServiceException.js +7 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +556 -0
- package/dist-es/pagination/GetCasePaginator.js +31 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListCasesForContactPaginator.js +32 -0
- package/dist-es/pagination/ListDomainsPaginator.js +32 -0
- package/dist-es/pagination/ListFieldOptionsPaginator.js +32 -0
- package/dist-es/pagination/ListFieldsPaginator.js +32 -0
- package/dist-es/pagination/ListLayoutsPaginator.js +32 -0
- package/dist-es/pagination/ListTemplatesPaginator.js +32 -0
- package/dist-es/pagination/SearchCasesPaginator.js +32 -0
- package/dist-es/pagination/SearchRelatedItemsPaginator.js +32 -0
- package/dist-es/pagination/index.js +10 -0
- package/dist-es/protocols/Aws_restJson1.js +2853 -0
- package/dist-es/runtimeConfig.browser.js +40 -0
- package/dist-es/runtimeConfig.js +48 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +10 -0
- package/dist-types/ConnectCases.d.ts +276 -0
- package/dist-types/ConnectCasesClient.d.ts +178 -0
- package/dist-types/commands/BatchGetFieldCommand.d.ts +35 -0
- package/dist-types/commands/BatchPutFieldOptionsCommand.d.ts +36 -0
- package/dist-types/commands/CreateCaseCommand.d.ts +40 -0
- package/dist-types/commands/CreateDomainCommand.d.ts +42 -0
- package/dist-types/commands/CreateFieldCommand.d.ts +36 -0
- package/dist-types/commands/CreateLayoutCommand.d.ts +48 -0
- package/dist-types/commands/CreateRelatedItemCommand.d.ts +43 -0
- package/dist-types/commands/CreateTemplateCommand.d.ts +38 -0
- package/dist-types/commands/GetCaseCommand.d.ts +35 -0
- package/dist-types/commands/GetCaseEventConfigurationCommand.d.ts +35 -0
- package/dist-types/commands/GetDomainCommand.d.ts +35 -0
- package/dist-types/commands/GetLayoutCommand.d.ts +35 -0
- package/dist-types/commands/GetTemplateCommand.d.ts +35 -0
- package/dist-types/commands/ListCasesForContactCommand.d.ts +35 -0
- package/dist-types/commands/ListDomainsCommand.d.ts +36 -0
- package/dist-types/commands/ListFieldOptionsCommand.d.ts +35 -0
- package/dist-types/commands/ListFieldsCommand.d.ts +35 -0
- package/dist-types/commands/ListLayoutsCommand.d.ts +36 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +35 -0
- package/dist-types/commands/ListTemplatesCommand.d.ts +36 -0
- package/dist-types/commands/PutCaseEventConfigurationCommand.d.ts +35 -0
- package/dist-types/commands/SearchCasesCommand.d.ts +36 -0
- package/dist-types/commands/SearchRelatedItemsCommand.d.ts +39 -0
- package/dist-types/commands/TagResourceCommand.d.ts +35 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +35 -0
- package/dist-types/commands/UpdateCaseCommand.d.ts +38 -0
- package/dist-types/commands/UpdateFieldCommand.d.ts +35 -0
- package/dist-types/commands/UpdateLayoutCommand.d.ts +43 -0
- package/dist-types/commands/UpdateTemplateCommand.d.ts +39 -0
- package/dist-types/commands/index.d.ts +29 -0
- package/dist-types/endpoints.d.ts +2 -0
- package/dist-types/index.d.ts +6 -0
- package/dist-types/models/ConnectCasesServiceException.d.ts +10 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +1985 -0
- package/dist-types/pagination/GetCasePaginator.d.ts +4 -0
- package/dist-types/pagination/Interfaces.d.ts +6 -0
- package/dist-types/pagination/ListCasesForContactPaginator.d.ts +4 -0
- package/dist-types/pagination/ListDomainsPaginator.d.ts +4 -0
- package/dist-types/pagination/ListFieldOptionsPaginator.d.ts +4 -0
- package/dist-types/pagination/ListFieldsPaginator.d.ts +4 -0
- package/dist-types/pagination/ListLayoutsPaginator.d.ts +4 -0
- package/dist-types/pagination/ListTemplatesPaginator.d.ts +4 -0
- package/dist-types/pagination/SearchCasesPaginator.d.ts +4 -0
- package/dist-types/pagination/SearchRelatedItemsPaginator.d.ts +4 -0
- package/dist-types/pagination/index.d.ts +10 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +89 -0
- package/dist-types/runtimeConfig.browser.d.ts +40 -0
- package/dist-types/runtimeConfig.d.ts +40 -0
- package/dist-types/runtimeConfig.native.d.ts +39 -0
- package/dist-types/runtimeConfig.shared.d.ts +13 -0
- package/dist-types/ts3.4/ConnectCases.d.ts +497 -0
- package/dist-types/ts3.4/ConnectCasesClient.d.ts +279 -0
- package/dist-types/ts3.4/commands/BatchGetFieldCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/BatchPutFieldOptionsCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/CreateCaseCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/CreateDomainCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/CreateFieldCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/CreateLayoutCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/CreateRelatedItemCommand.d.ts +36 -0
- package/dist-types/ts3.4/commands/CreateTemplateCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetCaseCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/GetCaseEventConfigurationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/GetDomainCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/GetLayoutCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/GetTemplateCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/ListCasesForContactCommand.d.ts +36 -0
- package/dist-types/ts3.4/commands/ListDomainsCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/ListFieldOptionsCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListFieldsCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/ListLayoutsCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +36 -0
- package/dist-types/ts3.4/commands/ListTemplatesCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/PutCaseEventConfigurationCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/SearchCasesCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/SearchRelatedItemsCommand.d.ts +36 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +30 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +30 -0
- package/dist-types/ts3.4/commands/UpdateCaseCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/UpdateFieldCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/UpdateLayoutCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/UpdateTemplateCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/index.d.ts +29 -0
- package/dist-types/ts3.4/endpoints.d.ts +2 -0
- package/dist-types/ts3.4/index.d.ts +6 -0
- package/dist-types/ts3.4/models/ConnectCasesServiceException.d.ts +7 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +988 -0
- package/dist-types/ts3.4/pagination/GetCasePaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +7 -0
- package/dist-types/ts3.4/pagination/ListCasesForContactPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListDomainsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListFieldOptionsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListFieldsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListLayoutsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListTemplatesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/SearchCasesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/SearchRelatedItemsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +10 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +353 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +67 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +67 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +68 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +10 -0
- package/package.json +102 -0
|
@@ -0,0 +1,2853 @@
|
|
|
1
|
+
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
|
+
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
4
|
+
import { ConnectCasesServiceException as __BaseException } from "../models/ConnectCasesServiceException";
|
|
5
|
+
import { AccessDeniedException, CaseFilter, ConflictException, FieldFilter, FieldValueUnion, InternalServerException, LayoutContent, RelatedItemInputContent, RelatedItemTypeFilter, ResourceNotFoundException, Section, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
export const serializeAws_restJson1BatchGetFieldCommand = async (input, context) => {
|
|
7
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
8
|
+
const headers = {
|
|
9
|
+
"content-type": "application/json",
|
|
10
|
+
};
|
|
11
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/fields-batch";
|
|
12
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
13
|
+
let body;
|
|
14
|
+
body = JSON.stringify({
|
|
15
|
+
...(input.fields != null && { fields: serializeAws_restJson1BatchGetFieldIdentifierList(input.fields, context) }),
|
|
16
|
+
});
|
|
17
|
+
return new __HttpRequest({
|
|
18
|
+
protocol,
|
|
19
|
+
hostname,
|
|
20
|
+
port,
|
|
21
|
+
method: "POST",
|
|
22
|
+
headers,
|
|
23
|
+
path: resolvedPath,
|
|
24
|
+
body,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
export const serializeAws_restJson1BatchPutFieldOptionsCommand = async (input, context) => {
|
|
28
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
29
|
+
const headers = {
|
|
30
|
+
"content-type": "application/json",
|
|
31
|
+
};
|
|
32
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
33
|
+
"/domains/{domainId}/fields/{fieldId}/options";
|
|
34
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
35
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "fieldId", () => input.fieldId, "{fieldId}", false);
|
|
36
|
+
let body;
|
|
37
|
+
body = JSON.stringify({
|
|
38
|
+
...(input.options != null && { options: serializeAws_restJson1FieldOptionsList(input.options, context) }),
|
|
39
|
+
});
|
|
40
|
+
return new __HttpRequest({
|
|
41
|
+
protocol,
|
|
42
|
+
hostname,
|
|
43
|
+
port,
|
|
44
|
+
method: "PUT",
|
|
45
|
+
headers,
|
|
46
|
+
path: resolvedPath,
|
|
47
|
+
body,
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
export const serializeAws_restJson1CreateCaseCommand = async (input, context) => {
|
|
51
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
52
|
+
const headers = {
|
|
53
|
+
"content-type": "application/json",
|
|
54
|
+
};
|
|
55
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/cases";
|
|
56
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
57
|
+
let body;
|
|
58
|
+
body = JSON.stringify({
|
|
59
|
+
clientToken: input.clientToken ?? generateIdempotencyToken(),
|
|
60
|
+
...(input.fields != null && { fields: serializeAws_restJson1FieldValueList(input.fields, context) }),
|
|
61
|
+
...(input.templateId != null && { templateId: input.templateId }),
|
|
62
|
+
});
|
|
63
|
+
return new __HttpRequest({
|
|
64
|
+
protocol,
|
|
65
|
+
hostname,
|
|
66
|
+
port,
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers,
|
|
69
|
+
path: resolvedPath,
|
|
70
|
+
body,
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
export const serializeAws_restJson1CreateDomainCommand = async (input, context) => {
|
|
74
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
75
|
+
const headers = {
|
|
76
|
+
"content-type": "application/json",
|
|
77
|
+
};
|
|
78
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains";
|
|
79
|
+
let body;
|
|
80
|
+
body = JSON.stringify({
|
|
81
|
+
...(input.name != null && { name: input.name }),
|
|
82
|
+
});
|
|
83
|
+
return new __HttpRequest({
|
|
84
|
+
protocol,
|
|
85
|
+
hostname,
|
|
86
|
+
port,
|
|
87
|
+
method: "POST",
|
|
88
|
+
headers,
|
|
89
|
+
path: resolvedPath,
|
|
90
|
+
body,
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
export const serializeAws_restJson1CreateFieldCommand = async (input, context) => {
|
|
94
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
95
|
+
const headers = {
|
|
96
|
+
"content-type": "application/json",
|
|
97
|
+
};
|
|
98
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/fields";
|
|
99
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
100
|
+
let body;
|
|
101
|
+
body = JSON.stringify({
|
|
102
|
+
...(input.description != null && { description: input.description }),
|
|
103
|
+
...(input.name != null && { name: input.name }),
|
|
104
|
+
...(input.type != null && { type: input.type }),
|
|
105
|
+
});
|
|
106
|
+
return new __HttpRequest({
|
|
107
|
+
protocol,
|
|
108
|
+
hostname,
|
|
109
|
+
port,
|
|
110
|
+
method: "POST",
|
|
111
|
+
headers,
|
|
112
|
+
path: resolvedPath,
|
|
113
|
+
body,
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
export const serializeAws_restJson1CreateLayoutCommand = async (input, context) => {
|
|
117
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
118
|
+
const headers = {
|
|
119
|
+
"content-type": "application/json",
|
|
120
|
+
};
|
|
121
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/layouts";
|
|
122
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
123
|
+
let body;
|
|
124
|
+
body = JSON.stringify({
|
|
125
|
+
...(input.content != null && { content: serializeAws_restJson1LayoutContent(input.content, context) }),
|
|
126
|
+
...(input.name != null && { name: input.name }),
|
|
127
|
+
});
|
|
128
|
+
return new __HttpRequest({
|
|
129
|
+
protocol,
|
|
130
|
+
hostname,
|
|
131
|
+
port,
|
|
132
|
+
method: "POST",
|
|
133
|
+
headers,
|
|
134
|
+
path: resolvedPath,
|
|
135
|
+
body,
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
export const serializeAws_restJson1CreateRelatedItemCommand = async (input, context) => {
|
|
139
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
140
|
+
const headers = {
|
|
141
|
+
"content-type": "application/json",
|
|
142
|
+
};
|
|
143
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
144
|
+
"/domains/{domainId}/cases/{caseId}/related-items";
|
|
145
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
146
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "caseId", () => input.caseId, "{caseId}", false);
|
|
147
|
+
let body;
|
|
148
|
+
body = JSON.stringify({
|
|
149
|
+
...(input.content != null && { content: serializeAws_restJson1RelatedItemInputContent(input.content, context) }),
|
|
150
|
+
...(input.type != null && { type: input.type }),
|
|
151
|
+
});
|
|
152
|
+
return new __HttpRequest({
|
|
153
|
+
protocol,
|
|
154
|
+
hostname,
|
|
155
|
+
port,
|
|
156
|
+
method: "POST",
|
|
157
|
+
headers,
|
|
158
|
+
path: resolvedPath,
|
|
159
|
+
body,
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
export const serializeAws_restJson1CreateTemplateCommand = async (input, context) => {
|
|
163
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
164
|
+
const headers = {
|
|
165
|
+
"content-type": "application/json",
|
|
166
|
+
};
|
|
167
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/templates";
|
|
168
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
169
|
+
let body;
|
|
170
|
+
body = JSON.stringify({
|
|
171
|
+
...(input.description != null && { description: input.description }),
|
|
172
|
+
...(input.layoutConfiguration != null && {
|
|
173
|
+
layoutConfiguration: serializeAws_restJson1LayoutConfiguration(input.layoutConfiguration, context),
|
|
174
|
+
}),
|
|
175
|
+
...(input.name != null && { name: input.name }),
|
|
176
|
+
...(input.requiredFields != null && {
|
|
177
|
+
requiredFields: serializeAws_restJson1RequiredFieldList(input.requiredFields, context),
|
|
178
|
+
}),
|
|
179
|
+
});
|
|
180
|
+
return new __HttpRequest({
|
|
181
|
+
protocol,
|
|
182
|
+
hostname,
|
|
183
|
+
port,
|
|
184
|
+
method: "POST",
|
|
185
|
+
headers,
|
|
186
|
+
path: resolvedPath,
|
|
187
|
+
body,
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
export const serializeAws_restJson1GetCaseCommand = async (input, context) => {
|
|
191
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
192
|
+
const headers = {
|
|
193
|
+
"content-type": "application/json",
|
|
194
|
+
};
|
|
195
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/cases/{caseId}";
|
|
196
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "caseId", () => input.caseId, "{caseId}", false);
|
|
197
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
198
|
+
let body;
|
|
199
|
+
body = JSON.stringify({
|
|
200
|
+
...(input.fields != null && { fields: serializeAws_restJson1FieldIdentifierList(input.fields, context) }),
|
|
201
|
+
...(input.nextToken != null && { nextToken: input.nextToken }),
|
|
202
|
+
});
|
|
203
|
+
return new __HttpRequest({
|
|
204
|
+
protocol,
|
|
205
|
+
hostname,
|
|
206
|
+
port,
|
|
207
|
+
method: "POST",
|
|
208
|
+
headers,
|
|
209
|
+
path: resolvedPath,
|
|
210
|
+
body,
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
export const serializeAws_restJson1GetCaseEventConfigurationCommand = async (input, context) => {
|
|
214
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
215
|
+
const headers = {};
|
|
216
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
217
|
+
"/domains/{domainId}/case-event-configuration";
|
|
218
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
219
|
+
let body;
|
|
220
|
+
return new __HttpRequest({
|
|
221
|
+
protocol,
|
|
222
|
+
hostname,
|
|
223
|
+
port,
|
|
224
|
+
method: "POST",
|
|
225
|
+
headers,
|
|
226
|
+
path: resolvedPath,
|
|
227
|
+
body,
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
export const serializeAws_restJson1GetDomainCommand = async (input, context) => {
|
|
231
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
232
|
+
const headers = {};
|
|
233
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}";
|
|
234
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
235
|
+
let body;
|
|
236
|
+
return new __HttpRequest({
|
|
237
|
+
protocol,
|
|
238
|
+
hostname,
|
|
239
|
+
port,
|
|
240
|
+
method: "POST",
|
|
241
|
+
headers,
|
|
242
|
+
path: resolvedPath,
|
|
243
|
+
body,
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
export const serializeAws_restJson1GetLayoutCommand = async (input, context) => {
|
|
247
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
248
|
+
const headers = {};
|
|
249
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/layouts/{layoutId}";
|
|
250
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
251
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "layoutId", () => input.layoutId, "{layoutId}", false);
|
|
252
|
+
let body;
|
|
253
|
+
return new __HttpRequest({
|
|
254
|
+
protocol,
|
|
255
|
+
hostname,
|
|
256
|
+
port,
|
|
257
|
+
method: "POST",
|
|
258
|
+
headers,
|
|
259
|
+
path: resolvedPath,
|
|
260
|
+
body,
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
export const serializeAws_restJson1GetTemplateCommand = async (input, context) => {
|
|
264
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
265
|
+
const headers = {};
|
|
266
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
267
|
+
"/domains/{domainId}/templates/{templateId}";
|
|
268
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
269
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "templateId", () => input.templateId, "{templateId}", false);
|
|
270
|
+
let body;
|
|
271
|
+
return new __HttpRequest({
|
|
272
|
+
protocol,
|
|
273
|
+
hostname,
|
|
274
|
+
port,
|
|
275
|
+
method: "POST",
|
|
276
|
+
headers,
|
|
277
|
+
path: resolvedPath,
|
|
278
|
+
body,
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
export const serializeAws_restJson1ListCasesForContactCommand = async (input, context) => {
|
|
282
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
283
|
+
const headers = {
|
|
284
|
+
"content-type": "application/json",
|
|
285
|
+
};
|
|
286
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
287
|
+
"/domains/{domainId}/list-cases-for-contact";
|
|
288
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
289
|
+
let body;
|
|
290
|
+
body = JSON.stringify({
|
|
291
|
+
...(input.contactArn != null && { contactArn: input.contactArn }),
|
|
292
|
+
...(input.maxResults != null && { maxResults: input.maxResults }),
|
|
293
|
+
...(input.nextToken != null && { nextToken: input.nextToken }),
|
|
294
|
+
});
|
|
295
|
+
return new __HttpRequest({
|
|
296
|
+
protocol,
|
|
297
|
+
hostname,
|
|
298
|
+
port,
|
|
299
|
+
method: "POST",
|
|
300
|
+
headers,
|
|
301
|
+
path: resolvedPath,
|
|
302
|
+
body,
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
export const serializeAws_restJson1ListDomainsCommand = async (input, context) => {
|
|
306
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
307
|
+
const headers = {};
|
|
308
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains-list";
|
|
309
|
+
const query = map({
|
|
310
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
311
|
+
nextToken: [, input.nextToken],
|
|
312
|
+
});
|
|
313
|
+
let body;
|
|
314
|
+
return new __HttpRequest({
|
|
315
|
+
protocol,
|
|
316
|
+
hostname,
|
|
317
|
+
port,
|
|
318
|
+
method: "POST",
|
|
319
|
+
headers,
|
|
320
|
+
path: resolvedPath,
|
|
321
|
+
query,
|
|
322
|
+
body,
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
export const serializeAws_restJson1ListFieldOptionsCommand = async (input, context) => {
|
|
326
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
327
|
+
const headers = {};
|
|
328
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
329
|
+
"/domains/{domainId}/fields/{fieldId}/options-list";
|
|
330
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
331
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "fieldId", () => input.fieldId, "{fieldId}", false);
|
|
332
|
+
const query = map({
|
|
333
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
334
|
+
nextToken: [, input.nextToken],
|
|
335
|
+
values: [() => input.values !== void 0, () => (input.values || []).map((_entry) => _entry)],
|
|
336
|
+
});
|
|
337
|
+
let body;
|
|
338
|
+
return new __HttpRequest({
|
|
339
|
+
protocol,
|
|
340
|
+
hostname,
|
|
341
|
+
port,
|
|
342
|
+
method: "POST",
|
|
343
|
+
headers,
|
|
344
|
+
path: resolvedPath,
|
|
345
|
+
query,
|
|
346
|
+
body,
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
export const serializeAws_restJson1ListFieldsCommand = async (input, context) => {
|
|
350
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
351
|
+
const headers = {};
|
|
352
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/fields-list";
|
|
353
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
354
|
+
const query = map({
|
|
355
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
356
|
+
nextToken: [, input.nextToken],
|
|
357
|
+
});
|
|
358
|
+
let body;
|
|
359
|
+
return new __HttpRequest({
|
|
360
|
+
protocol,
|
|
361
|
+
hostname,
|
|
362
|
+
port,
|
|
363
|
+
method: "POST",
|
|
364
|
+
headers,
|
|
365
|
+
path: resolvedPath,
|
|
366
|
+
query,
|
|
367
|
+
body,
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
export const serializeAws_restJson1ListLayoutsCommand = async (input, context) => {
|
|
371
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
372
|
+
const headers = {};
|
|
373
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/layouts-list";
|
|
374
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
375
|
+
const query = map({
|
|
376
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
377
|
+
nextToken: [, input.nextToken],
|
|
378
|
+
});
|
|
379
|
+
let body;
|
|
380
|
+
return new __HttpRequest({
|
|
381
|
+
protocol,
|
|
382
|
+
hostname,
|
|
383
|
+
port,
|
|
384
|
+
method: "POST",
|
|
385
|
+
headers,
|
|
386
|
+
path: resolvedPath,
|
|
387
|
+
query,
|
|
388
|
+
body,
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
|
|
392
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
393
|
+
const headers = {};
|
|
394
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
|
|
395
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "arn", () => input.arn, "{arn}", false);
|
|
396
|
+
let body;
|
|
397
|
+
return new __HttpRequest({
|
|
398
|
+
protocol,
|
|
399
|
+
hostname,
|
|
400
|
+
port,
|
|
401
|
+
method: "GET",
|
|
402
|
+
headers,
|
|
403
|
+
path: resolvedPath,
|
|
404
|
+
body,
|
|
405
|
+
});
|
|
406
|
+
};
|
|
407
|
+
export const serializeAws_restJson1ListTemplatesCommand = async (input, context) => {
|
|
408
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
409
|
+
const headers = {};
|
|
410
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/templates-list";
|
|
411
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
412
|
+
const query = map({
|
|
413
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
414
|
+
nextToken: [, input.nextToken],
|
|
415
|
+
});
|
|
416
|
+
let body;
|
|
417
|
+
return new __HttpRequest({
|
|
418
|
+
protocol,
|
|
419
|
+
hostname,
|
|
420
|
+
port,
|
|
421
|
+
method: "POST",
|
|
422
|
+
headers,
|
|
423
|
+
path: resolvedPath,
|
|
424
|
+
query,
|
|
425
|
+
body,
|
|
426
|
+
});
|
|
427
|
+
};
|
|
428
|
+
export const serializeAws_restJson1PutCaseEventConfigurationCommand = async (input, context) => {
|
|
429
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
430
|
+
const headers = {
|
|
431
|
+
"content-type": "application/json",
|
|
432
|
+
};
|
|
433
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
434
|
+
"/domains/{domainId}/case-event-configuration";
|
|
435
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
436
|
+
let body;
|
|
437
|
+
body = JSON.stringify({
|
|
438
|
+
...(input.eventBridge != null && {
|
|
439
|
+
eventBridge: serializeAws_restJson1EventBridgeConfiguration(input.eventBridge, context),
|
|
440
|
+
}),
|
|
441
|
+
});
|
|
442
|
+
return new __HttpRequest({
|
|
443
|
+
protocol,
|
|
444
|
+
hostname,
|
|
445
|
+
port,
|
|
446
|
+
method: "PUT",
|
|
447
|
+
headers,
|
|
448
|
+
path: resolvedPath,
|
|
449
|
+
body,
|
|
450
|
+
});
|
|
451
|
+
};
|
|
452
|
+
export const serializeAws_restJson1SearchCasesCommand = async (input, context) => {
|
|
453
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
454
|
+
const headers = {
|
|
455
|
+
"content-type": "application/json",
|
|
456
|
+
};
|
|
457
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/cases-search";
|
|
458
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
459
|
+
let body;
|
|
460
|
+
body = JSON.stringify({
|
|
461
|
+
...(input.fields != null && { fields: serializeAws_restJson1FieldIdentifierList(input.fields, context) }),
|
|
462
|
+
...(input.filter != null && { filter: serializeAws_restJson1CaseFilter(input.filter, context) }),
|
|
463
|
+
...(input.maxResults != null && { maxResults: input.maxResults }),
|
|
464
|
+
...(input.nextToken != null && { nextToken: input.nextToken }),
|
|
465
|
+
...(input.searchTerm != null && { searchTerm: input.searchTerm }),
|
|
466
|
+
...(input.sorts != null && { sorts: serializeAws_restJson1SortList(input.sorts, context) }),
|
|
467
|
+
});
|
|
468
|
+
return new __HttpRequest({
|
|
469
|
+
protocol,
|
|
470
|
+
hostname,
|
|
471
|
+
port,
|
|
472
|
+
method: "POST",
|
|
473
|
+
headers,
|
|
474
|
+
path: resolvedPath,
|
|
475
|
+
body,
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
export const serializeAws_restJson1SearchRelatedItemsCommand = async (input, context) => {
|
|
479
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
480
|
+
const headers = {
|
|
481
|
+
"content-type": "application/json",
|
|
482
|
+
};
|
|
483
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
484
|
+
"/domains/{domainId}/cases/{caseId}/related-items-search";
|
|
485
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
486
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "caseId", () => input.caseId, "{caseId}", false);
|
|
487
|
+
let body;
|
|
488
|
+
body = JSON.stringify({
|
|
489
|
+
...(input.filters != null && { filters: serializeAws_restJson1RelatedItemFilterList(input.filters, context) }),
|
|
490
|
+
...(input.maxResults != null && { maxResults: input.maxResults }),
|
|
491
|
+
...(input.nextToken != null && { nextToken: input.nextToken }),
|
|
492
|
+
});
|
|
493
|
+
return new __HttpRequest({
|
|
494
|
+
protocol,
|
|
495
|
+
hostname,
|
|
496
|
+
port,
|
|
497
|
+
method: "POST",
|
|
498
|
+
headers,
|
|
499
|
+
path: resolvedPath,
|
|
500
|
+
body,
|
|
501
|
+
});
|
|
502
|
+
};
|
|
503
|
+
export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
|
|
504
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
505
|
+
const headers = {
|
|
506
|
+
"content-type": "application/json",
|
|
507
|
+
};
|
|
508
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
|
|
509
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "arn", () => input.arn, "{arn}", false);
|
|
510
|
+
let body;
|
|
511
|
+
body = JSON.stringify({
|
|
512
|
+
...(input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
|
|
513
|
+
});
|
|
514
|
+
return new __HttpRequest({
|
|
515
|
+
protocol,
|
|
516
|
+
hostname,
|
|
517
|
+
port,
|
|
518
|
+
method: "POST",
|
|
519
|
+
headers,
|
|
520
|
+
path: resolvedPath,
|
|
521
|
+
body,
|
|
522
|
+
});
|
|
523
|
+
};
|
|
524
|
+
export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
|
|
525
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
526
|
+
const headers = {};
|
|
527
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
|
|
528
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "arn", () => input.arn, "{arn}", false);
|
|
529
|
+
const query = map({
|
|
530
|
+
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
|
|
531
|
+
});
|
|
532
|
+
let body;
|
|
533
|
+
return new __HttpRequest({
|
|
534
|
+
protocol,
|
|
535
|
+
hostname,
|
|
536
|
+
port,
|
|
537
|
+
method: "DELETE",
|
|
538
|
+
headers,
|
|
539
|
+
path: resolvedPath,
|
|
540
|
+
query,
|
|
541
|
+
body,
|
|
542
|
+
});
|
|
543
|
+
};
|
|
544
|
+
export const serializeAws_restJson1UpdateCaseCommand = async (input, context) => {
|
|
545
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
546
|
+
const headers = {
|
|
547
|
+
"content-type": "application/json",
|
|
548
|
+
};
|
|
549
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/cases/{caseId}";
|
|
550
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
551
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "caseId", () => input.caseId, "{caseId}", false);
|
|
552
|
+
let body;
|
|
553
|
+
body = JSON.stringify({
|
|
554
|
+
...(input.fields != null && { fields: serializeAws_restJson1FieldValueList(input.fields, context) }),
|
|
555
|
+
});
|
|
556
|
+
return new __HttpRequest({
|
|
557
|
+
protocol,
|
|
558
|
+
hostname,
|
|
559
|
+
port,
|
|
560
|
+
method: "PUT",
|
|
561
|
+
headers,
|
|
562
|
+
path: resolvedPath,
|
|
563
|
+
body,
|
|
564
|
+
});
|
|
565
|
+
};
|
|
566
|
+
export const serializeAws_restJson1UpdateFieldCommand = async (input, context) => {
|
|
567
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
568
|
+
const headers = {
|
|
569
|
+
"content-type": "application/json",
|
|
570
|
+
};
|
|
571
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/fields/{fieldId}";
|
|
572
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
573
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "fieldId", () => input.fieldId, "{fieldId}", false);
|
|
574
|
+
let body;
|
|
575
|
+
body = JSON.stringify({
|
|
576
|
+
...(input.description != null && { description: input.description }),
|
|
577
|
+
...(input.name != null && { name: input.name }),
|
|
578
|
+
});
|
|
579
|
+
return new __HttpRequest({
|
|
580
|
+
protocol,
|
|
581
|
+
hostname,
|
|
582
|
+
port,
|
|
583
|
+
method: "PUT",
|
|
584
|
+
headers,
|
|
585
|
+
path: resolvedPath,
|
|
586
|
+
body,
|
|
587
|
+
});
|
|
588
|
+
};
|
|
589
|
+
export const serializeAws_restJson1UpdateLayoutCommand = async (input, context) => {
|
|
590
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
591
|
+
const headers = {
|
|
592
|
+
"content-type": "application/json",
|
|
593
|
+
};
|
|
594
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/domains/{domainId}/layouts/{layoutId}";
|
|
595
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
596
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "layoutId", () => input.layoutId, "{layoutId}", false);
|
|
597
|
+
let body;
|
|
598
|
+
body = JSON.stringify({
|
|
599
|
+
...(input.content != null && { content: serializeAws_restJson1LayoutContent(input.content, context) }),
|
|
600
|
+
...(input.name != null && { name: input.name }),
|
|
601
|
+
});
|
|
602
|
+
return new __HttpRequest({
|
|
603
|
+
protocol,
|
|
604
|
+
hostname,
|
|
605
|
+
port,
|
|
606
|
+
method: "PUT",
|
|
607
|
+
headers,
|
|
608
|
+
path: resolvedPath,
|
|
609
|
+
body,
|
|
610
|
+
});
|
|
611
|
+
};
|
|
612
|
+
export const serializeAws_restJson1UpdateTemplateCommand = async (input, context) => {
|
|
613
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
614
|
+
const headers = {
|
|
615
|
+
"content-type": "application/json",
|
|
616
|
+
};
|
|
617
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
618
|
+
"/domains/{domainId}/templates/{templateId}";
|
|
619
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "domainId", () => input.domainId, "{domainId}", false);
|
|
620
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "templateId", () => input.templateId, "{templateId}", false);
|
|
621
|
+
let body;
|
|
622
|
+
body = JSON.stringify({
|
|
623
|
+
...(input.description != null && { description: input.description }),
|
|
624
|
+
...(input.layoutConfiguration != null && {
|
|
625
|
+
layoutConfiguration: serializeAws_restJson1LayoutConfiguration(input.layoutConfiguration, context),
|
|
626
|
+
}),
|
|
627
|
+
...(input.name != null && { name: input.name }),
|
|
628
|
+
...(input.requiredFields != null && {
|
|
629
|
+
requiredFields: serializeAws_restJson1RequiredFieldList(input.requiredFields, context),
|
|
630
|
+
}),
|
|
631
|
+
});
|
|
632
|
+
return new __HttpRequest({
|
|
633
|
+
protocol,
|
|
634
|
+
hostname,
|
|
635
|
+
port,
|
|
636
|
+
method: "PUT",
|
|
637
|
+
headers,
|
|
638
|
+
path: resolvedPath,
|
|
639
|
+
body,
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
export const deserializeAws_restJson1BatchGetFieldCommand = async (output, context) => {
|
|
643
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
644
|
+
return deserializeAws_restJson1BatchGetFieldCommandError(output, context);
|
|
645
|
+
}
|
|
646
|
+
const contents = map({
|
|
647
|
+
$metadata: deserializeMetadata(output),
|
|
648
|
+
});
|
|
649
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
650
|
+
if (data.errors != null) {
|
|
651
|
+
contents.errors = deserializeAws_restJson1BatchGetFieldErrorList(data.errors, context);
|
|
652
|
+
}
|
|
653
|
+
if (data.fields != null) {
|
|
654
|
+
contents.fields = deserializeAws_restJson1BatchGetFieldList(data.fields, context);
|
|
655
|
+
}
|
|
656
|
+
return contents;
|
|
657
|
+
};
|
|
658
|
+
const deserializeAws_restJson1BatchGetFieldCommandError = async (output, context) => {
|
|
659
|
+
const parsedOutput = {
|
|
660
|
+
...output,
|
|
661
|
+
body: await parseErrorBody(output.body, context),
|
|
662
|
+
};
|
|
663
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
664
|
+
switch (errorCode) {
|
|
665
|
+
case "AccessDeniedException":
|
|
666
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
667
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
668
|
+
case "InternalServerException":
|
|
669
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
670
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
671
|
+
case "ResourceNotFoundException":
|
|
672
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
673
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
674
|
+
case "ThrottlingException":
|
|
675
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
676
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
677
|
+
case "ValidationException":
|
|
678
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
679
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
680
|
+
default:
|
|
681
|
+
const parsedBody = parsedOutput.body;
|
|
682
|
+
throwDefaultError({
|
|
683
|
+
output,
|
|
684
|
+
parsedBody,
|
|
685
|
+
exceptionCtor: __BaseException,
|
|
686
|
+
errorCode,
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
export const deserializeAws_restJson1BatchPutFieldOptionsCommand = async (output, context) => {
|
|
691
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
692
|
+
return deserializeAws_restJson1BatchPutFieldOptionsCommandError(output, context);
|
|
693
|
+
}
|
|
694
|
+
const contents = map({
|
|
695
|
+
$metadata: deserializeMetadata(output),
|
|
696
|
+
});
|
|
697
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
698
|
+
if (data.errors != null) {
|
|
699
|
+
contents.errors = deserializeAws_restJson1FieldOptionErrorList(data.errors, context);
|
|
700
|
+
}
|
|
701
|
+
return contents;
|
|
702
|
+
};
|
|
703
|
+
const deserializeAws_restJson1BatchPutFieldOptionsCommandError = async (output, context) => {
|
|
704
|
+
const parsedOutput = {
|
|
705
|
+
...output,
|
|
706
|
+
body: await parseErrorBody(output.body, context),
|
|
707
|
+
};
|
|
708
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
709
|
+
switch (errorCode) {
|
|
710
|
+
case "AccessDeniedException":
|
|
711
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
712
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
713
|
+
case "InternalServerException":
|
|
714
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
715
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
716
|
+
case "ResourceNotFoundException":
|
|
717
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
718
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
719
|
+
case "ServiceQuotaExceededException":
|
|
720
|
+
case "com.amazonaws.connectcases#ServiceQuotaExceededException":
|
|
721
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
722
|
+
case "ThrottlingException":
|
|
723
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
724
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
725
|
+
case "ValidationException":
|
|
726
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
727
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
728
|
+
default:
|
|
729
|
+
const parsedBody = parsedOutput.body;
|
|
730
|
+
throwDefaultError({
|
|
731
|
+
output,
|
|
732
|
+
parsedBody,
|
|
733
|
+
exceptionCtor: __BaseException,
|
|
734
|
+
errorCode,
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
export const deserializeAws_restJson1CreateCaseCommand = async (output, context) => {
|
|
739
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
740
|
+
return deserializeAws_restJson1CreateCaseCommandError(output, context);
|
|
741
|
+
}
|
|
742
|
+
const contents = map({
|
|
743
|
+
$metadata: deserializeMetadata(output),
|
|
744
|
+
});
|
|
745
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
746
|
+
if (data.caseArn != null) {
|
|
747
|
+
contents.caseArn = __expectString(data.caseArn);
|
|
748
|
+
}
|
|
749
|
+
if (data.caseId != null) {
|
|
750
|
+
contents.caseId = __expectString(data.caseId);
|
|
751
|
+
}
|
|
752
|
+
return contents;
|
|
753
|
+
};
|
|
754
|
+
const deserializeAws_restJson1CreateCaseCommandError = async (output, context) => {
|
|
755
|
+
const parsedOutput = {
|
|
756
|
+
...output,
|
|
757
|
+
body: await parseErrorBody(output.body, context),
|
|
758
|
+
};
|
|
759
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
760
|
+
switch (errorCode) {
|
|
761
|
+
case "AccessDeniedException":
|
|
762
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
763
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
764
|
+
case "ConflictException":
|
|
765
|
+
case "com.amazonaws.connectcases#ConflictException":
|
|
766
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
767
|
+
case "InternalServerException":
|
|
768
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
769
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
770
|
+
case "ResourceNotFoundException":
|
|
771
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
772
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
773
|
+
case "ThrottlingException":
|
|
774
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
775
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
776
|
+
case "ValidationException":
|
|
777
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
778
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
779
|
+
default:
|
|
780
|
+
const parsedBody = parsedOutput.body;
|
|
781
|
+
throwDefaultError({
|
|
782
|
+
output,
|
|
783
|
+
parsedBody,
|
|
784
|
+
exceptionCtor: __BaseException,
|
|
785
|
+
errorCode,
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
export const deserializeAws_restJson1CreateDomainCommand = async (output, context) => {
|
|
790
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
791
|
+
return deserializeAws_restJson1CreateDomainCommandError(output, context);
|
|
792
|
+
}
|
|
793
|
+
const contents = map({
|
|
794
|
+
$metadata: deserializeMetadata(output),
|
|
795
|
+
});
|
|
796
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
797
|
+
if (data.domainArn != null) {
|
|
798
|
+
contents.domainArn = __expectString(data.domainArn);
|
|
799
|
+
}
|
|
800
|
+
if (data.domainId != null) {
|
|
801
|
+
contents.domainId = __expectString(data.domainId);
|
|
802
|
+
}
|
|
803
|
+
if (data.domainStatus != null) {
|
|
804
|
+
contents.domainStatus = __expectString(data.domainStatus);
|
|
805
|
+
}
|
|
806
|
+
return contents;
|
|
807
|
+
};
|
|
808
|
+
const deserializeAws_restJson1CreateDomainCommandError = async (output, context) => {
|
|
809
|
+
const parsedOutput = {
|
|
810
|
+
...output,
|
|
811
|
+
body: await parseErrorBody(output.body, context),
|
|
812
|
+
};
|
|
813
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
814
|
+
switch (errorCode) {
|
|
815
|
+
case "AccessDeniedException":
|
|
816
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
817
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
818
|
+
case "ConflictException":
|
|
819
|
+
case "com.amazonaws.connectcases#ConflictException":
|
|
820
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
821
|
+
case "InternalServerException":
|
|
822
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
823
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
824
|
+
case "ServiceQuotaExceededException":
|
|
825
|
+
case "com.amazonaws.connectcases#ServiceQuotaExceededException":
|
|
826
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
827
|
+
case "ThrottlingException":
|
|
828
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
829
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
830
|
+
case "ValidationException":
|
|
831
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
832
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
833
|
+
default:
|
|
834
|
+
const parsedBody = parsedOutput.body;
|
|
835
|
+
throwDefaultError({
|
|
836
|
+
output,
|
|
837
|
+
parsedBody,
|
|
838
|
+
exceptionCtor: __BaseException,
|
|
839
|
+
errorCode,
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
};
|
|
843
|
+
export const deserializeAws_restJson1CreateFieldCommand = async (output, context) => {
|
|
844
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
845
|
+
return deserializeAws_restJson1CreateFieldCommandError(output, context);
|
|
846
|
+
}
|
|
847
|
+
const contents = map({
|
|
848
|
+
$metadata: deserializeMetadata(output),
|
|
849
|
+
});
|
|
850
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
851
|
+
if (data.fieldArn != null) {
|
|
852
|
+
contents.fieldArn = __expectString(data.fieldArn);
|
|
853
|
+
}
|
|
854
|
+
if (data.fieldId != null) {
|
|
855
|
+
contents.fieldId = __expectString(data.fieldId);
|
|
856
|
+
}
|
|
857
|
+
return contents;
|
|
858
|
+
};
|
|
859
|
+
const deserializeAws_restJson1CreateFieldCommandError = async (output, context) => {
|
|
860
|
+
const parsedOutput = {
|
|
861
|
+
...output,
|
|
862
|
+
body: await parseErrorBody(output.body, context),
|
|
863
|
+
};
|
|
864
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
865
|
+
switch (errorCode) {
|
|
866
|
+
case "AccessDeniedException":
|
|
867
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
868
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
869
|
+
case "ConflictException":
|
|
870
|
+
case "com.amazonaws.connectcases#ConflictException":
|
|
871
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
872
|
+
case "InternalServerException":
|
|
873
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
874
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
875
|
+
case "ResourceNotFoundException":
|
|
876
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
877
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
878
|
+
case "ServiceQuotaExceededException":
|
|
879
|
+
case "com.amazonaws.connectcases#ServiceQuotaExceededException":
|
|
880
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
881
|
+
case "ThrottlingException":
|
|
882
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
883
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
884
|
+
case "ValidationException":
|
|
885
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
886
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
887
|
+
default:
|
|
888
|
+
const parsedBody = parsedOutput.body;
|
|
889
|
+
throwDefaultError({
|
|
890
|
+
output,
|
|
891
|
+
parsedBody,
|
|
892
|
+
exceptionCtor: __BaseException,
|
|
893
|
+
errorCode,
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
export const deserializeAws_restJson1CreateLayoutCommand = async (output, context) => {
|
|
898
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
899
|
+
return deserializeAws_restJson1CreateLayoutCommandError(output, context);
|
|
900
|
+
}
|
|
901
|
+
const contents = map({
|
|
902
|
+
$metadata: deserializeMetadata(output),
|
|
903
|
+
});
|
|
904
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
905
|
+
if (data.layoutArn != null) {
|
|
906
|
+
contents.layoutArn = __expectString(data.layoutArn);
|
|
907
|
+
}
|
|
908
|
+
if (data.layoutId != null) {
|
|
909
|
+
contents.layoutId = __expectString(data.layoutId);
|
|
910
|
+
}
|
|
911
|
+
return contents;
|
|
912
|
+
};
|
|
913
|
+
const deserializeAws_restJson1CreateLayoutCommandError = async (output, context) => {
|
|
914
|
+
const parsedOutput = {
|
|
915
|
+
...output,
|
|
916
|
+
body: await parseErrorBody(output.body, context),
|
|
917
|
+
};
|
|
918
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
919
|
+
switch (errorCode) {
|
|
920
|
+
case "AccessDeniedException":
|
|
921
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
922
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
923
|
+
case "ConflictException":
|
|
924
|
+
case "com.amazonaws.connectcases#ConflictException":
|
|
925
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
926
|
+
case "InternalServerException":
|
|
927
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
928
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
929
|
+
case "ResourceNotFoundException":
|
|
930
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
931
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
932
|
+
case "ServiceQuotaExceededException":
|
|
933
|
+
case "com.amazonaws.connectcases#ServiceQuotaExceededException":
|
|
934
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
935
|
+
case "ThrottlingException":
|
|
936
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
937
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
938
|
+
case "ValidationException":
|
|
939
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
940
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
941
|
+
default:
|
|
942
|
+
const parsedBody = parsedOutput.body;
|
|
943
|
+
throwDefaultError({
|
|
944
|
+
output,
|
|
945
|
+
parsedBody,
|
|
946
|
+
exceptionCtor: __BaseException,
|
|
947
|
+
errorCode,
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
export const deserializeAws_restJson1CreateRelatedItemCommand = async (output, context) => {
|
|
952
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
953
|
+
return deserializeAws_restJson1CreateRelatedItemCommandError(output, context);
|
|
954
|
+
}
|
|
955
|
+
const contents = map({
|
|
956
|
+
$metadata: deserializeMetadata(output),
|
|
957
|
+
});
|
|
958
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
959
|
+
if (data.relatedItemArn != null) {
|
|
960
|
+
contents.relatedItemArn = __expectString(data.relatedItemArn);
|
|
961
|
+
}
|
|
962
|
+
if (data.relatedItemId != null) {
|
|
963
|
+
contents.relatedItemId = __expectString(data.relatedItemId);
|
|
964
|
+
}
|
|
965
|
+
return contents;
|
|
966
|
+
};
|
|
967
|
+
const deserializeAws_restJson1CreateRelatedItemCommandError = async (output, context) => {
|
|
968
|
+
const parsedOutput = {
|
|
969
|
+
...output,
|
|
970
|
+
body: await parseErrorBody(output.body, context),
|
|
971
|
+
};
|
|
972
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
973
|
+
switch (errorCode) {
|
|
974
|
+
case "AccessDeniedException":
|
|
975
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
976
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
977
|
+
case "InternalServerException":
|
|
978
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
979
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
980
|
+
case "ResourceNotFoundException":
|
|
981
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
982
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
983
|
+
case "ServiceQuotaExceededException":
|
|
984
|
+
case "com.amazonaws.connectcases#ServiceQuotaExceededException":
|
|
985
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
986
|
+
case "ThrottlingException":
|
|
987
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
988
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
989
|
+
case "ValidationException":
|
|
990
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
991
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
992
|
+
default:
|
|
993
|
+
const parsedBody = parsedOutput.body;
|
|
994
|
+
throwDefaultError({
|
|
995
|
+
output,
|
|
996
|
+
parsedBody,
|
|
997
|
+
exceptionCtor: __BaseException,
|
|
998
|
+
errorCode,
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
export const deserializeAws_restJson1CreateTemplateCommand = async (output, context) => {
|
|
1003
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1004
|
+
return deserializeAws_restJson1CreateTemplateCommandError(output, context);
|
|
1005
|
+
}
|
|
1006
|
+
const contents = map({
|
|
1007
|
+
$metadata: deserializeMetadata(output),
|
|
1008
|
+
});
|
|
1009
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1010
|
+
if (data.templateArn != null) {
|
|
1011
|
+
contents.templateArn = __expectString(data.templateArn);
|
|
1012
|
+
}
|
|
1013
|
+
if (data.templateId != null) {
|
|
1014
|
+
contents.templateId = __expectString(data.templateId);
|
|
1015
|
+
}
|
|
1016
|
+
return contents;
|
|
1017
|
+
};
|
|
1018
|
+
const deserializeAws_restJson1CreateTemplateCommandError = async (output, context) => {
|
|
1019
|
+
const parsedOutput = {
|
|
1020
|
+
...output,
|
|
1021
|
+
body: await parseErrorBody(output.body, context),
|
|
1022
|
+
};
|
|
1023
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1024
|
+
switch (errorCode) {
|
|
1025
|
+
case "AccessDeniedException":
|
|
1026
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1027
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1028
|
+
case "ConflictException":
|
|
1029
|
+
case "com.amazonaws.connectcases#ConflictException":
|
|
1030
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1031
|
+
case "InternalServerException":
|
|
1032
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1033
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1034
|
+
case "ResourceNotFoundException":
|
|
1035
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1036
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1037
|
+
case "ServiceQuotaExceededException":
|
|
1038
|
+
case "com.amazonaws.connectcases#ServiceQuotaExceededException":
|
|
1039
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
1040
|
+
case "ThrottlingException":
|
|
1041
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1042
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1043
|
+
case "ValidationException":
|
|
1044
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1045
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1046
|
+
default:
|
|
1047
|
+
const parsedBody = parsedOutput.body;
|
|
1048
|
+
throwDefaultError({
|
|
1049
|
+
output,
|
|
1050
|
+
parsedBody,
|
|
1051
|
+
exceptionCtor: __BaseException,
|
|
1052
|
+
errorCode,
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
export const deserializeAws_restJson1GetCaseCommand = async (output, context) => {
|
|
1057
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1058
|
+
return deserializeAws_restJson1GetCaseCommandError(output, context);
|
|
1059
|
+
}
|
|
1060
|
+
const contents = map({
|
|
1061
|
+
$metadata: deserializeMetadata(output),
|
|
1062
|
+
});
|
|
1063
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1064
|
+
if (data.fields != null) {
|
|
1065
|
+
contents.fields = deserializeAws_restJson1FieldValueList(data.fields, context);
|
|
1066
|
+
}
|
|
1067
|
+
if (data.nextToken != null) {
|
|
1068
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1069
|
+
}
|
|
1070
|
+
if (data.tags != null) {
|
|
1071
|
+
contents.tags = deserializeAws_restJson1Tags(data.tags, context);
|
|
1072
|
+
}
|
|
1073
|
+
if (data.templateId != null) {
|
|
1074
|
+
contents.templateId = __expectString(data.templateId);
|
|
1075
|
+
}
|
|
1076
|
+
return contents;
|
|
1077
|
+
};
|
|
1078
|
+
const deserializeAws_restJson1GetCaseCommandError = async (output, context) => {
|
|
1079
|
+
const parsedOutput = {
|
|
1080
|
+
...output,
|
|
1081
|
+
body: await parseErrorBody(output.body, context),
|
|
1082
|
+
};
|
|
1083
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1084
|
+
switch (errorCode) {
|
|
1085
|
+
case "AccessDeniedException":
|
|
1086
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1087
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1088
|
+
case "InternalServerException":
|
|
1089
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1090
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1091
|
+
case "ResourceNotFoundException":
|
|
1092
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1093
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1094
|
+
case "ThrottlingException":
|
|
1095
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1096
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1097
|
+
case "ValidationException":
|
|
1098
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1099
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1100
|
+
default:
|
|
1101
|
+
const parsedBody = parsedOutput.body;
|
|
1102
|
+
throwDefaultError({
|
|
1103
|
+
output,
|
|
1104
|
+
parsedBody,
|
|
1105
|
+
exceptionCtor: __BaseException,
|
|
1106
|
+
errorCode,
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
export const deserializeAws_restJson1GetCaseEventConfigurationCommand = async (output, context) => {
|
|
1111
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1112
|
+
return deserializeAws_restJson1GetCaseEventConfigurationCommandError(output, context);
|
|
1113
|
+
}
|
|
1114
|
+
const contents = map({
|
|
1115
|
+
$metadata: deserializeMetadata(output),
|
|
1116
|
+
});
|
|
1117
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1118
|
+
if (data.eventBridge != null) {
|
|
1119
|
+
contents.eventBridge = deserializeAws_restJson1EventBridgeConfiguration(data.eventBridge, context);
|
|
1120
|
+
}
|
|
1121
|
+
return contents;
|
|
1122
|
+
};
|
|
1123
|
+
const deserializeAws_restJson1GetCaseEventConfigurationCommandError = async (output, context) => {
|
|
1124
|
+
const parsedOutput = {
|
|
1125
|
+
...output,
|
|
1126
|
+
body: await parseErrorBody(output.body, context),
|
|
1127
|
+
};
|
|
1128
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1129
|
+
switch (errorCode) {
|
|
1130
|
+
case "AccessDeniedException":
|
|
1131
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1132
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1133
|
+
case "InternalServerException":
|
|
1134
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1135
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1136
|
+
case "ResourceNotFoundException":
|
|
1137
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1138
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1139
|
+
case "ThrottlingException":
|
|
1140
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1141
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1142
|
+
case "ValidationException":
|
|
1143
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1144
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1145
|
+
default:
|
|
1146
|
+
const parsedBody = parsedOutput.body;
|
|
1147
|
+
throwDefaultError({
|
|
1148
|
+
output,
|
|
1149
|
+
parsedBody,
|
|
1150
|
+
exceptionCtor: __BaseException,
|
|
1151
|
+
errorCode,
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
};
|
|
1155
|
+
export const deserializeAws_restJson1GetDomainCommand = async (output, context) => {
|
|
1156
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1157
|
+
return deserializeAws_restJson1GetDomainCommandError(output, context);
|
|
1158
|
+
}
|
|
1159
|
+
const contents = map({
|
|
1160
|
+
$metadata: deserializeMetadata(output),
|
|
1161
|
+
});
|
|
1162
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1163
|
+
if (data.createdTime != null) {
|
|
1164
|
+
contents.createdTime = __expectNonNull(__parseRfc3339DateTime(data.createdTime));
|
|
1165
|
+
}
|
|
1166
|
+
if (data.domainArn != null) {
|
|
1167
|
+
contents.domainArn = __expectString(data.domainArn);
|
|
1168
|
+
}
|
|
1169
|
+
if (data.domainId != null) {
|
|
1170
|
+
contents.domainId = __expectString(data.domainId);
|
|
1171
|
+
}
|
|
1172
|
+
if (data.domainStatus != null) {
|
|
1173
|
+
contents.domainStatus = __expectString(data.domainStatus);
|
|
1174
|
+
}
|
|
1175
|
+
if (data.name != null) {
|
|
1176
|
+
contents.name = __expectString(data.name);
|
|
1177
|
+
}
|
|
1178
|
+
if (data.tags != null) {
|
|
1179
|
+
contents.tags = deserializeAws_restJson1Tags(data.tags, context);
|
|
1180
|
+
}
|
|
1181
|
+
return contents;
|
|
1182
|
+
};
|
|
1183
|
+
const deserializeAws_restJson1GetDomainCommandError = async (output, context) => {
|
|
1184
|
+
const parsedOutput = {
|
|
1185
|
+
...output,
|
|
1186
|
+
body: await parseErrorBody(output.body, context),
|
|
1187
|
+
};
|
|
1188
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1189
|
+
switch (errorCode) {
|
|
1190
|
+
case "AccessDeniedException":
|
|
1191
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1192
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1193
|
+
case "InternalServerException":
|
|
1194
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1195
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1196
|
+
case "ResourceNotFoundException":
|
|
1197
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1198
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1199
|
+
case "ThrottlingException":
|
|
1200
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1201
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1202
|
+
case "ValidationException":
|
|
1203
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1204
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1205
|
+
default:
|
|
1206
|
+
const parsedBody = parsedOutput.body;
|
|
1207
|
+
throwDefaultError({
|
|
1208
|
+
output,
|
|
1209
|
+
parsedBody,
|
|
1210
|
+
exceptionCtor: __BaseException,
|
|
1211
|
+
errorCode,
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
export const deserializeAws_restJson1GetLayoutCommand = async (output, context) => {
|
|
1216
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1217
|
+
return deserializeAws_restJson1GetLayoutCommandError(output, context);
|
|
1218
|
+
}
|
|
1219
|
+
const contents = map({
|
|
1220
|
+
$metadata: deserializeMetadata(output),
|
|
1221
|
+
});
|
|
1222
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1223
|
+
if (data.content != null) {
|
|
1224
|
+
contents.content = deserializeAws_restJson1LayoutContent(__expectUnion(data.content), context);
|
|
1225
|
+
}
|
|
1226
|
+
if (data.layoutArn != null) {
|
|
1227
|
+
contents.layoutArn = __expectString(data.layoutArn);
|
|
1228
|
+
}
|
|
1229
|
+
if (data.layoutId != null) {
|
|
1230
|
+
contents.layoutId = __expectString(data.layoutId);
|
|
1231
|
+
}
|
|
1232
|
+
if (data.name != null) {
|
|
1233
|
+
contents.name = __expectString(data.name);
|
|
1234
|
+
}
|
|
1235
|
+
if (data.tags != null) {
|
|
1236
|
+
contents.tags = deserializeAws_restJson1Tags(data.tags, context);
|
|
1237
|
+
}
|
|
1238
|
+
return contents;
|
|
1239
|
+
};
|
|
1240
|
+
const deserializeAws_restJson1GetLayoutCommandError = async (output, context) => {
|
|
1241
|
+
const parsedOutput = {
|
|
1242
|
+
...output,
|
|
1243
|
+
body: await parseErrorBody(output.body, context),
|
|
1244
|
+
};
|
|
1245
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1246
|
+
switch (errorCode) {
|
|
1247
|
+
case "AccessDeniedException":
|
|
1248
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1249
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1250
|
+
case "InternalServerException":
|
|
1251
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1252
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1253
|
+
case "ResourceNotFoundException":
|
|
1254
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1255
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1256
|
+
case "ThrottlingException":
|
|
1257
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1258
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1259
|
+
case "ValidationException":
|
|
1260
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1261
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1262
|
+
default:
|
|
1263
|
+
const parsedBody = parsedOutput.body;
|
|
1264
|
+
throwDefaultError({
|
|
1265
|
+
output,
|
|
1266
|
+
parsedBody,
|
|
1267
|
+
exceptionCtor: __BaseException,
|
|
1268
|
+
errorCode,
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
export const deserializeAws_restJson1GetTemplateCommand = async (output, context) => {
|
|
1273
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1274
|
+
return deserializeAws_restJson1GetTemplateCommandError(output, context);
|
|
1275
|
+
}
|
|
1276
|
+
const contents = map({
|
|
1277
|
+
$metadata: deserializeMetadata(output),
|
|
1278
|
+
});
|
|
1279
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1280
|
+
if (data.description != null) {
|
|
1281
|
+
contents.description = __expectString(data.description);
|
|
1282
|
+
}
|
|
1283
|
+
if (data.layoutConfiguration != null) {
|
|
1284
|
+
contents.layoutConfiguration = deserializeAws_restJson1LayoutConfiguration(data.layoutConfiguration, context);
|
|
1285
|
+
}
|
|
1286
|
+
if (data.name != null) {
|
|
1287
|
+
contents.name = __expectString(data.name);
|
|
1288
|
+
}
|
|
1289
|
+
if (data.requiredFields != null) {
|
|
1290
|
+
contents.requiredFields = deserializeAws_restJson1RequiredFieldList(data.requiredFields, context);
|
|
1291
|
+
}
|
|
1292
|
+
if (data.tags != null) {
|
|
1293
|
+
contents.tags = deserializeAws_restJson1Tags(data.tags, context);
|
|
1294
|
+
}
|
|
1295
|
+
if (data.templateArn != null) {
|
|
1296
|
+
contents.templateArn = __expectString(data.templateArn);
|
|
1297
|
+
}
|
|
1298
|
+
if (data.templateId != null) {
|
|
1299
|
+
contents.templateId = __expectString(data.templateId);
|
|
1300
|
+
}
|
|
1301
|
+
return contents;
|
|
1302
|
+
};
|
|
1303
|
+
const deserializeAws_restJson1GetTemplateCommandError = async (output, context) => {
|
|
1304
|
+
const parsedOutput = {
|
|
1305
|
+
...output,
|
|
1306
|
+
body: await parseErrorBody(output.body, context),
|
|
1307
|
+
};
|
|
1308
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1309
|
+
switch (errorCode) {
|
|
1310
|
+
case "AccessDeniedException":
|
|
1311
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1312
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1313
|
+
case "InternalServerException":
|
|
1314
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1315
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1316
|
+
case "ResourceNotFoundException":
|
|
1317
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1318
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1319
|
+
case "ThrottlingException":
|
|
1320
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1321
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1322
|
+
case "ValidationException":
|
|
1323
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1324
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1325
|
+
default:
|
|
1326
|
+
const parsedBody = parsedOutput.body;
|
|
1327
|
+
throwDefaultError({
|
|
1328
|
+
output,
|
|
1329
|
+
parsedBody,
|
|
1330
|
+
exceptionCtor: __BaseException,
|
|
1331
|
+
errorCode,
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
};
|
|
1335
|
+
export const deserializeAws_restJson1ListCasesForContactCommand = async (output, context) => {
|
|
1336
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1337
|
+
return deserializeAws_restJson1ListCasesForContactCommandError(output, context);
|
|
1338
|
+
}
|
|
1339
|
+
const contents = map({
|
|
1340
|
+
$metadata: deserializeMetadata(output),
|
|
1341
|
+
});
|
|
1342
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1343
|
+
if (data.cases != null) {
|
|
1344
|
+
contents.cases = deserializeAws_restJson1CaseSummaryList(data.cases, context);
|
|
1345
|
+
}
|
|
1346
|
+
if (data.nextToken != null) {
|
|
1347
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1348
|
+
}
|
|
1349
|
+
return contents;
|
|
1350
|
+
};
|
|
1351
|
+
const deserializeAws_restJson1ListCasesForContactCommandError = async (output, context) => {
|
|
1352
|
+
const parsedOutput = {
|
|
1353
|
+
...output,
|
|
1354
|
+
body: await parseErrorBody(output.body, context),
|
|
1355
|
+
};
|
|
1356
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1357
|
+
switch (errorCode) {
|
|
1358
|
+
case "AccessDeniedException":
|
|
1359
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1360
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1361
|
+
case "InternalServerException":
|
|
1362
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1363
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1364
|
+
case "ResourceNotFoundException":
|
|
1365
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1366
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1367
|
+
case "ThrottlingException":
|
|
1368
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1369
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1370
|
+
case "ValidationException":
|
|
1371
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1372
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1373
|
+
default:
|
|
1374
|
+
const parsedBody = parsedOutput.body;
|
|
1375
|
+
throwDefaultError({
|
|
1376
|
+
output,
|
|
1377
|
+
parsedBody,
|
|
1378
|
+
exceptionCtor: __BaseException,
|
|
1379
|
+
errorCode,
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
};
|
|
1383
|
+
export const deserializeAws_restJson1ListDomainsCommand = async (output, context) => {
|
|
1384
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1385
|
+
return deserializeAws_restJson1ListDomainsCommandError(output, context);
|
|
1386
|
+
}
|
|
1387
|
+
const contents = map({
|
|
1388
|
+
$metadata: deserializeMetadata(output),
|
|
1389
|
+
});
|
|
1390
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1391
|
+
if (data.domains != null) {
|
|
1392
|
+
contents.domains = deserializeAws_restJson1DomainSummaryList(data.domains, context);
|
|
1393
|
+
}
|
|
1394
|
+
if (data.nextToken != null) {
|
|
1395
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1396
|
+
}
|
|
1397
|
+
return contents;
|
|
1398
|
+
};
|
|
1399
|
+
const deserializeAws_restJson1ListDomainsCommandError = async (output, context) => {
|
|
1400
|
+
const parsedOutput = {
|
|
1401
|
+
...output,
|
|
1402
|
+
body: await parseErrorBody(output.body, context),
|
|
1403
|
+
};
|
|
1404
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1405
|
+
switch (errorCode) {
|
|
1406
|
+
case "AccessDeniedException":
|
|
1407
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1408
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1409
|
+
case "InternalServerException":
|
|
1410
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1411
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1412
|
+
case "ThrottlingException":
|
|
1413
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1414
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1415
|
+
case "ValidationException":
|
|
1416
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1417
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1418
|
+
default:
|
|
1419
|
+
const parsedBody = parsedOutput.body;
|
|
1420
|
+
throwDefaultError({
|
|
1421
|
+
output,
|
|
1422
|
+
parsedBody,
|
|
1423
|
+
exceptionCtor: __BaseException,
|
|
1424
|
+
errorCode,
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
export const deserializeAws_restJson1ListFieldOptionsCommand = async (output, context) => {
|
|
1429
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1430
|
+
return deserializeAws_restJson1ListFieldOptionsCommandError(output, context);
|
|
1431
|
+
}
|
|
1432
|
+
const contents = map({
|
|
1433
|
+
$metadata: deserializeMetadata(output),
|
|
1434
|
+
});
|
|
1435
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1436
|
+
if (data.nextToken != null) {
|
|
1437
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1438
|
+
}
|
|
1439
|
+
if (data.options != null) {
|
|
1440
|
+
contents.options = deserializeAws_restJson1FieldOptionsList(data.options, context);
|
|
1441
|
+
}
|
|
1442
|
+
return contents;
|
|
1443
|
+
};
|
|
1444
|
+
const deserializeAws_restJson1ListFieldOptionsCommandError = async (output, context) => {
|
|
1445
|
+
const parsedOutput = {
|
|
1446
|
+
...output,
|
|
1447
|
+
body: await parseErrorBody(output.body, context),
|
|
1448
|
+
};
|
|
1449
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1450
|
+
switch (errorCode) {
|
|
1451
|
+
case "AccessDeniedException":
|
|
1452
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1453
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1454
|
+
case "InternalServerException":
|
|
1455
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1456
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1457
|
+
case "ResourceNotFoundException":
|
|
1458
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1459
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1460
|
+
case "ThrottlingException":
|
|
1461
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1462
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1463
|
+
case "ValidationException":
|
|
1464
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1465
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1466
|
+
default:
|
|
1467
|
+
const parsedBody = parsedOutput.body;
|
|
1468
|
+
throwDefaultError({
|
|
1469
|
+
output,
|
|
1470
|
+
parsedBody,
|
|
1471
|
+
exceptionCtor: __BaseException,
|
|
1472
|
+
errorCode,
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
export const deserializeAws_restJson1ListFieldsCommand = async (output, context) => {
|
|
1477
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1478
|
+
return deserializeAws_restJson1ListFieldsCommandError(output, context);
|
|
1479
|
+
}
|
|
1480
|
+
const contents = map({
|
|
1481
|
+
$metadata: deserializeMetadata(output),
|
|
1482
|
+
});
|
|
1483
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1484
|
+
if (data.fields != null) {
|
|
1485
|
+
contents.fields = deserializeAws_restJson1FieldSummaryList(data.fields, context);
|
|
1486
|
+
}
|
|
1487
|
+
if (data.nextToken != null) {
|
|
1488
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1489
|
+
}
|
|
1490
|
+
return contents;
|
|
1491
|
+
};
|
|
1492
|
+
const deserializeAws_restJson1ListFieldsCommandError = async (output, context) => {
|
|
1493
|
+
const parsedOutput = {
|
|
1494
|
+
...output,
|
|
1495
|
+
body: await parseErrorBody(output.body, context),
|
|
1496
|
+
};
|
|
1497
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1498
|
+
switch (errorCode) {
|
|
1499
|
+
case "AccessDeniedException":
|
|
1500
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1501
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1502
|
+
case "InternalServerException":
|
|
1503
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1504
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1505
|
+
case "ResourceNotFoundException":
|
|
1506
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1507
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1508
|
+
case "ThrottlingException":
|
|
1509
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1510
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1511
|
+
case "ValidationException":
|
|
1512
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1513
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1514
|
+
default:
|
|
1515
|
+
const parsedBody = parsedOutput.body;
|
|
1516
|
+
throwDefaultError({
|
|
1517
|
+
output,
|
|
1518
|
+
parsedBody,
|
|
1519
|
+
exceptionCtor: __BaseException,
|
|
1520
|
+
errorCode,
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
};
|
|
1524
|
+
export const deserializeAws_restJson1ListLayoutsCommand = async (output, context) => {
|
|
1525
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1526
|
+
return deserializeAws_restJson1ListLayoutsCommandError(output, context);
|
|
1527
|
+
}
|
|
1528
|
+
const contents = map({
|
|
1529
|
+
$metadata: deserializeMetadata(output),
|
|
1530
|
+
});
|
|
1531
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1532
|
+
if (data.layouts != null) {
|
|
1533
|
+
contents.layouts = deserializeAws_restJson1LayoutSummaryList(data.layouts, context);
|
|
1534
|
+
}
|
|
1535
|
+
if (data.nextToken != null) {
|
|
1536
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1537
|
+
}
|
|
1538
|
+
return contents;
|
|
1539
|
+
};
|
|
1540
|
+
const deserializeAws_restJson1ListLayoutsCommandError = async (output, context) => {
|
|
1541
|
+
const parsedOutput = {
|
|
1542
|
+
...output,
|
|
1543
|
+
body: await parseErrorBody(output.body, context),
|
|
1544
|
+
};
|
|
1545
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1546
|
+
switch (errorCode) {
|
|
1547
|
+
case "AccessDeniedException":
|
|
1548
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1549
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1550
|
+
case "InternalServerException":
|
|
1551
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1552
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1553
|
+
case "ResourceNotFoundException":
|
|
1554
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1555
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1556
|
+
case "ThrottlingException":
|
|
1557
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1558
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1559
|
+
case "ValidationException":
|
|
1560
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1561
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1562
|
+
default:
|
|
1563
|
+
const parsedBody = parsedOutput.body;
|
|
1564
|
+
throwDefaultError({
|
|
1565
|
+
output,
|
|
1566
|
+
parsedBody,
|
|
1567
|
+
exceptionCtor: __BaseException,
|
|
1568
|
+
errorCode,
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
};
|
|
1572
|
+
export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
1573
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1574
|
+
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
1575
|
+
}
|
|
1576
|
+
const contents = map({
|
|
1577
|
+
$metadata: deserializeMetadata(output),
|
|
1578
|
+
});
|
|
1579
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1580
|
+
if (data.tags != null) {
|
|
1581
|
+
contents.tags = deserializeAws_restJson1Tags(data.tags, context);
|
|
1582
|
+
}
|
|
1583
|
+
return contents;
|
|
1584
|
+
};
|
|
1585
|
+
const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
|
|
1586
|
+
const parsedOutput = {
|
|
1587
|
+
...output,
|
|
1588
|
+
body: await parseErrorBody(output.body, context),
|
|
1589
|
+
};
|
|
1590
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1591
|
+
switch (errorCode) {
|
|
1592
|
+
case "AccessDeniedException":
|
|
1593
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1594
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1595
|
+
case "InternalServerException":
|
|
1596
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1597
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1598
|
+
case "ResourceNotFoundException":
|
|
1599
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1600
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1601
|
+
case "ThrottlingException":
|
|
1602
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1603
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1604
|
+
case "ValidationException":
|
|
1605
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1606
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1607
|
+
default:
|
|
1608
|
+
const parsedBody = parsedOutput.body;
|
|
1609
|
+
throwDefaultError({
|
|
1610
|
+
output,
|
|
1611
|
+
parsedBody,
|
|
1612
|
+
exceptionCtor: __BaseException,
|
|
1613
|
+
errorCode,
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1617
|
+
export const deserializeAws_restJson1ListTemplatesCommand = async (output, context) => {
|
|
1618
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1619
|
+
return deserializeAws_restJson1ListTemplatesCommandError(output, context);
|
|
1620
|
+
}
|
|
1621
|
+
const contents = map({
|
|
1622
|
+
$metadata: deserializeMetadata(output),
|
|
1623
|
+
});
|
|
1624
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1625
|
+
if (data.nextToken != null) {
|
|
1626
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1627
|
+
}
|
|
1628
|
+
if (data.templates != null) {
|
|
1629
|
+
contents.templates = deserializeAws_restJson1TemplateSummaryList(data.templates, context);
|
|
1630
|
+
}
|
|
1631
|
+
return contents;
|
|
1632
|
+
};
|
|
1633
|
+
const deserializeAws_restJson1ListTemplatesCommandError = async (output, context) => {
|
|
1634
|
+
const parsedOutput = {
|
|
1635
|
+
...output,
|
|
1636
|
+
body: await parseErrorBody(output.body, context),
|
|
1637
|
+
};
|
|
1638
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1639
|
+
switch (errorCode) {
|
|
1640
|
+
case "AccessDeniedException":
|
|
1641
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1642
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1643
|
+
case "InternalServerException":
|
|
1644
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1645
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1646
|
+
case "ResourceNotFoundException":
|
|
1647
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1648
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1649
|
+
case "ThrottlingException":
|
|
1650
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1651
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1652
|
+
case "ValidationException":
|
|
1653
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1654
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1655
|
+
default:
|
|
1656
|
+
const parsedBody = parsedOutput.body;
|
|
1657
|
+
throwDefaultError({
|
|
1658
|
+
output,
|
|
1659
|
+
parsedBody,
|
|
1660
|
+
exceptionCtor: __BaseException,
|
|
1661
|
+
errorCode,
|
|
1662
|
+
});
|
|
1663
|
+
}
|
|
1664
|
+
};
|
|
1665
|
+
export const deserializeAws_restJson1PutCaseEventConfigurationCommand = async (output, context) => {
|
|
1666
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1667
|
+
return deserializeAws_restJson1PutCaseEventConfigurationCommandError(output, context);
|
|
1668
|
+
}
|
|
1669
|
+
const contents = map({
|
|
1670
|
+
$metadata: deserializeMetadata(output),
|
|
1671
|
+
});
|
|
1672
|
+
await collectBody(output.body, context);
|
|
1673
|
+
return contents;
|
|
1674
|
+
};
|
|
1675
|
+
const deserializeAws_restJson1PutCaseEventConfigurationCommandError = async (output, context) => {
|
|
1676
|
+
const parsedOutput = {
|
|
1677
|
+
...output,
|
|
1678
|
+
body: await parseErrorBody(output.body, context),
|
|
1679
|
+
};
|
|
1680
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1681
|
+
switch (errorCode) {
|
|
1682
|
+
case "AccessDeniedException":
|
|
1683
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1684
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1685
|
+
case "InternalServerException":
|
|
1686
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1687
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1688
|
+
case "ResourceNotFoundException":
|
|
1689
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1690
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1691
|
+
case "ThrottlingException":
|
|
1692
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1693
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1694
|
+
case "ValidationException":
|
|
1695
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1696
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1697
|
+
default:
|
|
1698
|
+
const parsedBody = parsedOutput.body;
|
|
1699
|
+
throwDefaultError({
|
|
1700
|
+
output,
|
|
1701
|
+
parsedBody,
|
|
1702
|
+
exceptionCtor: __BaseException,
|
|
1703
|
+
errorCode,
|
|
1704
|
+
});
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
export const deserializeAws_restJson1SearchCasesCommand = async (output, context) => {
|
|
1708
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1709
|
+
return deserializeAws_restJson1SearchCasesCommandError(output, context);
|
|
1710
|
+
}
|
|
1711
|
+
const contents = map({
|
|
1712
|
+
$metadata: deserializeMetadata(output),
|
|
1713
|
+
});
|
|
1714
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1715
|
+
if (data.cases != null) {
|
|
1716
|
+
contents.cases = deserializeAws_restJson1SearchCasesResponseItemList(data.cases, context);
|
|
1717
|
+
}
|
|
1718
|
+
if (data.nextToken != null) {
|
|
1719
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1720
|
+
}
|
|
1721
|
+
return contents;
|
|
1722
|
+
};
|
|
1723
|
+
const deserializeAws_restJson1SearchCasesCommandError = async (output, context) => {
|
|
1724
|
+
const parsedOutput = {
|
|
1725
|
+
...output,
|
|
1726
|
+
body: await parseErrorBody(output.body, context),
|
|
1727
|
+
};
|
|
1728
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1729
|
+
switch (errorCode) {
|
|
1730
|
+
case "AccessDeniedException":
|
|
1731
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1732
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1733
|
+
case "InternalServerException":
|
|
1734
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1735
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1736
|
+
case "ResourceNotFoundException":
|
|
1737
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1738
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1739
|
+
case "ThrottlingException":
|
|
1740
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1741
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1742
|
+
case "ValidationException":
|
|
1743
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1744
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1745
|
+
default:
|
|
1746
|
+
const parsedBody = parsedOutput.body;
|
|
1747
|
+
throwDefaultError({
|
|
1748
|
+
output,
|
|
1749
|
+
parsedBody,
|
|
1750
|
+
exceptionCtor: __BaseException,
|
|
1751
|
+
errorCode,
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
};
|
|
1755
|
+
export const deserializeAws_restJson1SearchRelatedItemsCommand = async (output, context) => {
|
|
1756
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1757
|
+
return deserializeAws_restJson1SearchRelatedItemsCommandError(output, context);
|
|
1758
|
+
}
|
|
1759
|
+
const contents = map({
|
|
1760
|
+
$metadata: deserializeMetadata(output),
|
|
1761
|
+
});
|
|
1762
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1763
|
+
if (data.nextToken != null) {
|
|
1764
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
1765
|
+
}
|
|
1766
|
+
if (data.relatedItems != null) {
|
|
1767
|
+
contents.relatedItems = deserializeAws_restJson1SearchRelatedItemsResponseItemList(data.relatedItems, context);
|
|
1768
|
+
}
|
|
1769
|
+
return contents;
|
|
1770
|
+
};
|
|
1771
|
+
const deserializeAws_restJson1SearchRelatedItemsCommandError = async (output, context) => {
|
|
1772
|
+
const parsedOutput = {
|
|
1773
|
+
...output,
|
|
1774
|
+
body: await parseErrorBody(output.body, context),
|
|
1775
|
+
};
|
|
1776
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1777
|
+
switch (errorCode) {
|
|
1778
|
+
case "AccessDeniedException":
|
|
1779
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1780
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1781
|
+
case "InternalServerException":
|
|
1782
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1783
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1784
|
+
case "ResourceNotFoundException":
|
|
1785
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1786
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1787
|
+
case "ThrottlingException":
|
|
1788
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1789
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1790
|
+
case "ValidationException":
|
|
1791
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1792
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1793
|
+
default:
|
|
1794
|
+
const parsedBody = parsedOutput.body;
|
|
1795
|
+
throwDefaultError({
|
|
1796
|
+
output,
|
|
1797
|
+
parsedBody,
|
|
1798
|
+
exceptionCtor: __BaseException,
|
|
1799
|
+
errorCode,
|
|
1800
|
+
});
|
|
1801
|
+
}
|
|
1802
|
+
};
|
|
1803
|
+
export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
1804
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1805
|
+
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
1806
|
+
}
|
|
1807
|
+
const contents = map({
|
|
1808
|
+
$metadata: deserializeMetadata(output),
|
|
1809
|
+
});
|
|
1810
|
+
await collectBody(output.body, context);
|
|
1811
|
+
return contents;
|
|
1812
|
+
};
|
|
1813
|
+
const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
|
|
1814
|
+
const parsedOutput = {
|
|
1815
|
+
...output,
|
|
1816
|
+
body: await parseErrorBody(output.body, context),
|
|
1817
|
+
};
|
|
1818
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1819
|
+
switch (errorCode) {
|
|
1820
|
+
case "AccessDeniedException":
|
|
1821
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1822
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1823
|
+
case "InternalServerException":
|
|
1824
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1825
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1826
|
+
case "ResourceNotFoundException":
|
|
1827
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1828
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1829
|
+
case "ThrottlingException":
|
|
1830
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1831
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1832
|
+
case "ValidationException":
|
|
1833
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1834
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1835
|
+
default:
|
|
1836
|
+
const parsedBody = parsedOutput.body;
|
|
1837
|
+
throwDefaultError({
|
|
1838
|
+
output,
|
|
1839
|
+
parsedBody,
|
|
1840
|
+
exceptionCtor: __BaseException,
|
|
1841
|
+
errorCode,
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1845
|
+
export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
1846
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1847
|
+
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
1848
|
+
}
|
|
1849
|
+
const contents = map({
|
|
1850
|
+
$metadata: deserializeMetadata(output),
|
|
1851
|
+
});
|
|
1852
|
+
await collectBody(output.body, context);
|
|
1853
|
+
return contents;
|
|
1854
|
+
};
|
|
1855
|
+
const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
|
|
1856
|
+
const parsedOutput = {
|
|
1857
|
+
...output,
|
|
1858
|
+
body: await parseErrorBody(output.body, context),
|
|
1859
|
+
};
|
|
1860
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1861
|
+
switch (errorCode) {
|
|
1862
|
+
case "AccessDeniedException":
|
|
1863
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1864
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1865
|
+
case "InternalServerException":
|
|
1866
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1867
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1868
|
+
case "ResourceNotFoundException":
|
|
1869
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1870
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1871
|
+
case "ThrottlingException":
|
|
1872
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1873
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1874
|
+
case "ValidationException":
|
|
1875
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1876
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1877
|
+
default:
|
|
1878
|
+
const parsedBody = parsedOutput.body;
|
|
1879
|
+
throwDefaultError({
|
|
1880
|
+
output,
|
|
1881
|
+
parsedBody,
|
|
1882
|
+
exceptionCtor: __BaseException,
|
|
1883
|
+
errorCode,
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
export const deserializeAws_restJson1UpdateCaseCommand = async (output, context) => {
|
|
1888
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1889
|
+
return deserializeAws_restJson1UpdateCaseCommandError(output, context);
|
|
1890
|
+
}
|
|
1891
|
+
const contents = map({
|
|
1892
|
+
$metadata: deserializeMetadata(output),
|
|
1893
|
+
});
|
|
1894
|
+
await collectBody(output.body, context);
|
|
1895
|
+
return contents;
|
|
1896
|
+
};
|
|
1897
|
+
const deserializeAws_restJson1UpdateCaseCommandError = async (output, context) => {
|
|
1898
|
+
const parsedOutput = {
|
|
1899
|
+
...output,
|
|
1900
|
+
body: await parseErrorBody(output.body, context),
|
|
1901
|
+
};
|
|
1902
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1903
|
+
switch (errorCode) {
|
|
1904
|
+
case "AccessDeniedException":
|
|
1905
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1906
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1907
|
+
case "InternalServerException":
|
|
1908
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1909
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1910
|
+
case "ResourceNotFoundException":
|
|
1911
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1912
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1913
|
+
case "ThrottlingException":
|
|
1914
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1915
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1916
|
+
case "ValidationException":
|
|
1917
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1918
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1919
|
+
default:
|
|
1920
|
+
const parsedBody = parsedOutput.body;
|
|
1921
|
+
throwDefaultError({
|
|
1922
|
+
output,
|
|
1923
|
+
parsedBody,
|
|
1924
|
+
exceptionCtor: __BaseException,
|
|
1925
|
+
errorCode,
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
};
|
|
1929
|
+
export const deserializeAws_restJson1UpdateFieldCommand = async (output, context) => {
|
|
1930
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1931
|
+
return deserializeAws_restJson1UpdateFieldCommandError(output, context);
|
|
1932
|
+
}
|
|
1933
|
+
const contents = map({
|
|
1934
|
+
$metadata: deserializeMetadata(output),
|
|
1935
|
+
});
|
|
1936
|
+
await collectBody(output.body, context);
|
|
1937
|
+
return contents;
|
|
1938
|
+
};
|
|
1939
|
+
const deserializeAws_restJson1UpdateFieldCommandError = async (output, context) => {
|
|
1940
|
+
const parsedOutput = {
|
|
1941
|
+
...output,
|
|
1942
|
+
body: await parseErrorBody(output.body, context),
|
|
1943
|
+
};
|
|
1944
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1945
|
+
switch (errorCode) {
|
|
1946
|
+
case "AccessDeniedException":
|
|
1947
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1948
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1949
|
+
case "ConflictException":
|
|
1950
|
+
case "com.amazonaws.connectcases#ConflictException":
|
|
1951
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1952
|
+
case "InternalServerException":
|
|
1953
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1954
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
1955
|
+
case "ResourceNotFoundException":
|
|
1956
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
1957
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
1958
|
+
case "ThrottlingException":
|
|
1959
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
1960
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
1961
|
+
case "ValidationException":
|
|
1962
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
1963
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
1964
|
+
default:
|
|
1965
|
+
const parsedBody = parsedOutput.body;
|
|
1966
|
+
throwDefaultError({
|
|
1967
|
+
output,
|
|
1968
|
+
parsedBody,
|
|
1969
|
+
exceptionCtor: __BaseException,
|
|
1970
|
+
errorCode,
|
|
1971
|
+
});
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
export const deserializeAws_restJson1UpdateLayoutCommand = async (output, context) => {
|
|
1975
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1976
|
+
return deserializeAws_restJson1UpdateLayoutCommandError(output, context);
|
|
1977
|
+
}
|
|
1978
|
+
const contents = map({
|
|
1979
|
+
$metadata: deserializeMetadata(output),
|
|
1980
|
+
});
|
|
1981
|
+
await collectBody(output.body, context);
|
|
1982
|
+
return contents;
|
|
1983
|
+
};
|
|
1984
|
+
const deserializeAws_restJson1UpdateLayoutCommandError = async (output, context) => {
|
|
1985
|
+
const parsedOutput = {
|
|
1986
|
+
...output,
|
|
1987
|
+
body: await parseErrorBody(output.body, context),
|
|
1988
|
+
};
|
|
1989
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1990
|
+
switch (errorCode) {
|
|
1991
|
+
case "AccessDeniedException":
|
|
1992
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
1993
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
1994
|
+
case "ConflictException":
|
|
1995
|
+
case "com.amazonaws.connectcases#ConflictException":
|
|
1996
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
1997
|
+
case "InternalServerException":
|
|
1998
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
1999
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
2000
|
+
case "ResourceNotFoundException":
|
|
2001
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
2002
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
2003
|
+
case "ThrottlingException":
|
|
2004
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
2005
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
2006
|
+
case "ValidationException":
|
|
2007
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
2008
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
2009
|
+
default:
|
|
2010
|
+
const parsedBody = parsedOutput.body;
|
|
2011
|
+
throwDefaultError({
|
|
2012
|
+
output,
|
|
2013
|
+
parsedBody,
|
|
2014
|
+
exceptionCtor: __BaseException,
|
|
2015
|
+
errorCode,
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
export const deserializeAws_restJson1UpdateTemplateCommand = async (output, context) => {
|
|
2020
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2021
|
+
return deserializeAws_restJson1UpdateTemplateCommandError(output, context);
|
|
2022
|
+
}
|
|
2023
|
+
const contents = map({
|
|
2024
|
+
$metadata: deserializeMetadata(output),
|
|
2025
|
+
});
|
|
2026
|
+
await collectBody(output.body, context);
|
|
2027
|
+
return contents;
|
|
2028
|
+
};
|
|
2029
|
+
const deserializeAws_restJson1UpdateTemplateCommandError = async (output, context) => {
|
|
2030
|
+
const parsedOutput = {
|
|
2031
|
+
...output,
|
|
2032
|
+
body: await parseErrorBody(output.body, context),
|
|
2033
|
+
};
|
|
2034
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2035
|
+
switch (errorCode) {
|
|
2036
|
+
case "AccessDeniedException":
|
|
2037
|
+
case "com.amazonaws.connectcases#AccessDeniedException":
|
|
2038
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
2039
|
+
case "ConflictException":
|
|
2040
|
+
case "com.amazonaws.connectcases#ConflictException":
|
|
2041
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
2042
|
+
case "InternalServerException":
|
|
2043
|
+
case "com.amazonaws.connectcases#InternalServerException":
|
|
2044
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
2045
|
+
case "ResourceNotFoundException":
|
|
2046
|
+
case "com.amazonaws.connectcases#ResourceNotFoundException":
|
|
2047
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
2048
|
+
case "ThrottlingException":
|
|
2049
|
+
case "com.amazonaws.connectcases#ThrottlingException":
|
|
2050
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
2051
|
+
case "ValidationException":
|
|
2052
|
+
case "com.amazonaws.connectcases#ValidationException":
|
|
2053
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
2054
|
+
default:
|
|
2055
|
+
const parsedBody = parsedOutput.body;
|
|
2056
|
+
throwDefaultError({
|
|
2057
|
+
output,
|
|
2058
|
+
parsedBody,
|
|
2059
|
+
exceptionCtor: __BaseException,
|
|
2060
|
+
errorCode,
|
|
2061
|
+
});
|
|
2062
|
+
}
|
|
2063
|
+
};
|
|
2064
|
+
const map = __map;
|
|
2065
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
2066
|
+
const contents = map({});
|
|
2067
|
+
const data = parsedOutput.body;
|
|
2068
|
+
if (data.message != null) {
|
|
2069
|
+
contents.message = __expectString(data.message);
|
|
2070
|
+
}
|
|
2071
|
+
const exception = new AccessDeniedException({
|
|
2072
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2073
|
+
...contents,
|
|
2074
|
+
});
|
|
2075
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2076
|
+
};
|
|
2077
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
2078
|
+
const contents = map({});
|
|
2079
|
+
const data = parsedOutput.body;
|
|
2080
|
+
if (data.message != null) {
|
|
2081
|
+
contents.message = __expectString(data.message);
|
|
2082
|
+
}
|
|
2083
|
+
const exception = new ConflictException({
|
|
2084
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2085
|
+
...contents,
|
|
2086
|
+
});
|
|
2087
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2088
|
+
};
|
|
2089
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
2090
|
+
const contents = map({
|
|
2091
|
+
retryAfterSeconds: [
|
|
2092
|
+
() => void 0 !== parsedOutput.headers["retry-after"],
|
|
2093
|
+
() => __strictParseInt32(parsedOutput.headers["retry-after"]),
|
|
2094
|
+
],
|
|
2095
|
+
});
|
|
2096
|
+
const data = parsedOutput.body;
|
|
2097
|
+
if (data.message != null) {
|
|
2098
|
+
contents.message = __expectString(data.message);
|
|
2099
|
+
}
|
|
2100
|
+
const exception = new InternalServerException({
|
|
2101
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2102
|
+
...contents,
|
|
2103
|
+
});
|
|
2104
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2105
|
+
};
|
|
2106
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
2107
|
+
const contents = map({});
|
|
2108
|
+
const data = parsedOutput.body;
|
|
2109
|
+
if (data.message != null) {
|
|
2110
|
+
contents.message = __expectString(data.message);
|
|
2111
|
+
}
|
|
2112
|
+
if (data.resourceId != null) {
|
|
2113
|
+
contents.resourceId = __expectString(data.resourceId);
|
|
2114
|
+
}
|
|
2115
|
+
if (data.resourceType != null) {
|
|
2116
|
+
contents.resourceType = __expectString(data.resourceType);
|
|
2117
|
+
}
|
|
2118
|
+
const exception = new ResourceNotFoundException({
|
|
2119
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2120
|
+
...contents,
|
|
2121
|
+
});
|
|
2122
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2123
|
+
};
|
|
2124
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
2125
|
+
const contents = map({});
|
|
2126
|
+
const data = parsedOutput.body;
|
|
2127
|
+
if (data.message != null) {
|
|
2128
|
+
contents.message = __expectString(data.message);
|
|
2129
|
+
}
|
|
2130
|
+
const exception = new ServiceQuotaExceededException({
|
|
2131
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2132
|
+
...contents,
|
|
2133
|
+
});
|
|
2134
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2135
|
+
};
|
|
2136
|
+
const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
2137
|
+
const contents = map({});
|
|
2138
|
+
const data = parsedOutput.body;
|
|
2139
|
+
if (data.message != null) {
|
|
2140
|
+
contents.message = __expectString(data.message);
|
|
2141
|
+
}
|
|
2142
|
+
const exception = new ThrottlingException({
|
|
2143
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2144
|
+
...contents,
|
|
2145
|
+
});
|
|
2146
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2147
|
+
};
|
|
2148
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
2149
|
+
const contents = map({});
|
|
2150
|
+
const data = parsedOutput.body;
|
|
2151
|
+
if (data.message != null) {
|
|
2152
|
+
contents.message = __expectString(data.message);
|
|
2153
|
+
}
|
|
2154
|
+
const exception = new ValidationException({
|
|
2155
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2156
|
+
...contents,
|
|
2157
|
+
});
|
|
2158
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2159
|
+
};
|
|
2160
|
+
const serializeAws_restJson1BasicLayout = (input, context) => {
|
|
2161
|
+
return {
|
|
2162
|
+
...(input.moreInfo != null && { moreInfo: serializeAws_restJson1LayoutSections(input.moreInfo, context) }),
|
|
2163
|
+
...(input.topPanel != null && { topPanel: serializeAws_restJson1LayoutSections(input.topPanel, context) }),
|
|
2164
|
+
};
|
|
2165
|
+
};
|
|
2166
|
+
const serializeAws_restJson1BatchGetFieldIdentifierList = (input, context) => {
|
|
2167
|
+
return input
|
|
2168
|
+
.filter((e) => e != null)
|
|
2169
|
+
.map((entry) => {
|
|
2170
|
+
return serializeAws_restJson1FieldIdentifier(entry, context);
|
|
2171
|
+
});
|
|
2172
|
+
};
|
|
2173
|
+
const serializeAws_restJson1CaseEventIncludedData = (input, context) => {
|
|
2174
|
+
return {
|
|
2175
|
+
...(input.fields != null && { fields: serializeAws_restJson1FieldIdentifierList(input.fields, context) }),
|
|
2176
|
+
};
|
|
2177
|
+
};
|
|
2178
|
+
const serializeAws_restJson1CaseFilter = (input, context) => {
|
|
2179
|
+
return CaseFilter.visit(input, {
|
|
2180
|
+
andAll: (value) => ({ andAll: serializeAws_restJson1CaseFilterList(value, context) }),
|
|
2181
|
+
field: (value) => ({ field: serializeAws_restJson1FieldFilter(value, context) }),
|
|
2182
|
+
not: (value) => ({ not: serializeAws_restJson1CaseFilter(value, context) }),
|
|
2183
|
+
_: (name, value) => ({ name: value }),
|
|
2184
|
+
});
|
|
2185
|
+
};
|
|
2186
|
+
const serializeAws_restJson1CaseFilterList = (input, context) => {
|
|
2187
|
+
return input
|
|
2188
|
+
.filter((e) => e != null)
|
|
2189
|
+
.map((entry) => {
|
|
2190
|
+
return serializeAws_restJson1CaseFilter(entry, context);
|
|
2191
|
+
});
|
|
2192
|
+
};
|
|
2193
|
+
const serializeAws_restJson1ChannelList = (input, context) => {
|
|
2194
|
+
return input
|
|
2195
|
+
.filter((e) => e != null)
|
|
2196
|
+
.map((entry) => {
|
|
2197
|
+
return entry;
|
|
2198
|
+
});
|
|
2199
|
+
};
|
|
2200
|
+
const serializeAws_restJson1CommentContent = (input, context) => {
|
|
2201
|
+
return {
|
|
2202
|
+
...(input.body != null && { body: input.body }),
|
|
2203
|
+
...(input.contentType != null && { contentType: input.contentType }),
|
|
2204
|
+
};
|
|
2205
|
+
};
|
|
2206
|
+
const serializeAws_restJson1CommentFilter = (input, context) => {
|
|
2207
|
+
return {};
|
|
2208
|
+
};
|
|
2209
|
+
const serializeAws_restJson1Contact = (input, context) => {
|
|
2210
|
+
return {
|
|
2211
|
+
...(input.contactArn != null && { contactArn: input.contactArn }),
|
|
2212
|
+
};
|
|
2213
|
+
};
|
|
2214
|
+
const serializeAws_restJson1ContactFilter = (input, context) => {
|
|
2215
|
+
return {
|
|
2216
|
+
...(input.channel != null && { channel: serializeAws_restJson1ChannelList(input.channel, context) }),
|
|
2217
|
+
...(input.contactArn != null && { contactArn: input.contactArn }),
|
|
2218
|
+
};
|
|
2219
|
+
};
|
|
2220
|
+
const serializeAws_restJson1EventBridgeConfiguration = (input, context) => {
|
|
2221
|
+
return {
|
|
2222
|
+
...(input.enabled != null && { enabled: input.enabled }),
|
|
2223
|
+
...(input.includedData != null && {
|
|
2224
|
+
includedData: serializeAws_restJson1EventIncludedData(input.includedData, context),
|
|
2225
|
+
}),
|
|
2226
|
+
};
|
|
2227
|
+
};
|
|
2228
|
+
const serializeAws_restJson1EventIncludedData = (input, context) => {
|
|
2229
|
+
return {
|
|
2230
|
+
...(input.caseData != null && { caseData: serializeAws_restJson1CaseEventIncludedData(input.caseData, context) }),
|
|
2231
|
+
...(input.relatedItemData != null && {
|
|
2232
|
+
relatedItemData: serializeAws_restJson1RelatedItemEventIncludedData(input.relatedItemData, context),
|
|
2233
|
+
}),
|
|
2234
|
+
};
|
|
2235
|
+
};
|
|
2236
|
+
const serializeAws_restJson1FieldFilter = (input, context) => {
|
|
2237
|
+
return FieldFilter.visit(input, {
|
|
2238
|
+
contains: (value) => ({ contains: serializeAws_restJson1FieldValue(value, context) }),
|
|
2239
|
+
equalTo: (value) => ({ equalTo: serializeAws_restJson1FieldValue(value, context) }),
|
|
2240
|
+
greaterThan: (value) => ({ greaterThan: serializeAws_restJson1FieldValue(value, context) }),
|
|
2241
|
+
greaterThanOrEqualTo: (value) => ({ greaterThanOrEqualTo: serializeAws_restJson1FieldValue(value, context) }),
|
|
2242
|
+
lessThan: (value) => ({ lessThan: serializeAws_restJson1FieldValue(value, context) }),
|
|
2243
|
+
lessThanOrEqualTo: (value) => ({ lessThanOrEqualTo: serializeAws_restJson1FieldValue(value, context) }),
|
|
2244
|
+
_: (name, value) => ({ name: value }),
|
|
2245
|
+
});
|
|
2246
|
+
};
|
|
2247
|
+
const serializeAws_restJson1FieldGroup = (input, context) => {
|
|
2248
|
+
return {
|
|
2249
|
+
...(input.fields != null && { fields: serializeAws_restJson1FieldList(input.fields, context) }),
|
|
2250
|
+
...(input.name != null && { name: input.name }),
|
|
2251
|
+
};
|
|
2252
|
+
};
|
|
2253
|
+
const serializeAws_restJson1FieldIdentifier = (input, context) => {
|
|
2254
|
+
return {
|
|
2255
|
+
...(input.id != null && { id: input.id }),
|
|
2256
|
+
};
|
|
2257
|
+
};
|
|
2258
|
+
const serializeAws_restJson1FieldIdentifierList = (input, context) => {
|
|
2259
|
+
return input
|
|
2260
|
+
.filter((e) => e != null)
|
|
2261
|
+
.map((entry) => {
|
|
2262
|
+
return serializeAws_restJson1FieldIdentifier(entry, context);
|
|
2263
|
+
});
|
|
2264
|
+
};
|
|
2265
|
+
const serializeAws_restJson1FieldItem = (input, context) => {
|
|
2266
|
+
return {
|
|
2267
|
+
...(input.id != null && { id: input.id }),
|
|
2268
|
+
};
|
|
2269
|
+
};
|
|
2270
|
+
const serializeAws_restJson1FieldList = (input, context) => {
|
|
2271
|
+
return input
|
|
2272
|
+
.filter((e) => e != null)
|
|
2273
|
+
.map((entry) => {
|
|
2274
|
+
return serializeAws_restJson1FieldItem(entry, context);
|
|
2275
|
+
});
|
|
2276
|
+
};
|
|
2277
|
+
const serializeAws_restJson1FieldOption = (input, context) => {
|
|
2278
|
+
return {
|
|
2279
|
+
...(input.active != null && { active: input.active }),
|
|
2280
|
+
...(input.name != null && { name: input.name }),
|
|
2281
|
+
...(input.value != null && { value: input.value }),
|
|
2282
|
+
};
|
|
2283
|
+
};
|
|
2284
|
+
const serializeAws_restJson1FieldOptionsList = (input, context) => {
|
|
2285
|
+
return input
|
|
2286
|
+
.filter((e) => e != null)
|
|
2287
|
+
.map((entry) => {
|
|
2288
|
+
return serializeAws_restJson1FieldOption(entry, context);
|
|
2289
|
+
});
|
|
2290
|
+
};
|
|
2291
|
+
const serializeAws_restJson1FieldValue = (input, context) => {
|
|
2292
|
+
return {
|
|
2293
|
+
...(input.id != null && { id: input.id }),
|
|
2294
|
+
...(input.value != null && { value: serializeAws_restJson1FieldValueUnion(input.value, context) }),
|
|
2295
|
+
};
|
|
2296
|
+
};
|
|
2297
|
+
const serializeAws_restJson1FieldValueList = (input, context) => {
|
|
2298
|
+
return input
|
|
2299
|
+
.filter((e) => e != null)
|
|
2300
|
+
.map((entry) => {
|
|
2301
|
+
return serializeAws_restJson1FieldValue(entry, context);
|
|
2302
|
+
});
|
|
2303
|
+
};
|
|
2304
|
+
const serializeAws_restJson1FieldValueUnion = (input, context) => {
|
|
2305
|
+
return FieldValueUnion.visit(input, {
|
|
2306
|
+
booleanValue: (value) => ({ booleanValue: value }),
|
|
2307
|
+
doubleValue: (value) => ({ doubleValue: __serializeFloat(value) }),
|
|
2308
|
+
stringValue: (value) => ({ stringValue: value }),
|
|
2309
|
+
_: (name, value) => ({ name: value }),
|
|
2310
|
+
});
|
|
2311
|
+
};
|
|
2312
|
+
const serializeAws_restJson1LayoutConfiguration = (input, context) => {
|
|
2313
|
+
return {
|
|
2314
|
+
...(input.defaultLayout != null && { defaultLayout: input.defaultLayout }),
|
|
2315
|
+
};
|
|
2316
|
+
};
|
|
2317
|
+
const serializeAws_restJson1LayoutContent = (input, context) => {
|
|
2318
|
+
return LayoutContent.visit(input, {
|
|
2319
|
+
basic: (value) => ({ basic: serializeAws_restJson1BasicLayout(value, context) }),
|
|
2320
|
+
_: (name, value) => ({ name: value }),
|
|
2321
|
+
});
|
|
2322
|
+
};
|
|
2323
|
+
const serializeAws_restJson1LayoutSections = (input, context) => {
|
|
2324
|
+
return {
|
|
2325
|
+
...(input.sections != null && { sections: serializeAws_restJson1SectionsList(input.sections, context) }),
|
|
2326
|
+
};
|
|
2327
|
+
};
|
|
2328
|
+
const serializeAws_restJson1RelatedItemEventIncludedData = (input, context) => {
|
|
2329
|
+
return {
|
|
2330
|
+
...(input.includeContent != null && { includeContent: input.includeContent }),
|
|
2331
|
+
};
|
|
2332
|
+
};
|
|
2333
|
+
const serializeAws_restJson1RelatedItemFilterList = (input, context) => {
|
|
2334
|
+
return input
|
|
2335
|
+
.filter((e) => e != null)
|
|
2336
|
+
.map((entry) => {
|
|
2337
|
+
return serializeAws_restJson1RelatedItemTypeFilter(entry, context);
|
|
2338
|
+
});
|
|
2339
|
+
};
|
|
2340
|
+
const serializeAws_restJson1RelatedItemInputContent = (input, context) => {
|
|
2341
|
+
return RelatedItemInputContent.visit(input, {
|
|
2342
|
+
comment: (value) => ({ comment: serializeAws_restJson1CommentContent(value, context) }),
|
|
2343
|
+
contact: (value) => ({ contact: serializeAws_restJson1Contact(value, context) }),
|
|
2344
|
+
_: (name, value) => ({ name: value }),
|
|
2345
|
+
});
|
|
2346
|
+
};
|
|
2347
|
+
const serializeAws_restJson1RelatedItemTypeFilter = (input, context) => {
|
|
2348
|
+
return RelatedItemTypeFilter.visit(input, {
|
|
2349
|
+
comment: (value) => ({ comment: serializeAws_restJson1CommentFilter(value, context) }),
|
|
2350
|
+
contact: (value) => ({ contact: serializeAws_restJson1ContactFilter(value, context) }),
|
|
2351
|
+
_: (name, value) => ({ name: value }),
|
|
2352
|
+
});
|
|
2353
|
+
};
|
|
2354
|
+
const serializeAws_restJson1RequiredField = (input, context) => {
|
|
2355
|
+
return {
|
|
2356
|
+
...(input.fieldId != null && { fieldId: input.fieldId }),
|
|
2357
|
+
};
|
|
2358
|
+
};
|
|
2359
|
+
const serializeAws_restJson1RequiredFieldList = (input, context) => {
|
|
2360
|
+
return input
|
|
2361
|
+
.filter((e) => e != null)
|
|
2362
|
+
.map((entry) => {
|
|
2363
|
+
return serializeAws_restJson1RequiredField(entry, context);
|
|
2364
|
+
});
|
|
2365
|
+
};
|
|
2366
|
+
const serializeAws_restJson1Section = (input, context) => {
|
|
2367
|
+
return Section.visit(input, {
|
|
2368
|
+
fieldGroup: (value) => ({ fieldGroup: serializeAws_restJson1FieldGroup(value, context) }),
|
|
2369
|
+
_: (name, value) => ({ name: value }),
|
|
2370
|
+
});
|
|
2371
|
+
};
|
|
2372
|
+
const serializeAws_restJson1SectionsList = (input, context) => {
|
|
2373
|
+
return input
|
|
2374
|
+
.filter((e) => e != null)
|
|
2375
|
+
.map((entry) => {
|
|
2376
|
+
return serializeAws_restJson1Section(entry, context);
|
|
2377
|
+
});
|
|
2378
|
+
};
|
|
2379
|
+
const serializeAws_restJson1Sort = (input, context) => {
|
|
2380
|
+
return {
|
|
2381
|
+
...(input.fieldId != null && { fieldId: input.fieldId }),
|
|
2382
|
+
...(input.sortOrder != null && { sortOrder: input.sortOrder }),
|
|
2383
|
+
};
|
|
2384
|
+
};
|
|
2385
|
+
const serializeAws_restJson1SortList = (input, context) => {
|
|
2386
|
+
return input
|
|
2387
|
+
.filter((e) => e != null)
|
|
2388
|
+
.map((entry) => {
|
|
2389
|
+
return serializeAws_restJson1Sort(entry, context);
|
|
2390
|
+
});
|
|
2391
|
+
};
|
|
2392
|
+
const serializeAws_restJson1Tags = (input, context) => {
|
|
2393
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
2394
|
+
if (value === null) {
|
|
2395
|
+
return { ...acc, [key]: null };
|
|
2396
|
+
}
|
|
2397
|
+
return {
|
|
2398
|
+
...acc,
|
|
2399
|
+
[key]: value,
|
|
2400
|
+
};
|
|
2401
|
+
}, {});
|
|
2402
|
+
};
|
|
2403
|
+
const deserializeAws_restJson1BasicLayout = (output, context) => {
|
|
2404
|
+
return {
|
|
2405
|
+
moreInfo: output.moreInfo != null ? deserializeAws_restJson1LayoutSections(output.moreInfo, context) : undefined,
|
|
2406
|
+
topPanel: output.topPanel != null ? deserializeAws_restJson1LayoutSections(output.topPanel, context) : undefined,
|
|
2407
|
+
};
|
|
2408
|
+
};
|
|
2409
|
+
const deserializeAws_restJson1BatchGetFieldErrorList = (output, context) => {
|
|
2410
|
+
const retVal = (output || [])
|
|
2411
|
+
.filter((e) => e != null)
|
|
2412
|
+
.map((entry) => {
|
|
2413
|
+
if (entry === null) {
|
|
2414
|
+
return null;
|
|
2415
|
+
}
|
|
2416
|
+
return deserializeAws_restJson1FieldError(entry, context);
|
|
2417
|
+
});
|
|
2418
|
+
return retVal;
|
|
2419
|
+
};
|
|
2420
|
+
const deserializeAws_restJson1BatchGetFieldList = (output, context) => {
|
|
2421
|
+
const retVal = (output || [])
|
|
2422
|
+
.filter((e) => e != null)
|
|
2423
|
+
.map((entry) => {
|
|
2424
|
+
if (entry === null) {
|
|
2425
|
+
return null;
|
|
2426
|
+
}
|
|
2427
|
+
return deserializeAws_restJson1GetFieldResponse(entry, context);
|
|
2428
|
+
});
|
|
2429
|
+
return retVal;
|
|
2430
|
+
};
|
|
2431
|
+
const deserializeAws_restJson1CaseEventIncludedData = (output, context) => {
|
|
2432
|
+
return {
|
|
2433
|
+
fields: output.fields != null ? deserializeAws_restJson1FieldIdentifierList(output.fields, context) : undefined,
|
|
2434
|
+
};
|
|
2435
|
+
};
|
|
2436
|
+
const deserializeAws_restJson1CaseSummary = (output, context) => {
|
|
2437
|
+
return {
|
|
2438
|
+
caseId: __expectString(output.caseId),
|
|
2439
|
+
templateId: __expectString(output.templateId),
|
|
2440
|
+
};
|
|
2441
|
+
};
|
|
2442
|
+
const deserializeAws_restJson1CaseSummaryList = (output, context) => {
|
|
2443
|
+
const retVal = (output || [])
|
|
2444
|
+
.filter((e) => e != null)
|
|
2445
|
+
.map((entry) => {
|
|
2446
|
+
if (entry === null) {
|
|
2447
|
+
return null;
|
|
2448
|
+
}
|
|
2449
|
+
return deserializeAws_restJson1CaseSummary(entry, context);
|
|
2450
|
+
});
|
|
2451
|
+
return retVal;
|
|
2452
|
+
};
|
|
2453
|
+
const deserializeAws_restJson1CommentContent = (output, context) => {
|
|
2454
|
+
return {
|
|
2455
|
+
body: __expectString(output.body),
|
|
2456
|
+
contentType: __expectString(output.contentType),
|
|
2457
|
+
};
|
|
2458
|
+
};
|
|
2459
|
+
const deserializeAws_restJson1ContactContent = (output, context) => {
|
|
2460
|
+
return {
|
|
2461
|
+
channel: __expectString(output.channel),
|
|
2462
|
+
connectedToSystemTime: output.connectedToSystemTime != null
|
|
2463
|
+
? __expectNonNull(__parseRfc3339DateTime(output.connectedToSystemTime))
|
|
2464
|
+
: undefined,
|
|
2465
|
+
contactArn: __expectString(output.contactArn),
|
|
2466
|
+
};
|
|
2467
|
+
};
|
|
2468
|
+
const deserializeAws_restJson1DomainSummary = (output, context) => {
|
|
2469
|
+
return {
|
|
2470
|
+
domainArn: __expectString(output.domainArn),
|
|
2471
|
+
domainId: __expectString(output.domainId),
|
|
2472
|
+
name: __expectString(output.name),
|
|
2473
|
+
};
|
|
2474
|
+
};
|
|
2475
|
+
const deserializeAws_restJson1DomainSummaryList = (output, context) => {
|
|
2476
|
+
const retVal = (output || [])
|
|
2477
|
+
.filter((e) => e != null)
|
|
2478
|
+
.map((entry) => {
|
|
2479
|
+
if (entry === null) {
|
|
2480
|
+
return null;
|
|
2481
|
+
}
|
|
2482
|
+
return deserializeAws_restJson1DomainSummary(entry, context);
|
|
2483
|
+
});
|
|
2484
|
+
return retVal;
|
|
2485
|
+
};
|
|
2486
|
+
const deserializeAws_restJson1EventBridgeConfiguration = (output, context) => {
|
|
2487
|
+
return {
|
|
2488
|
+
enabled: __expectBoolean(output.enabled),
|
|
2489
|
+
includedData: output.includedData != null ? deserializeAws_restJson1EventIncludedData(output.includedData, context) : undefined,
|
|
2490
|
+
};
|
|
2491
|
+
};
|
|
2492
|
+
const deserializeAws_restJson1EventIncludedData = (output, context) => {
|
|
2493
|
+
return {
|
|
2494
|
+
caseData: output.caseData != null ? deserializeAws_restJson1CaseEventIncludedData(output.caseData, context) : undefined,
|
|
2495
|
+
relatedItemData: output.relatedItemData != null
|
|
2496
|
+
? deserializeAws_restJson1RelatedItemEventIncludedData(output.relatedItemData, context)
|
|
2497
|
+
: undefined,
|
|
2498
|
+
};
|
|
2499
|
+
};
|
|
2500
|
+
const deserializeAws_restJson1FieldError = (output, context) => {
|
|
2501
|
+
return {
|
|
2502
|
+
errorCode: __expectString(output.errorCode),
|
|
2503
|
+
id: __expectString(output.id),
|
|
2504
|
+
message: __expectString(output.message),
|
|
2505
|
+
};
|
|
2506
|
+
};
|
|
2507
|
+
const deserializeAws_restJson1FieldGroup = (output, context) => {
|
|
2508
|
+
return {
|
|
2509
|
+
fields: output.fields != null ? deserializeAws_restJson1FieldList(output.fields, context) : undefined,
|
|
2510
|
+
name: __expectString(output.name),
|
|
2511
|
+
};
|
|
2512
|
+
};
|
|
2513
|
+
const deserializeAws_restJson1FieldIdentifier = (output, context) => {
|
|
2514
|
+
return {
|
|
2515
|
+
id: __expectString(output.id),
|
|
2516
|
+
};
|
|
2517
|
+
};
|
|
2518
|
+
const deserializeAws_restJson1FieldIdentifierList = (output, context) => {
|
|
2519
|
+
const retVal = (output || [])
|
|
2520
|
+
.filter((e) => e != null)
|
|
2521
|
+
.map((entry) => {
|
|
2522
|
+
if (entry === null) {
|
|
2523
|
+
return null;
|
|
2524
|
+
}
|
|
2525
|
+
return deserializeAws_restJson1FieldIdentifier(entry, context);
|
|
2526
|
+
});
|
|
2527
|
+
return retVal;
|
|
2528
|
+
};
|
|
2529
|
+
const deserializeAws_restJson1FieldItem = (output, context) => {
|
|
2530
|
+
return {
|
|
2531
|
+
id: __expectString(output.id),
|
|
2532
|
+
};
|
|
2533
|
+
};
|
|
2534
|
+
const deserializeAws_restJson1FieldList = (output, context) => {
|
|
2535
|
+
const retVal = (output || [])
|
|
2536
|
+
.filter((e) => e != null)
|
|
2537
|
+
.map((entry) => {
|
|
2538
|
+
if (entry === null) {
|
|
2539
|
+
return null;
|
|
2540
|
+
}
|
|
2541
|
+
return deserializeAws_restJson1FieldItem(entry, context);
|
|
2542
|
+
});
|
|
2543
|
+
return retVal;
|
|
2544
|
+
};
|
|
2545
|
+
const deserializeAws_restJson1FieldOption = (output, context) => {
|
|
2546
|
+
return {
|
|
2547
|
+
active: __expectBoolean(output.active),
|
|
2548
|
+
name: __expectString(output.name),
|
|
2549
|
+
value: __expectString(output.value),
|
|
2550
|
+
};
|
|
2551
|
+
};
|
|
2552
|
+
const deserializeAws_restJson1FieldOptionError = (output, context) => {
|
|
2553
|
+
return {
|
|
2554
|
+
errorCode: __expectString(output.errorCode),
|
|
2555
|
+
message: __expectString(output.message),
|
|
2556
|
+
value: __expectString(output.value),
|
|
2557
|
+
};
|
|
2558
|
+
};
|
|
2559
|
+
const deserializeAws_restJson1FieldOptionErrorList = (output, context) => {
|
|
2560
|
+
const retVal = (output || [])
|
|
2561
|
+
.filter((e) => e != null)
|
|
2562
|
+
.map((entry) => {
|
|
2563
|
+
if (entry === null) {
|
|
2564
|
+
return null;
|
|
2565
|
+
}
|
|
2566
|
+
return deserializeAws_restJson1FieldOptionError(entry, context);
|
|
2567
|
+
});
|
|
2568
|
+
return retVal;
|
|
2569
|
+
};
|
|
2570
|
+
const deserializeAws_restJson1FieldOptionsList = (output, context) => {
|
|
2571
|
+
const retVal = (output || [])
|
|
2572
|
+
.filter((e) => e != null)
|
|
2573
|
+
.map((entry) => {
|
|
2574
|
+
if (entry === null) {
|
|
2575
|
+
return null;
|
|
2576
|
+
}
|
|
2577
|
+
return deserializeAws_restJson1FieldOption(entry, context);
|
|
2578
|
+
});
|
|
2579
|
+
return retVal;
|
|
2580
|
+
};
|
|
2581
|
+
const deserializeAws_restJson1FieldSummary = (output, context) => {
|
|
2582
|
+
return {
|
|
2583
|
+
fieldArn: __expectString(output.fieldArn),
|
|
2584
|
+
fieldId: __expectString(output.fieldId),
|
|
2585
|
+
name: __expectString(output.name),
|
|
2586
|
+
namespace: __expectString(output.namespace),
|
|
2587
|
+
type: __expectString(output.type),
|
|
2588
|
+
};
|
|
2589
|
+
};
|
|
2590
|
+
const deserializeAws_restJson1FieldSummaryList = (output, context) => {
|
|
2591
|
+
const retVal = (output || [])
|
|
2592
|
+
.filter((e) => e != null)
|
|
2593
|
+
.map((entry) => {
|
|
2594
|
+
if (entry === null) {
|
|
2595
|
+
return null;
|
|
2596
|
+
}
|
|
2597
|
+
return deserializeAws_restJson1FieldSummary(entry, context);
|
|
2598
|
+
});
|
|
2599
|
+
return retVal;
|
|
2600
|
+
};
|
|
2601
|
+
const deserializeAws_restJson1FieldValue = (output, context) => {
|
|
2602
|
+
return {
|
|
2603
|
+
id: __expectString(output.id),
|
|
2604
|
+
value: output.value != null ? deserializeAws_restJson1FieldValueUnion(__expectUnion(output.value), context) : undefined,
|
|
2605
|
+
};
|
|
2606
|
+
};
|
|
2607
|
+
const deserializeAws_restJson1FieldValueList = (output, context) => {
|
|
2608
|
+
const retVal = (output || [])
|
|
2609
|
+
.filter((e) => e != null)
|
|
2610
|
+
.map((entry) => {
|
|
2611
|
+
if (entry === null) {
|
|
2612
|
+
return null;
|
|
2613
|
+
}
|
|
2614
|
+
return deserializeAws_restJson1FieldValue(entry, context);
|
|
2615
|
+
});
|
|
2616
|
+
return retVal;
|
|
2617
|
+
};
|
|
2618
|
+
const deserializeAws_restJson1FieldValueUnion = (output, context) => {
|
|
2619
|
+
if (__expectBoolean(output.booleanValue) !== undefined) {
|
|
2620
|
+
return { booleanValue: __expectBoolean(output.booleanValue) };
|
|
2621
|
+
}
|
|
2622
|
+
if (__limitedParseDouble(output.doubleValue) !== undefined) {
|
|
2623
|
+
return { doubleValue: __limitedParseDouble(output.doubleValue) };
|
|
2624
|
+
}
|
|
2625
|
+
if (__expectString(output.stringValue) !== undefined) {
|
|
2626
|
+
return { stringValue: __expectString(output.stringValue) };
|
|
2627
|
+
}
|
|
2628
|
+
return { $unknown: Object.entries(output)[0] };
|
|
2629
|
+
};
|
|
2630
|
+
const deserializeAws_restJson1GetFieldResponse = (output, context) => {
|
|
2631
|
+
return {
|
|
2632
|
+
description: __expectString(output.description),
|
|
2633
|
+
fieldArn: __expectString(output.fieldArn),
|
|
2634
|
+
fieldId: __expectString(output.fieldId),
|
|
2635
|
+
name: __expectString(output.name),
|
|
2636
|
+
namespace: __expectString(output.namespace),
|
|
2637
|
+
tags: output.tags != null ? deserializeAws_restJson1Tags(output.tags, context) : undefined,
|
|
2638
|
+
type: __expectString(output.type),
|
|
2639
|
+
};
|
|
2640
|
+
};
|
|
2641
|
+
const deserializeAws_restJson1LayoutConfiguration = (output, context) => {
|
|
2642
|
+
return {
|
|
2643
|
+
defaultLayout: __expectString(output.defaultLayout),
|
|
2644
|
+
};
|
|
2645
|
+
};
|
|
2646
|
+
const deserializeAws_restJson1LayoutContent = (output, context) => {
|
|
2647
|
+
if (output.basic != null) {
|
|
2648
|
+
return {
|
|
2649
|
+
basic: deserializeAws_restJson1BasicLayout(output.basic, context),
|
|
2650
|
+
};
|
|
2651
|
+
}
|
|
2652
|
+
return { $unknown: Object.entries(output)[0] };
|
|
2653
|
+
};
|
|
2654
|
+
const deserializeAws_restJson1LayoutSections = (output, context) => {
|
|
2655
|
+
return {
|
|
2656
|
+
sections: output.sections != null ? deserializeAws_restJson1SectionsList(output.sections, context) : undefined,
|
|
2657
|
+
};
|
|
2658
|
+
};
|
|
2659
|
+
const deserializeAws_restJson1LayoutSummary = (output, context) => {
|
|
2660
|
+
return {
|
|
2661
|
+
layoutArn: __expectString(output.layoutArn),
|
|
2662
|
+
layoutId: __expectString(output.layoutId),
|
|
2663
|
+
name: __expectString(output.name),
|
|
2664
|
+
};
|
|
2665
|
+
};
|
|
2666
|
+
const deserializeAws_restJson1LayoutSummaryList = (output, context) => {
|
|
2667
|
+
const retVal = (output || [])
|
|
2668
|
+
.filter((e) => e != null)
|
|
2669
|
+
.map((entry) => {
|
|
2670
|
+
if (entry === null) {
|
|
2671
|
+
return null;
|
|
2672
|
+
}
|
|
2673
|
+
return deserializeAws_restJson1LayoutSummary(entry, context);
|
|
2674
|
+
});
|
|
2675
|
+
return retVal;
|
|
2676
|
+
};
|
|
2677
|
+
const deserializeAws_restJson1RelatedItemContent = (output, context) => {
|
|
2678
|
+
if (output.comment != null) {
|
|
2679
|
+
return {
|
|
2680
|
+
comment: deserializeAws_restJson1CommentContent(output.comment, context),
|
|
2681
|
+
};
|
|
2682
|
+
}
|
|
2683
|
+
if (output.contact != null) {
|
|
2684
|
+
return {
|
|
2685
|
+
contact: deserializeAws_restJson1ContactContent(output.contact, context),
|
|
2686
|
+
};
|
|
2687
|
+
}
|
|
2688
|
+
return { $unknown: Object.entries(output)[0] };
|
|
2689
|
+
};
|
|
2690
|
+
const deserializeAws_restJson1RelatedItemEventIncludedData = (output, context) => {
|
|
2691
|
+
return {
|
|
2692
|
+
includeContent: __expectBoolean(output.includeContent),
|
|
2693
|
+
};
|
|
2694
|
+
};
|
|
2695
|
+
const deserializeAws_restJson1RequiredField = (output, context) => {
|
|
2696
|
+
return {
|
|
2697
|
+
fieldId: __expectString(output.fieldId),
|
|
2698
|
+
};
|
|
2699
|
+
};
|
|
2700
|
+
const deserializeAws_restJson1RequiredFieldList = (output, context) => {
|
|
2701
|
+
const retVal = (output || [])
|
|
2702
|
+
.filter((e) => e != null)
|
|
2703
|
+
.map((entry) => {
|
|
2704
|
+
if (entry === null) {
|
|
2705
|
+
return null;
|
|
2706
|
+
}
|
|
2707
|
+
return deserializeAws_restJson1RequiredField(entry, context);
|
|
2708
|
+
});
|
|
2709
|
+
return retVal;
|
|
2710
|
+
};
|
|
2711
|
+
const deserializeAws_restJson1SearchCasesResponseItem = (output, context) => {
|
|
2712
|
+
return {
|
|
2713
|
+
caseId: __expectString(output.caseId),
|
|
2714
|
+
fields: output.fields != null ? deserializeAws_restJson1FieldValueList(output.fields, context) : undefined,
|
|
2715
|
+
tags: output.tags != null ? deserializeAws_restJson1Tags(output.tags, context) : undefined,
|
|
2716
|
+
templateId: __expectString(output.templateId),
|
|
2717
|
+
};
|
|
2718
|
+
};
|
|
2719
|
+
const deserializeAws_restJson1SearchCasesResponseItemList = (output, context) => {
|
|
2720
|
+
const retVal = (output || []).map((entry) => {
|
|
2721
|
+
if (entry === null) {
|
|
2722
|
+
return null;
|
|
2723
|
+
}
|
|
2724
|
+
return deserializeAws_restJson1SearchCasesResponseItem(entry, context);
|
|
2725
|
+
});
|
|
2726
|
+
return retVal;
|
|
2727
|
+
};
|
|
2728
|
+
const deserializeAws_restJson1SearchRelatedItemsResponseItem = (output, context) => {
|
|
2729
|
+
return {
|
|
2730
|
+
associationTime: output.associationTime != null ? __expectNonNull(__parseRfc3339DateTime(output.associationTime)) : undefined,
|
|
2731
|
+
content: output.content != null
|
|
2732
|
+
? deserializeAws_restJson1RelatedItemContent(__expectUnion(output.content), context)
|
|
2733
|
+
: undefined,
|
|
2734
|
+
relatedItemId: __expectString(output.relatedItemId),
|
|
2735
|
+
tags: output.tags != null ? deserializeAws_restJson1Tags(output.tags, context) : undefined,
|
|
2736
|
+
type: __expectString(output.type),
|
|
2737
|
+
};
|
|
2738
|
+
};
|
|
2739
|
+
const deserializeAws_restJson1SearchRelatedItemsResponseItemList = (output, context) => {
|
|
2740
|
+
const retVal = (output || []).map((entry) => {
|
|
2741
|
+
if (entry === null) {
|
|
2742
|
+
return null;
|
|
2743
|
+
}
|
|
2744
|
+
return deserializeAws_restJson1SearchRelatedItemsResponseItem(entry, context);
|
|
2745
|
+
});
|
|
2746
|
+
return retVal;
|
|
2747
|
+
};
|
|
2748
|
+
const deserializeAws_restJson1Section = (output, context) => {
|
|
2749
|
+
if (output.fieldGroup != null) {
|
|
2750
|
+
return {
|
|
2751
|
+
fieldGroup: deserializeAws_restJson1FieldGroup(output.fieldGroup, context),
|
|
2752
|
+
};
|
|
2753
|
+
}
|
|
2754
|
+
return { $unknown: Object.entries(output)[0] };
|
|
2755
|
+
};
|
|
2756
|
+
const deserializeAws_restJson1SectionsList = (output, context) => {
|
|
2757
|
+
const retVal = (output || [])
|
|
2758
|
+
.filter((e) => e != null)
|
|
2759
|
+
.map((entry) => {
|
|
2760
|
+
if (entry === null) {
|
|
2761
|
+
return null;
|
|
2762
|
+
}
|
|
2763
|
+
return deserializeAws_restJson1Section(__expectUnion(entry), context);
|
|
2764
|
+
});
|
|
2765
|
+
return retVal;
|
|
2766
|
+
};
|
|
2767
|
+
const deserializeAws_restJson1Tags = (output, context) => {
|
|
2768
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
2769
|
+
if (value === null) {
|
|
2770
|
+
return { ...acc, [key]: null };
|
|
2771
|
+
}
|
|
2772
|
+
return {
|
|
2773
|
+
...acc,
|
|
2774
|
+
[key]: __expectString(value),
|
|
2775
|
+
};
|
|
2776
|
+
}, {});
|
|
2777
|
+
};
|
|
2778
|
+
const deserializeAws_restJson1TemplateSummary = (output, context) => {
|
|
2779
|
+
return {
|
|
2780
|
+
name: __expectString(output.name),
|
|
2781
|
+
templateArn: __expectString(output.templateArn),
|
|
2782
|
+
templateId: __expectString(output.templateId),
|
|
2783
|
+
};
|
|
2784
|
+
};
|
|
2785
|
+
const deserializeAws_restJson1TemplateSummaryList = (output, context) => {
|
|
2786
|
+
const retVal = (output || [])
|
|
2787
|
+
.filter((e) => e != null)
|
|
2788
|
+
.map((entry) => {
|
|
2789
|
+
if (entry === null) {
|
|
2790
|
+
return null;
|
|
2791
|
+
}
|
|
2792
|
+
return deserializeAws_restJson1TemplateSummary(entry, context);
|
|
2793
|
+
});
|
|
2794
|
+
return retVal;
|
|
2795
|
+
};
|
|
2796
|
+
const deserializeMetadata = (output) => ({
|
|
2797
|
+
httpStatusCode: output.statusCode,
|
|
2798
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
2799
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
2800
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
2801
|
+
});
|
|
2802
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
2803
|
+
if (streamBody instanceof Uint8Array) {
|
|
2804
|
+
return Promise.resolve(streamBody);
|
|
2805
|
+
}
|
|
2806
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
2807
|
+
};
|
|
2808
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
2809
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
2810
|
+
value !== null &&
|
|
2811
|
+
value !== "" &&
|
|
2812
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
2813
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
2814
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
2815
|
+
if (encoded.length) {
|
|
2816
|
+
return JSON.parse(encoded);
|
|
2817
|
+
}
|
|
2818
|
+
return {};
|
|
2819
|
+
});
|
|
2820
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
2821
|
+
const value = await parseBody(errorBody, context);
|
|
2822
|
+
value.message = value.message ?? value.Message;
|
|
2823
|
+
return value;
|
|
2824
|
+
};
|
|
2825
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
2826
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
2827
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
2828
|
+
let cleanValue = rawValue;
|
|
2829
|
+
if (typeof cleanValue === "number") {
|
|
2830
|
+
cleanValue = cleanValue.toString();
|
|
2831
|
+
}
|
|
2832
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
2833
|
+
cleanValue = cleanValue.split(",")[0];
|
|
2834
|
+
}
|
|
2835
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
2836
|
+
cleanValue = cleanValue.split(":")[0];
|
|
2837
|
+
}
|
|
2838
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
2839
|
+
cleanValue = cleanValue.split("#")[1];
|
|
2840
|
+
}
|
|
2841
|
+
return cleanValue;
|
|
2842
|
+
};
|
|
2843
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
2844
|
+
if (headerKey !== undefined) {
|
|
2845
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
2846
|
+
}
|
|
2847
|
+
if (data.code !== undefined) {
|
|
2848
|
+
return sanitizeErrorCode(data.code);
|
|
2849
|
+
}
|
|
2850
|
+
if (data["__type"] !== undefined) {
|
|
2851
|
+
return sanitizeErrorCode(data["__type"]);
|
|
2852
|
+
}
|
|
2853
|
+
};
|