@aws-sdk/client-support 3.181.0 → 3.183.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/Support.js +58 -65
  3. package/dist-es/SupportClient.js +22 -28
  4. package/dist-es/commands/AddAttachmentsToSetCommand.js +21 -28
  5. package/dist-es/commands/AddCommunicationToCaseCommand.js +21 -28
  6. package/dist-es/commands/CreateCaseCommand.js +21 -28
  7. package/dist-es/commands/DescribeAttachmentCommand.js +21 -28
  8. package/dist-es/commands/DescribeCasesCommand.js +21 -28
  9. package/dist-es/commands/DescribeCommunicationsCommand.js +21 -28
  10. package/dist-es/commands/DescribeServicesCommand.js +21 -28
  11. package/dist-es/commands/DescribeSeverityLevelsCommand.js +21 -28
  12. package/dist-es/commands/DescribeTrustedAdvisorCheckRefreshStatusesCommand.js +21 -28
  13. package/dist-es/commands/DescribeTrustedAdvisorCheckResultCommand.js +21 -28
  14. package/dist-es/commands/DescribeTrustedAdvisorCheckSummariesCommand.js +21 -28
  15. package/dist-es/commands/DescribeTrustedAdvisorChecksCommand.js +21 -28
  16. package/dist-es/commands/RefreshTrustedAdvisorCheckCommand.js +21 -28
  17. package/dist-es/commands/ResolveCaseCommand.js +21 -28
  18. package/dist-es/endpoints.js +8 -8
  19. package/dist-es/models/SupportServiceException.js +5 -10
  20. package/dist-es/models/models_0.js +231 -144
  21. package/dist-es/pagination/DescribeCasesPaginator.js +25 -68
  22. package/dist-es/pagination/DescribeCommunicationsPaginator.js +25 -68
  23. package/dist-es/protocols/Aws_json1_1.js +950 -1212
  24. package/dist-es/runtimeConfig.browser.js +26 -12
  25. package/dist-es/runtimeConfig.js +30 -12
  26. package/dist-es/runtimeConfig.native.js +8 -5
  27. package/dist-es/runtimeConfig.shared.js +8 -11
  28. package/package.json +33 -33
@@ -1,1140 +1,901 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectString as __expectString, limitedParseDouble as __limitedParseDouble, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { AttachmentIdNotFound, AttachmentLimitExceeded, AttachmentSetExpired, AttachmentSetIdNotFound, AttachmentSetSizeLimitExceeded, CaseCreationLimitExceeded, CaseIdNotFound, DescribeAttachmentLimitExceeded, InternalServerError, } from "../models/models_0";
5
4
  import { SupportServiceException as __BaseException } from "../models/SupportServiceException";
6
- export var serializeAws_json1_1AddAttachmentsToSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var headers, body;
8
- return __generator(this, function (_a) {
9
- headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "AWSSupport_20130415.AddAttachmentsToSet",
12
- };
13
- body = JSON.stringify(serializeAws_json1_1AddAttachmentsToSetRequest(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_1AddCommunicationToCaseCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
- var headers, body;
19
- return __generator(this, function (_a) {
20
- headers = {
21
- "content-type": "application/x-amz-json-1.1",
22
- "x-amz-target": "AWSSupport_20130415.AddCommunicationToCase",
23
- };
24
- body = JSON.stringify(serializeAws_json1_1AddCommunicationToCaseRequest(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_1CreateCaseCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var headers, body;
30
- return __generator(this, function (_a) {
31
- headers = {
32
- "content-type": "application/x-amz-json-1.1",
33
- "x-amz-target": "AWSSupport_20130415.CreateCase",
34
- };
35
- body = JSON.stringify(serializeAws_json1_1CreateCaseRequest(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var serializeAws_json1_1DescribeAttachmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
40
- var headers, body;
41
- return __generator(this, function (_a) {
42
- headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "AWSSupport_20130415.DescribeAttachment",
45
- };
46
- body = JSON.stringify(serializeAws_json1_1DescribeAttachmentRequest(input, context));
47
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
- });
49
- }); };
50
- export var serializeAws_json1_1DescribeCasesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
- var headers, body;
52
- return __generator(this, function (_a) {
53
- headers = {
54
- "content-type": "application/x-amz-json-1.1",
55
- "x-amz-target": "AWSSupport_20130415.DescribeCases",
56
- };
57
- body = JSON.stringify(serializeAws_json1_1DescribeCasesRequest(input, context));
58
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
- });
60
- }); };
61
- export var serializeAws_json1_1DescribeCommunicationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
62
- var headers, body;
63
- return __generator(this, function (_a) {
64
- headers = {
65
- "content-type": "application/x-amz-json-1.1",
66
- "x-amz-target": "AWSSupport_20130415.DescribeCommunications",
67
- };
68
- body = JSON.stringify(serializeAws_json1_1DescribeCommunicationsRequest(input, context));
69
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
- });
71
- }); };
72
- export var serializeAws_json1_1DescribeServicesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
73
- var headers, body;
74
- return __generator(this, function (_a) {
75
- headers = {
76
- "content-type": "application/x-amz-json-1.1",
77
- "x-amz-target": "AWSSupport_20130415.DescribeServices",
78
- };
79
- body = JSON.stringify(serializeAws_json1_1DescribeServicesRequest(input, context));
80
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
81
- });
82
- }); };
83
- export var serializeAws_json1_1DescribeSeverityLevelsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
84
- var headers, body;
85
- return __generator(this, function (_a) {
86
- headers = {
87
- "content-type": "application/x-amz-json-1.1",
88
- "x-amz-target": "AWSSupport_20130415.DescribeSeverityLevels",
89
- };
90
- body = JSON.stringify(serializeAws_json1_1DescribeSeverityLevelsRequest(input, context));
91
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
92
- });
93
- }); };
94
- export var serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
95
- var headers, body;
96
- return __generator(this, function (_a) {
97
- headers = {
98
- "content-type": "application/x-amz-json-1.1",
99
- "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckRefreshStatuses",
100
- };
101
- body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest(input, context));
102
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
103
- });
104
- }); };
105
- export var serializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
106
- var headers, body;
107
- return __generator(this, function (_a) {
108
- headers = {
109
- "content-type": "application/x-amz-json-1.1",
110
- "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckResult",
111
- };
112
- body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest(input, context));
113
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
114
- });
115
- }); };
116
- export var serializeAws_json1_1DescribeTrustedAdvisorChecksCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
117
- var headers, body;
118
- return __generator(this, function (_a) {
119
- headers = {
120
- "content-type": "application/x-amz-json-1.1",
121
- "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorChecks",
122
- };
123
- body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorChecksRequest(input, context));
124
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
125
- });
126
- }); };
127
- export var serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
128
- var headers, body;
129
- return __generator(this, function (_a) {
130
- headers = {
131
- "content-type": "application/x-amz-json-1.1",
132
- "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckSummaries",
133
- };
134
- body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest(input, context));
135
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
136
- });
137
- }); };
138
- export var serializeAws_json1_1RefreshTrustedAdvisorCheckCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
139
- var headers, body;
140
- return __generator(this, function (_a) {
141
- headers = {
142
- "content-type": "application/x-amz-json-1.1",
143
- "x-amz-target": "AWSSupport_20130415.RefreshTrustedAdvisorCheck",
144
- };
145
- body = JSON.stringify(serializeAws_json1_1RefreshTrustedAdvisorCheckRequest(input, context));
146
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
147
- });
148
- }); };
149
- export var serializeAws_json1_1ResolveCaseCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
150
- var headers, body;
151
- return __generator(this, function (_a) {
152
- headers = {
153
- "content-type": "application/x-amz-json-1.1",
154
- "x-amz-target": "AWSSupport_20130415.ResolveCase",
155
- };
156
- body = JSON.stringify(serializeAws_json1_1ResolveCaseRequest(input, context));
157
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
158
- });
159
- }); };
160
- export var deserializeAws_json1_1AddAttachmentsToSetCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
161
- var data, contents, response;
162
- return __generator(this, function (_a) {
163
- switch (_a.label) {
164
- case 0:
165
- if (output.statusCode >= 300) {
166
- return [2, deserializeAws_json1_1AddAttachmentsToSetCommandError(output, context)];
167
- }
168
- return [4, parseBody(output.body, context)];
169
- case 1:
170
- data = _a.sent();
171
- contents = {};
172
- contents = deserializeAws_json1_1AddAttachmentsToSetResponse(data, context);
173
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
174
- return [2, Promise.resolve(response)];
175
- }
176
- });
177
- }); };
178
- var deserializeAws_json1_1AddAttachmentsToSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
179
- var parsedOutput, _a, errorCode, _b, parsedBody;
180
- var _c;
181
- return __generator(this, function (_d) {
182
- switch (_d.label) {
183
- case 0:
184
- _a = [__assign({}, output)];
185
- _c = {};
186
- return [4, parseErrorBody(output.body, context)];
187
- case 1:
188
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
189
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
190
- _b = errorCode;
191
- switch (_b) {
192
- case "AttachmentLimitExceeded": return [3, 2];
193
- case "com.amazonaws.support#AttachmentLimitExceeded": return [3, 2];
194
- case "AttachmentSetExpired": return [3, 4];
195
- case "com.amazonaws.support#AttachmentSetExpired": return [3, 4];
196
- case "AttachmentSetIdNotFound": return [3, 6];
197
- case "com.amazonaws.support#AttachmentSetIdNotFound": return [3, 6];
198
- case "AttachmentSetSizeLimitExceeded": return [3, 8];
199
- case "com.amazonaws.support#AttachmentSetSizeLimitExceeded": return [3, 8];
200
- case "InternalServerError": return [3, 10];
201
- case "com.amazonaws.support#InternalServerError": return [3, 10];
202
- }
203
- return [3, 12];
204
- case 2: return [4, deserializeAws_json1_1AttachmentLimitExceededResponse(parsedOutput, context)];
205
- case 3: throw _d.sent();
206
- case 4: return [4, deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context)];
207
- case 5: throw _d.sent();
208
- case 6: return [4, deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context)];
209
- case 7: throw _d.sent();
210
- case 8: return [4, deserializeAws_json1_1AttachmentSetSizeLimitExceededResponse(parsedOutput, context)];
211
- case 9: throw _d.sent();
212
- case 10: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
213
- case 11: throw _d.sent();
214
- case 12:
215
- parsedBody = parsedOutput.body;
216
- throwDefaultError({
217
- output: output,
218
- parsedBody: parsedBody,
219
- exceptionCtor: __BaseException,
220
- errorCode: errorCode,
221
- });
222
- _d.label = 13;
223
- case 13: return [2];
224
- }
225
- });
226
- }); };
227
- export var deserializeAws_json1_1AddCommunicationToCaseCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
228
- var data, contents, response;
229
- return __generator(this, function (_a) {
230
- switch (_a.label) {
231
- case 0:
232
- if (output.statusCode >= 300) {
233
- return [2, deserializeAws_json1_1AddCommunicationToCaseCommandError(output, context)];
234
- }
235
- return [4, parseBody(output.body, context)];
236
- case 1:
237
- data = _a.sent();
238
- contents = {};
239
- contents = deserializeAws_json1_1AddCommunicationToCaseResponse(data, context);
240
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
241
- return [2, Promise.resolve(response)];
242
- }
243
- });
244
- }); };
245
- var deserializeAws_json1_1AddCommunicationToCaseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
246
- var parsedOutput, _a, errorCode, _b, parsedBody;
247
- var _c;
248
- return __generator(this, function (_d) {
249
- switch (_d.label) {
250
- case 0:
251
- _a = [__assign({}, output)];
252
- _c = {};
253
- return [4, parseErrorBody(output.body, context)];
254
- case 1:
255
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
256
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
257
- _b = errorCode;
258
- switch (_b) {
259
- case "AttachmentSetExpired": return [3, 2];
260
- case "com.amazonaws.support#AttachmentSetExpired": return [3, 2];
261
- case "AttachmentSetIdNotFound": return [3, 4];
262
- case "com.amazonaws.support#AttachmentSetIdNotFound": return [3, 4];
263
- case "CaseIdNotFound": return [3, 6];
264
- case "com.amazonaws.support#CaseIdNotFound": return [3, 6];
265
- case "InternalServerError": return [3, 8];
266
- case "com.amazonaws.support#InternalServerError": return [3, 8];
267
- }
268
- return [3, 10];
269
- case 2: return [4, deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context)];
270
- case 3: throw _d.sent();
271
- case 4: return [4, deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context)];
272
- case 5: throw _d.sent();
273
- case 6: return [4, deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context)];
274
- case 7: throw _d.sent();
275
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
276
- case 9: throw _d.sent();
277
- case 10:
278
- parsedBody = parsedOutput.body;
279
- throwDefaultError({
280
- output: output,
281
- parsedBody: parsedBody,
282
- exceptionCtor: __BaseException,
283
- errorCode: errorCode,
284
- });
285
- _d.label = 11;
286
- case 11: return [2];
287
- }
288
- });
289
- }); };
290
- export var deserializeAws_json1_1CreateCaseCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
291
- var data, contents, response;
292
- return __generator(this, function (_a) {
293
- switch (_a.label) {
294
- case 0:
295
- if (output.statusCode >= 300) {
296
- return [2, deserializeAws_json1_1CreateCaseCommandError(output, context)];
297
- }
298
- return [4, parseBody(output.body, context)];
299
- case 1:
300
- data = _a.sent();
301
- contents = {};
302
- contents = deserializeAws_json1_1CreateCaseResponse(data, context);
303
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
304
- return [2, Promise.resolve(response)];
305
- }
306
- });
307
- }); };
308
- var deserializeAws_json1_1CreateCaseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
309
- var parsedOutput, _a, errorCode, _b, parsedBody;
310
- var _c;
311
- return __generator(this, function (_d) {
312
- switch (_d.label) {
313
- case 0:
314
- _a = [__assign({}, output)];
315
- _c = {};
316
- return [4, parseErrorBody(output.body, context)];
317
- case 1:
318
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
319
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
320
- _b = errorCode;
321
- switch (_b) {
322
- case "AttachmentSetExpired": return [3, 2];
323
- case "com.amazonaws.support#AttachmentSetExpired": return [3, 2];
324
- case "AttachmentSetIdNotFound": return [3, 4];
325
- case "com.amazonaws.support#AttachmentSetIdNotFound": return [3, 4];
326
- case "CaseCreationLimitExceeded": return [3, 6];
327
- case "com.amazonaws.support#CaseCreationLimitExceeded": return [3, 6];
328
- case "InternalServerError": return [3, 8];
329
- case "com.amazonaws.support#InternalServerError": return [3, 8];
330
- }
331
- return [3, 10];
332
- case 2: return [4, deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context)];
333
- case 3: throw _d.sent();
334
- case 4: return [4, deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context)];
335
- case 5: throw _d.sent();
336
- case 6: return [4, deserializeAws_json1_1CaseCreationLimitExceededResponse(parsedOutput, context)];
337
- case 7: throw _d.sent();
338
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
339
- case 9: throw _d.sent();
340
- case 10:
341
- parsedBody = parsedOutput.body;
342
- throwDefaultError({
343
- output: output,
344
- parsedBody: parsedBody,
345
- exceptionCtor: __BaseException,
346
- errorCode: errorCode,
347
- });
348
- _d.label = 11;
349
- case 11: return [2];
350
- }
351
- });
352
- }); };
353
- export var deserializeAws_json1_1DescribeAttachmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
354
- var data, contents, response;
355
- return __generator(this, function (_a) {
356
- switch (_a.label) {
357
- case 0:
358
- if (output.statusCode >= 300) {
359
- return [2, deserializeAws_json1_1DescribeAttachmentCommandError(output, context)];
360
- }
361
- return [4, parseBody(output.body, context)];
362
- case 1:
363
- data = _a.sent();
364
- contents = {};
365
- contents = deserializeAws_json1_1DescribeAttachmentResponse(data, context);
366
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
367
- return [2, Promise.resolve(response)];
368
- }
369
- });
370
- }); };
371
- var deserializeAws_json1_1DescribeAttachmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
372
- var parsedOutput, _a, errorCode, _b, parsedBody;
373
- var _c;
374
- return __generator(this, function (_d) {
375
- switch (_d.label) {
376
- case 0:
377
- _a = [__assign({}, output)];
378
- _c = {};
379
- return [4, parseErrorBody(output.body, context)];
380
- case 1:
381
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
382
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
383
- _b = errorCode;
384
- switch (_b) {
385
- case "AttachmentIdNotFound": return [3, 2];
386
- case "com.amazonaws.support#AttachmentIdNotFound": return [3, 2];
387
- case "DescribeAttachmentLimitExceeded": return [3, 4];
388
- case "com.amazonaws.support#DescribeAttachmentLimitExceeded": return [3, 4];
389
- case "InternalServerError": return [3, 6];
390
- case "com.amazonaws.support#InternalServerError": return [3, 6];
391
- }
392
- return [3, 8];
393
- case 2: return [4, deserializeAws_json1_1AttachmentIdNotFoundResponse(parsedOutput, context)];
394
- case 3: throw _d.sent();
395
- case 4: return [4, deserializeAws_json1_1DescribeAttachmentLimitExceededResponse(parsedOutput, context)];
396
- case 5: throw _d.sent();
397
- case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
398
- case 7: throw _d.sent();
399
- case 8:
400
- parsedBody = parsedOutput.body;
401
- throwDefaultError({
402
- output: output,
403
- parsedBody: parsedBody,
404
- exceptionCtor: __BaseException,
405
- errorCode: errorCode,
406
- });
407
- _d.label = 9;
408
- case 9: return [2];
409
- }
410
- });
411
- }); };
412
- export var deserializeAws_json1_1DescribeCasesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
413
- var data, contents, response;
414
- return __generator(this, function (_a) {
415
- switch (_a.label) {
416
- case 0:
417
- if (output.statusCode >= 300) {
418
- return [2, deserializeAws_json1_1DescribeCasesCommandError(output, context)];
419
- }
420
- return [4, parseBody(output.body, context)];
421
- case 1:
422
- data = _a.sent();
423
- contents = {};
424
- contents = deserializeAws_json1_1DescribeCasesResponse(data, context);
425
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
426
- return [2, Promise.resolve(response)];
427
- }
428
- });
429
- }); };
430
- var deserializeAws_json1_1DescribeCasesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
431
- var parsedOutput, _a, errorCode, _b, parsedBody;
432
- var _c;
433
- return __generator(this, function (_d) {
434
- switch (_d.label) {
435
- case 0:
436
- _a = [__assign({}, output)];
437
- _c = {};
438
- return [4, parseErrorBody(output.body, context)];
439
- case 1:
440
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
441
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
442
- _b = errorCode;
443
- switch (_b) {
444
- case "CaseIdNotFound": return [3, 2];
445
- case "com.amazonaws.support#CaseIdNotFound": return [3, 2];
446
- case "InternalServerError": return [3, 4];
447
- case "com.amazonaws.support#InternalServerError": return [3, 4];
448
- }
449
- return [3, 6];
450
- case 2: return [4, deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context)];
451
- case 3: throw _d.sent();
452
- case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
453
- case 5: throw _d.sent();
454
- case 6:
455
- parsedBody = parsedOutput.body;
456
- throwDefaultError({
457
- output: output,
458
- parsedBody: parsedBody,
459
- exceptionCtor: __BaseException,
460
- errorCode: errorCode,
461
- });
462
- _d.label = 7;
463
- case 7: return [2];
464
- }
465
- });
466
- }); };
467
- export var deserializeAws_json1_1DescribeCommunicationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
468
- var data, contents, response;
469
- return __generator(this, function (_a) {
470
- switch (_a.label) {
471
- case 0:
472
- if (output.statusCode >= 300) {
473
- return [2, deserializeAws_json1_1DescribeCommunicationsCommandError(output, context)];
474
- }
475
- return [4, parseBody(output.body, context)];
476
- case 1:
477
- data = _a.sent();
478
- contents = {};
479
- contents = deserializeAws_json1_1DescribeCommunicationsResponse(data, context);
480
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
481
- return [2, Promise.resolve(response)];
482
- }
483
- });
484
- }); };
485
- var deserializeAws_json1_1DescribeCommunicationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
486
- var parsedOutput, _a, errorCode, _b, parsedBody;
487
- var _c;
488
- return __generator(this, function (_d) {
489
- switch (_d.label) {
490
- case 0:
491
- _a = [__assign({}, output)];
492
- _c = {};
493
- return [4, parseErrorBody(output.body, context)];
494
- case 1:
495
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
496
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
497
- _b = errorCode;
498
- switch (_b) {
499
- case "CaseIdNotFound": return [3, 2];
500
- case "com.amazonaws.support#CaseIdNotFound": return [3, 2];
501
- case "InternalServerError": return [3, 4];
502
- case "com.amazonaws.support#InternalServerError": return [3, 4];
503
- }
504
- return [3, 6];
505
- case 2: return [4, deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context)];
506
- case 3: throw _d.sent();
507
- case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
508
- case 5: throw _d.sent();
509
- case 6:
510
- parsedBody = parsedOutput.body;
511
- throwDefaultError({
512
- output: output,
513
- parsedBody: parsedBody,
514
- exceptionCtor: __BaseException,
515
- errorCode: errorCode,
516
- });
517
- _d.label = 7;
518
- case 7: return [2];
519
- }
520
- });
521
- }); };
522
- export var deserializeAws_json1_1DescribeServicesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
523
- var data, contents, response;
524
- return __generator(this, function (_a) {
525
- switch (_a.label) {
526
- case 0:
527
- if (output.statusCode >= 300) {
528
- return [2, deserializeAws_json1_1DescribeServicesCommandError(output, context)];
529
- }
530
- return [4, parseBody(output.body, context)];
531
- case 1:
532
- data = _a.sent();
533
- contents = {};
534
- contents = deserializeAws_json1_1DescribeServicesResponse(data, context);
535
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
536
- return [2, Promise.resolve(response)];
537
- }
538
- });
539
- }); };
540
- var deserializeAws_json1_1DescribeServicesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
541
- var parsedOutput, _a, errorCode, _b, parsedBody;
542
- var _c;
543
- return __generator(this, function (_d) {
544
- switch (_d.label) {
545
- case 0:
546
- _a = [__assign({}, output)];
547
- _c = {};
548
- return [4, parseErrorBody(output.body, context)];
549
- case 1:
550
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
551
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
552
- _b = errorCode;
553
- switch (_b) {
554
- case "InternalServerError": return [3, 2];
555
- case "com.amazonaws.support#InternalServerError": return [3, 2];
556
- }
557
- return [3, 4];
558
- case 2: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
559
- case 3: throw _d.sent();
560
- case 4:
561
- parsedBody = parsedOutput.body;
562
- throwDefaultError({
563
- output: output,
564
- parsedBody: parsedBody,
565
- exceptionCtor: __BaseException,
566
- errorCode: errorCode,
567
- });
568
- _d.label = 5;
569
- case 5: return [2];
570
- }
571
- });
572
- }); };
573
- export var deserializeAws_json1_1DescribeSeverityLevelsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
574
- var data, contents, response;
575
- return __generator(this, function (_a) {
576
- switch (_a.label) {
577
- case 0:
578
- if (output.statusCode >= 300) {
579
- return [2, deserializeAws_json1_1DescribeSeverityLevelsCommandError(output, context)];
580
- }
581
- return [4, parseBody(output.body, context)];
582
- case 1:
583
- data = _a.sent();
584
- contents = {};
585
- contents = deserializeAws_json1_1DescribeSeverityLevelsResponse(data, context);
586
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
587
- return [2, Promise.resolve(response)];
588
- }
589
- });
590
- }); };
591
- var deserializeAws_json1_1DescribeSeverityLevelsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
592
- var parsedOutput, _a, errorCode, _b, parsedBody;
593
- var _c;
594
- return __generator(this, function (_d) {
595
- switch (_d.label) {
596
- case 0:
597
- _a = [__assign({}, output)];
598
- _c = {};
599
- return [4, parseErrorBody(output.body, context)];
600
- case 1:
601
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
602
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
603
- _b = errorCode;
604
- switch (_b) {
605
- case "InternalServerError": return [3, 2];
606
- case "com.amazonaws.support#InternalServerError": return [3, 2];
607
- }
608
- return [3, 4];
609
- case 2: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
610
- case 3: throw _d.sent();
611
- case 4:
612
- parsedBody = parsedOutput.body;
613
- throwDefaultError({
614
- output: output,
615
- parsedBody: parsedBody,
616
- exceptionCtor: __BaseException,
617
- errorCode: errorCode,
618
- });
619
- _d.label = 5;
620
- case 5: return [2];
621
- }
622
- });
623
- }); };
624
- export var deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
625
- var data, contents, response;
626
- return __generator(this, function (_a) {
627
- switch (_a.label) {
628
- case 0:
629
- if (output.statusCode >= 300) {
630
- return [2, deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommandError(output, context)];
631
- }
632
- return [4, parseBody(output.body, context)];
633
- case 1:
634
- data = _a.sent();
635
- contents = {};
636
- contents = deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesResponse(data, context);
637
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
638
- return [2, Promise.resolve(response)];
639
- }
640
- });
641
- }); };
642
- var deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
643
- var parsedOutput, _a, errorCode, _b, parsedBody;
644
- var _c;
645
- return __generator(this, function (_d) {
646
- switch (_d.label) {
647
- case 0:
648
- _a = [__assign({}, output)];
649
- _c = {};
650
- return [4, parseErrorBody(output.body, context)];
651
- case 1:
652
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
653
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
654
- _b = errorCode;
655
- switch (_b) {
656
- case "InternalServerError": return [3, 2];
657
- case "com.amazonaws.support#InternalServerError": return [3, 2];
658
- }
659
- return [3, 4];
660
- case 2: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
661
- case 3: throw _d.sent();
662
- case 4:
663
- parsedBody = parsedOutput.body;
664
- throwDefaultError({
665
- output: output,
666
- parsedBody: parsedBody,
667
- exceptionCtor: __BaseException,
668
- errorCode: errorCode,
669
- });
670
- _d.label = 5;
671
- case 5: return [2];
672
- }
673
- });
674
- }); };
675
- export var deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
676
- var data, contents, response;
677
- return __generator(this, function (_a) {
678
- switch (_a.label) {
679
- case 0:
680
- if (output.statusCode >= 300) {
681
- return [2, deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommandError(output, context)];
682
- }
683
- return [4, parseBody(output.body, context)];
684
- case 1:
685
- data = _a.sent();
686
- contents = {};
687
- contents = deserializeAws_json1_1DescribeTrustedAdvisorCheckResultResponse(data, context);
688
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
689
- return [2, Promise.resolve(response)];
690
- }
691
- });
692
- }); };
693
- var deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
694
- var parsedOutput, _a, errorCode, _b, parsedBody;
695
- var _c;
696
- return __generator(this, function (_d) {
697
- switch (_d.label) {
698
- case 0:
699
- _a = [__assign({}, output)];
700
- _c = {};
701
- return [4, parseErrorBody(output.body, context)];
702
- case 1:
703
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
704
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
705
- _b = errorCode;
706
- switch (_b) {
707
- case "InternalServerError": return [3, 2];
708
- case "com.amazonaws.support#InternalServerError": return [3, 2];
709
- }
710
- return [3, 4];
711
- case 2: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
712
- case 3: throw _d.sent();
713
- case 4:
714
- parsedBody = parsedOutput.body;
715
- throwDefaultError({
716
- output: output,
717
- parsedBody: parsedBody,
718
- exceptionCtor: __BaseException,
719
- errorCode: errorCode,
720
- });
721
- _d.label = 5;
722
- case 5: return [2];
723
- }
724
- });
725
- }); };
726
- export var deserializeAws_json1_1DescribeTrustedAdvisorChecksCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
727
- var data, contents, response;
728
- return __generator(this, function (_a) {
729
- switch (_a.label) {
730
- case 0:
731
- if (output.statusCode >= 300) {
732
- return [2, deserializeAws_json1_1DescribeTrustedAdvisorChecksCommandError(output, context)];
733
- }
734
- return [4, parseBody(output.body, context)];
735
- case 1:
736
- data = _a.sent();
737
- contents = {};
738
- contents = deserializeAws_json1_1DescribeTrustedAdvisorChecksResponse(data, context);
739
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
740
- return [2, Promise.resolve(response)];
741
- }
742
- });
743
- }); };
744
- var deserializeAws_json1_1DescribeTrustedAdvisorChecksCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
745
- var parsedOutput, _a, errorCode, _b, parsedBody;
746
- var _c;
747
- return __generator(this, function (_d) {
748
- switch (_d.label) {
749
- case 0:
750
- _a = [__assign({}, output)];
751
- _c = {};
752
- return [4, parseErrorBody(output.body, context)];
753
- case 1:
754
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
755
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
756
- _b = errorCode;
757
- switch (_b) {
758
- case "InternalServerError": return [3, 2];
759
- case "com.amazonaws.support#InternalServerError": return [3, 2];
760
- }
761
- return [3, 4];
762
- case 2: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
763
- case 3: throw _d.sent();
764
- case 4:
765
- parsedBody = parsedOutput.body;
766
- throwDefaultError({
767
- output: output,
768
- parsedBody: parsedBody,
769
- exceptionCtor: __BaseException,
770
- errorCode: errorCode,
771
- });
772
- _d.label = 5;
773
- case 5: return [2];
774
- }
775
- });
776
- }); };
777
- export var deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
778
- var data, contents, response;
779
- return __generator(this, function (_a) {
780
- switch (_a.label) {
781
- case 0:
782
- if (output.statusCode >= 300) {
783
- return [2, deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommandError(output, context)];
784
- }
785
- return [4, parseBody(output.body, context)];
786
- case 1:
787
- data = _a.sent();
788
- contents = {};
789
- contents = deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesResponse(data, context);
790
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
791
- return [2, Promise.resolve(response)];
792
- }
793
- });
794
- }); };
795
- var deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
796
- var parsedOutput, _a, errorCode, _b, parsedBody;
797
- var _c;
798
- return __generator(this, function (_d) {
799
- switch (_d.label) {
800
- case 0:
801
- _a = [__assign({}, output)];
802
- _c = {};
803
- return [4, parseErrorBody(output.body, context)];
804
- case 1:
805
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
806
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
807
- _b = errorCode;
808
- switch (_b) {
809
- case "InternalServerError": return [3, 2];
810
- case "com.amazonaws.support#InternalServerError": return [3, 2];
811
- }
812
- return [3, 4];
813
- case 2: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
814
- case 3: throw _d.sent();
815
- case 4:
816
- parsedBody = parsedOutput.body;
817
- throwDefaultError({
818
- output: output,
819
- parsedBody: parsedBody,
820
- exceptionCtor: __BaseException,
821
- errorCode: errorCode,
822
- });
823
- _d.label = 5;
824
- case 5: return [2];
825
- }
826
- });
827
- }); };
828
- export var deserializeAws_json1_1RefreshTrustedAdvisorCheckCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
829
- var data, contents, response;
830
- return __generator(this, function (_a) {
831
- switch (_a.label) {
832
- case 0:
833
- if (output.statusCode >= 300) {
834
- return [2, deserializeAws_json1_1RefreshTrustedAdvisorCheckCommandError(output, context)];
835
- }
836
- return [4, parseBody(output.body, context)];
837
- case 1:
838
- data = _a.sent();
839
- contents = {};
840
- contents = deserializeAws_json1_1RefreshTrustedAdvisorCheckResponse(data, context);
841
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
842
- return [2, Promise.resolve(response)];
843
- }
844
- });
845
- }); };
846
- var deserializeAws_json1_1RefreshTrustedAdvisorCheckCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
847
- var parsedOutput, _a, errorCode, _b, parsedBody;
848
- var _c;
849
- return __generator(this, function (_d) {
850
- switch (_d.label) {
851
- case 0:
852
- _a = [__assign({}, output)];
853
- _c = {};
854
- return [4, parseErrorBody(output.body, context)];
855
- case 1:
856
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
857
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
858
- _b = errorCode;
859
- switch (_b) {
860
- case "InternalServerError": return [3, 2];
861
- case "com.amazonaws.support#InternalServerError": return [3, 2];
862
- }
863
- return [3, 4];
864
- case 2: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
865
- case 3: throw _d.sent();
866
- case 4:
867
- parsedBody = parsedOutput.body;
868
- throwDefaultError({
869
- output: output,
870
- parsedBody: parsedBody,
871
- exceptionCtor: __BaseException,
872
- errorCode: errorCode,
873
- });
874
- _d.label = 5;
875
- case 5: return [2];
876
- }
877
- });
878
- }); };
879
- export var deserializeAws_json1_1ResolveCaseCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
880
- var data, contents, response;
881
- return __generator(this, function (_a) {
882
- switch (_a.label) {
883
- case 0:
884
- if (output.statusCode >= 300) {
885
- return [2, deserializeAws_json1_1ResolveCaseCommandError(output, context)];
886
- }
887
- return [4, parseBody(output.body, context)];
888
- case 1:
889
- data = _a.sent();
890
- contents = {};
891
- contents = deserializeAws_json1_1ResolveCaseResponse(data, context);
892
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
893
- return [2, Promise.resolve(response)];
894
- }
895
- });
896
- }); };
897
- var deserializeAws_json1_1ResolveCaseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
898
- var parsedOutput, _a, errorCode, _b, parsedBody;
899
- var _c;
900
- return __generator(this, function (_d) {
901
- switch (_d.label) {
902
- case 0:
903
- _a = [__assign({}, output)];
904
- _c = {};
905
- return [4, parseErrorBody(output.body, context)];
906
- case 1:
907
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
908
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
909
- _b = errorCode;
910
- switch (_b) {
911
- case "CaseIdNotFound": return [3, 2];
912
- case "com.amazonaws.support#CaseIdNotFound": return [3, 2];
913
- case "InternalServerError": return [3, 4];
914
- case "com.amazonaws.support#InternalServerError": return [3, 4];
915
- }
916
- return [3, 6];
917
- case 2: return [4, deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context)];
918
- case 3: throw _d.sent();
919
- case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
920
- case 5: throw _d.sent();
921
- case 6:
922
- parsedBody = parsedOutput.body;
923
- throwDefaultError({
924
- output: output,
925
- parsedBody: parsedBody,
926
- exceptionCtor: __BaseException,
927
- errorCode: errorCode,
928
- });
929
- _d.label = 7;
930
- case 7: return [2];
931
- }
932
- });
933
- }); };
934
- var deserializeAws_json1_1AttachmentIdNotFoundResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
935
- var body, deserialized, exception;
936
- return __generator(this, function (_a) {
937
- body = parsedOutput.body;
938
- deserialized = deserializeAws_json1_1AttachmentIdNotFound(body, context);
939
- exception = new AttachmentIdNotFound(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
940
- return [2, __decorateServiceException(exception, body)];
941
- });
942
- }); };
943
- var deserializeAws_json1_1AttachmentLimitExceededResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
944
- var body, deserialized, exception;
945
- return __generator(this, function (_a) {
946
- body = parsedOutput.body;
947
- deserialized = deserializeAws_json1_1AttachmentLimitExceeded(body, context);
948
- exception = new AttachmentLimitExceeded(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
949
- return [2, __decorateServiceException(exception, body)];
950
- });
951
- }); };
952
- var deserializeAws_json1_1AttachmentSetExpiredResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
953
- var body, deserialized, exception;
954
- return __generator(this, function (_a) {
955
- body = parsedOutput.body;
956
- deserialized = deserializeAws_json1_1AttachmentSetExpired(body, context);
957
- exception = new AttachmentSetExpired(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
958
- return [2, __decorateServiceException(exception, body)];
959
- });
960
- }); };
961
- var deserializeAws_json1_1AttachmentSetIdNotFoundResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
962
- var body, deserialized, exception;
963
- return __generator(this, function (_a) {
964
- body = parsedOutput.body;
965
- deserialized = deserializeAws_json1_1AttachmentSetIdNotFound(body, context);
966
- exception = new AttachmentSetIdNotFound(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
967
- return [2, __decorateServiceException(exception, body)];
968
- });
969
- }); };
970
- var deserializeAws_json1_1AttachmentSetSizeLimitExceededResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
971
- var body, deserialized, exception;
972
- return __generator(this, function (_a) {
973
- body = parsedOutput.body;
974
- deserialized = deserializeAws_json1_1AttachmentSetSizeLimitExceeded(body, context);
975
- exception = new AttachmentSetSizeLimitExceeded(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
976
- return [2, __decorateServiceException(exception, body)];
977
- });
978
- }); };
979
- var deserializeAws_json1_1CaseCreationLimitExceededResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
980
- var body, deserialized, exception;
981
- return __generator(this, function (_a) {
982
- body = parsedOutput.body;
983
- deserialized = deserializeAws_json1_1CaseCreationLimitExceeded(body, context);
984
- exception = new CaseCreationLimitExceeded(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
985
- return [2, __decorateServiceException(exception, body)];
986
- });
987
- }); };
988
- var deserializeAws_json1_1CaseIdNotFoundResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
989
- var body, deserialized, exception;
990
- return __generator(this, function (_a) {
991
- body = parsedOutput.body;
992
- deserialized = deserializeAws_json1_1CaseIdNotFound(body, context);
993
- exception = new CaseIdNotFound(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
994
- return [2, __decorateServiceException(exception, body)];
995
- });
996
- }); };
997
- var deserializeAws_json1_1DescribeAttachmentLimitExceededResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
998
- var body, deserialized, exception;
999
- return __generator(this, function (_a) {
1000
- body = parsedOutput.body;
1001
- deserialized = deserializeAws_json1_1DescribeAttachmentLimitExceeded(body, context);
1002
- exception = new DescribeAttachmentLimitExceeded(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1003
- return [2, __decorateServiceException(exception, body)];
1004
- });
1005
- }); };
1006
- var deserializeAws_json1_1InternalServerErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1007
- var body, deserialized, exception;
1008
- return __generator(this, function (_a) {
1009
- body = parsedOutput.body;
1010
- deserialized = deserializeAws_json1_1InternalServerError(body, context);
1011
- exception = new InternalServerError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1012
- return [2, __decorateServiceException(exception, body)];
1013
- });
1014
- }); };
1015
- var serializeAws_json1_1AddAttachmentsToSetRequest = function (input, context) {
1016
- return __assign(__assign({}, (input.attachmentSetId != null && { attachmentSetId: input.attachmentSetId })), (input.attachments != null && { attachments: serializeAws_json1_1Attachments(input.attachments, context) }));
5
+ export const serializeAws_json1_1AddAttachmentsToSetCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.1",
8
+ "x-amz-target": "AWSSupport_20130415.AddAttachmentsToSet",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_1AddAttachmentsToSetRequest(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_1AddCommunicationToCaseCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.1",
17
+ "x-amz-target": "AWSSupport_20130415.AddCommunicationToCase",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_1AddCommunicationToCaseRequest(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_1CreateCaseCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "AWSSupport_20130415.CreateCase",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1CreateCaseRequest(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const serializeAws_json1_1DescribeAttachmentCommand = async (input, context) => {
33
+ const headers = {
34
+ "content-type": "application/x-amz-json-1.1",
35
+ "x-amz-target": "AWSSupport_20130415.DescribeAttachment",
36
+ };
37
+ let body;
38
+ body = JSON.stringify(serializeAws_json1_1DescribeAttachmentRequest(input, context));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const serializeAws_json1_1DescribeCasesCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "AWSSupport_20130415.DescribeCases",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_1DescribeCasesRequest(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
50
+ export const serializeAws_json1_1DescribeCommunicationsCommand = async (input, context) => {
51
+ const headers = {
52
+ "content-type": "application/x-amz-json-1.1",
53
+ "x-amz-target": "AWSSupport_20130415.DescribeCommunications",
54
+ };
55
+ let body;
56
+ body = JSON.stringify(serializeAws_json1_1DescribeCommunicationsRequest(input, context));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const serializeAws_json1_1DescribeServicesCommand = async (input, context) => {
60
+ const headers = {
61
+ "content-type": "application/x-amz-json-1.1",
62
+ "x-amz-target": "AWSSupport_20130415.DescribeServices",
63
+ };
64
+ let body;
65
+ body = JSON.stringify(serializeAws_json1_1DescribeServicesRequest(input, context));
66
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
+ };
68
+ export const serializeAws_json1_1DescribeSeverityLevelsCommand = async (input, context) => {
69
+ const headers = {
70
+ "content-type": "application/x-amz-json-1.1",
71
+ "x-amz-target": "AWSSupport_20130415.DescribeSeverityLevels",
72
+ };
73
+ let body;
74
+ body = JSON.stringify(serializeAws_json1_1DescribeSeverityLevelsRequest(input, context));
75
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
+ };
77
+ export const serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommand = async (input, context) => {
78
+ const headers = {
79
+ "content-type": "application/x-amz-json-1.1",
80
+ "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckRefreshStatuses",
81
+ };
82
+ let body;
83
+ body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest(input, context));
84
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
+ };
86
+ export const serializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = async (input, context) => {
87
+ const headers = {
88
+ "content-type": "application/x-amz-json-1.1",
89
+ "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckResult",
90
+ };
91
+ let body;
92
+ body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest(input, context));
93
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
+ };
95
+ export const serializeAws_json1_1DescribeTrustedAdvisorChecksCommand = async (input, context) => {
96
+ const headers = {
97
+ "content-type": "application/x-amz-json-1.1",
98
+ "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorChecks",
99
+ };
100
+ let body;
101
+ body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorChecksRequest(input, context));
102
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
103
+ };
104
+ export const serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = async (input, context) => {
105
+ const headers = {
106
+ "content-type": "application/x-amz-json-1.1",
107
+ "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckSummaries",
108
+ };
109
+ let body;
110
+ body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest(input, context));
111
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
+ };
113
+ export const serializeAws_json1_1RefreshTrustedAdvisorCheckCommand = async (input, context) => {
114
+ const headers = {
115
+ "content-type": "application/x-amz-json-1.1",
116
+ "x-amz-target": "AWSSupport_20130415.RefreshTrustedAdvisorCheck",
117
+ };
118
+ let body;
119
+ body = JSON.stringify(serializeAws_json1_1RefreshTrustedAdvisorCheckRequest(input, context));
120
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
121
+ };
122
+ export const serializeAws_json1_1ResolveCaseCommand = async (input, context) => {
123
+ const headers = {
124
+ "content-type": "application/x-amz-json-1.1",
125
+ "x-amz-target": "AWSSupport_20130415.ResolveCase",
126
+ };
127
+ let body;
128
+ body = JSON.stringify(serializeAws_json1_1ResolveCaseRequest(input, context));
129
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
130
+ };
131
+ export const deserializeAws_json1_1AddAttachmentsToSetCommand = async (output, context) => {
132
+ if (output.statusCode >= 300) {
133
+ return deserializeAws_json1_1AddAttachmentsToSetCommandError(output, context);
134
+ }
135
+ const data = await parseBody(output.body, context);
136
+ let contents = {};
137
+ contents = deserializeAws_json1_1AddAttachmentsToSetResponse(data, context);
138
+ const response = {
139
+ $metadata: deserializeMetadata(output),
140
+ ...contents,
141
+ };
142
+ return Promise.resolve(response);
143
+ };
144
+ const deserializeAws_json1_1AddAttachmentsToSetCommandError = async (output, context) => {
145
+ const parsedOutput = {
146
+ ...output,
147
+ body: await parseErrorBody(output.body, context),
148
+ };
149
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
150
+ switch (errorCode) {
151
+ case "AttachmentLimitExceeded":
152
+ case "com.amazonaws.support#AttachmentLimitExceeded":
153
+ throw await deserializeAws_json1_1AttachmentLimitExceededResponse(parsedOutput, context);
154
+ case "AttachmentSetExpired":
155
+ case "com.amazonaws.support#AttachmentSetExpired":
156
+ throw await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context);
157
+ case "AttachmentSetIdNotFound":
158
+ case "com.amazonaws.support#AttachmentSetIdNotFound":
159
+ throw await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context);
160
+ case "AttachmentSetSizeLimitExceeded":
161
+ case "com.amazonaws.support#AttachmentSetSizeLimitExceeded":
162
+ throw await deserializeAws_json1_1AttachmentSetSizeLimitExceededResponse(parsedOutput, context);
163
+ case "InternalServerError":
164
+ case "com.amazonaws.support#InternalServerError":
165
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
166
+ default:
167
+ const parsedBody = parsedOutput.body;
168
+ throwDefaultError({
169
+ output,
170
+ parsedBody,
171
+ exceptionCtor: __BaseException,
172
+ errorCode,
173
+ });
174
+ }
175
+ };
176
+ export const deserializeAws_json1_1AddCommunicationToCaseCommand = async (output, context) => {
177
+ if (output.statusCode >= 300) {
178
+ return deserializeAws_json1_1AddCommunicationToCaseCommandError(output, context);
179
+ }
180
+ const data = await parseBody(output.body, context);
181
+ let contents = {};
182
+ contents = deserializeAws_json1_1AddCommunicationToCaseResponse(data, context);
183
+ const response = {
184
+ $metadata: deserializeMetadata(output),
185
+ ...contents,
186
+ };
187
+ return Promise.resolve(response);
188
+ };
189
+ const deserializeAws_json1_1AddCommunicationToCaseCommandError = async (output, context) => {
190
+ const parsedOutput = {
191
+ ...output,
192
+ body: await parseErrorBody(output.body, context),
193
+ };
194
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
195
+ switch (errorCode) {
196
+ case "AttachmentSetExpired":
197
+ case "com.amazonaws.support#AttachmentSetExpired":
198
+ throw await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context);
199
+ case "AttachmentSetIdNotFound":
200
+ case "com.amazonaws.support#AttachmentSetIdNotFound":
201
+ throw await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context);
202
+ case "CaseIdNotFound":
203
+ case "com.amazonaws.support#CaseIdNotFound":
204
+ throw await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context);
205
+ case "InternalServerError":
206
+ case "com.amazonaws.support#InternalServerError":
207
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
208
+ default:
209
+ const parsedBody = parsedOutput.body;
210
+ throwDefaultError({
211
+ output,
212
+ parsedBody,
213
+ exceptionCtor: __BaseException,
214
+ errorCode,
215
+ });
216
+ }
217
+ };
218
+ export const deserializeAws_json1_1CreateCaseCommand = async (output, context) => {
219
+ if (output.statusCode >= 300) {
220
+ return deserializeAws_json1_1CreateCaseCommandError(output, context);
221
+ }
222
+ const data = await parseBody(output.body, context);
223
+ let contents = {};
224
+ contents = deserializeAws_json1_1CreateCaseResponse(data, context);
225
+ const response = {
226
+ $metadata: deserializeMetadata(output),
227
+ ...contents,
228
+ };
229
+ return Promise.resolve(response);
230
+ };
231
+ const deserializeAws_json1_1CreateCaseCommandError = async (output, context) => {
232
+ const parsedOutput = {
233
+ ...output,
234
+ body: await parseErrorBody(output.body, context),
235
+ };
236
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
237
+ switch (errorCode) {
238
+ case "AttachmentSetExpired":
239
+ case "com.amazonaws.support#AttachmentSetExpired":
240
+ throw await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context);
241
+ case "AttachmentSetIdNotFound":
242
+ case "com.amazonaws.support#AttachmentSetIdNotFound":
243
+ throw await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context);
244
+ case "CaseCreationLimitExceeded":
245
+ case "com.amazonaws.support#CaseCreationLimitExceeded":
246
+ throw await deserializeAws_json1_1CaseCreationLimitExceededResponse(parsedOutput, context);
247
+ case "InternalServerError":
248
+ case "com.amazonaws.support#InternalServerError":
249
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
250
+ default:
251
+ const parsedBody = parsedOutput.body;
252
+ throwDefaultError({
253
+ output,
254
+ parsedBody,
255
+ exceptionCtor: __BaseException,
256
+ errorCode,
257
+ });
258
+ }
259
+ };
260
+ export const deserializeAws_json1_1DescribeAttachmentCommand = async (output, context) => {
261
+ if (output.statusCode >= 300) {
262
+ return deserializeAws_json1_1DescribeAttachmentCommandError(output, context);
263
+ }
264
+ const data = await parseBody(output.body, context);
265
+ let contents = {};
266
+ contents = deserializeAws_json1_1DescribeAttachmentResponse(data, context);
267
+ const response = {
268
+ $metadata: deserializeMetadata(output),
269
+ ...contents,
270
+ };
271
+ return Promise.resolve(response);
272
+ };
273
+ const deserializeAws_json1_1DescribeAttachmentCommandError = async (output, context) => {
274
+ const parsedOutput = {
275
+ ...output,
276
+ body: await parseErrorBody(output.body, context),
277
+ };
278
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
279
+ switch (errorCode) {
280
+ case "AttachmentIdNotFound":
281
+ case "com.amazonaws.support#AttachmentIdNotFound":
282
+ throw await deserializeAws_json1_1AttachmentIdNotFoundResponse(parsedOutput, context);
283
+ case "DescribeAttachmentLimitExceeded":
284
+ case "com.amazonaws.support#DescribeAttachmentLimitExceeded":
285
+ throw await deserializeAws_json1_1DescribeAttachmentLimitExceededResponse(parsedOutput, context);
286
+ case "InternalServerError":
287
+ case "com.amazonaws.support#InternalServerError":
288
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
289
+ default:
290
+ const parsedBody = parsedOutput.body;
291
+ throwDefaultError({
292
+ output,
293
+ parsedBody,
294
+ exceptionCtor: __BaseException,
295
+ errorCode,
296
+ });
297
+ }
298
+ };
299
+ export const deserializeAws_json1_1DescribeCasesCommand = async (output, context) => {
300
+ if (output.statusCode >= 300) {
301
+ return deserializeAws_json1_1DescribeCasesCommandError(output, context);
302
+ }
303
+ const data = await parseBody(output.body, context);
304
+ let contents = {};
305
+ contents = deserializeAws_json1_1DescribeCasesResponse(data, context);
306
+ const response = {
307
+ $metadata: deserializeMetadata(output),
308
+ ...contents,
309
+ };
310
+ return Promise.resolve(response);
311
+ };
312
+ const deserializeAws_json1_1DescribeCasesCommandError = async (output, context) => {
313
+ const parsedOutput = {
314
+ ...output,
315
+ body: await parseErrorBody(output.body, context),
316
+ };
317
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
318
+ switch (errorCode) {
319
+ case "CaseIdNotFound":
320
+ case "com.amazonaws.support#CaseIdNotFound":
321
+ throw await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context);
322
+ case "InternalServerError":
323
+ case "com.amazonaws.support#InternalServerError":
324
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
325
+ default:
326
+ const parsedBody = parsedOutput.body;
327
+ throwDefaultError({
328
+ output,
329
+ parsedBody,
330
+ exceptionCtor: __BaseException,
331
+ errorCode,
332
+ });
333
+ }
334
+ };
335
+ export const deserializeAws_json1_1DescribeCommunicationsCommand = async (output, context) => {
336
+ if (output.statusCode >= 300) {
337
+ return deserializeAws_json1_1DescribeCommunicationsCommandError(output, context);
338
+ }
339
+ const data = await parseBody(output.body, context);
340
+ let contents = {};
341
+ contents = deserializeAws_json1_1DescribeCommunicationsResponse(data, context);
342
+ const response = {
343
+ $metadata: deserializeMetadata(output),
344
+ ...contents,
345
+ };
346
+ return Promise.resolve(response);
347
+ };
348
+ const deserializeAws_json1_1DescribeCommunicationsCommandError = async (output, context) => {
349
+ const parsedOutput = {
350
+ ...output,
351
+ body: await parseErrorBody(output.body, context),
352
+ };
353
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
354
+ switch (errorCode) {
355
+ case "CaseIdNotFound":
356
+ case "com.amazonaws.support#CaseIdNotFound":
357
+ throw await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context);
358
+ case "InternalServerError":
359
+ case "com.amazonaws.support#InternalServerError":
360
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
361
+ default:
362
+ const parsedBody = parsedOutput.body;
363
+ throwDefaultError({
364
+ output,
365
+ parsedBody,
366
+ exceptionCtor: __BaseException,
367
+ errorCode,
368
+ });
369
+ }
370
+ };
371
+ export const deserializeAws_json1_1DescribeServicesCommand = async (output, context) => {
372
+ if (output.statusCode >= 300) {
373
+ return deserializeAws_json1_1DescribeServicesCommandError(output, context);
374
+ }
375
+ const data = await parseBody(output.body, context);
376
+ let contents = {};
377
+ contents = deserializeAws_json1_1DescribeServicesResponse(data, context);
378
+ const response = {
379
+ $metadata: deserializeMetadata(output),
380
+ ...contents,
381
+ };
382
+ return Promise.resolve(response);
383
+ };
384
+ const deserializeAws_json1_1DescribeServicesCommandError = async (output, context) => {
385
+ const parsedOutput = {
386
+ ...output,
387
+ body: await parseErrorBody(output.body, context),
388
+ };
389
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
390
+ switch (errorCode) {
391
+ case "InternalServerError":
392
+ case "com.amazonaws.support#InternalServerError":
393
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
394
+ default:
395
+ const parsedBody = parsedOutput.body;
396
+ throwDefaultError({
397
+ output,
398
+ parsedBody,
399
+ exceptionCtor: __BaseException,
400
+ errorCode,
401
+ });
402
+ }
403
+ };
404
+ export const deserializeAws_json1_1DescribeSeverityLevelsCommand = async (output, context) => {
405
+ if (output.statusCode >= 300) {
406
+ return deserializeAws_json1_1DescribeSeverityLevelsCommandError(output, context);
407
+ }
408
+ const data = await parseBody(output.body, context);
409
+ let contents = {};
410
+ contents = deserializeAws_json1_1DescribeSeverityLevelsResponse(data, context);
411
+ const response = {
412
+ $metadata: deserializeMetadata(output),
413
+ ...contents,
414
+ };
415
+ return Promise.resolve(response);
416
+ };
417
+ const deserializeAws_json1_1DescribeSeverityLevelsCommandError = 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 "InternalServerError":
425
+ case "com.amazonaws.support#InternalServerError":
426
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
427
+ default:
428
+ const parsedBody = parsedOutput.body;
429
+ throwDefaultError({
430
+ output,
431
+ parsedBody,
432
+ exceptionCtor: __BaseException,
433
+ errorCode,
434
+ });
435
+ }
436
+ };
437
+ export const deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommand = async (output, context) => {
438
+ if (output.statusCode >= 300) {
439
+ return deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommandError(output, context);
440
+ }
441
+ const data = await parseBody(output.body, context);
442
+ let contents = {};
443
+ contents = deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesResponse(data, context);
444
+ const response = {
445
+ $metadata: deserializeMetadata(output),
446
+ ...contents,
447
+ };
448
+ return Promise.resolve(response);
449
+ };
450
+ const deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommandError = async (output, context) => {
451
+ const parsedOutput = {
452
+ ...output,
453
+ body: await parseErrorBody(output.body, context),
454
+ };
455
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
456
+ switch (errorCode) {
457
+ case "InternalServerError":
458
+ case "com.amazonaws.support#InternalServerError":
459
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
460
+ default:
461
+ const parsedBody = parsedOutput.body;
462
+ throwDefaultError({
463
+ output,
464
+ parsedBody,
465
+ exceptionCtor: __BaseException,
466
+ errorCode,
467
+ });
468
+ }
469
+ };
470
+ export const deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = async (output, context) => {
471
+ if (output.statusCode >= 300) {
472
+ return deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommandError(output, context);
473
+ }
474
+ const data = await parseBody(output.body, context);
475
+ let contents = {};
476
+ contents = deserializeAws_json1_1DescribeTrustedAdvisorCheckResultResponse(data, context);
477
+ const response = {
478
+ $metadata: deserializeMetadata(output),
479
+ ...contents,
480
+ };
481
+ return Promise.resolve(response);
482
+ };
483
+ const deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommandError = async (output, context) => {
484
+ const parsedOutput = {
485
+ ...output,
486
+ body: await parseErrorBody(output.body, context),
487
+ };
488
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
489
+ switch (errorCode) {
490
+ case "InternalServerError":
491
+ case "com.amazonaws.support#InternalServerError":
492
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
493
+ default:
494
+ const parsedBody = parsedOutput.body;
495
+ throwDefaultError({
496
+ output,
497
+ parsedBody,
498
+ exceptionCtor: __BaseException,
499
+ errorCode,
500
+ });
501
+ }
502
+ };
503
+ export const deserializeAws_json1_1DescribeTrustedAdvisorChecksCommand = async (output, context) => {
504
+ if (output.statusCode >= 300) {
505
+ return deserializeAws_json1_1DescribeTrustedAdvisorChecksCommandError(output, context);
506
+ }
507
+ const data = await parseBody(output.body, context);
508
+ let contents = {};
509
+ contents = deserializeAws_json1_1DescribeTrustedAdvisorChecksResponse(data, context);
510
+ const response = {
511
+ $metadata: deserializeMetadata(output),
512
+ ...contents,
513
+ };
514
+ return Promise.resolve(response);
515
+ };
516
+ const deserializeAws_json1_1DescribeTrustedAdvisorChecksCommandError = async (output, context) => {
517
+ const parsedOutput = {
518
+ ...output,
519
+ body: await parseErrorBody(output.body, context),
520
+ };
521
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
522
+ switch (errorCode) {
523
+ case "InternalServerError":
524
+ case "com.amazonaws.support#InternalServerError":
525
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
526
+ default:
527
+ const parsedBody = parsedOutput.body;
528
+ throwDefaultError({
529
+ output,
530
+ parsedBody,
531
+ exceptionCtor: __BaseException,
532
+ errorCode,
533
+ });
534
+ }
535
+ };
536
+ export const deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = async (output, context) => {
537
+ if (output.statusCode >= 300) {
538
+ return deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommandError(output, context);
539
+ }
540
+ const data = await parseBody(output.body, context);
541
+ let contents = {};
542
+ contents = deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesResponse(data, context);
543
+ const response = {
544
+ $metadata: deserializeMetadata(output),
545
+ ...contents,
546
+ };
547
+ return Promise.resolve(response);
548
+ };
549
+ const deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommandError = 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 "InternalServerError":
557
+ case "com.amazonaws.support#InternalServerError":
558
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
559
+ default:
560
+ const parsedBody = parsedOutput.body;
561
+ throwDefaultError({
562
+ output,
563
+ parsedBody,
564
+ exceptionCtor: __BaseException,
565
+ errorCode,
566
+ });
567
+ }
1017
568
  };
1018
- var serializeAws_json1_1AddCommunicationToCaseRequest = function (input, context) {
1019
- return __assign(__assign(__assign(__assign({}, (input.attachmentSetId != null && { attachmentSetId: input.attachmentSetId })), (input.caseId != null && { caseId: input.caseId })), (input.ccEmailAddresses != null && {
1020
- ccEmailAddresses: serializeAws_json1_1CcEmailAddressList(input.ccEmailAddresses, context),
1021
- })), (input.communicationBody != null && { communicationBody: input.communicationBody }));
569
+ export const deserializeAws_json1_1RefreshTrustedAdvisorCheckCommand = async (output, context) => {
570
+ if (output.statusCode >= 300) {
571
+ return deserializeAws_json1_1RefreshTrustedAdvisorCheckCommandError(output, context);
572
+ }
573
+ const data = await parseBody(output.body, context);
574
+ let contents = {};
575
+ contents = deserializeAws_json1_1RefreshTrustedAdvisorCheckResponse(data, context);
576
+ const response = {
577
+ $metadata: deserializeMetadata(output),
578
+ ...contents,
579
+ };
580
+ return Promise.resolve(response);
581
+ };
582
+ const deserializeAws_json1_1RefreshTrustedAdvisorCheckCommandError = async (output, context) => {
583
+ const parsedOutput = {
584
+ ...output,
585
+ body: await parseErrorBody(output.body, context),
586
+ };
587
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
588
+ switch (errorCode) {
589
+ case "InternalServerError":
590
+ case "com.amazonaws.support#InternalServerError":
591
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
592
+ default:
593
+ const parsedBody = parsedOutput.body;
594
+ throwDefaultError({
595
+ output,
596
+ parsedBody,
597
+ exceptionCtor: __BaseException,
598
+ errorCode,
599
+ });
600
+ }
601
+ };
602
+ export const deserializeAws_json1_1ResolveCaseCommand = async (output, context) => {
603
+ if (output.statusCode >= 300) {
604
+ return deserializeAws_json1_1ResolveCaseCommandError(output, context);
605
+ }
606
+ const data = await parseBody(output.body, context);
607
+ let contents = {};
608
+ contents = deserializeAws_json1_1ResolveCaseResponse(data, context);
609
+ const response = {
610
+ $metadata: deserializeMetadata(output),
611
+ ...contents,
612
+ };
613
+ return Promise.resolve(response);
614
+ };
615
+ const deserializeAws_json1_1ResolveCaseCommandError = async (output, context) => {
616
+ const parsedOutput = {
617
+ ...output,
618
+ body: await parseErrorBody(output.body, context),
619
+ };
620
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
621
+ switch (errorCode) {
622
+ case "CaseIdNotFound":
623
+ case "com.amazonaws.support#CaseIdNotFound":
624
+ throw await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context);
625
+ case "InternalServerError":
626
+ case "com.amazonaws.support#InternalServerError":
627
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
628
+ default:
629
+ const parsedBody = parsedOutput.body;
630
+ throwDefaultError({
631
+ output,
632
+ parsedBody,
633
+ exceptionCtor: __BaseException,
634
+ errorCode,
635
+ });
636
+ }
637
+ };
638
+ const deserializeAws_json1_1AttachmentIdNotFoundResponse = async (parsedOutput, context) => {
639
+ const body = parsedOutput.body;
640
+ const deserialized = deserializeAws_json1_1AttachmentIdNotFound(body, context);
641
+ const exception = new AttachmentIdNotFound({
642
+ $metadata: deserializeMetadata(parsedOutput),
643
+ ...deserialized,
644
+ });
645
+ return __decorateServiceException(exception, body);
646
+ };
647
+ const deserializeAws_json1_1AttachmentLimitExceededResponse = async (parsedOutput, context) => {
648
+ const body = parsedOutput.body;
649
+ const deserialized = deserializeAws_json1_1AttachmentLimitExceeded(body, context);
650
+ const exception = new AttachmentLimitExceeded({
651
+ $metadata: deserializeMetadata(parsedOutput),
652
+ ...deserialized,
653
+ });
654
+ return __decorateServiceException(exception, body);
655
+ };
656
+ const deserializeAws_json1_1AttachmentSetExpiredResponse = async (parsedOutput, context) => {
657
+ const body = parsedOutput.body;
658
+ const deserialized = deserializeAws_json1_1AttachmentSetExpired(body, context);
659
+ const exception = new AttachmentSetExpired({
660
+ $metadata: deserializeMetadata(parsedOutput),
661
+ ...deserialized,
662
+ });
663
+ return __decorateServiceException(exception, body);
664
+ };
665
+ const deserializeAws_json1_1AttachmentSetIdNotFoundResponse = async (parsedOutput, context) => {
666
+ const body = parsedOutput.body;
667
+ const deserialized = deserializeAws_json1_1AttachmentSetIdNotFound(body, context);
668
+ const exception = new AttachmentSetIdNotFound({
669
+ $metadata: deserializeMetadata(parsedOutput),
670
+ ...deserialized,
671
+ });
672
+ return __decorateServiceException(exception, body);
673
+ };
674
+ const deserializeAws_json1_1AttachmentSetSizeLimitExceededResponse = async (parsedOutput, context) => {
675
+ const body = parsedOutput.body;
676
+ const deserialized = deserializeAws_json1_1AttachmentSetSizeLimitExceeded(body, context);
677
+ const exception = new AttachmentSetSizeLimitExceeded({
678
+ $metadata: deserializeMetadata(parsedOutput),
679
+ ...deserialized,
680
+ });
681
+ return __decorateServiceException(exception, body);
682
+ };
683
+ const deserializeAws_json1_1CaseCreationLimitExceededResponse = async (parsedOutput, context) => {
684
+ const body = parsedOutput.body;
685
+ const deserialized = deserializeAws_json1_1CaseCreationLimitExceeded(body, context);
686
+ const exception = new CaseCreationLimitExceeded({
687
+ $metadata: deserializeMetadata(parsedOutput),
688
+ ...deserialized,
689
+ });
690
+ return __decorateServiceException(exception, body);
691
+ };
692
+ const deserializeAws_json1_1CaseIdNotFoundResponse = async (parsedOutput, context) => {
693
+ const body = parsedOutput.body;
694
+ const deserialized = deserializeAws_json1_1CaseIdNotFound(body, context);
695
+ const exception = new CaseIdNotFound({
696
+ $metadata: deserializeMetadata(parsedOutput),
697
+ ...deserialized,
698
+ });
699
+ return __decorateServiceException(exception, body);
700
+ };
701
+ const deserializeAws_json1_1DescribeAttachmentLimitExceededResponse = async (parsedOutput, context) => {
702
+ const body = parsedOutput.body;
703
+ const deserialized = deserializeAws_json1_1DescribeAttachmentLimitExceeded(body, context);
704
+ const exception = new DescribeAttachmentLimitExceeded({
705
+ $metadata: deserializeMetadata(parsedOutput),
706
+ ...deserialized,
707
+ });
708
+ return __decorateServiceException(exception, body);
709
+ };
710
+ const deserializeAws_json1_1InternalServerErrorResponse = async (parsedOutput, context) => {
711
+ const body = parsedOutput.body;
712
+ const deserialized = deserializeAws_json1_1InternalServerError(body, context);
713
+ const exception = new InternalServerError({
714
+ $metadata: deserializeMetadata(parsedOutput),
715
+ ...deserialized,
716
+ });
717
+ return __decorateServiceException(exception, body);
718
+ };
719
+ const serializeAws_json1_1AddAttachmentsToSetRequest = (input, context) => {
720
+ return {
721
+ ...(input.attachmentSetId != null && { attachmentSetId: input.attachmentSetId }),
722
+ ...(input.attachments != null && { attachments: serializeAws_json1_1Attachments(input.attachments, context) }),
723
+ };
1022
724
  };
1023
- var serializeAws_json1_1Attachment = function (input, context) {
1024
- return __assign(__assign({}, (input.data != null && { data: context.base64Encoder(input.data) })), (input.fileName != null && { fileName: input.fileName }));
725
+ const serializeAws_json1_1AddCommunicationToCaseRequest = (input, context) => {
726
+ return {
727
+ ...(input.attachmentSetId != null && { attachmentSetId: input.attachmentSetId }),
728
+ ...(input.caseId != null && { caseId: input.caseId }),
729
+ ...(input.ccEmailAddresses != null && {
730
+ ccEmailAddresses: serializeAws_json1_1CcEmailAddressList(input.ccEmailAddresses, context),
731
+ }),
732
+ ...(input.communicationBody != null && { communicationBody: input.communicationBody }),
733
+ };
1025
734
  };
1026
- var serializeAws_json1_1Attachments = function (input, context) {
735
+ const serializeAws_json1_1Attachment = (input, context) => {
736
+ return {
737
+ ...(input.data != null && { data: context.base64Encoder(input.data) }),
738
+ ...(input.fileName != null && { fileName: input.fileName }),
739
+ };
740
+ };
741
+ const serializeAws_json1_1Attachments = (input, context) => {
1027
742
  return input
1028
- .filter(function (e) { return e != null; })
1029
- .map(function (entry) {
743
+ .filter((e) => e != null)
744
+ .map((entry) => {
1030
745
  return serializeAws_json1_1Attachment(entry, context);
1031
746
  });
1032
747
  };
1033
- var serializeAws_json1_1CaseIdList = function (input, context) {
748
+ const serializeAws_json1_1CaseIdList = (input, context) => {
1034
749
  return input
1035
- .filter(function (e) { return e != null; })
1036
- .map(function (entry) {
750
+ .filter((e) => e != null)
751
+ .map((entry) => {
1037
752
  return entry;
1038
753
  });
1039
754
  };
1040
- var serializeAws_json1_1CcEmailAddressList = function (input, context) {
755
+ const serializeAws_json1_1CcEmailAddressList = (input, context) => {
1041
756
  return input
1042
- .filter(function (e) { return e != null; })
1043
- .map(function (entry) {
757
+ .filter((e) => e != null)
758
+ .map((entry) => {
1044
759
  return entry;
1045
760
  });
1046
761
  };
1047
- var serializeAws_json1_1CreateCaseRequest = function (input, context) {
1048
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.attachmentSetId != null && { attachmentSetId: input.attachmentSetId })), (input.categoryCode != null && { categoryCode: input.categoryCode })), (input.ccEmailAddresses != null && {
1049
- ccEmailAddresses: serializeAws_json1_1CcEmailAddressList(input.ccEmailAddresses, context),
1050
- })), (input.communicationBody != null && { communicationBody: input.communicationBody })), (input.issueType != null && { issueType: input.issueType })), (input.language != null && { language: input.language })), (input.serviceCode != null && { serviceCode: input.serviceCode })), (input.severityCode != null && { severityCode: input.severityCode })), (input.subject != null && { subject: input.subject }));
762
+ const serializeAws_json1_1CreateCaseRequest = (input, context) => {
763
+ return {
764
+ ...(input.attachmentSetId != null && { attachmentSetId: input.attachmentSetId }),
765
+ ...(input.categoryCode != null && { categoryCode: input.categoryCode }),
766
+ ...(input.ccEmailAddresses != null && {
767
+ ccEmailAddresses: serializeAws_json1_1CcEmailAddressList(input.ccEmailAddresses, context),
768
+ }),
769
+ ...(input.communicationBody != null && { communicationBody: input.communicationBody }),
770
+ ...(input.issueType != null && { issueType: input.issueType }),
771
+ ...(input.language != null && { language: input.language }),
772
+ ...(input.serviceCode != null && { serviceCode: input.serviceCode }),
773
+ ...(input.severityCode != null && { severityCode: input.severityCode }),
774
+ ...(input.subject != null && { subject: input.subject }),
775
+ };
1051
776
  };
1052
- var serializeAws_json1_1DescribeAttachmentRequest = function (input, context) {
1053
- return __assign({}, (input.attachmentId != null && { attachmentId: input.attachmentId }));
777
+ const serializeAws_json1_1DescribeAttachmentRequest = (input, context) => {
778
+ return {
779
+ ...(input.attachmentId != null && { attachmentId: input.attachmentId }),
780
+ };
1054
781
  };
1055
- var serializeAws_json1_1DescribeCasesRequest = function (input, context) {
1056
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.afterTime != null && { afterTime: input.afterTime })), (input.beforeTime != null && { beforeTime: input.beforeTime })), (input.caseIdList != null && { caseIdList: serializeAws_json1_1CaseIdList(input.caseIdList, context) })), (input.displayId != null && { displayId: input.displayId })), (input.includeCommunications != null && { includeCommunications: input.includeCommunications })), (input.includeResolvedCases != null && { includeResolvedCases: input.includeResolvedCases })), (input.language != null && { language: input.language })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken }));
782
+ const serializeAws_json1_1DescribeCasesRequest = (input, context) => {
783
+ return {
784
+ ...(input.afterTime != null && { afterTime: input.afterTime }),
785
+ ...(input.beforeTime != null && { beforeTime: input.beforeTime }),
786
+ ...(input.caseIdList != null && { caseIdList: serializeAws_json1_1CaseIdList(input.caseIdList, context) }),
787
+ ...(input.displayId != null && { displayId: input.displayId }),
788
+ ...(input.includeCommunications != null && { includeCommunications: input.includeCommunications }),
789
+ ...(input.includeResolvedCases != null && { includeResolvedCases: input.includeResolvedCases }),
790
+ ...(input.language != null && { language: input.language }),
791
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
792
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
793
+ };
1057
794
  };
1058
- var serializeAws_json1_1DescribeCommunicationsRequest = function (input, context) {
1059
- return __assign(__assign(__assign(__assign(__assign({}, (input.afterTime != null && { afterTime: input.afterTime })), (input.beforeTime != null && { beforeTime: input.beforeTime })), (input.caseId != null && { caseId: input.caseId })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken }));
795
+ const serializeAws_json1_1DescribeCommunicationsRequest = (input, context) => {
796
+ return {
797
+ ...(input.afterTime != null && { afterTime: input.afterTime }),
798
+ ...(input.beforeTime != null && { beforeTime: input.beforeTime }),
799
+ ...(input.caseId != null && { caseId: input.caseId }),
800
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
801
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
802
+ };
1060
803
  };
1061
- var serializeAws_json1_1DescribeServicesRequest = function (input, context) {
1062
- return __assign(__assign({}, (input.language != null && { language: input.language })), (input.serviceCodeList != null && {
1063
- serviceCodeList: serializeAws_json1_1ServiceCodeList(input.serviceCodeList, context),
1064
- }));
804
+ const serializeAws_json1_1DescribeServicesRequest = (input, context) => {
805
+ return {
806
+ ...(input.language != null && { language: input.language }),
807
+ ...(input.serviceCodeList != null && {
808
+ serviceCodeList: serializeAws_json1_1ServiceCodeList(input.serviceCodeList, context),
809
+ }),
810
+ };
1065
811
  };
1066
- var serializeAws_json1_1DescribeSeverityLevelsRequest = function (input, context) {
1067
- return __assign({}, (input.language != null && { language: input.language }));
812
+ const serializeAws_json1_1DescribeSeverityLevelsRequest = (input, context) => {
813
+ return {
814
+ ...(input.language != null && { language: input.language }),
815
+ };
1068
816
  };
1069
- var serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest = function (input, context) {
1070
- return __assign({}, (input.checkIds != null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }));
817
+ const serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest = (input, context) => {
818
+ return {
819
+ ...(input.checkIds != null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }),
820
+ };
1071
821
  };
1072
- var serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest = function (input, context) {
1073
- return __assign(__assign({}, (input.checkId != null && { checkId: input.checkId })), (input.language != null && { language: input.language }));
822
+ const serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest = (input, context) => {
823
+ return {
824
+ ...(input.checkId != null && { checkId: input.checkId }),
825
+ ...(input.language != null && { language: input.language }),
826
+ };
1074
827
  };
1075
- var serializeAws_json1_1DescribeTrustedAdvisorChecksRequest = function (input, context) {
1076
- return __assign({}, (input.language != null && { language: input.language }));
828
+ const serializeAws_json1_1DescribeTrustedAdvisorChecksRequest = (input, context) => {
829
+ return {
830
+ ...(input.language != null && { language: input.language }),
831
+ };
1077
832
  };
1078
- var serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest = function (input, context) {
1079
- return __assign({}, (input.checkIds != null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }));
833
+ const serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest = (input, context) => {
834
+ return {
835
+ ...(input.checkIds != null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }),
836
+ };
1080
837
  };
1081
- var serializeAws_json1_1RefreshTrustedAdvisorCheckRequest = function (input, context) {
1082
- return __assign({}, (input.checkId != null && { checkId: input.checkId }));
838
+ const serializeAws_json1_1RefreshTrustedAdvisorCheckRequest = (input, context) => {
839
+ return {
840
+ ...(input.checkId != null && { checkId: input.checkId }),
841
+ };
1083
842
  };
1084
- var serializeAws_json1_1ResolveCaseRequest = function (input, context) {
1085
- return __assign({}, (input.caseId != null && { caseId: input.caseId }));
843
+ const serializeAws_json1_1ResolveCaseRequest = (input, context) => {
844
+ return {
845
+ ...(input.caseId != null && { caseId: input.caseId }),
846
+ };
1086
847
  };
1087
- var serializeAws_json1_1ServiceCodeList = function (input, context) {
848
+ const serializeAws_json1_1ServiceCodeList = (input, context) => {
1088
849
  return input
1089
- .filter(function (e) { return e != null; })
1090
- .map(function (entry) {
850
+ .filter((e) => e != null)
851
+ .map((entry) => {
1091
852
  return entry;
1092
853
  });
1093
854
  };
1094
- var serializeAws_json1_1StringList = function (input, context) {
855
+ const serializeAws_json1_1StringList = (input, context) => {
1095
856
  return input
1096
- .filter(function (e) { return e != null; })
1097
- .map(function (entry) {
857
+ .filter((e) => e != null)
858
+ .map((entry) => {
1098
859
  return entry;
1099
860
  });
1100
861
  };
1101
- var deserializeAws_json1_1AddAttachmentsToSetResponse = function (output, context) {
862
+ const deserializeAws_json1_1AddAttachmentsToSetResponse = (output, context) => {
1102
863
  return {
1103
864
  attachmentSetId: __expectString(output.attachmentSetId),
1104
865
  expiryTime: __expectString(output.expiryTime),
1105
866
  };
1106
867
  };
1107
- var deserializeAws_json1_1AddCommunicationToCaseResponse = function (output, context) {
868
+ const deserializeAws_json1_1AddCommunicationToCaseResponse = (output, context) => {
1108
869
  return {
1109
870
  result: __expectBoolean(output.result),
1110
871
  };
1111
872
  };
1112
- var deserializeAws_json1_1Attachment = function (output, context) {
873
+ const deserializeAws_json1_1Attachment = (output, context) => {
1113
874
  return {
1114
875
  data: output.data != null ? context.base64Decoder(output.data) : undefined,
1115
876
  fileName: __expectString(output.fileName),
1116
877
  };
1117
878
  };
1118
- var deserializeAws_json1_1AttachmentDetails = function (output, context) {
879
+ const deserializeAws_json1_1AttachmentDetails = (output, context) => {
1119
880
  return {
1120
881
  attachmentId: __expectString(output.attachmentId),
1121
882
  fileName: __expectString(output.fileName),
1122
883
  };
1123
884
  };
1124
- var deserializeAws_json1_1AttachmentIdNotFound = function (output, context) {
885
+ const deserializeAws_json1_1AttachmentIdNotFound = (output, context) => {
1125
886
  return {
1126
887
  message: __expectString(output.message),
1127
888
  };
1128
889
  };
1129
- var deserializeAws_json1_1AttachmentLimitExceeded = function (output, context) {
890
+ const deserializeAws_json1_1AttachmentLimitExceeded = (output, context) => {
1130
891
  return {
1131
892
  message: __expectString(output.message),
1132
893
  };
1133
894
  };
1134
- var deserializeAws_json1_1AttachmentSet = function (output, context) {
1135
- var retVal = (output || [])
1136
- .filter(function (e) { return e != null; })
1137
- .map(function (entry) {
895
+ const deserializeAws_json1_1AttachmentSet = (output, context) => {
896
+ const retVal = (output || [])
897
+ .filter((e) => e != null)
898
+ .map((entry) => {
1138
899
  if (entry === null) {
1139
900
  return null;
1140
901
  }
@@ -1142,27 +903,27 @@ var deserializeAws_json1_1AttachmentSet = function (output, context) {
1142
903
  });
1143
904
  return retVal;
1144
905
  };
1145
- var deserializeAws_json1_1AttachmentSetExpired = function (output, context) {
906
+ const deserializeAws_json1_1AttachmentSetExpired = (output, context) => {
1146
907
  return {
1147
908
  message: __expectString(output.message),
1148
909
  };
1149
910
  };
1150
- var deserializeAws_json1_1AttachmentSetIdNotFound = function (output, context) {
911
+ const deserializeAws_json1_1AttachmentSetIdNotFound = (output, context) => {
1151
912
  return {
1152
913
  message: __expectString(output.message),
1153
914
  };
1154
915
  };
1155
- var deserializeAws_json1_1AttachmentSetSizeLimitExceeded = function (output, context) {
916
+ const deserializeAws_json1_1AttachmentSetSizeLimitExceeded = (output, context) => {
1156
917
  return {
1157
918
  message: __expectString(output.message),
1158
919
  };
1159
920
  };
1160
- var deserializeAws_json1_1CaseCreationLimitExceeded = function (output, context) {
921
+ const deserializeAws_json1_1CaseCreationLimitExceeded = (output, context) => {
1161
922
  return {
1162
923
  message: __expectString(output.message),
1163
924
  };
1164
925
  };
1165
- var deserializeAws_json1_1CaseDetails = function (output, context) {
926
+ const deserializeAws_json1_1CaseDetails = (output, context) => {
1166
927
  return {
1167
928
  caseId: __expectString(output.caseId),
1168
929
  categoryCode: __expectString(output.categoryCode),
@@ -1182,15 +943,15 @@ var deserializeAws_json1_1CaseDetails = function (output, context) {
1182
943
  timeCreated: __expectString(output.timeCreated),
1183
944
  };
1184
945
  };
1185
- var deserializeAws_json1_1CaseIdNotFound = function (output, context) {
946
+ const deserializeAws_json1_1CaseIdNotFound = (output, context) => {
1186
947
  return {
1187
948
  message: __expectString(output.message),
1188
949
  };
1189
950
  };
1190
- var deserializeAws_json1_1CaseList = function (output, context) {
1191
- var retVal = (output || [])
1192
- .filter(function (e) { return e != null; })
1193
- .map(function (entry) {
951
+ const deserializeAws_json1_1CaseList = (output, context) => {
952
+ const retVal = (output || [])
953
+ .filter((e) => e != null)
954
+ .map((entry) => {
1194
955
  if (entry === null) {
1195
956
  return null;
1196
957
  }
@@ -1198,16 +959,16 @@ var deserializeAws_json1_1CaseList = function (output, context) {
1198
959
  });
1199
960
  return retVal;
1200
961
  };
1201
- var deserializeAws_json1_1Category = function (output, context) {
962
+ const deserializeAws_json1_1Category = (output, context) => {
1202
963
  return {
1203
964
  code: __expectString(output.code),
1204
965
  name: __expectString(output.name),
1205
966
  };
1206
967
  };
1207
- var deserializeAws_json1_1CategoryList = function (output, context) {
1208
- var retVal = (output || [])
1209
- .filter(function (e) { return e != null; })
1210
- .map(function (entry) {
968
+ const deserializeAws_json1_1CategoryList = (output, context) => {
969
+ const retVal = (output || [])
970
+ .filter((e) => e != null)
971
+ .map((entry) => {
1211
972
  if (entry === null) {
1212
973
  return null;
1213
974
  }
@@ -1215,10 +976,10 @@ var deserializeAws_json1_1CategoryList = function (output, context) {
1215
976
  });
1216
977
  return retVal;
1217
978
  };
1218
- var deserializeAws_json1_1CcEmailAddressList = function (output, context) {
1219
- var retVal = (output || [])
1220
- .filter(function (e) { return e != null; })
1221
- .map(function (entry) {
979
+ const deserializeAws_json1_1CcEmailAddressList = (output, context) => {
980
+ const retVal = (output || [])
981
+ .filter((e) => e != null)
982
+ .map((entry) => {
1222
983
  if (entry === null) {
1223
984
  return null;
1224
985
  }
@@ -1226,7 +987,7 @@ var deserializeAws_json1_1CcEmailAddressList = function (output, context) {
1226
987
  });
1227
988
  return retVal;
1228
989
  };
1229
- var deserializeAws_json1_1Communication = function (output, context) {
990
+ const deserializeAws_json1_1Communication = (output, context) => {
1230
991
  return {
1231
992
  attachmentSet: output.attachmentSet != null ? deserializeAws_json1_1AttachmentSet(output.attachmentSet, context) : undefined,
1232
993
  body: __expectString(output.body),
@@ -1235,10 +996,10 @@ var deserializeAws_json1_1Communication = function (output, context) {
1235
996
  timeCreated: __expectString(output.timeCreated),
1236
997
  };
1237
998
  };
1238
- var deserializeAws_json1_1CommunicationList = function (output, context) {
1239
- var retVal = (output || [])
1240
- .filter(function (e) { return e != null; })
1241
- .map(function (entry) {
999
+ const deserializeAws_json1_1CommunicationList = (output, context) => {
1000
+ const retVal = (output || [])
1001
+ .filter((e) => e != null)
1002
+ .map((entry) => {
1242
1003
  if (entry === null) {
1243
1004
  return null;
1244
1005
  }
@@ -1246,28 +1007,28 @@ var deserializeAws_json1_1CommunicationList = function (output, context) {
1246
1007
  });
1247
1008
  return retVal;
1248
1009
  };
1249
- var deserializeAws_json1_1CreateCaseResponse = function (output, context) {
1010
+ const deserializeAws_json1_1CreateCaseResponse = (output, context) => {
1250
1011
  return {
1251
1012
  caseId: __expectString(output.caseId),
1252
1013
  };
1253
1014
  };
1254
- var deserializeAws_json1_1DescribeAttachmentLimitExceeded = function (output, context) {
1015
+ const deserializeAws_json1_1DescribeAttachmentLimitExceeded = (output, context) => {
1255
1016
  return {
1256
1017
  message: __expectString(output.message),
1257
1018
  };
1258
1019
  };
1259
- var deserializeAws_json1_1DescribeAttachmentResponse = function (output, context) {
1020
+ const deserializeAws_json1_1DescribeAttachmentResponse = (output, context) => {
1260
1021
  return {
1261
1022
  attachment: output.attachment != null ? deserializeAws_json1_1Attachment(output.attachment, context) : undefined,
1262
1023
  };
1263
1024
  };
1264
- var deserializeAws_json1_1DescribeCasesResponse = function (output, context) {
1025
+ const deserializeAws_json1_1DescribeCasesResponse = (output, context) => {
1265
1026
  return {
1266
1027
  cases: output.cases != null ? deserializeAws_json1_1CaseList(output.cases, context) : undefined,
1267
1028
  nextToken: __expectString(output.nextToken),
1268
1029
  };
1269
1030
  };
1270
- var deserializeAws_json1_1DescribeCommunicationsResponse = function (output, context) {
1031
+ const deserializeAws_json1_1DescribeCommunicationsResponse = (output, context) => {
1271
1032
  return {
1272
1033
  communications: output.communications != null
1273
1034
  ? deserializeAws_json1_1CommunicationList(output.communications, context)
@@ -1275,48 +1036,48 @@ var deserializeAws_json1_1DescribeCommunicationsResponse = function (output, con
1275
1036
  nextToken: __expectString(output.nextToken),
1276
1037
  };
1277
1038
  };
1278
- var deserializeAws_json1_1DescribeServicesResponse = function (output, context) {
1039
+ const deserializeAws_json1_1DescribeServicesResponse = (output, context) => {
1279
1040
  return {
1280
1041
  services: output.services != null ? deserializeAws_json1_1ServiceList(output.services, context) : undefined,
1281
1042
  };
1282
1043
  };
1283
- var deserializeAws_json1_1DescribeSeverityLevelsResponse = function (output, context) {
1044
+ const deserializeAws_json1_1DescribeSeverityLevelsResponse = (output, context) => {
1284
1045
  return {
1285
1046
  severityLevels: output.severityLevels != null
1286
1047
  ? deserializeAws_json1_1SeverityLevelsList(output.severityLevels, context)
1287
1048
  : undefined,
1288
1049
  };
1289
1050
  };
1290
- var deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesResponse = function (output, context) {
1051
+ const deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesResponse = (output, context) => {
1291
1052
  return {
1292
1053
  statuses: output.statuses != null
1293
1054
  ? deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList(output.statuses, context)
1294
1055
  : undefined,
1295
1056
  };
1296
1057
  };
1297
- var deserializeAws_json1_1DescribeTrustedAdvisorCheckResultResponse = function (output, context) {
1058
+ const deserializeAws_json1_1DescribeTrustedAdvisorCheckResultResponse = (output, context) => {
1298
1059
  return {
1299
1060
  result: output.result != null ? deserializeAws_json1_1TrustedAdvisorCheckResult(output.result, context) : undefined,
1300
1061
  };
1301
1062
  };
1302
- var deserializeAws_json1_1DescribeTrustedAdvisorChecksResponse = function (output, context) {
1063
+ const deserializeAws_json1_1DescribeTrustedAdvisorChecksResponse = (output, context) => {
1303
1064
  return {
1304
1065
  checks: output.checks != null ? deserializeAws_json1_1TrustedAdvisorCheckList(output.checks, context) : undefined,
1305
1066
  };
1306
1067
  };
1307
- var deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesResponse = function (output, context) {
1068
+ const deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesResponse = (output, context) => {
1308
1069
  return {
1309
1070
  summaries: output.summaries != null
1310
1071
  ? deserializeAws_json1_1TrustedAdvisorCheckSummaryList(output.summaries, context)
1311
1072
  : undefined,
1312
1073
  };
1313
1074
  };
1314
- var deserializeAws_json1_1InternalServerError = function (output, context) {
1075
+ const deserializeAws_json1_1InternalServerError = (output, context) => {
1315
1076
  return {
1316
1077
  message: __expectString(output.message),
1317
1078
  };
1318
1079
  };
1319
- var deserializeAws_json1_1RecentCaseCommunications = function (output, context) {
1080
+ const deserializeAws_json1_1RecentCaseCommunications = (output, context) => {
1320
1081
  return {
1321
1082
  communications: output.communications != null
1322
1083
  ? deserializeAws_json1_1CommunicationList(output.communications, context)
@@ -1324,30 +1085,30 @@ var deserializeAws_json1_1RecentCaseCommunications = function (output, context)
1324
1085
  nextToken: __expectString(output.nextToken),
1325
1086
  };
1326
1087
  };
1327
- var deserializeAws_json1_1RefreshTrustedAdvisorCheckResponse = function (output, context) {
1088
+ const deserializeAws_json1_1RefreshTrustedAdvisorCheckResponse = (output, context) => {
1328
1089
  return {
1329
1090
  status: output.status != null
1330
1091
  ? deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus(output.status, context)
1331
1092
  : undefined,
1332
1093
  };
1333
1094
  };
1334
- var deserializeAws_json1_1ResolveCaseResponse = function (output, context) {
1095
+ const deserializeAws_json1_1ResolveCaseResponse = (output, context) => {
1335
1096
  return {
1336
1097
  finalCaseStatus: __expectString(output.finalCaseStatus),
1337
1098
  initialCaseStatus: __expectString(output.initialCaseStatus),
1338
1099
  };
1339
1100
  };
1340
- var deserializeAws_json1_1Service = function (output, context) {
1101
+ const deserializeAws_json1_1Service = (output, context) => {
1341
1102
  return {
1342
1103
  categories: output.categories != null ? deserializeAws_json1_1CategoryList(output.categories, context) : undefined,
1343
1104
  code: __expectString(output.code),
1344
1105
  name: __expectString(output.name),
1345
1106
  };
1346
1107
  };
1347
- var deserializeAws_json1_1ServiceList = function (output, context) {
1348
- var retVal = (output || [])
1349
- .filter(function (e) { return e != null; })
1350
- .map(function (entry) {
1108
+ const deserializeAws_json1_1ServiceList = (output, context) => {
1109
+ const retVal = (output || [])
1110
+ .filter((e) => e != null)
1111
+ .map((entry) => {
1351
1112
  if (entry === null) {
1352
1113
  return null;
1353
1114
  }
@@ -1355,16 +1116,16 @@ var deserializeAws_json1_1ServiceList = function (output, context) {
1355
1116
  });
1356
1117
  return retVal;
1357
1118
  };
1358
- var deserializeAws_json1_1SeverityLevel = function (output, context) {
1119
+ const deserializeAws_json1_1SeverityLevel = (output, context) => {
1359
1120
  return {
1360
1121
  code: __expectString(output.code),
1361
1122
  name: __expectString(output.name),
1362
1123
  };
1363
1124
  };
1364
- var deserializeAws_json1_1SeverityLevelsList = function (output, context) {
1365
- var retVal = (output || [])
1366
- .filter(function (e) { return e != null; })
1367
- .map(function (entry) {
1125
+ const deserializeAws_json1_1SeverityLevelsList = (output, context) => {
1126
+ const retVal = (output || [])
1127
+ .filter((e) => e != null)
1128
+ .map((entry) => {
1368
1129
  if (entry === null) {
1369
1130
  return null;
1370
1131
  }
@@ -1372,10 +1133,10 @@ var deserializeAws_json1_1SeverityLevelsList = function (output, context) {
1372
1133
  });
1373
1134
  return retVal;
1374
1135
  };
1375
- var deserializeAws_json1_1StringList = function (output, context) {
1376
- var retVal = (output || [])
1377
- .filter(function (e) { return e != null; })
1378
- .map(function (entry) {
1136
+ const deserializeAws_json1_1StringList = (output, context) => {
1137
+ const retVal = (output || [])
1138
+ .filter((e) => e != null)
1139
+ .map((entry) => {
1379
1140
  if (entry === null) {
1380
1141
  return null;
1381
1142
  }
@@ -1383,14 +1144,14 @@ var deserializeAws_json1_1StringList = function (output, context) {
1383
1144
  });
1384
1145
  return retVal;
1385
1146
  };
1386
- var deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary = function (output, context) {
1147
+ const deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary = (output, context) => {
1387
1148
  return {
1388
1149
  costOptimizing: output.costOptimizing != null
1389
1150
  ? deserializeAws_json1_1TrustedAdvisorCostOptimizingSummary(output.costOptimizing, context)
1390
1151
  : undefined,
1391
1152
  };
1392
1153
  };
1393
- var deserializeAws_json1_1TrustedAdvisorCheckDescription = function (output, context) {
1154
+ const deserializeAws_json1_1TrustedAdvisorCheckDescription = (output, context) => {
1394
1155
  return {
1395
1156
  category: __expectString(output.category),
1396
1157
  description: __expectString(output.description),
@@ -1399,10 +1160,10 @@ var deserializeAws_json1_1TrustedAdvisorCheckDescription = function (output, con
1399
1160
  name: __expectString(output.name),
1400
1161
  };
1401
1162
  };
1402
- var deserializeAws_json1_1TrustedAdvisorCheckList = function (output, context) {
1403
- var retVal = (output || [])
1404
- .filter(function (e) { return e != null; })
1405
- .map(function (entry) {
1163
+ const deserializeAws_json1_1TrustedAdvisorCheckList = (output, context) => {
1164
+ const retVal = (output || [])
1165
+ .filter((e) => e != null)
1166
+ .map((entry) => {
1406
1167
  if (entry === null) {
1407
1168
  return null;
1408
1169
  }
@@ -1410,17 +1171,17 @@ var deserializeAws_json1_1TrustedAdvisorCheckList = function (output, context) {
1410
1171
  });
1411
1172
  return retVal;
1412
1173
  };
1413
- var deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus = function (output, context) {
1174
+ const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus = (output, context) => {
1414
1175
  return {
1415
1176
  checkId: __expectString(output.checkId),
1416
1177
  millisUntilNextRefreshable: __expectLong(output.millisUntilNextRefreshable),
1417
1178
  status: __expectString(output.status),
1418
1179
  };
1419
1180
  };
1420
- var deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = function (output, context) {
1421
- var retVal = (output || [])
1422
- .filter(function (e) { return e != null; })
1423
- .map(function (entry) {
1181
+ const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = (output, context) => {
1182
+ const retVal = (output || [])
1183
+ .filter((e) => e != null)
1184
+ .map((entry) => {
1424
1185
  if (entry === null) {
1425
1186
  return null;
1426
1187
  }
@@ -1428,7 +1189,7 @@ var deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = function (outpu
1428
1189
  });
1429
1190
  return retVal;
1430
1191
  };
1431
- var deserializeAws_json1_1TrustedAdvisorCheckResult = function (output, context) {
1192
+ const deserializeAws_json1_1TrustedAdvisorCheckResult = (output, context) => {
1432
1193
  return {
1433
1194
  categorySpecificSummary: output.categorySpecificSummary != null
1434
1195
  ? deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary(output.categorySpecificSummary, context)
@@ -1444,7 +1205,7 @@ var deserializeAws_json1_1TrustedAdvisorCheckResult = function (output, context)
1444
1205
  timestamp: __expectString(output.timestamp),
1445
1206
  };
1446
1207
  };
1447
- var deserializeAws_json1_1TrustedAdvisorCheckSummary = function (output, context) {
1208
+ const deserializeAws_json1_1TrustedAdvisorCheckSummary = (output, context) => {
1448
1209
  return {
1449
1210
  categorySpecificSummary: output.categorySpecificSummary != null
1450
1211
  ? deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary(output.categorySpecificSummary, context)
@@ -1458,10 +1219,10 @@ var deserializeAws_json1_1TrustedAdvisorCheckSummary = function (output, context
1458
1219
  timestamp: __expectString(output.timestamp),
1459
1220
  };
1460
1221
  };
1461
- var deserializeAws_json1_1TrustedAdvisorCheckSummaryList = function (output, context) {
1462
- var retVal = (output || [])
1463
- .filter(function (e) { return e != null; })
1464
- .map(function (entry) {
1222
+ const deserializeAws_json1_1TrustedAdvisorCheckSummaryList = (output, context) => {
1223
+ const retVal = (output || [])
1224
+ .filter((e) => e != null)
1225
+ .map((entry) => {
1465
1226
  if (entry === null) {
1466
1227
  return null;
1467
1228
  }
@@ -1469,13 +1230,13 @@ var deserializeAws_json1_1TrustedAdvisorCheckSummaryList = function (output, con
1469
1230
  });
1470
1231
  return retVal;
1471
1232
  };
1472
- var deserializeAws_json1_1TrustedAdvisorCostOptimizingSummary = function (output, context) {
1233
+ const deserializeAws_json1_1TrustedAdvisorCostOptimizingSummary = (output, context) => {
1473
1234
  return {
1474
1235
  estimatedMonthlySavings: __limitedParseDouble(output.estimatedMonthlySavings),
1475
1236
  estimatedPercentMonthlySavings: __limitedParseDouble(output.estimatedPercentMonthlySavings),
1476
1237
  };
1477
1238
  };
1478
- var deserializeAws_json1_1TrustedAdvisorResourceDetail = function (output, context) {
1239
+ const deserializeAws_json1_1TrustedAdvisorResourceDetail = (output, context) => {
1479
1240
  return {
1480
1241
  isSuppressed: __expectBoolean(output.isSuppressed),
1481
1242
  metadata: output.metadata != null ? deserializeAws_json1_1StringList(output.metadata, context) : undefined,
@@ -1484,10 +1245,10 @@ var deserializeAws_json1_1TrustedAdvisorResourceDetail = function (output, conte
1484
1245
  status: __expectString(output.status),
1485
1246
  };
1486
1247
  };
1487
- var deserializeAws_json1_1TrustedAdvisorResourceDetailList = function (output, context) {
1488
- var retVal = (output || [])
1489
- .filter(function (e) { return e != null; })
1490
- .map(function (entry) {
1248
+ const deserializeAws_json1_1TrustedAdvisorResourceDetailList = (output, context) => {
1249
+ const retVal = (output || [])
1250
+ .filter((e) => e != null)
1251
+ .map((entry) => {
1491
1252
  if (entry === null) {
1492
1253
  return null;
1493
1254
  }
@@ -1495,7 +1256,7 @@ var deserializeAws_json1_1TrustedAdvisorResourceDetailList = function (output, c
1495
1256
  });
1496
1257
  return retVal;
1497
1258
  };
1498
- var deserializeAws_json1_1TrustedAdvisorResourcesSummary = function (output, context) {
1259
+ const deserializeAws_json1_1TrustedAdvisorResourcesSummary = (output, context) => {
1499
1260
  return {
1500
1261
  resourcesFlagged: __expectLong(output.resourcesFlagged),
1501
1262
  resourcesIgnored: __expectLong(output.resourcesIgnored),
@@ -1503,75 +1264,52 @@ var deserializeAws_json1_1TrustedAdvisorResourcesSummary = function (output, con
1503
1264
  resourcesSuppressed: __expectLong(output.resourcesSuppressed),
1504
1265
  };
1505
1266
  };
1506
- var deserializeMetadata = function (output) {
1507
- var _a;
1508
- return ({
1509
- httpStatusCode: output.statusCode,
1510
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1511
- extendedRequestId: output.headers["x-amz-id-2"],
1512
- cfId: output.headers["x-amz-cf-id"],
1513
- });
1514
- };
1515
- var collectBody = function (streamBody, context) {
1516
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1267
+ const deserializeMetadata = (output) => ({
1268
+ httpStatusCode: output.statusCode,
1269
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1270
+ extendedRequestId: output.headers["x-amz-id-2"],
1271
+ cfId: output.headers["x-amz-cf-id"],
1272
+ });
1273
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1517
1274
  if (streamBody instanceof Uint8Array) {
1518
1275
  return Promise.resolve(streamBody);
1519
1276
  }
1520
1277
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1521
1278
  };
1522
- var collectBodyString = function (streamBody, context) {
1523
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1524
- };
1525
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
1526
- var _a, hostname, _b, protocol, port, basePath, contents;
1527
- return __generator(this, function (_c) {
1528
- switch (_c.label) {
1529
- case 0: return [4, context.endpoint()];
1530
- case 1:
1531
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1532
- contents = {
1533
- protocol: protocol,
1534
- hostname: hostname,
1535
- port: port,
1536
- method: "POST",
1537
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1538
- headers: headers,
1539
- };
1540
- if (resolvedHostname !== undefined) {
1541
- contents.hostname = resolvedHostname;
1542
- }
1543
- if (body !== undefined) {
1544
- contents.body = body;
1545
- }
1546
- return [2, new __HttpRequest(contents)];
1547
- }
1548
- });
1549
- }); };
1550
- var parseBody = function (streamBody, context) {
1551
- return collectBodyString(streamBody, context).then(function (encoded) {
1552
- if (encoded.length) {
1553
- return JSON.parse(encoded);
1554
- }
1555
- return {};
1556
- });
1279
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1280
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1281
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1282
+ const contents = {
1283
+ protocol,
1284
+ hostname,
1285
+ port,
1286
+ method: "POST",
1287
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1288
+ headers,
1289
+ };
1290
+ if (resolvedHostname !== undefined) {
1291
+ contents.hostname = resolvedHostname;
1292
+ }
1293
+ if (body !== undefined) {
1294
+ contents.body = body;
1295
+ }
1296
+ return new __HttpRequest(contents);
1557
1297
  };
1558
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1559
- var value;
1560
- var _a;
1561
- return __generator(this, function (_b) {
1562
- switch (_b.label) {
1563
- case 0: return [4, parseBody(errorBody, context)];
1564
- case 1:
1565
- value = _b.sent();
1566
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1567
- return [2, value];
1568
- }
1569
- });
1570
- }); };
1571
- var loadRestJsonErrorCode = function (output, data) {
1572
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1573
- var sanitizeErrorCode = function (rawValue) {
1574
- var cleanValue = rawValue;
1298
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1299
+ if (encoded.length) {
1300
+ return JSON.parse(encoded);
1301
+ }
1302
+ return {};
1303
+ });
1304
+ const parseErrorBody = async (errorBody, context) => {
1305
+ const value = await parseBody(errorBody, context);
1306
+ value.message = value.message ?? value.Message;
1307
+ return value;
1308
+ };
1309
+ const loadRestJsonErrorCode = (output, data) => {
1310
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1311
+ const sanitizeErrorCode = (rawValue) => {
1312
+ let cleanValue = rawValue;
1575
1313
  if (typeof cleanValue === "number") {
1576
1314
  cleanValue = cleanValue.toString();
1577
1315
  }
@@ -1586,7 +1324,7 @@ var loadRestJsonErrorCode = function (output, data) {
1586
1324
  }
1587
1325
  return cleanValue;
1588
1326
  };
1589
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1327
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1590
1328
  if (headerKey !== undefined) {
1591
1329
  return sanitizeErrorCode(output.headers[headerKey]);
1592
1330
  }