@aws-sdk/client-support-app 3.183.0 → 3.185.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.
@@ -1,657 +1,902 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
4
5
  import { SupportAppServiceException as __BaseException } from "../models/SupportAppServiceException";
5
- export const serializeAws_restJson1CreateSlackChannelConfigurationCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
- const headers = {
8
- "content-type": "application/json",
9
- };
10
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
11
- "/control/create-slack-channel-configuration";
12
- let body;
13
- body = JSON.stringify({
14
- ...(input.channelId != null && { channelId: input.channelId }),
15
- ...(input.channelName != null && { channelName: input.channelName }),
16
- ...(input.channelRoleArn != null && { channelRoleArn: input.channelRoleArn }),
17
- ...(input.notifyOnAddCorrespondenceToCase != null && {
18
- notifyOnAddCorrespondenceToCase: input.notifyOnAddCorrespondenceToCase,
19
- }),
20
- ...(input.notifyOnCaseSeverity != null && { notifyOnCaseSeverity: input.notifyOnCaseSeverity }),
21
- ...(input.notifyOnCreateOrReopenCase != null && { notifyOnCreateOrReopenCase: input.notifyOnCreateOrReopenCase }),
22
- ...(input.notifyOnResolveCase != null && { notifyOnResolveCase: input.notifyOnResolveCase }),
23
- ...(input.teamId != null && { teamId: input.teamId }),
24
- });
25
- return new __HttpRequest({
26
- protocol,
27
- hostname,
28
- port,
29
- method: "POST",
30
- headers,
31
- path: resolvedPath,
32
- body,
6
+ export var serializeAws_restJson1CreateSlackChannelConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
+ return __generator(this, function (_c) {
9
+ switch (_c.label) {
10
+ case 0: return [4, context.endpoint()];
11
+ case 1:
12
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
+ headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
17
+ "/control/create-slack-channel-configuration";
18
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.channelId != null && { channelId: input.channelId })), (input.channelName != null && { channelName: input.channelName })), (input.channelRoleArn != null && { channelRoleArn: input.channelRoleArn })), (input.notifyOnAddCorrespondenceToCase != null && {
19
+ notifyOnAddCorrespondenceToCase: input.notifyOnAddCorrespondenceToCase,
20
+ })), (input.notifyOnCaseSeverity != null && { notifyOnCaseSeverity: input.notifyOnCaseSeverity })), (input.notifyOnCreateOrReopenCase != null && { notifyOnCreateOrReopenCase: input.notifyOnCreateOrReopenCase })), (input.notifyOnResolveCase != null && { notifyOnResolveCase: input.notifyOnResolveCase })), (input.teamId != null && { teamId: input.teamId })));
21
+ return [2, new __HttpRequest({
22
+ protocol: protocol,
23
+ hostname: hostname,
24
+ port: port,
25
+ method: "POST",
26
+ headers: headers,
27
+ path: resolvedPath,
28
+ body: body,
29
+ })];
30
+ }
33
31
  });
34
- };
35
- export const serializeAws_restJson1DeleteAccountAliasCommand = async (input, context) => {
36
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
37
- const headers = {
38
- "content-type": "application/json",
39
- };
40
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/control/delete-account-alias";
41
- let body;
42
- body = "";
43
- return new __HttpRequest({
44
- protocol,
45
- hostname,
46
- port,
47
- method: "POST",
48
- headers,
49
- path: resolvedPath,
50
- body,
32
+ }); };
33
+ export var serializeAws_restJson1DeleteAccountAliasCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
34
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
35
+ return __generator(this, function (_c) {
36
+ switch (_c.label) {
37
+ case 0: return [4, context.endpoint()];
38
+ case 1:
39
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
40
+ headers = {
41
+ "content-type": "application/json",
42
+ };
43
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/control/delete-account-alias";
44
+ body = "";
45
+ return [2, new __HttpRequest({
46
+ protocol: protocol,
47
+ hostname: hostname,
48
+ port: port,
49
+ method: "POST",
50
+ headers: headers,
51
+ path: resolvedPath,
52
+ body: body,
53
+ })];
54
+ }
51
55
  });
52
- };
53
- export const serializeAws_restJson1DeleteSlackChannelConfigurationCommand = async (input, context) => {
54
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
55
- const headers = {
56
- "content-type": "application/json",
57
- };
58
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
59
- "/control/delete-slack-channel-configuration";
60
- let body;
61
- body = JSON.stringify({
62
- ...(input.channelId != null && { channelId: input.channelId }),
63
- ...(input.teamId != null && { teamId: input.teamId }),
64
- });
65
- return new __HttpRequest({
66
- protocol,
67
- hostname,
68
- port,
69
- method: "POST",
70
- headers,
71
- path: resolvedPath,
72
- body,
56
+ }); };
57
+ export var serializeAws_restJson1DeleteSlackChannelConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
58
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
59
+ return __generator(this, function (_c) {
60
+ switch (_c.label) {
61
+ case 0: return [4, context.endpoint()];
62
+ case 1:
63
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
64
+ headers = {
65
+ "content-type": "application/json",
66
+ };
67
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
68
+ "/control/delete-slack-channel-configuration";
69
+ body = JSON.stringify(__assign(__assign({}, (input.channelId != null && { channelId: input.channelId })), (input.teamId != null && { teamId: input.teamId })));
70
+ return [2, new __HttpRequest({
71
+ protocol: protocol,
72
+ hostname: hostname,
73
+ port: port,
74
+ method: "POST",
75
+ headers: headers,
76
+ path: resolvedPath,
77
+ body: body,
78
+ })];
79
+ }
73
80
  });
74
- };
75
- export const serializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = async (input, context) => {
76
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
77
- const headers = {
78
- "content-type": "application/json",
79
- };
80
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
81
- "/control/delete-slack-workspace-configuration";
82
- let body;
83
- body = JSON.stringify({
84
- ...(input.teamId != null && { teamId: input.teamId }),
85
- });
86
- return new __HttpRequest({
87
- protocol,
88
- hostname,
89
- port,
90
- method: "POST",
91
- headers,
92
- path: resolvedPath,
93
- body,
81
+ }); };
82
+ export var serializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
83
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
84
+ return __generator(this, function (_c) {
85
+ switch (_c.label) {
86
+ case 0: return [4, context.endpoint()];
87
+ case 1:
88
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
89
+ headers = {
90
+ "content-type": "application/json",
91
+ };
92
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
93
+ "/control/delete-slack-workspace-configuration";
94
+ body = JSON.stringify(__assign({}, (input.teamId != null && { teamId: input.teamId })));
95
+ return [2, new __HttpRequest({
96
+ protocol: protocol,
97
+ hostname: hostname,
98
+ port: port,
99
+ method: "POST",
100
+ headers: headers,
101
+ path: resolvedPath,
102
+ body: body,
103
+ })];
104
+ }
94
105
  });
95
- };
96
- export const serializeAws_restJson1GetAccountAliasCommand = async (input, context) => {
97
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
98
- const headers = {
99
- "content-type": "application/json",
100
- };
101
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/control/get-account-alias";
102
- let body;
103
- body = "";
104
- return new __HttpRequest({
105
- protocol,
106
- hostname,
107
- port,
108
- method: "POST",
109
- headers,
110
- path: resolvedPath,
111
- body,
106
+ }); };
107
+ export var serializeAws_restJson1GetAccountAliasCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
108
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
109
+ return __generator(this, function (_c) {
110
+ switch (_c.label) {
111
+ case 0: return [4, context.endpoint()];
112
+ case 1:
113
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
114
+ headers = {
115
+ "content-type": "application/json",
116
+ };
117
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/control/get-account-alias";
118
+ body = "";
119
+ return [2, new __HttpRequest({
120
+ protocol: protocol,
121
+ hostname: hostname,
122
+ port: port,
123
+ method: "POST",
124
+ headers: headers,
125
+ path: resolvedPath,
126
+ body: body,
127
+ })];
128
+ }
112
129
  });
113
- };
114
- export const serializeAws_restJson1ListSlackChannelConfigurationsCommand = async (input, context) => {
115
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
116
- const headers = {
117
- "content-type": "application/json",
118
- };
119
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
120
- "/control/list-slack-channel-configurations";
121
- let body;
122
- body = JSON.stringify({
123
- ...(input.nextToken != null && { nextToken: input.nextToken }),
124
- });
125
- return new __HttpRequest({
126
- protocol,
127
- hostname,
128
- port,
129
- method: "POST",
130
- headers,
131
- path: resolvedPath,
132
- body,
130
+ }); };
131
+ export var serializeAws_restJson1ListSlackChannelConfigurationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
132
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
133
+ return __generator(this, function (_c) {
134
+ switch (_c.label) {
135
+ case 0: return [4, context.endpoint()];
136
+ case 1:
137
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
138
+ headers = {
139
+ "content-type": "application/json",
140
+ };
141
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
142
+ "/control/list-slack-channel-configurations";
143
+ body = JSON.stringify(__assign({}, (input.nextToken != null && { nextToken: input.nextToken })));
144
+ return [2, new __HttpRequest({
145
+ protocol: protocol,
146
+ hostname: hostname,
147
+ port: port,
148
+ method: "POST",
149
+ headers: headers,
150
+ path: resolvedPath,
151
+ body: body,
152
+ })];
153
+ }
133
154
  });
134
- };
135
- export const serializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = async (input, context) => {
136
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
137
- const headers = {
138
- "content-type": "application/json",
139
- };
140
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
141
- "/control/list-slack-workspace-configurations";
142
- let body;
143
- body = JSON.stringify({
144
- ...(input.nextToken != null && { nextToken: input.nextToken }),
145
- });
146
- return new __HttpRequest({
147
- protocol,
148
- hostname,
149
- port,
150
- method: "POST",
151
- headers,
152
- path: resolvedPath,
153
- body,
155
+ }); };
156
+ export var serializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
157
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
158
+ return __generator(this, function (_c) {
159
+ switch (_c.label) {
160
+ case 0: return [4, context.endpoint()];
161
+ case 1:
162
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
163
+ headers = {
164
+ "content-type": "application/json",
165
+ };
166
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
167
+ "/control/list-slack-workspace-configurations";
168
+ body = JSON.stringify(__assign({}, (input.nextToken != null && { nextToken: input.nextToken })));
169
+ return [2, new __HttpRequest({
170
+ protocol: protocol,
171
+ hostname: hostname,
172
+ port: port,
173
+ method: "POST",
174
+ headers: headers,
175
+ path: resolvedPath,
176
+ body: body,
177
+ })];
178
+ }
154
179
  });
155
- };
156
- export const serializeAws_restJson1PutAccountAliasCommand = async (input, context) => {
157
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
158
- const headers = {
159
- "content-type": "application/json",
160
- };
161
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/control/put-account-alias";
162
- let body;
163
- body = JSON.stringify({
164
- ...(input.accountAlias != null && { accountAlias: input.accountAlias }),
165
- });
166
- return new __HttpRequest({
167
- protocol,
168
- hostname,
169
- port,
170
- method: "POST",
171
- headers,
172
- path: resolvedPath,
173
- body,
180
+ }); };
181
+ export var serializeAws_restJson1PutAccountAliasCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
182
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
183
+ return __generator(this, function (_c) {
184
+ switch (_c.label) {
185
+ case 0: return [4, context.endpoint()];
186
+ case 1:
187
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
188
+ headers = {
189
+ "content-type": "application/json",
190
+ };
191
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/control/put-account-alias";
192
+ body = JSON.stringify(__assign({}, (input.accountAlias != null && { accountAlias: input.accountAlias })));
193
+ return [2, new __HttpRequest({
194
+ protocol: protocol,
195
+ hostname: hostname,
196
+ port: port,
197
+ method: "POST",
198
+ headers: headers,
199
+ path: resolvedPath,
200
+ body: body,
201
+ })];
202
+ }
174
203
  });
175
- };
176
- export const serializeAws_restJson1UpdateSlackChannelConfigurationCommand = async (input, context) => {
177
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
178
- const headers = {
179
- "content-type": "application/json",
180
- };
181
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
182
- "/control/update-slack-channel-configuration";
183
- let body;
184
- body = JSON.stringify({
185
- ...(input.channelId != null && { channelId: input.channelId }),
186
- ...(input.channelName != null && { channelName: input.channelName }),
187
- ...(input.channelRoleArn != null && { channelRoleArn: input.channelRoleArn }),
188
- ...(input.notifyOnAddCorrespondenceToCase != null && {
189
- notifyOnAddCorrespondenceToCase: input.notifyOnAddCorrespondenceToCase,
190
- }),
191
- ...(input.notifyOnCaseSeverity != null && { notifyOnCaseSeverity: input.notifyOnCaseSeverity }),
192
- ...(input.notifyOnCreateOrReopenCase != null && { notifyOnCreateOrReopenCase: input.notifyOnCreateOrReopenCase }),
193
- ...(input.notifyOnResolveCase != null && { notifyOnResolveCase: input.notifyOnResolveCase }),
194
- ...(input.teamId != null && { teamId: input.teamId }),
195
- });
196
- return new __HttpRequest({
197
- protocol,
198
- hostname,
199
- port,
200
- method: "POST",
201
- headers,
202
- path: resolvedPath,
203
- body,
204
+ }); };
205
+ export var serializeAws_restJson1UpdateSlackChannelConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
206
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
207
+ return __generator(this, function (_c) {
208
+ switch (_c.label) {
209
+ case 0: return [4, context.endpoint()];
210
+ case 1:
211
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
212
+ headers = {
213
+ "content-type": "application/json",
214
+ };
215
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
216
+ "/control/update-slack-channel-configuration";
217
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.channelId != null && { channelId: input.channelId })), (input.channelName != null && { channelName: input.channelName })), (input.channelRoleArn != null && { channelRoleArn: input.channelRoleArn })), (input.notifyOnAddCorrespondenceToCase != null && {
218
+ notifyOnAddCorrespondenceToCase: input.notifyOnAddCorrespondenceToCase,
219
+ })), (input.notifyOnCaseSeverity != null && { notifyOnCaseSeverity: input.notifyOnCaseSeverity })), (input.notifyOnCreateOrReopenCase != null && { notifyOnCreateOrReopenCase: input.notifyOnCreateOrReopenCase })), (input.notifyOnResolveCase != null && { notifyOnResolveCase: input.notifyOnResolveCase })), (input.teamId != null && { teamId: input.teamId })));
220
+ return [2, new __HttpRequest({
221
+ protocol: protocol,
222
+ hostname: hostname,
223
+ port: port,
224
+ method: "POST",
225
+ headers: headers,
226
+ path: resolvedPath,
227
+ body: body,
228
+ })];
229
+ }
204
230
  });
205
- };
206
- export const deserializeAws_restJson1CreateSlackChannelConfigurationCommand = async (output, context) => {
207
- if (output.statusCode !== 200 && output.statusCode >= 300) {
208
- return deserializeAws_restJson1CreateSlackChannelConfigurationCommandError(output, context);
209
- }
210
- const contents = map({
211
- $metadata: deserializeMetadata(output),
231
+ }); };
232
+ export var deserializeAws_restJson1CreateSlackChannelConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
233
+ var contents;
234
+ return __generator(this, function (_a) {
235
+ switch (_a.label) {
236
+ case 0:
237
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
238
+ return [2, deserializeAws_restJson1CreateSlackChannelConfigurationCommandError(output, context)];
239
+ }
240
+ contents = map({
241
+ $metadata: deserializeMetadata(output),
242
+ });
243
+ return [4, collectBody(output.body, context)];
244
+ case 1:
245
+ _a.sent();
246
+ return [2, contents];
247
+ }
212
248
  });
213
- await collectBody(output.body, context);
214
- return contents;
215
- };
216
- const deserializeAws_restJson1CreateSlackChannelConfigurationCommandError = async (output, context) => {
217
- const parsedOutput = {
218
- ...output,
219
- body: await parseErrorBody(output.body, context),
220
- };
221
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
222
- switch (errorCode) {
223
- case "AccessDeniedException":
224
- case "com.amazonaws.supportapp#AccessDeniedException":
225
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
226
- case "ConflictException":
227
- case "com.amazonaws.supportapp#ConflictException":
228
- throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
229
- case "InternalServerException":
230
- case "com.amazonaws.supportapp#InternalServerException":
231
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
232
- case "ServiceQuotaExceededException":
233
- case "com.amazonaws.supportapp#ServiceQuotaExceededException":
234
- throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
235
- case "ValidationException":
236
- case "com.amazonaws.supportapp#ValidationException":
237
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
238
- default:
239
- const parsedBody = parsedOutput.body;
240
- throwDefaultError({
241
- output,
242
- parsedBody,
243
- exceptionCtor: __BaseException,
244
- errorCode,
245
- });
246
- }
247
- };
248
- export const deserializeAws_restJson1DeleteAccountAliasCommand = async (output, context) => {
249
- if (output.statusCode !== 200 && output.statusCode >= 300) {
250
- return deserializeAws_restJson1DeleteAccountAliasCommandError(output, context);
251
- }
252
- const contents = map({
253
- $metadata: deserializeMetadata(output),
249
+ }); };
250
+ var deserializeAws_restJson1CreateSlackChannelConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
251
+ var parsedOutput, _a, errorCode, _b, parsedBody;
252
+ var _c;
253
+ return __generator(this, function (_d) {
254
+ switch (_d.label) {
255
+ case 0:
256
+ _a = [__assign({}, output)];
257
+ _c = {};
258
+ return [4, parseErrorBody(output.body, context)];
259
+ case 1:
260
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
261
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
262
+ _b = errorCode;
263
+ switch (_b) {
264
+ case "AccessDeniedException": return [3, 2];
265
+ case "com.amazonaws.supportapp#AccessDeniedException": return [3, 2];
266
+ case "ConflictException": return [3, 4];
267
+ case "com.amazonaws.supportapp#ConflictException": return [3, 4];
268
+ case "InternalServerException": return [3, 6];
269
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 6];
270
+ case "ServiceQuotaExceededException": return [3, 8];
271
+ case "com.amazonaws.supportapp#ServiceQuotaExceededException": return [3, 8];
272
+ case "ValidationException": return [3, 10];
273
+ case "com.amazonaws.supportapp#ValidationException": return [3, 10];
274
+ }
275
+ return [3, 12];
276
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
277
+ case 3: throw _d.sent();
278
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
279
+ case 5: throw _d.sent();
280
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
281
+ case 7: throw _d.sent();
282
+ case 8: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
283
+ case 9: throw _d.sent();
284
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
285
+ case 11: throw _d.sent();
286
+ case 12:
287
+ parsedBody = parsedOutput.body;
288
+ throwDefaultError({
289
+ output: output,
290
+ parsedBody: parsedBody,
291
+ exceptionCtor: __BaseException,
292
+ errorCode: errorCode,
293
+ });
294
+ _d.label = 13;
295
+ case 13: return [2];
296
+ }
254
297
  });
255
- await collectBody(output.body, context);
256
- return contents;
257
- };
258
- const deserializeAws_restJson1DeleteAccountAliasCommandError = async (output, context) => {
259
- const parsedOutput = {
260
- ...output,
261
- body: await parseErrorBody(output.body, context),
262
- };
263
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
264
- switch (errorCode) {
265
- case "AccessDeniedException":
266
- case "com.amazonaws.supportapp#AccessDeniedException":
267
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
268
- case "InternalServerException":
269
- case "com.amazonaws.supportapp#InternalServerException":
270
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
271
- case "ResourceNotFoundException":
272
- case "com.amazonaws.supportapp#ResourceNotFoundException":
273
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
274
- default:
275
- const parsedBody = parsedOutput.body;
276
- throwDefaultError({
277
- output,
278
- parsedBody,
279
- exceptionCtor: __BaseException,
280
- errorCode,
281
- });
282
- }
283
- };
284
- export const deserializeAws_restJson1DeleteSlackChannelConfigurationCommand = async (output, context) => {
285
- if (output.statusCode !== 200 && output.statusCode >= 300) {
286
- return deserializeAws_restJson1DeleteSlackChannelConfigurationCommandError(output, context);
287
- }
288
- const contents = map({
289
- $metadata: deserializeMetadata(output),
298
+ }); };
299
+ export var deserializeAws_restJson1DeleteAccountAliasCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
300
+ var contents;
301
+ return __generator(this, function (_a) {
302
+ switch (_a.label) {
303
+ case 0:
304
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
305
+ return [2, deserializeAws_restJson1DeleteAccountAliasCommandError(output, context)];
306
+ }
307
+ contents = map({
308
+ $metadata: deserializeMetadata(output),
309
+ });
310
+ return [4, collectBody(output.body, context)];
311
+ case 1:
312
+ _a.sent();
313
+ return [2, contents];
314
+ }
290
315
  });
291
- await collectBody(output.body, context);
292
- return contents;
293
- };
294
- const deserializeAws_restJson1DeleteSlackChannelConfigurationCommandError = async (output, context) => {
295
- const parsedOutput = {
296
- ...output,
297
- body: await parseErrorBody(output.body, context),
298
- };
299
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
300
- switch (errorCode) {
301
- case "AccessDeniedException":
302
- case "com.amazonaws.supportapp#AccessDeniedException":
303
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
304
- case "ConflictException":
305
- case "com.amazonaws.supportapp#ConflictException":
306
- throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
307
- case "InternalServerException":
308
- case "com.amazonaws.supportapp#InternalServerException":
309
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
310
- case "ResourceNotFoundException":
311
- case "com.amazonaws.supportapp#ResourceNotFoundException":
312
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
313
- case "ValidationException":
314
- case "com.amazonaws.supportapp#ValidationException":
315
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
316
- default:
317
- const parsedBody = parsedOutput.body;
318
- throwDefaultError({
319
- output,
320
- parsedBody,
321
- exceptionCtor: __BaseException,
322
- errorCode,
323
- });
324
- }
325
- };
326
- export const deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = async (output, context) => {
327
- if (output.statusCode !== 200 && output.statusCode >= 300) {
328
- return deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommandError(output, context);
329
- }
330
- const contents = map({
331
- $metadata: deserializeMetadata(output),
316
+ }); };
317
+ var deserializeAws_restJson1DeleteAccountAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
318
+ var parsedOutput, _a, errorCode, _b, parsedBody;
319
+ var _c;
320
+ return __generator(this, function (_d) {
321
+ switch (_d.label) {
322
+ case 0:
323
+ _a = [__assign({}, output)];
324
+ _c = {};
325
+ return [4, parseErrorBody(output.body, context)];
326
+ case 1:
327
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
328
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
329
+ _b = errorCode;
330
+ switch (_b) {
331
+ case "AccessDeniedException": return [3, 2];
332
+ case "com.amazonaws.supportapp#AccessDeniedException": return [3, 2];
333
+ case "InternalServerException": return [3, 4];
334
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 4];
335
+ case "ResourceNotFoundException": return [3, 6];
336
+ case "com.amazonaws.supportapp#ResourceNotFoundException": return [3, 6];
337
+ }
338
+ return [3, 8];
339
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
340
+ case 3: throw _d.sent();
341
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
342
+ case 5: throw _d.sent();
343
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
344
+ case 7: throw _d.sent();
345
+ case 8:
346
+ parsedBody = parsedOutput.body;
347
+ throwDefaultError({
348
+ output: output,
349
+ parsedBody: parsedBody,
350
+ exceptionCtor: __BaseException,
351
+ errorCode: errorCode,
352
+ });
353
+ _d.label = 9;
354
+ case 9: return [2];
355
+ }
332
356
  });
333
- await collectBody(output.body, context);
334
- return contents;
335
- };
336
- const deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommandError = async (output, context) => {
337
- const parsedOutput = {
338
- ...output,
339
- body: await parseErrorBody(output.body, context),
340
- };
341
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
342
- switch (errorCode) {
343
- case "AccessDeniedException":
344
- case "com.amazonaws.supportapp#AccessDeniedException":
345
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
346
- case "ConflictException":
347
- case "com.amazonaws.supportapp#ConflictException":
348
- throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
349
- case "InternalServerException":
350
- case "com.amazonaws.supportapp#InternalServerException":
351
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
352
- case "ResourceNotFoundException":
353
- case "com.amazonaws.supportapp#ResourceNotFoundException":
354
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
355
- case "ValidationException":
356
- case "com.amazonaws.supportapp#ValidationException":
357
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
358
- default:
359
- const parsedBody = parsedOutput.body;
360
- throwDefaultError({
361
- output,
362
- parsedBody,
363
- exceptionCtor: __BaseException,
364
- errorCode,
365
- });
366
- }
367
- };
368
- export const deserializeAws_restJson1GetAccountAliasCommand = async (output, context) => {
369
- if (output.statusCode !== 200 && output.statusCode >= 300) {
370
- return deserializeAws_restJson1GetAccountAliasCommandError(output, context);
371
- }
372
- const contents = map({
373
- $metadata: deserializeMetadata(output),
357
+ }); };
358
+ export var deserializeAws_restJson1DeleteSlackChannelConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
359
+ var contents;
360
+ return __generator(this, function (_a) {
361
+ switch (_a.label) {
362
+ case 0:
363
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
364
+ return [2, deserializeAws_restJson1DeleteSlackChannelConfigurationCommandError(output, context)];
365
+ }
366
+ contents = map({
367
+ $metadata: deserializeMetadata(output),
368
+ });
369
+ return [4, collectBody(output.body, context)];
370
+ case 1:
371
+ _a.sent();
372
+ return [2, contents];
373
+ }
374
374
  });
375
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
376
- if (data.accountAlias != null) {
377
- contents.accountAlias = __expectString(data.accountAlias);
378
- }
379
- return contents;
380
- };
381
- const deserializeAws_restJson1GetAccountAliasCommandError = async (output, context) => {
382
- const parsedOutput = {
383
- ...output,
384
- body: await parseErrorBody(output.body, context),
385
- };
386
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
387
- switch (errorCode) {
388
- case "InternalServerException":
389
- case "com.amazonaws.supportapp#InternalServerException":
390
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
391
- default:
392
- const parsedBody = parsedOutput.body;
393
- throwDefaultError({
394
- output,
395
- parsedBody,
396
- exceptionCtor: __BaseException,
397
- errorCode,
398
- });
399
- }
400
- };
401
- export const deserializeAws_restJson1ListSlackChannelConfigurationsCommand = async (output, context) => {
402
- if (output.statusCode !== 200 && output.statusCode >= 300) {
403
- return deserializeAws_restJson1ListSlackChannelConfigurationsCommandError(output, context);
404
- }
405
- const contents = map({
406
- $metadata: deserializeMetadata(output),
375
+ }); };
376
+ var deserializeAws_restJson1DeleteSlackChannelConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
377
+ var parsedOutput, _a, errorCode, _b, parsedBody;
378
+ var _c;
379
+ return __generator(this, function (_d) {
380
+ switch (_d.label) {
381
+ case 0:
382
+ _a = [__assign({}, output)];
383
+ _c = {};
384
+ return [4, parseErrorBody(output.body, context)];
385
+ case 1:
386
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
387
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
388
+ _b = errorCode;
389
+ switch (_b) {
390
+ case "AccessDeniedException": return [3, 2];
391
+ case "com.amazonaws.supportapp#AccessDeniedException": return [3, 2];
392
+ case "ConflictException": return [3, 4];
393
+ case "com.amazonaws.supportapp#ConflictException": return [3, 4];
394
+ case "InternalServerException": return [3, 6];
395
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 6];
396
+ case "ResourceNotFoundException": return [3, 8];
397
+ case "com.amazonaws.supportapp#ResourceNotFoundException": return [3, 8];
398
+ case "ValidationException": return [3, 10];
399
+ case "com.amazonaws.supportapp#ValidationException": return [3, 10];
400
+ }
401
+ return [3, 12];
402
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
403
+ case 3: throw _d.sent();
404
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
405
+ case 5: throw _d.sent();
406
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
407
+ case 7: throw _d.sent();
408
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
409
+ case 9: throw _d.sent();
410
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
411
+ case 11: throw _d.sent();
412
+ case 12:
413
+ parsedBody = parsedOutput.body;
414
+ throwDefaultError({
415
+ output: output,
416
+ parsedBody: parsedBody,
417
+ exceptionCtor: __BaseException,
418
+ errorCode: errorCode,
419
+ });
420
+ _d.label = 13;
421
+ case 13: return [2];
422
+ }
407
423
  });
408
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
409
- if (data.nextToken != null) {
410
- contents.nextToken = __expectString(data.nextToken);
411
- }
412
- if (data.slackChannelConfigurations != null) {
413
- contents.slackChannelConfigurations = deserializeAws_restJson1slackChannelConfigurationList(data.slackChannelConfigurations, context);
414
- }
415
- return contents;
416
- };
417
- const deserializeAws_restJson1ListSlackChannelConfigurationsCommandError = async (output, context) => {
418
- const parsedOutput = {
419
- ...output,
420
- body: await parseErrorBody(output.body, context),
421
- };
422
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
423
- switch (errorCode) {
424
- case "AccessDeniedException":
425
- case "com.amazonaws.supportapp#AccessDeniedException":
426
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
427
- case "InternalServerException":
428
- case "com.amazonaws.supportapp#InternalServerException":
429
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
430
- default:
431
- const parsedBody = parsedOutput.body;
432
- throwDefaultError({
433
- output,
434
- parsedBody,
435
- exceptionCtor: __BaseException,
436
- errorCode,
437
- });
438
- }
439
- };
440
- export const deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = async (output, context) => {
441
- if (output.statusCode !== 200 && output.statusCode >= 300) {
442
- return deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommandError(output, context);
443
- }
444
- const contents = map({
445
- $metadata: deserializeMetadata(output),
424
+ }); };
425
+ export var deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
426
+ var contents;
427
+ return __generator(this, function (_a) {
428
+ switch (_a.label) {
429
+ case 0:
430
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
431
+ return [2, deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommandError(output, context)];
432
+ }
433
+ contents = map({
434
+ $metadata: deserializeMetadata(output),
435
+ });
436
+ return [4, collectBody(output.body, context)];
437
+ case 1:
438
+ _a.sent();
439
+ return [2, contents];
440
+ }
446
441
  });
447
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
448
- if (data.nextToken != null) {
449
- contents.nextToken = __expectString(data.nextToken);
450
- }
451
- if (data.slackWorkspaceConfigurations != null) {
452
- contents.slackWorkspaceConfigurations = deserializeAws_restJson1SlackWorkspaceConfigurationList(data.slackWorkspaceConfigurations, context);
453
- }
454
- return contents;
455
- };
456
- const deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommandError = async (output, context) => {
457
- const parsedOutput = {
458
- ...output,
459
- body: await parseErrorBody(output.body, context),
460
- };
461
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
462
- switch (errorCode) {
463
- case "AccessDeniedException":
464
- case "com.amazonaws.supportapp#AccessDeniedException":
465
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
466
- case "InternalServerException":
467
- case "com.amazonaws.supportapp#InternalServerException":
468
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
469
- default:
470
- const parsedBody = parsedOutput.body;
471
- throwDefaultError({
472
- output,
473
- parsedBody,
474
- exceptionCtor: __BaseException,
475
- errorCode,
476
- });
477
- }
478
- };
479
- export const deserializeAws_restJson1PutAccountAliasCommand = async (output, context) => {
480
- if (output.statusCode !== 200 && output.statusCode >= 300) {
481
- return deserializeAws_restJson1PutAccountAliasCommandError(output, context);
482
- }
483
- const contents = map({
484
- $metadata: deserializeMetadata(output),
442
+ }); };
443
+ var deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
444
+ var parsedOutput, _a, errorCode, _b, parsedBody;
445
+ var _c;
446
+ return __generator(this, function (_d) {
447
+ switch (_d.label) {
448
+ case 0:
449
+ _a = [__assign({}, output)];
450
+ _c = {};
451
+ return [4, parseErrorBody(output.body, context)];
452
+ case 1:
453
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
454
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
455
+ _b = errorCode;
456
+ switch (_b) {
457
+ case "AccessDeniedException": return [3, 2];
458
+ case "com.amazonaws.supportapp#AccessDeniedException": return [3, 2];
459
+ case "ConflictException": return [3, 4];
460
+ case "com.amazonaws.supportapp#ConflictException": return [3, 4];
461
+ case "InternalServerException": return [3, 6];
462
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 6];
463
+ case "ResourceNotFoundException": return [3, 8];
464
+ case "com.amazonaws.supportapp#ResourceNotFoundException": return [3, 8];
465
+ case "ValidationException": return [3, 10];
466
+ case "com.amazonaws.supportapp#ValidationException": return [3, 10];
467
+ }
468
+ return [3, 12];
469
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
470
+ case 3: throw _d.sent();
471
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
472
+ case 5: throw _d.sent();
473
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
474
+ case 7: throw _d.sent();
475
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
476
+ case 9: throw _d.sent();
477
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
478
+ case 11: throw _d.sent();
479
+ case 12:
480
+ parsedBody = parsedOutput.body;
481
+ throwDefaultError({
482
+ output: output,
483
+ parsedBody: parsedBody,
484
+ exceptionCtor: __BaseException,
485
+ errorCode: errorCode,
486
+ });
487
+ _d.label = 13;
488
+ case 13: return [2];
489
+ }
485
490
  });
486
- await collectBody(output.body, context);
487
- return contents;
488
- };
489
- const deserializeAws_restJson1PutAccountAliasCommandError = async (output, context) => {
490
- const parsedOutput = {
491
- ...output,
492
- body: await parseErrorBody(output.body, context),
493
- };
494
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
495
- switch (errorCode) {
496
- case "AccessDeniedException":
497
- case "com.amazonaws.supportapp#AccessDeniedException":
498
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
499
- case "InternalServerException":
500
- case "com.amazonaws.supportapp#InternalServerException":
501
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
502
- case "ValidationException":
503
- case "com.amazonaws.supportapp#ValidationException":
504
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
505
- default:
506
- const parsedBody = parsedOutput.body;
507
- throwDefaultError({
508
- output,
509
- parsedBody,
510
- exceptionCtor: __BaseException,
511
- errorCode,
512
- });
513
- }
514
- };
515
- export const deserializeAws_restJson1UpdateSlackChannelConfigurationCommand = async (output, context) => {
516
- if (output.statusCode !== 200 && output.statusCode >= 300) {
517
- return deserializeAws_restJson1UpdateSlackChannelConfigurationCommandError(output, context);
518
- }
519
- const contents = map({
520
- $metadata: deserializeMetadata(output),
491
+ }); };
492
+ export var deserializeAws_restJson1GetAccountAliasCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
493
+ var contents, data, _a, _b;
494
+ return __generator(this, function (_c) {
495
+ switch (_c.label) {
496
+ case 0:
497
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
498
+ return [2, deserializeAws_restJson1GetAccountAliasCommandError(output, context)];
499
+ }
500
+ contents = map({
501
+ $metadata: deserializeMetadata(output),
502
+ });
503
+ _a = __expectNonNull;
504
+ _b = __expectObject;
505
+ return [4, parseBody(output.body, context)];
506
+ case 1:
507
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
508
+ if (data.accountAlias != null) {
509
+ contents.accountAlias = __expectString(data.accountAlias);
510
+ }
511
+ return [2, contents];
512
+ }
521
513
  });
522
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
523
- if (data.channelId != null) {
524
- contents.channelId = __expectString(data.channelId);
525
- }
526
- if (data.channelName != null) {
527
- contents.channelName = __expectString(data.channelName);
528
- }
529
- if (data.channelRoleArn != null) {
530
- contents.channelRoleArn = __expectString(data.channelRoleArn);
531
- }
532
- if (data.notifyOnAddCorrespondenceToCase != null) {
533
- contents.notifyOnAddCorrespondenceToCase = __expectBoolean(data.notifyOnAddCorrespondenceToCase);
534
- }
535
- if (data.notifyOnCaseSeverity != null) {
536
- contents.notifyOnCaseSeverity = __expectString(data.notifyOnCaseSeverity);
537
- }
538
- if (data.notifyOnCreateOrReopenCase != null) {
539
- contents.notifyOnCreateOrReopenCase = __expectBoolean(data.notifyOnCreateOrReopenCase);
540
- }
541
- if (data.notifyOnResolveCase != null) {
542
- contents.notifyOnResolveCase = __expectBoolean(data.notifyOnResolveCase);
543
- }
544
- if (data.teamId != null) {
545
- contents.teamId = __expectString(data.teamId);
546
- }
547
- return contents;
548
- };
549
- const deserializeAws_restJson1UpdateSlackChannelConfigurationCommandError = async (output, context) => {
550
- const parsedOutput = {
551
- ...output,
552
- body: await parseErrorBody(output.body, context),
553
- };
554
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
555
- switch (errorCode) {
556
- case "AccessDeniedException":
557
- case "com.amazonaws.supportapp#AccessDeniedException":
558
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
559
- case "ConflictException":
560
- case "com.amazonaws.supportapp#ConflictException":
561
- throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
562
- case "InternalServerException":
563
- case "com.amazonaws.supportapp#InternalServerException":
564
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
565
- case "ResourceNotFoundException":
566
- case "com.amazonaws.supportapp#ResourceNotFoundException":
567
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
568
- case "ValidationException":
569
- case "com.amazonaws.supportapp#ValidationException":
570
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
571
- default:
572
- const parsedBody = parsedOutput.body;
573
- throwDefaultError({
574
- output,
575
- parsedBody,
576
- exceptionCtor: __BaseException,
577
- errorCode,
578
- });
579
- }
580
- };
581
- const map = __map;
582
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
583
- const contents = map({});
584
- const data = parsedOutput.body;
585
- if (data.message != null) {
586
- contents.message = __expectString(data.message);
587
- }
588
- const exception = new AccessDeniedException({
589
- $metadata: deserializeMetadata(parsedOutput),
590
- ...contents,
514
+ }); };
515
+ var deserializeAws_restJson1GetAccountAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
516
+ var parsedOutput, _a, errorCode, _b, parsedBody;
517
+ var _c;
518
+ return __generator(this, function (_d) {
519
+ switch (_d.label) {
520
+ case 0:
521
+ _a = [__assign({}, output)];
522
+ _c = {};
523
+ return [4, parseErrorBody(output.body, context)];
524
+ case 1:
525
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
526
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
527
+ _b = errorCode;
528
+ switch (_b) {
529
+ case "InternalServerException": return [3, 2];
530
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 2];
531
+ }
532
+ return [3, 4];
533
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
534
+ case 3: throw _d.sent();
535
+ case 4:
536
+ parsedBody = parsedOutput.body;
537
+ throwDefaultError({
538
+ output: output,
539
+ parsedBody: parsedBody,
540
+ exceptionCtor: __BaseException,
541
+ errorCode: errorCode,
542
+ });
543
+ _d.label = 5;
544
+ case 5: return [2];
545
+ }
591
546
  });
592
- return __decorateServiceException(exception, parsedOutput.body);
593
- };
594
- const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
595
- const contents = map({});
596
- const data = parsedOutput.body;
597
- if (data.message != null) {
598
- contents.message = __expectString(data.message);
599
- }
600
- const exception = new ConflictException({
601
- $metadata: deserializeMetadata(parsedOutput),
602
- ...contents,
547
+ }); };
548
+ export var deserializeAws_restJson1ListSlackChannelConfigurationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
549
+ var contents, data, _a, _b;
550
+ return __generator(this, function (_c) {
551
+ switch (_c.label) {
552
+ case 0:
553
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
554
+ return [2, deserializeAws_restJson1ListSlackChannelConfigurationsCommandError(output, context)];
555
+ }
556
+ contents = map({
557
+ $metadata: deserializeMetadata(output),
558
+ });
559
+ _a = __expectNonNull;
560
+ _b = __expectObject;
561
+ return [4, parseBody(output.body, context)];
562
+ case 1:
563
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
564
+ if (data.nextToken != null) {
565
+ contents.nextToken = __expectString(data.nextToken);
566
+ }
567
+ if (data.slackChannelConfigurations != null) {
568
+ contents.slackChannelConfigurations = deserializeAws_restJson1slackChannelConfigurationList(data.slackChannelConfigurations, context);
569
+ }
570
+ return [2, contents];
571
+ }
603
572
  });
604
- return __decorateServiceException(exception, parsedOutput.body);
605
- };
606
- const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
607
- const contents = map({});
608
- const data = parsedOutput.body;
609
- if (data.message != null) {
610
- contents.message = __expectString(data.message);
611
- }
612
- const exception = new InternalServerException({
613
- $metadata: deserializeMetadata(parsedOutput),
614
- ...contents,
573
+ }); };
574
+ var deserializeAws_restJson1ListSlackChannelConfigurationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
575
+ var parsedOutput, _a, errorCode, _b, parsedBody;
576
+ var _c;
577
+ return __generator(this, function (_d) {
578
+ switch (_d.label) {
579
+ case 0:
580
+ _a = [__assign({}, output)];
581
+ _c = {};
582
+ return [4, parseErrorBody(output.body, context)];
583
+ case 1:
584
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
585
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
586
+ _b = errorCode;
587
+ switch (_b) {
588
+ case "AccessDeniedException": return [3, 2];
589
+ case "com.amazonaws.supportapp#AccessDeniedException": return [3, 2];
590
+ case "InternalServerException": return [3, 4];
591
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 4];
592
+ }
593
+ return [3, 6];
594
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
595
+ case 3: throw _d.sent();
596
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
597
+ case 5: throw _d.sent();
598
+ case 6:
599
+ parsedBody = parsedOutput.body;
600
+ throwDefaultError({
601
+ output: output,
602
+ parsedBody: parsedBody,
603
+ exceptionCtor: __BaseException,
604
+ errorCode: errorCode,
605
+ });
606
+ _d.label = 7;
607
+ case 7: return [2];
608
+ }
615
609
  });
616
- return __decorateServiceException(exception, parsedOutput.body);
617
- };
618
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
619
- const contents = map({});
620
- const data = parsedOutput.body;
621
- if (data.message != null) {
622
- contents.message = __expectString(data.message);
623
- }
624
- const exception = new ResourceNotFoundException({
625
- $metadata: deserializeMetadata(parsedOutput),
626
- ...contents,
610
+ }); };
611
+ export var deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
612
+ var contents, data, _a, _b;
613
+ return __generator(this, function (_c) {
614
+ switch (_c.label) {
615
+ case 0:
616
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
617
+ return [2, deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommandError(output, context)];
618
+ }
619
+ contents = map({
620
+ $metadata: deserializeMetadata(output),
621
+ });
622
+ _a = __expectNonNull;
623
+ _b = __expectObject;
624
+ return [4, parseBody(output.body, context)];
625
+ case 1:
626
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
627
+ if (data.nextToken != null) {
628
+ contents.nextToken = __expectString(data.nextToken);
629
+ }
630
+ if (data.slackWorkspaceConfigurations != null) {
631
+ contents.slackWorkspaceConfigurations = deserializeAws_restJson1SlackWorkspaceConfigurationList(data.slackWorkspaceConfigurations, context);
632
+ }
633
+ return [2, contents];
634
+ }
627
635
  });
628
- return __decorateServiceException(exception, parsedOutput.body);
629
- };
630
- const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
631
- const contents = map({});
632
- const data = parsedOutput.body;
633
- if (data.message != null) {
634
- contents.message = __expectString(data.message);
635
- }
636
- const exception = new ServiceQuotaExceededException({
637
- $metadata: deserializeMetadata(parsedOutput),
638
- ...contents,
636
+ }); };
637
+ var deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
638
+ var parsedOutput, _a, errorCode, _b, parsedBody;
639
+ var _c;
640
+ return __generator(this, function (_d) {
641
+ switch (_d.label) {
642
+ case 0:
643
+ _a = [__assign({}, output)];
644
+ _c = {};
645
+ return [4, parseErrorBody(output.body, context)];
646
+ case 1:
647
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
648
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
649
+ _b = errorCode;
650
+ switch (_b) {
651
+ case "AccessDeniedException": return [3, 2];
652
+ case "com.amazonaws.supportapp#AccessDeniedException": return [3, 2];
653
+ case "InternalServerException": return [3, 4];
654
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 4];
655
+ }
656
+ return [3, 6];
657
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
658
+ case 3: throw _d.sent();
659
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
660
+ case 5: throw _d.sent();
661
+ case 6:
662
+ parsedBody = parsedOutput.body;
663
+ throwDefaultError({
664
+ output: output,
665
+ parsedBody: parsedBody,
666
+ exceptionCtor: __BaseException,
667
+ errorCode: errorCode,
668
+ });
669
+ _d.label = 7;
670
+ case 7: return [2];
671
+ }
639
672
  });
640
- return __decorateServiceException(exception, parsedOutput.body);
641
- };
642
- const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
643
- const contents = map({});
644
- const data = parsedOutput.body;
645
- if (data.message != null) {
646
- contents.message = __expectString(data.message);
647
- }
648
- const exception = new ValidationException({
649
- $metadata: deserializeMetadata(parsedOutput),
650
- ...contents,
673
+ }); };
674
+ export var deserializeAws_restJson1PutAccountAliasCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
675
+ var contents;
676
+ return __generator(this, function (_a) {
677
+ switch (_a.label) {
678
+ case 0:
679
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
680
+ return [2, deserializeAws_restJson1PutAccountAliasCommandError(output, context)];
681
+ }
682
+ contents = map({
683
+ $metadata: deserializeMetadata(output),
684
+ });
685
+ return [4, collectBody(output.body, context)];
686
+ case 1:
687
+ _a.sent();
688
+ return [2, contents];
689
+ }
651
690
  });
652
- return __decorateServiceException(exception, parsedOutput.body);
653
- };
654
- const deserializeAws_restJson1SlackChannelConfiguration = (output, context) => {
691
+ }); };
692
+ var deserializeAws_restJson1PutAccountAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
693
+ var parsedOutput, _a, errorCode, _b, parsedBody;
694
+ var _c;
695
+ return __generator(this, function (_d) {
696
+ switch (_d.label) {
697
+ case 0:
698
+ _a = [__assign({}, output)];
699
+ _c = {};
700
+ return [4, parseErrorBody(output.body, context)];
701
+ case 1:
702
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
703
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
704
+ _b = errorCode;
705
+ switch (_b) {
706
+ case "AccessDeniedException": return [3, 2];
707
+ case "com.amazonaws.supportapp#AccessDeniedException": return [3, 2];
708
+ case "InternalServerException": return [3, 4];
709
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 4];
710
+ case "ValidationException": return [3, 6];
711
+ case "com.amazonaws.supportapp#ValidationException": return [3, 6];
712
+ }
713
+ return [3, 8];
714
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
715
+ case 3: throw _d.sent();
716
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
717
+ case 5: throw _d.sent();
718
+ case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
719
+ case 7: throw _d.sent();
720
+ case 8:
721
+ parsedBody = parsedOutput.body;
722
+ throwDefaultError({
723
+ output: output,
724
+ parsedBody: parsedBody,
725
+ exceptionCtor: __BaseException,
726
+ errorCode: errorCode,
727
+ });
728
+ _d.label = 9;
729
+ case 9: return [2];
730
+ }
731
+ });
732
+ }); };
733
+ export var deserializeAws_restJson1UpdateSlackChannelConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
734
+ var contents, data, _a, _b;
735
+ return __generator(this, function (_c) {
736
+ switch (_c.label) {
737
+ case 0:
738
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
739
+ return [2, deserializeAws_restJson1UpdateSlackChannelConfigurationCommandError(output, context)];
740
+ }
741
+ contents = map({
742
+ $metadata: deserializeMetadata(output),
743
+ });
744
+ _a = __expectNonNull;
745
+ _b = __expectObject;
746
+ return [4, parseBody(output.body, context)];
747
+ case 1:
748
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
749
+ if (data.channelId != null) {
750
+ contents.channelId = __expectString(data.channelId);
751
+ }
752
+ if (data.channelName != null) {
753
+ contents.channelName = __expectString(data.channelName);
754
+ }
755
+ if (data.channelRoleArn != null) {
756
+ contents.channelRoleArn = __expectString(data.channelRoleArn);
757
+ }
758
+ if (data.notifyOnAddCorrespondenceToCase != null) {
759
+ contents.notifyOnAddCorrespondenceToCase = __expectBoolean(data.notifyOnAddCorrespondenceToCase);
760
+ }
761
+ if (data.notifyOnCaseSeverity != null) {
762
+ contents.notifyOnCaseSeverity = __expectString(data.notifyOnCaseSeverity);
763
+ }
764
+ if (data.notifyOnCreateOrReopenCase != null) {
765
+ contents.notifyOnCreateOrReopenCase = __expectBoolean(data.notifyOnCreateOrReopenCase);
766
+ }
767
+ if (data.notifyOnResolveCase != null) {
768
+ contents.notifyOnResolveCase = __expectBoolean(data.notifyOnResolveCase);
769
+ }
770
+ if (data.teamId != null) {
771
+ contents.teamId = __expectString(data.teamId);
772
+ }
773
+ return [2, contents];
774
+ }
775
+ });
776
+ }); };
777
+ var deserializeAws_restJson1UpdateSlackChannelConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
778
+ var parsedOutput, _a, errorCode, _b, parsedBody;
779
+ var _c;
780
+ return __generator(this, function (_d) {
781
+ switch (_d.label) {
782
+ case 0:
783
+ _a = [__assign({}, output)];
784
+ _c = {};
785
+ return [4, parseErrorBody(output.body, context)];
786
+ case 1:
787
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
788
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
789
+ _b = errorCode;
790
+ switch (_b) {
791
+ case "AccessDeniedException": return [3, 2];
792
+ case "com.amazonaws.supportapp#AccessDeniedException": return [3, 2];
793
+ case "ConflictException": return [3, 4];
794
+ case "com.amazonaws.supportapp#ConflictException": return [3, 4];
795
+ case "InternalServerException": return [3, 6];
796
+ case "com.amazonaws.supportapp#InternalServerException": return [3, 6];
797
+ case "ResourceNotFoundException": return [3, 8];
798
+ case "com.amazonaws.supportapp#ResourceNotFoundException": return [3, 8];
799
+ case "ValidationException": return [3, 10];
800
+ case "com.amazonaws.supportapp#ValidationException": return [3, 10];
801
+ }
802
+ return [3, 12];
803
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
804
+ case 3: throw _d.sent();
805
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
806
+ case 5: throw _d.sent();
807
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
808
+ case 7: throw _d.sent();
809
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
810
+ case 9: throw _d.sent();
811
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
812
+ case 11: throw _d.sent();
813
+ case 12:
814
+ parsedBody = parsedOutput.body;
815
+ throwDefaultError({
816
+ output: output,
817
+ parsedBody: parsedBody,
818
+ exceptionCtor: __BaseException,
819
+ errorCode: errorCode,
820
+ });
821
+ _d.label = 13;
822
+ case 13: return [2];
823
+ }
824
+ });
825
+ }); };
826
+ var map = __map;
827
+ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
828
+ var contents, data, exception;
829
+ return __generator(this, function (_a) {
830
+ contents = map({});
831
+ data = parsedOutput.body;
832
+ if (data.message != null) {
833
+ contents.message = __expectString(data.message);
834
+ }
835
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
836
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
837
+ });
838
+ }); };
839
+ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
840
+ var contents, data, exception;
841
+ return __generator(this, function (_a) {
842
+ contents = map({});
843
+ data = parsedOutput.body;
844
+ if (data.message != null) {
845
+ contents.message = __expectString(data.message);
846
+ }
847
+ exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
848
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
849
+ });
850
+ }); };
851
+ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
852
+ var contents, data, exception;
853
+ return __generator(this, function (_a) {
854
+ contents = map({});
855
+ data = parsedOutput.body;
856
+ if (data.message != null) {
857
+ contents.message = __expectString(data.message);
858
+ }
859
+ exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
860
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
861
+ });
862
+ }); };
863
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
864
+ var contents, data, exception;
865
+ return __generator(this, function (_a) {
866
+ contents = map({});
867
+ data = parsedOutput.body;
868
+ if (data.message != null) {
869
+ contents.message = __expectString(data.message);
870
+ }
871
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
872
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
873
+ });
874
+ }); };
875
+ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
876
+ var contents, data, exception;
877
+ return __generator(this, function (_a) {
878
+ contents = map({});
879
+ data = parsedOutput.body;
880
+ if (data.message != null) {
881
+ contents.message = __expectString(data.message);
882
+ }
883
+ exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
884
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
885
+ });
886
+ }); };
887
+ var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
888
+ var contents, data, exception;
889
+ return __generator(this, function (_a) {
890
+ contents = map({});
891
+ data = parsedOutput.body;
892
+ if (data.message != null) {
893
+ contents.message = __expectString(data.message);
894
+ }
895
+ exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
896
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
897
+ });
898
+ }); };
899
+ var deserializeAws_restJson1SlackChannelConfiguration = function (output, context) {
655
900
  return {
656
901
  channelId: __expectString(output.channelId),
657
902
  channelName: __expectString(output.channelName),
@@ -663,10 +908,10 @@ const deserializeAws_restJson1SlackChannelConfiguration = (output, context) => {
663
908
  teamId: __expectString(output.teamId),
664
909
  };
665
910
  };
666
- const deserializeAws_restJson1slackChannelConfigurationList = (output, context) => {
667
- const retVal = (output || [])
668
- .filter((e) => e != null)
669
- .map((entry) => {
911
+ var deserializeAws_restJson1slackChannelConfigurationList = function (output, context) {
912
+ var retVal = (output || [])
913
+ .filter(function (e) { return e != null; })
914
+ .map(function (entry) {
670
915
  if (entry === null) {
671
916
  return null;
672
917
  }
@@ -674,15 +919,15 @@ const deserializeAws_restJson1slackChannelConfigurationList = (output, context)
674
919
  });
675
920
  return retVal;
676
921
  };
677
- const deserializeAws_restJson1SlackWorkspaceConfiguration = (output, context) => {
922
+ var deserializeAws_restJson1SlackWorkspaceConfiguration = function (output, context) {
678
923
  return {
679
924
  teamId: __expectString(output.teamId),
680
925
  };
681
926
  };
682
- const deserializeAws_restJson1SlackWorkspaceConfigurationList = (output, context) => {
683
- const retVal = (output || [])
684
- .filter((e) => e != null)
685
- .map((entry) => {
927
+ var deserializeAws_restJson1SlackWorkspaceConfigurationList = function (output, context) {
928
+ var retVal = (output || [])
929
+ .filter(function (e) { return e != null; })
930
+ .map(function (entry) {
686
931
  if (entry === null) {
687
932
  return null;
688
933
  }
@@ -690,39 +935,57 @@ const deserializeAws_restJson1SlackWorkspaceConfigurationList = (output, context
690
935
  });
691
936
  return retVal;
692
937
  };
693
- const deserializeMetadata = (output) => ({
694
- httpStatusCode: output.statusCode,
695
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
696
- extendedRequestId: output.headers["x-amz-id-2"],
697
- cfId: output.headers["x-amz-cf-id"],
698
- });
699
- const collectBody = (streamBody = new Uint8Array(), context) => {
938
+ var deserializeMetadata = function (output) {
939
+ var _a, _b;
940
+ return ({
941
+ httpStatusCode: output.statusCode,
942
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
943
+ extendedRequestId: output.headers["x-amz-id-2"],
944
+ cfId: output.headers["x-amz-cf-id"],
945
+ });
946
+ };
947
+ var collectBody = function (streamBody, context) {
948
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
700
949
  if (streamBody instanceof Uint8Array) {
701
950
  return Promise.resolve(streamBody);
702
951
  }
703
952
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
704
953
  };
705
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
706
- const isSerializableHeaderValue = (value) => value !== undefined &&
707
- value !== null &&
708
- value !== "" &&
709
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
710
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
711
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
712
- if (encoded.length) {
713
- return JSON.parse(encoded);
714
- }
715
- return {};
716
- });
717
- const parseErrorBody = async (errorBody, context) => {
718
- const value = await parseBody(errorBody, context);
719
- value.message = value.message ?? value.Message;
720
- return value;
954
+ var collectBodyString = function (streamBody, context) {
955
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
721
956
  };
722
- const loadRestJsonErrorCode = (output, data) => {
723
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
724
- const sanitizeErrorCode = (rawValue) => {
725
- let cleanValue = rawValue;
957
+ var isSerializableHeaderValue = function (value) {
958
+ return value !== undefined &&
959
+ value !== null &&
960
+ value !== "" &&
961
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
962
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
963
+ };
964
+ var parseBody = function (streamBody, context) {
965
+ return collectBodyString(streamBody, context).then(function (encoded) {
966
+ if (encoded.length) {
967
+ return JSON.parse(encoded);
968
+ }
969
+ return {};
970
+ });
971
+ };
972
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
973
+ var value;
974
+ var _a;
975
+ return __generator(this, function (_b) {
976
+ switch (_b.label) {
977
+ case 0: return [4, parseBody(errorBody, context)];
978
+ case 1:
979
+ value = _b.sent();
980
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
981
+ return [2, value];
982
+ }
983
+ });
984
+ }); };
985
+ var loadRestJsonErrorCode = function (output, data) {
986
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
987
+ var sanitizeErrorCode = function (rawValue) {
988
+ var cleanValue = rawValue;
726
989
  if (typeof cleanValue === "number") {
727
990
  cleanValue = cleanValue.toString();
728
991
  }
@@ -737,7 +1000,7 @@ const loadRestJsonErrorCode = (output, data) => {
737
1000
  }
738
1001
  return cleanValue;
739
1002
  };
740
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1003
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
741
1004
  if (headerKey !== undefined) {
742
1005
  return sanitizeErrorCode(output.headers[headerKey]);
743
1006
  }