@aws-sdk/client-support 3.183.0 → 3.186.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 (29) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist-cjs/protocols/Aws_json1_1.js +2 -2
  3. package/dist-es/Support.js +65 -58
  4. package/dist-es/SupportClient.js +28 -22
  5. package/dist-es/commands/AddAttachmentsToSetCommand.js +28 -21
  6. package/dist-es/commands/AddCommunicationToCaseCommand.js +28 -21
  7. package/dist-es/commands/CreateCaseCommand.js +28 -21
  8. package/dist-es/commands/DescribeAttachmentCommand.js +28 -21
  9. package/dist-es/commands/DescribeCasesCommand.js +28 -21
  10. package/dist-es/commands/DescribeCommunicationsCommand.js +28 -21
  11. package/dist-es/commands/DescribeServicesCommand.js +28 -21
  12. package/dist-es/commands/DescribeSeverityLevelsCommand.js +28 -21
  13. package/dist-es/commands/DescribeTrustedAdvisorCheckRefreshStatusesCommand.js +28 -21
  14. package/dist-es/commands/DescribeTrustedAdvisorCheckResultCommand.js +28 -21
  15. package/dist-es/commands/DescribeTrustedAdvisorCheckSummariesCommand.js +28 -21
  16. package/dist-es/commands/DescribeTrustedAdvisorChecksCommand.js +28 -21
  17. package/dist-es/commands/RefreshTrustedAdvisorCheckCommand.js +28 -21
  18. package/dist-es/commands/ResolveCaseCommand.js +28 -21
  19. package/dist-es/endpoints.js +8 -8
  20. package/dist-es/models/SupportServiceException.js +10 -5
  21. package/dist-es/models/models_0.js +144 -231
  22. package/dist-es/pagination/DescribeCasesPaginator.js +68 -25
  23. package/dist-es/pagination/DescribeCommunicationsPaginator.js +68 -25
  24. package/dist-es/protocols/Aws_json1_1.js +1212 -950
  25. package/dist-es/runtimeConfig.browser.js +12 -26
  26. package/dist-es/runtimeConfig.js +12 -30
  27. package/dist-es/runtimeConfig.native.js +5 -8
  28. package/dist-es/runtimeConfig.shared.js +11 -8
  29. package/package.json +33 -33
@@ -1,901 +1,1140 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectString as __expectString, limitedParseDouble as __limitedParseDouble, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { AttachmentIdNotFound, AttachmentLimitExceeded, AttachmentSetExpired, AttachmentSetIdNotFound, AttachmentSetSizeLimitExceeded, CaseCreationLimitExceeded, CaseIdNotFound, DescribeAttachmentLimitExceeded, InternalServerError, } from "../models/models_0";
4
5
  import { SupportServiceException as __BaseException } from "../models/SupportServiceException";
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
- }
568
- };
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
- };
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) }));
724
1017
  };
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
- };
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 }));
734
1022
  };
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
- };
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 }));
740
1025
  };
741
- const serializeAws_json1_1Attachments = (input, context) => {
1026
+ var serializeAws_json1_1Attachments = function (input, context) {
742
1027
  return input
743
- .filter((e) => e != null)
744
- .map((entry) => {
1028
+ .filter(function (e) { return e != null; })
1029
+ .map(function (entry) {
745
1030
  return serializeAws_json1_1Attachment(entry, context);
746
1031
  });
747
1032
  };
748
- const serializeAws_json1_1CaseIdList = (input, context) => {
1033
+ var serializeAws_json1_1CaseIdList = function (input, context) {
749
1034
  return input
750
- .filter((e) => e != null)
751
- .map((entry) => {
1035
+ .filter(function (e) { return e != null; })
1036
+ .map(function (entry) {
752
1037
  return entry;
753
1038
  });
754
1039
  };
755
- const serializeAws_json1_1CcEmailAddressList = (input, context) => {
1040
+ var serializeAws_json1_1CcEmailAddressList = function (input, context) {
756
1041
  return input
757
- .filter((e) => e != null)
758
- .map((entry) => {
1042
+ .filter(function (e) { return e != null; })
1043
+ .map(function (entry) {
759
1044
  return entry;
760
1045
  });
761
1046
  };
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
- };
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 }));
776
1051
  };
777
- const serializeAws_json1_1DescribeAttachmentRequest = (input, context) => {
778
- return {
779
- ...(input.attachmentId != null && { attachmentId: input.attachmentId }),
780
- };
1052
+ var serializeAws_json1_1DescribeAttachmentRequest = function (input, context) {
1053
+ return __assign({}, (input.attachmentId != null && { attachmentId: input.attachmentId }));
781
1054
  };
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
- };
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 }));
794
1057
  };
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
- };
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 }));
803
1060
  };
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
- };
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
+ }));
811
1065
  };
812
- const serializeAws_json1_1DescribeSeverityLevelsRequest = (input, context) => {
813
- return {
814
- ...(input.language != null && { language: input.language }),
815
- };
1066
+ var serializeAws_json1_1DescribeSeverityLevelsRequest = function (input, context) {
1067
+ return __assign({}, (input.language != null && { language: input.language }));
816
1068
  };
817
- const serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest = (input, context) => {
818
- return {
819
- ...(input.checkIds != null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }),
820
- };
1069
+ var serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest = function (input, context) {
1070
+ return __assign({}, (input.checkIds != null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }));
821
1071
  };
822
- const serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest = (input, context) => {
823
- return {
824
- ...(input.checkId != null && { checkId: input.checkId }),
825
- ...(input.language != null && { language: input.language }),
826
- };
1072
+ var serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest = function (input, context) {
1073
+ return __assign(__assign({}, (input.checkId != null && { checkId: input.checkId })), (input.language != null && { language: input.language }));
827
1074
  };
828
- const serializeAws_json1_1DescribeTrustedAdvisorChecksRequest = (input, context) => {
829
- return {
830
- ...(input.language != null && { language: input.language }),
831
- };
1075
+ var serializeAws_json1_1DescribeTrustedAdvisorChecksRequest = function (input, context) {
1076
+ return __assign({}, (input.language != null && { language: input.language }));
832
1077
  };
833
- const serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest = (input, context) => {
834
- return {
835
- ...(input.checkIds != null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }),
836
- };
1078
+ var serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest = function (input, context) {
1079
+ return __assign({}, (input.checkIds != null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }));
837
1080
  };
838
- const serializeAws_json1_1RefreshTrustedAdvisorCheckRequest = (input, context) => {
839
- return {
840
- ...(input.checkId != null && { checkId: input.checkId }),
841
- };
1081
+ var serializeAws_json1_1RefreshTrustedAdvisorCheckRequest = function (input, context) {
1082
+ return __assign({}, (input.checkId != null && { checkId: input.checkId }));
842
1083
  };
843
- const serializeAws_json1_1ResolveCaseRequest = (input, context) => {
844
- return {
845
- ...(input.caseId != null && { caseId: input.caseId }),
846
- };
1084
+ var serializeAws_json1_1ResolveCaseRequest = function (input, context) {
1085
+ return __assign({}, (input.caseId != null && { caseId: input.caseId }));
847
1086
  };
848
- const serializeAws_json1_1ServiceCodeList = (input, context) => {
1087
+ var serializeAws_json1_1ServiceCodeList = function (input, context) {
849
1088
  return input
850
- .filter((e) => e != null)
851
- .map((entry) => {
1089
+ .filter(function (e) { return e != null; })
1090
+ .map(function (entry) {
852
1091
  return entry;
853
1092
  });
854
1093
  };
855
- const serializeAws_json1_1StringList = (input, context) => {
1094
+ var serializeAws_json1_1StringList = function (input, context) {
856
1095
  return input
857
- .filter((e) => e != null)
858
- .map((entry) => {
1096
+ .filter(function (e) { return e != null; })
1097
+ .map(function (entry) {
859
1098
  return entry;
860
1099
  });
861
1100
  };
862
- const deserializeAws_json1_1AddAttachmentsToSetResponse = (output, context) => {
1101
+ var deserializeAws_json1_1AddAttachmentsToSetResponse = function (output, context) {
863
1102
  return {
864
1103
  attachmentSetId: __expectString(output.attachmentSetId),
865
1104
  expiryTime: __expectString(output.expiryTime),
866
1105
  };
867
1106
  };
868
- const deserializeAws_json1_1AddCommunicationToCaseResponse = (output, context) => {
1107
+ var deserializeAws_json1_1AddCommunicationToCaseResponse = function (output, context) {
869
1108
  return {
870
1109
  result: __expectBoolean(output.result),
871
1110
  };
872
1111
  };
873
- const deserializeAws_json1_1Attachment = (output, context) => {
1112
+ var deserializeAws_json1_1Attachment = function (output, context) {
874
1113
  return {
875
1114
  data: output.data != null ? context.base64Decoder(output.data) : undefined,
876
1115
  fileName: __expectString(output.fileName),
877
1116
  };
878
1117
  };
879
- const deserializeAws_json1_1AttachmentDetails = (output, context) => {
1118
+ var deserializeAws_json1_1AttachmentDetails = function (output, context) {
880
1119
  return {
881
1120
  attachmentId: __expectString(output.attachmentId),
882
1121
  fileName: __expectString(output.fileName),
883
1122
  };
884
1123
  };
885
- const deserializeAws_json1_1AttachmentIdNotFound = (output, context) => {
1124
+ var deserializeAws_json1_1AttachmentIdNotFound = function (output, context) {
886
1125
  return {
887
1126
  message: __expectString(output.message),
888
1127
  };
889
1128
  };
890
- const deserializeAws_json1_1AttachmentLimitExceeded = (output, context) => {
1129
+ var deserializeAws_json1_1AttachmentLimitExceeded = function (output, context) {
891
1130
  return {
892
1131
  message: __expectString(output.message),
893
1132
  };
894
1133
  };
895
- const deserializeAws_json1_1AttachmentSet = (output, context) => {
896
- const retVal = (output || [])
897
- .filter((e) => e != null)
898
- .map((entry) => {
1134
+ var deserializeAws_json1_1AttachmentSet = function (output, context) {
1135
+ var retVal = (output || [])
1136
+ .filter(function (e) { return e != null; })
1137
+ .map(function (entry) {
899
1138
  if (entry === null) {
900
1139
  return null;
901
1140
  }
@@ -903,27 +1142,27 @@ const deserializeAws_json1_1AttachmentSet = (output, context) => {
903
1142
  });
904
1143
  return retVal;
905
1144
  };
906
- const deserializeAws_json1_1AttachmentSetExpired = (output, context) => {
1145
+ var deserializeAws_json1_1AttachmentSetExpired = function (output, context) {
907
1146
  return {
908
1147
  message: __expectString(output.message),
909
1148
  };
910
1149
  };
911
- const deserializeAws_json1_1AttachmentSetIdNotFound = (output, context) => {
1150
+ var deserializeAws_json1_1AttachmentSetIdNotFound = function (output, context) {
912
1151
  return {
913
1152
  message: __expectString(output.message),
914
1153
  };
915
1154
  };
916
- const deserializeAws_json1_1AttachmentSetSizeLimitExceeded = (output, context) => {
1155
+ var deserializeAws_json1_1AttachmentSetSizeLimitExceeded = function (output, context) {
917
1156
  return {
918
1157
  message: __expectString(output.message),
919
1158
  };
920
1159
  };
921
- const deserializeAws_json1_1CaseCreationLimitExceeded = (output, context) => {
1160
+ var deserializeAws_json1_1CaseCreationLimitExceeded = function (output, context) {
922
1161
  return {
923
1162
  message: __expectString(output.message),
924
1163
  };
925
1164
  };
926
- const deserializeAws_json1_1CaseDetails = (output, context) => {
1165
+ var deserializeAws_json1_1CaseDetails = function (output, context) {
927
1166
  return {
928
1167
  caseId: __expectString(output.caseId),
929
1168
  categoryCode: __expectString(output.categoryCode),
@@ -943,15 +1182,15 @@ const deserializeAws_json1_1CaseDetails = (output, context) => {
943
1182
  timeCreated: __expectString(output.timeCreated),
944
1183
  };
945
1184
  };
946
- const deserializeAws_json1_1CaseIdNotFound = (output, context) => {
1185
+ var deserializeAws_json1_1CaseIdNotFound = function (output, context) {
947
1186
  return {
948
1187
  message: __expectString(output.message),
949
1188
  };
950
1189
  };
951
- const deserializeAws_json1_1CaseList = (output, context) => {
952
- const retVal = (output || [])
953
- .filter((e) => e != null)
954
- .map((entry) => {
1190
+ var deserializeAws_json1_1CaseList = function (output, context) {
1191
+ var retVal = (output || [])
1192
+ .filter(function (e) { return e != null; })
1193
+ .map(function (entry) {
955
1194
  if (entry === null) {
956
1195
  return null;
957
1196
  }
@@ -959,16 +1198,16 @@ const deserializeAws_json1_1CaseList = (output, context) => {
959
1198
  });
960
1199
  return retVal;
961
1200
  };
962
- const deserializeAws_json1_1Category = (output, context) => {
1201
+ var deserializeAws_json1_1Category = function (output, context) {
963
1202
  return {
964
1203
  code: __expectString(output.code),
965
1204
  name: __expectString(output.name),
966
1205
  };
967
1206
  };
968
- const deserializeAws_json1_1CategoryList = (output, context) => {
969
- const retVal = (output || [])
970
- .filter((e) => e != null)
971
- .map((entry) => {
1207
+ var deserializeAws_json1_1CategoryList = function (output, context) {
1208
+ var retVal = (output || [])
1209
+ .filter(function (e) { return e != null; })
1210
+ .map(function (entry) {
972
1211
  if (entry === null) {
973
1212
  return null;
974
1213
  }
@@ -976,10 +1215,10 @@ const deserializeAws_json1_1CategoryList = (output, context) => {
976
1215
  });
977
1216
  return retVal;
978
1217
  };
979
- const deserializeAws_json1_1CcEmailAddressList = (output, context) => {
980
- const retVal = (output || [])
981
- .filter((e) => e != null)
982
- .map((entry) => {
1218
+ var deserializeAws_json1_1CcEmailAddressList = function (output, context) {
1219
+ var retVal = (output || [])
1220
+ .filter(function (e) { return e != null; })
1221
+ .map(function (entry) {
983
1222
  if (entry === null) {
984
1223
  return null;
985
1224
  }
@@ -987,7 +1226,7 @@ const deserializeAws_json1_1CcEmailAddressList = (output, context) => {
987
1226
  });
988
1227
  return retVal;
989
1228
  };
990
- const deserializeAws_json1_1Communication = (output, context) => {
1229
+ var deserializeAws_json1_1Communication = function (output, context) {
991
1230
  return {
992
1231
  attachmentSet: output.attachmentSet != null ? deserializeAws_json1_1AttachmentSet(output.attachmentSet, context) : undefined,
993
1232
  body: __expectString(output.body),
@@ -996,10 +1235,10 @@ const deserializeAws_json1_1Communication = (output, context) => {
996
1235
  timeCreated: __expectString(output.timeCreated),
997
1236
  };
998
1237
  };
999
- const deserializeAws_json1_1CommunicationList = (output, context) => {
1000
- const retVal = (output || [])
1001
- .filter((e) => e != null)
1002
- .map((entry) => {
1238
+ var deserializeAws_json1_1CommunicationList = function (output, context) {
1239
+ var retVal = (output || [])
1240
+ .filter(function (e) { return e != null; })
1241
+ .map(function (entry) {
1003
1242
  if (entry === null) {
1004
1243
  return null;
1005
1244
  }
@@ -1007,28 +1246,28 @@ const deserializeAws_json1_1CommunicationList = (output, context) => {
1007
1246
  });
1008
1247
  return retVal;
1009
1248
  };
1010
- const deserializeAws_json1_1CreateCaseResponse = (output, context) => {
1249
+ var deserializeAws_json1_1CreateCaseResponse = function (output, context) {
1011
1250
  return {
1012
1251
  caseId: __expectString(output.caseId),
1013
1252
  };
1014
1253
  };
1015
- const deserializeAws_json1_1DescribeAttachmentLimitExceeded = (output, context) => {
1254
+ var deserializeAws_json1_1DescribeAttachmentLimitExceeded = function (output, context) {
1016
1255
  return {
1017
1256
  message: __expectString(output.message),
1018
1257
  };
1019
1258
  };
1020
- const deserializeAws_json1_1DescribeAttachmentResponse = (output, context) => {
1259
+ var deserializeAws_json1_1DescribeAttachmentResponse = function (output, context) {
1021
1260
  return {
1022
1261
  attachment: output.attachment != null ? deserializeAws_json1_1Attachment(output.attachment, context) : undefined,
1023
1262
  };
1024
1263
  };
1025
- const deserializeAws_json1_1DescribeCasesResponse = (output, context) => {
1264
+ var deserializeAws_json1_1DescribeCasesResponse = function (output, context) {
1026
1265
  return {
1027
1266
  cases: output.cases != null ? deserializeAws_json1_1CaseList(output.cases, context) : undefined,
1028
1267
  nextToken: __expectString(output.nextToken),
1029
1268
  };
1030
1269
  };
1031
- const deserializeAws_json1_1DescribeCommunicationsResponse = (output, context) => {
1270
+ var deserializeAws_json1_1DescribeCommunicationsResponse = function (output, context) {
1032
1271
  return {
1033
1272
  communications: output.communications != null
1034
1273
  ? deserializeAws_json1_1CommunicationList(output.communications, context)
@@ -1036,48 +1275,48 @@ const deserializeAws_json1_1DescribeCommunicationsResponse = (output, context) =
1036
1275
  nextToken: __expectString(output.nextToken),
1037
1276
  };
1038
1277
  };
1039
- const deserializeAws_json1_1DescribeServicesResponse = (output, context) => {
1278
+ var deserializeAws_json1_1DescribeServicesResponse = function (output, context) {
1040
1279
  return {
1041
1280
  services: output.services != null ? deserializeAws_json1_1ServiceList(output.services, context) : undefined,
1042
1281
  };
1043
1282
  };
1044
- const deserializeAws_json1_1DescribeSeverityLevelsResponse = (output, context) => {
1283
+ var deserializeAws_json1_1DescribeSeverityLevelsResponse = function (output, context) {
1045
1284
  return {
1046
1285
  severityLevels: output.severityLevels != null
1047
1286
  ? deserializeAws_json1_1SeverityLevelsList(output.severityLevels, context)
1048
1287
  : undefined,
1049
1288
  };
1050
1289
  };
1051
- const deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesResponse = (output, context) => {
1290
+ var deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesResponse = function (output, context) {
1052
1291
  return {
1053
1292
  statuses: output.statuses != null
1054
1293
  ? deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList(output.statuses, context)
1055
1294
  : undefined,
1056
1295
  };
1057
1296
  };
1058
- const deserializeAws_json1_1DescribeTrustedAdvisorCheckResultResponse = (output, context) => {
1297
+ var deserializeAws_json1_1DescribeTrustedAdvisorCheckResultResponse = function (output, context) {
1059
1298
  return {
1060
1299
  result: output.result != null ? deserializeAws_json1_1TrustedAdvisorCheckResult(output.result, context) : undefined,
1061
1300
  };
1062
1301
  };
1063
- const deserializeAws_json1_1DescribeTrustedAdvisorChecksResponse = (output, context) => {
1302
+ var deserializeAws_json1_1DescribeTrustedAdvisorChecksResponse = function (output, context) {
1064
1303
  return {
1065
1304
  checks: output.checks != null ? deserializeAws_json1_1TrustedAdvisorCheckList(output.checks, context) : undefined,
1066
1305
  };
1067
1306
  };
1068
- const deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesResponse = (output, context) => {
1307
+ var deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesResponse = function (output, context) {
1069
1308
  return {
1070
1309
  summaries: output.summaries != null
1071
1310
  ? deserializeAws_json1_1TrustedAdvisorCheckSummaryList(output.summaries, context)
1072
1311
  : undefined,
1073
1312
  };
1074
1313
  };
1075
- const deserializeAws_json1_1InternalServerError = (output, context) => {
1314
+ var deserializeAws_json1_1InternalServerError = function (output, context) {
1076
1315
  return {
1077
1316
  message: __expectString(output.message),
1078
1317
  };
1079
1318
  };
1080
- const deserializeAws_json1_1RecentCaseCommunications = (output, context) => {
1319
+ var deserializeAws_json1_1RecentCaseCommunications = function (output, context) {
1081
1320
  return {
1082
1321
  communications: output.communications != null
1083
1322
  ? deserializeAws_json1_1CommunicationList(output.communications, context)
@@ -1085,30 +1324,30 @@ const deserializeAws_json1_1RecentCaseCommunications = (output, context) => {
1085
1324
  nextToken: __expectString(output.nextToken),
1086
1325
  };
1087
1326
  };
1088
- const deserializeAws_json1_1RefreshTrustedAdvisorCheckResponse = (output, context) => {
1327
+ var deserializeAws_json1_1RefreshTrustedAdvisorCheckResponse = function (output, context) {
1089
1328
  return {
1090
1329
  status: output.status != null
1091
1330
  ? deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus(output.status, context)
1092
1331
  : undefined,
1093
1332
  };
1094
1333
  };
1095
- const deserializeAws_json1_1ResolveCaseResponse = (output, context) => {
1334
+ var deserializeAws_json1_1ResolveCaseResponse = function (output, context) {
1096
1335
  return {
1097
1336
  finalCaseStatus: __expectString(output.finalCaseStatus),
1098
1337
  initialCaseStatus: __expectString(output.initialCaseStatus),
1099
1338
  };
1100
1339
  };
1101
- const deserializeAws_json1_1Service = (output, context) => {
1340
+ var deserializeAws_json1_1Service = function (output, context) {
1102
1341
  return {
1103
1342
  categories: output.categories != null ? deserializeAws_json1_1CategoryList(output.categories, context) : undefined,
1104
1343
  code: __expectString(output.code),
1105
1344
  name: __expectString(output.name),
1106
1345
  };
1107
1346
  };
1108
- const deserializeAws_json1_1ServiceList = (output, context) => {
1109
- const retVal = (output || [])
1110
- .filter((e) => e != null)
1111
- .map((entry) => {
1347
+ var deserializeAws_json1_1ServiceList = function (output, context) {
1348
+ var retVal = (output || [])
1349
+ .filter(function (e) { return e != null; })
1350
+ .map(function (entry) {
1112
1351
  if (entry === null) {
1113
1352
  return null;
1114
1353
  }
@@ -1116,16 +1355,16 @@ const deserializeAws_json1_1ServiceList = (output, context) => {
1116
1355
  });
1117
1356
  return retVal;
1118
1357
  };
1119
- const deserializeAws_json1_1SeverityLevel = (output, context) => {
1358
+ var deserializeAws_json1_1SeverityLevel = function (output, context) {
1120
1359
  return {
1121
1360
  code: __expectString(output.code),
1122
1361
  name: __expectString(output.name),
1123
1362
  };
1124
1363
  };
1125
- const deserializeAws_json1_1SeverityLevelsList = (output, context) => {
1126
- const retVal = (output || [])
1127
- .filter((e) => e != null)
1128
- .map((entry) => {
1364
+ var deserializeAws_json1_1SeverityLevelsList = function (output, context) {
1365
+ var retVal = (output || [])
1366
+ .filter(function (e) { return e != null; })
1367
+ .map(function (entry) {
1129
1368
  if (entry === null) {
1130
1369
  return null;
1131
1370
  }
@@ -1133,10 +1372,10 @@ const deserializeAws_json1_1SeverityLevelsList = (output, context) => {
1133
1372
  });
1134
1373
  return retVal;
1135
1374
  };
1136
- const deserializeAws_json1_1StringList = (output, context) => {
1137
- const retVal = (output || [])
1138
- .filter((e) => e != null)
1139
- .map((entry) => {
1375
+ var deserializeAws_json1_1StringList = function (output, context) {
1376
+ var retVal = (output || [])
1377
+ .filter(function (e) { return e != null; })
1378
+ .map(function (entry) {
1140
1379
  if (entry === null) {
1141
1380
  return null;
1142
1381
  }
@@ -1144,14 +1383,14 @@ const deserializeAws_json1_1StringList = (output, context) => {
1144
1383
  });
1145
1384
  return retVal;
1146
1385
  };
1147
- const deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary = (output, context) => {
1386
+ var deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary = function (output, context) {
1148
1387
  return {
1149
1388
  costOptimizing: output.costOptimizing != null
1150
1389
  ? deserializeAws_json1_1TrustedAdvisorCostOptimizingSummary(output.costOptimizing, context)
1151
1390
  : undefined,
1152
1391
  };
1153
1392
  };
1154
- const deserializeAws_json1_1TrustedAdvisorCheckDescription = (output, context) => {
1393
+ var deserializeAws_json1_1TrustedAdvisorCheckDescription = function (output, context) {
1155
1394
  return {
1156
1395
  category: __expectString(output.category),
1157
1396
  description: __expectString(output.description),
@@ -1160,10 +1399,10 @@ const deserializeAws_json1_1TrustedAdvisorCheckDescription = (output, context) =
1160
1399
  name: __expectString(output.name),
1161
1400
  };
1162
1401
  };
1163
- const deserializeAws_json1_1TrustedAdvisorCheckList = (output, context) => {
1164
- const retVal = (output || [])
1165
- .filter((e) => e != null)
1166
- .map((entry) => {
1402
+ var deserializeAws_json1_1TrustedAdvisorCheckList = function (output, context) {
1403
+ var retVal = (output || [])
1404
+ .filter(function (e) { return e != null; })
1405
+ .map(function (entry) {
1167
1406
  if (entry === null) {
1168
1407
  return null;
1169
1408
  }
@@ -1171,17 +1410,17 @@ const deserializeAws_json1_1TrustedAdvisorCheckList = (output, context) => {
1171
1410
  });
1172
1411
  return retVal;
1173
1412
  };
1174
- const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus = (output, context) => {
1413
+ var deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus = function (output, context) {
1175
1414
  return {
1176
1415
  checkId: __expectString(output.checkId),
1177
1416
  millisUntilNextRefreshable: __expectLong(output.millisUntilNextRefreshable),
1178
1417
  status: __expectString(output.status),
1179
1418
  };
1180
1419
  };
1181
- const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = (output, context) => {
1182
- const retVal = (output || [])
1183
- .filter((e) => e != null)
1184
- .map((entry) => {
1420
+ var deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = function (output, context) {
1421
+ var retVal = (output || [])
1422
+ .filter(function (e) { return e != null; })
1423
+ .map(function (entry) {
1185
1424
  if (entry === null) {
1186
1425
  return null;
1187
1426
  }
@@ -1189,7 +1428,7 @@ const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = (output, cont
1189
1428
  });
1190
1429
  return retVal;
1191
1430
  };
1192
- const deserializeAws_json1_1TrustedAdvisorCheckResult = (output, context) => {
1431
+ var deserializeAws_json1_1TrustedAdvisorCheckResult = function (output, context) {
1193
1432
  return {
1194
1433
  categorySpecificSummary: output.categorySpecificSummary != null
1195
1434
  ? deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary(output.categorySpecificSummary, context)
@@ -1205,7 +1444,7 @@ const deserializeAws_json1_1TrustedAdvisorCheckResult = (output, context) => {
1205
1444
  timestamp: __expectString(output.timestamp),
1206
1445
  };
1207
1446
  };
1208
- const deserializeAws_json1_1TrustedAdvisorCheckSummary = (output, context) => {
1447
+ var deserializeAws_json1_1TrustedAdvisorCheckSummary = function (output, context) {
1209
1448
  return {
1210
1449
  categorySpecificSummary: output.categorySpecificSummary != null
1211
1450
  ? deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary(output.categorySpecificSummary, context)
@@ -1219,10 +1458,10 @@ const deserializeAws_json1_1TrustedAdvisorCheckSummary = (output, context) => {
1219
1458
  timestamp: __expectString(output.timestamp),
1220
1459
  };
1221
1460
  };
1222
- const deserializeAws_json1_1TrustedAdvisorCheckSummaryList = (output, context) => {
1223
- const retVal = (output || [])
1224
- .filter((e) => e != null)
1225
- .map((entry) => {
1461
+ var deserializeAws_json1_1TrustedAdvisorCheckSummaryList = function (output, context) {
1462
+ var retVal = (output || [])
1463
+ .filter(function (e) { return e != null; })
1464
+ .map(function (entry) {
1226
1465
  if (entry === null) {
1227
1466
  return null;
1228
1467
  }
@@ -1230,13 +1469,13 @@ const deserializeAws_json1_1TrustedAdvisorCheckSummaryList = (output, context) =
1230
1469
  });
1231
1470
  return retVal;
1232
1471
  };
1233
- const deserializeAws_json1_1TrustedAdvisorCostOptimizingSummary = (output, context) => {
1472
+ var deserializeAws_json1_1TrustedAdvisorCostOptimizingSummary = function (output, context) {
1234
1473
  return {
1235
1474
  estimatedMonthlySavings: __limitedParseDouble(output.estimatedMonthlySavings),
1236
1475
  estimatedPercentMonthlySavings: __limitedParseDouble(output.estimatedPercentMonthlySavings),
1237
1476
  };
1238
1477
  };
1239
- const deserializeAws_json1_1TrustedAdvisorResourceDetail = (output, context) => {
1478
+ var deserializeAws_json1_1TrustedAdvisorResourceDetail = function (output, context) {
1240
1479
  return {
1241
1480
  isSuppressed: __expectBoolean(output.isSuppressed),
1242
1481
  metadata: output.metadata != null ? deserializeAws_json1_1StringList(output.metadata, context) : undefined,
@@ -1245,10 +1484,10 @@ const deserializeAws_json1_1TrustedAdvisorResourceDetail = (output, context) =>
1245
1484
  status: __expectString(output.status),
1246
1485
  };
1247
1486
  };
1248
- const deserializeAws_json1_1TrustedAdvisorResourceDetailList = (output, context) => {
1249
- const retVal = (output || [])
1250
- .filter((e) => e != null)
1251
- .map((entry) => {
1487
+ var deserializeAws_json1_1TrustedAdvisorResourceDetailList = function (output, context) {
1488
+ var retVal = (output || [])
1489
+ .filter(function (e) { return e != null; })
1490
+ .map(function (entry) {
1252
1491
  if (entry === null) {
1253
1492
  return null;
1254
1493
  }
@@ -1256,7 +1495,7 @@ const deserializeAws_json1_1TrustedAdvisorResourceDetailList = (output, context)
1256
1495
  });
1257
1496
  return retVal;
1258
1497
  };
1259
- const deserializeAws_json1_1TrustedAdvisorResourcesSummary = (output, context) => {
1498
+ var deserializeAws_json1_1TrustedAdvisorResourcesSummary = function (output, context) {
1260
1499
  return {
1261
1500
  resourcesFlagged: __expectLong(output.resourcesFlagged),
1262
1501
  resourcesIgnored: __expectLong(output.resourcesIgnored),
@@ -1264,52 +1503,75 @@ const deserializeAws_json1_1TrustedAdvisorResourcesSummary = (output, context) =
1264
1503
  resourcesSuppressed: __expectLong(output.resourcesSuppressed),
1265
1504
  };
1266
1505
  };
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) => {
1506
+ var deserializeMetadata = function (output) {
1507
+ var _a, _b;
1508
+ return ({
1509
+ httpStatusCode: output.statusCode,
1510
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
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(); }
1274
1517
  if (streamBody instanceof Uint8Array) {
1275
1518
  return Promise.resolve(streamBody);
1276
1519
  }
1277
1520
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1278
1521
  };
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);
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
+ });
1297
1557
  };
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;
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;
1313
1575
  if (typeof cleanValue === "number") {
1314
1576
  cleanValue = cleanValue.toString();
1315
1577
  }
@@ -1324,7 +1586,7 @@ const loadRestJsonErrorCode = (output, data) => {
1324
1586
  }
1325
1587
  return cleanValue;
1326
1588
  };
1327
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1589
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1328
1590
  if (headerKey !== undefined) {
1329
1591
  return sanitizeErrorCode(output.headers[headerKey]);
1330
1592
  }