@aws-sdk/client-resource-groups-tagging-api 3.181.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,774 +1,624 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectString as __expectString, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { ConcurrentModificationException, ConstraintViolationException, InternalServiceException, InvalidParameterException, PaginationTokenExpiredException, ThrottledException, } from "../models/models_0";
5
4
  import { ResourceGroupsTaggingAPIServiceException as __BaseException } from "../models/ResourceGroupsTaggingAPIServiceException";
6
- export var serializeAws_json1_1DescribeReportCreationCommand = 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": "ResourceGroupsTaggingAPI_20170126.DescribeReportCreation",
12
- };
13
- body = JSON.stringify(serializeAws_json1_1DescribeReportCreationInput(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_1GetComplianceSummaryCommand = 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": "ResourceGroupsTaggingAPI_20170126.GetComplianceSummary",
23
- };
24
- body = JSON.stringify(serializeAws_json1_1GetComplianceSummaryInput(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_1GetResourcesCommand = 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": "ResourceGroupsTaggingAPI_20170126.GetResources",
34
- };
35
- body = JSON.stringify(serializeAws_json1_1GetResourcesInput(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var serializeAws_json1_1GetTagKeysCommand = 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": "ResourceGroupsTaggingAPI_20170126.GetTagKeys",
45
- };
46
- body = JSON.stringify(serializeAws_json1_1GetTagKeysInput(input, context));
47
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
- });
49
- }); };
50
- export var serializeAws_json1_1GetTagValuesCommand = 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": "ResourceGroupsTaggingAPI_20170126.GetTagValues",
56
- };
57
- body = JSON.stringify(serializeAws_json1_1GetTagValuesInput(input, context));
58
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
- });
60
- }); };
61
- export var serializeAws_json1_1StartReportCreationCommand = 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": "ResourceGroupsTaggingAPI_20170126.StartReportCreation",
67
- };
68
- body = JSON.stringify(serializeAws_json1_1StartReportCreationInput(input, context));
69
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
- });
71
- }); };
72
- export var serializeAws_json1_1TagResourcesCommand = 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": "ResourceGroupsTaggingAPI_20170126.TagResources",
78
- };
79
- body = JSON.stringify(serializeAws_json1_1TagResourcesInput(input, context));
80
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
81
- });
82
- }); };
83
- export var serializeAws_json1_1UntagResourcesCommand = 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": "ResourceGroupsTaggingAPI_20170126.UntagResources",
89
- };
90
- body = JSON.stringify(serializeAws_json1_1UntagResourcesInput(input, context));
91
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
92
- });
93
- }); };
94
- export var deserializeAws_json1_1DescribeReportCreationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
95
- var data, contents, response;
96
- return __generator(this, function (_a) {
97
- switch (_a.label) {
98
- case 0:
99
- if (output.statusCode >= 300) {
100
- return [2, deserializeAws_json1_1DescribeReportCreationCommandError(output, context)];
101
- }
102
- return [4, parseBody(output.body, context)];
103
- case 1:
104
- data = _a.sent();
105
- contents = {};
106
- contents = deserializeAws_json1_1DescribeReportCreationOutput(data, context);
107
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
108
- return [2, Promise.resolve(response)];
109
- }
110
- });
111
- }); };
112
- var deserializeAws_json1_1DescribeReportCreationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
113
- var parsedOutput, _a, errorCode, _b, parsedBody;
114
- var _c;
115
- return __generator(this, function (_d) {
116
- switch (_d.label) {
117
- case 0:
118
- _a = [__assign({}, output)];
119
- _c = {};
120
- return [4, parseErrorBody(output.body, context)];
121
- case 1:
122
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
123
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
124
- _b = errorCode;
125
- switch (_b) {
126
- case "ConstraintViolationException": return [3, 2];
127
- case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": return [3, 2];
128
- case "InternalServiceException": return [3, 4];
129
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": return [3, 4];
130
- case "InvalidParameterException": return [3, 6];
131
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": return [3, 6];
132
- case "ThrottledException": return [3, 8];
133
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": return [3, 8];
134
- }
135
- return [3, 10];
136
- case 2: return [4, deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context)];
137
- case 3: throw _d.sent();
138
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
139
- case 5: throw _d.sent();
140
- case 6: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
141
- case 7: throw _d.sent();
142
- case 8: return [4, deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)];
143
- case 9: throw _d.sent();
144
- case 10:
145
- parsedBody = parsedOutput.body;
146
- throwDefaultError({
147
- output: output,
148
- parsedBody: parsedBody,
149
- exceptionCtor: __BaseException,
150
- errorCode: errorCode,
151
- });
152
- _d.label = 11;
153
- case 11: return [2];
154
- }
155
- });
156
- }); };
157
- export var deserializeAws_json1_1GetComplianceSummaryCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
158
- var data, contents, response;
159
- return __generator(this, function (_a) {
160
- switch (_a.label) {
161
- case 0:
162
- if (output.statusCode >= 300) {
163
- return [2, deserializeAws_json1_1GetComplianceSummaryCommandError(output, context)];
164
- }
165
- return [4, parseBody(output.body, context)];
166
- case 1:
167
- data = _a.sent();
168
- contents = {};
169
- contents = deserializeAws_json1_1GetComplianceSummaryOutput(data, context);
170
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
171
- return [2, Promise.resolve(response)];
172
- }
173
- });
174
- }); };
175
- var deserializeAws_json1_1GetComplianceSummaryCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
176
- var parsedOutput, _a, errorCode, _b, parsedBody;
177
- var _c;
178
- return __generator(this, function (_d) {
179
- switch (_d.label) {
180
- case 0:
181
- _a = [__assign({}, output)];
182
- _c = {};
183
- return [4, parseErrorBody(output.body, context)];
184
- case 1:
185
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
186
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
187
- _b = errorCode;
188
- switch (_b) {
189
- case "ConstraintViolationException": return [3, 2];
190
- case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": return [3, 2];
191
- case "InternalServiceException": return [3, 4];
192
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": return [3, 4];
193
- case "InvalidParameterException": return [3, 6];
194
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": return [3, 6];
195
- case "ThrottledException": return [3, 8];
196
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": return [3, 8];
197
- }
198
- return [3, 10];
199
- case 2: return [4, deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context)];
200
- case 3: throw _d.sent();
201
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
202
- case 5: throw _d.sent();
203
- case 6: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
204
- case 7: throw _d.sent();
205
- case 8: return [4, deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)];
206
- case 9: throw _d.sent();
207
- case 10:
208
- parsedBody = parsedOutput.body;
209
- throwDefaultError({
210
- output: output,
211
- parsedBody: parsedBody,
212
- exceptionCtor: __BaseException,
213
- errorCode: errorCode,
214
- });
215
- _d.label = 11;
216
- case 11: return [2];
217
- }
218
- });
219
- }); };
220
- export var deserializeAws_json1_1GetResourcesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
221
- var data, contents, response;
222
- return __generator(this, function (_a) {
223
- switch (_a.label) {
224
- case 0:
225
- if (output.statusCode >= 300) {
226
- return [2, deserializeAws_json1_1GetResourcesCommandError(output, context)];
227
- }
228
- return [4, parseBody(output.body, context)];
229
- case 1:
230
- data = _a.sent();
231
- contents = {};
232
- contents = deserializeAws_json1_1GetResourcesOutput(data, context);
233
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
234
- return [2, Promise.resolve(response)];
235
- }
236
- });
237
- }); };
238
- var deserializeAws_json1_1GetResourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
239
- var parsedOutput, _a, errorCode, _b, parsedBody;
240
- var _c;
241
- return __generator(this, function (_d) {
242
- switch (_d.label) {
243
- case 0:
244
- _a = [__assign({}, output)];
245
- _c = {};
246
- return [4, parseErrorBody(output.body, context)];
247
- case 1:
248
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
249
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
250
- _b = errorCode;
251
- switch (_b) {
252
- case "InternalServiceException": return [3, 2];
253
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": return [3, 2];
254
- case "InvalidParameterException": return [3, 4];
255
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": return [3, 4];
256
- case "PaginationTokenExpiredException": return [3, 6];
257
- case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException": return [3, 6];
258
- case "ThrottledException": return [3, 8];
259
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": return [3, 8];
260
- }
261
- return [3, 10];
262
- case 2: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
263
- case 3: throw _d.sent();
264
- case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
265
- case 5: throw _d.sent();
266
- case 6: return [4, deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context)];
267
- case 7: throw _d.sent();
268
- case 8: return [4, deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)];
269
- case 9: throw _d.sent();
270
- case 10:
271
- parsedBody = parsedOutput.body;
272
- throwDefaultError({
273
- output: output,
274
- parsedBody: parsedBody,
275
- exceptionCtor: __BaseException,
276
- errorCode: errorCode,
277
- });
278
- _d.label = 11;
279
- case 11: return [2];
280
- }
281
- });
282
- }); };
283
- export var deserializeAws_json1_1GetTagKeysCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
284
- var data, contents, response;
285
- return __generator(this, function (_a) {
286
- switch (_a.label) {
287
- case 0:
288
- if (output.statusCode >= 300) {
289
- return [2, deserializeAws_json1_1GetTagKeysCommandError(output, context)];
290
- }
291
- return [4, parseBody(output.body, context)];
292
- case 1:
293
- data = _a.sent();
294
- contents = {};
295
- contents = deserializeAws_json1_1GetTagKeysOutput(data, context);
296
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
297
- return [2, Promise.resolve(response)];
298
- }
299
- });
300
- }); };
301
- var deserializeAws_json1_1GetTagKeysCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
302
- var parsedOutput, _a, errorCode, _b, parsedBody;
303
- var _c;
304
- return __generator(this, function (_d) {
305
- switch (_d.label) {
306
- case 0:
307
- _a = [__assign({}, output)];
308
- _c = {};
309
- return [4, parseErrorBody(output.body, context)];
310
- case 1:
311
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
312
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
313
- _b = errorCode;
314
- switch (_b) {
315
- case "InternalServiceException": return [3, 2];
316
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": return [3, 2];
317
- case "InvalidParameterException": return [3, 4];
318
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": return [3, 4];
319
- case "PaginationTokenExpiredException": return [3, 6];
320
- case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException": return [3, 6];
321
- case "ThrottledException": return [3, 8];
322
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": return [3, 8];
323
- }
324
- return [3, 10];
325
- case 2: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
326
- case 3: throw _d.sent();
327
- case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
328
- case 5: throw _d.sent();
329
- case 6: return [4, deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context)];
330
- case 7: throw _d.sent();
331
- case 8: return [4, deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)];
332
- case 9: throw _d.sent();
333
- case 10:
334
- parsedBody = parsedOutput.body;
335
- throwDefaultError({
336
- output: output,
337
- parsedBody: parsedBody,
338
- exceptionCtor: __BaseException,
339
- errorCode: errorCode,
340
- });
341
- _d.label = 11;
342
- case 11: return [2];
343
- }
344
- });
345
- }); };
346
- export var deserializeAws_json1_1GetTagValuesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
347
- var data, contents, response;
348
- return __generator(this, function (_a) {
349
- switch (_a.label) {
350
- case 0:
351
- if (output.statusCode >= 300) {
352
- return [2, deserializeAws_json1_1GetTagValuesCommandError(output, context)];
353
- }
354
- return [4, parseBody(output.body, context)];
355
- case 1:
356
- data = _a.sent();
357
- contents = {};
358
- contents = deserializeAws_json1_1GetTagValuesOutput(data, context);
359
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
360
- return [2, Promise.resolve(response)];
361
- }
362
- });
363
- }); };
364
- var deserializeAws_json1_1GetTagValuesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
365
- var parsedOutput, _a, errorCode, _b, parsedBody;
366
- var _c;
367
- return __generator(this, function (_d) {
368
- switch (_d.label) {
369
- case 0:
370
- _a = [__assign({}, output)];
371
- _c = {};
372
- return [4, parseErrorBody(output.body, context)];
373
- case 1:
374
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
375
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
376
- _b = errorCode;
377
- switch (_b) {
378
- case "InternalServiceException": return [3, 2];
379
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": return [3, 2];
380
- case "InvalidParameterException": return [3, 4];
381
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": return [3, 4];
382
- case "PaginationTokenExpiredException": return [3, 6];
383
- case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException": return [3, 6];
384
- case "ThrottledException": return [3, 8];
385
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": return [3, 8];
386
- }
387
- return [3, 10];
388
- case 2: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
389
- case 3: throw _d.sent();
390
- case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
391
- case 5: throw _d.sent();
392
- case 6: return [4, deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context)];
393
- case 7: throw _d.sent();
394
- case 8: return [4, deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)];
395
- case 9: throw _d.sent();
396
- case 10:
397
- parsedBody = parsedOutput.body;
398
- throwDefaultError({
399
- output: output,
400
- parsedBody: parsedBody,
401
- exceptionCtor: __BaseException,
402
- errorCode: errorCode,
403
- });
404
- _d.label = 11;
405
- case 11: return [2];
406
- }
407
- });
408
- }); };
409
- export var deserializeAws_json1_1StartReportCreationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
410
- var data, contents, response;
411
- return __generator(this, function (_a) {
412
- switch (_a.label) {
413
- case 0:
414
- if (output.statusCode >= 300) {
415
- return [2, deserializeAws_json1_1StartReportCreationCommandError(output, context)];
416
- }
417
- return [4, parseBody(output.body, context)];
418
- case 1:
419
- data = _a.sent();
420
- contents = {};
421
- contents = deserializeAws_json1_1StartReportCreationOutput(data, context);
422
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
423
- return [2, Promise.resolve(response)];
424
- }
425
- });
426
- }); };
427
- var deserializeAws_json1_1StartReportCreationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
428
- var parsedOutput, _a, errorCode, _b, parsedBody;
429
- var _c;
430
- return __generator(this, function (_d) {
431
- switch (_d.label) {
432
- case 0:
433
- _a = [__assign({}, output)];
434
- _c = {};
435
- return [4, parseErrorBody(output.body, context)];
436
- case 1:
437
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
438
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
439
- _b = errorCode;
440
- switch (_b) {
441
- case "ConcurrentModificationException": return [3, 2];
442
- case "com.amazonaws.resourcegroupstaggingapi#ConcurrentModificationException": return [3, 2];
443
- case "ConstraintViolationException": return [3, 4];
444
- case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": return [3, 4];
445
- case "InternalServiceException": return [3, 6];
446
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": return [3, 6];
447
- case "InvalidParameterException": return [3, 8];
448
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": return [3, 8];
449
- case "ThrottledException": return [3, 10];
450
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": return [3, 10];
451
- }
452
- return [3, 12];
453
- case 2: return [4, deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)];
454
- case 3: throw _d.sent();
455
- case 4: return [4, deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context)];
456
- case 5: throw _d.sent();
457
- case 6: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
458
- case 7: throw _d.sent();
459
- case 8: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
460
- case 9: throw _d.sent();
461
- case 10: return [4, deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)];
462
- case 11: throw _d.sent();
463
- case 12:
464
- parsedBody = parsedOutput.body;
465
- throwDefaultError({
466
- output: output,
467
- parsedBody: parsedBody,
468
- exceptionCtor: __BaseException,
469
- errorCode: errorCode,
470
- });
471
- _d.label = 13;
472
- case 13: return [2];
473
- }
474
- });
475
- }); };
476
- export var deserializeAws_json1_1TagResourcesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
477
- var data, contents, response;
478
- return __generator(this, function (_a) {
479
- switch (_a.label) {
480
- case 0:
481
- if (output.statusCode >= 300) {
482
- return [2, deserializeAws_json1_1TagResourcesCommandError(output, context)];
483
- }
484
- return [4, parseBody(output.body, context)];
485
- case 1:
486
- data = _a.sent();
487
- contents = {};
488
- contents = deserializeAws_json1_1TagResourcesOutput(data, context);
489
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
490
- return [2, Promise.resolve(response)];
491
- }
492
- });
493
- }); };
494
- var deserializeAws_json1_1TagResourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
495
- var parsedOutput, _a, errorCode, _b, parsedBody;
496
- var _c;
497
- return __generator(this, function (_d) {
498
- switch (_d.label) {
499
- case 0:
500
- _a = [__assign({}, output)];
501
- _c = {};
502
- return [4, parseErrorBody(output.body, context)];
503
- case 1:
504
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
505
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
506
- _b = errorCode;
507
- switch (_b) {
508
- case "InternalServiceException": return [3, 2];
509
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": return [3, 2];
510
- case "InvalidParameterException": return [3, 4];
511
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": return [3, 4];
512
- case "ThrottledException": return [3, 6];
513
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": return [3, 6];
514
- }
515
- return [3, 8];
516
- case 2: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
517
- case 3: throw _d.sent();
518
- case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
519
- case 5: throw _d.sent();
520
- case 6: return [4, deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)];
521
- case 7: throw _d.sent();
522
- case 8:
523
- parsedBody = parsedOutput.body;
524
- throwDefaultError({
525
- output: output,
526
- parsedBody: parsedBody,
527
- exceptionCtor: __BaseException,
528
- errorCode: errorCode,
529
- });
530
- _d.label = 9;
531
- case 9: return [2];
532
- }
533
- });
534
- }); };
535
- export var deserializeAws_json1_1UntagResourcesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
536
- var data, contents, response;
537
- return __generator(this, function (_a) {
538
- switch (_a.label) {
539
- case 0:
540
- if (output.statusCode >= 300) {
541
- return [2, deserializeAws_json1_1UntagResourcesCommandError(output, context)];
542
- }
543
- return [4, parseBody(output.body, context)];
544
- case 1:
545
- data = _a.sent();
546
- contents = {};
547
- contents = deserializeAws_json1_1UntagResourcesOutput(data, context);
548
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
549
- return [2, Promise.resolve(response)];
550
- }
551
- });
552
- }); };
553
- var deserializeAws_json1_1UntagResourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
554
- var parsedOutput, _a, errorCode, _b, parsedBody;
555
- var _c;
556
- return __generator(this, function (_d) {
557
- switch (_d.label) {
558
- case 0:
559
- _a = [__assign({}, output)];
560
- _c = {};
561
- return [4, parseErrorBody(output.body, context)];
562
- case 1:
563
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
564
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
565
- _b = errorCode;
566
- switch (_b) {
567
- case "InternalServiceException": return [3, 2];
568
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": return [3, 2];
569
- case "InvalidParameterException": return [3, 4];
570
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": return [3, 4];
571
- case "ThrottledException": return [3, 6];
572
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": return [3, 6];
573
- }
574
- return [3, 8];
575
- case 2: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
576
- case 3: throw _d.sent();
577
- case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
578
- case 5: throw _d.sent();
579
- case 6: return [4, deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)];
580
- case 7: throw _d.sent();
581
- case 8:
582
- parsedBody = parsedOutput.body;
583
- throwDefaultError({
584
- output: output,
585
- parsedBody: parsedBody,
586
- exceptionCtor: __BaseException,
587
- errorCode: errorCode,
588
- });
589
- _d.label = 9;
590
- case 9: return [2];
591
- }
592
- });
593
- }); };
594
- var deserializeAws_json1_1ConcurrentModificationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
595
- var body, deserialized, exception;
596
- return __generator(this, function (_a) {
597
- body = parsedOutput.body;
598
- deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context);
599
- exception = new ConcurrentModificationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
600
- return [2, __decorateServiceException(exception, body)];
601
- });
602
- }); };
603
- var deserializeAws_json1_1ConstraintViolationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
604
- var body, deserialized, exception;
605
- return __generator(this, function (_a) {
606
- body = parsedOutput.body;
607
- deserialized = deserializeAws_json1_1ConstraintViolationException(body, context);
608
- exception = new ConstraintViolationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
609
- return [2, __decorateServiceException(exception, body)];
610
- });
611
- }); };
612
- var deserializeAws_json1_1InternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
613
- var body, deserialized, exception;
614
- return __generator(this, function (_a) {
615
- body = parsedOutput.body;
616
- deserialized = deserializeAws_json1_1InternalServiceException(body, context);
617
- exception = new InternalServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
618
- return [2, __decorateServiceException(exception, body)];
619
- });
620
- }); };
621
- var deserializeAws_json1_1InvalidParameterExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
622
- var body, deserialized, exception;
623
- return __generator(this, function (_a) {
624
- body = parsedOutput.body;
625
- deserialized = deserializeAws_json1_1InvalidParameterException(body, context);
626
- exception = new InvalidParameterException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
627
- return [2, __decorateServiceException(exception, body)];
628
- });
629
- }); };
630
- var deserializeAws_json1_1PaginationTokenExpiredExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
631
- var body, deserialized, exception;
632
- return __generator(this, function (_a) {
633
- body = parsedOutput.body;
634
- deserialized = deserializeAws_json1_1PaginationTokenExpiredException(body, context);
635
- exception = new PaginationTokenExpiredException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
636
- return [2, __decorateServiceException(exception, body)];
637
- });
638
- }); };
639
- var deserializeAws_json1_1ThrottledExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
640
- var body, deserialized, exception;
641
- return __generator(this, function (_a) {
642
- body = parsedOutput.body;
643
- deserialized = deserializeAws_json1_1ThrottledException(body, context);
644
- exception = new ThrottledException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
645
- return [2, __decorateServiceException(exception, body)];
646
- });
647
- }); };
648
- var serializeAws_json1_1DescribeReportCreationInput = function (input, context) {
5
+ export const serializeAws_json1_1DescribeReportCreationCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.1",
8
+ "x-amz-target": "ResourceGroupsTaggingAPI_20170126.DescribeReportCreation",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_1DescribeReportCreationInput(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_1GetComplianceSummaryCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.1",
17
+ "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetComplianceSummary",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_1GetComplianceSummaryInput(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_1GetResourcesCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetResources",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1GetResourcesInput(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const serializeAws_json1_1GetTagKeysCommand = async (input, context) => {
33
+ const headers = {
34
+ "content-type": "application/x-amz-json-1.1",
35
+ "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetTagKeys",
36
+ };
37
+ let body;
38
+ body = JSON.stringify(serializeAws_json1_1GetTagKeysInput(input, context));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const serializeAws_json1_1GetTagValuesCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetTagValues",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_1GetTagValuesInput(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
50
+ export const serializeAws_json1_1StartReportCreationCommand = async (input, context) => {
51
+ const headers = {
52
+ "content-type": "application/x-amz-json-1.1",
53
+ "x-amz-target": "ResourceGroupsTaggingAPI_20170126.StartReportCreation",
54
+ };
55
+ let body;
56
+ body = JSON.stringify(serializeAws_json1_1StartReportCreationInput(input, context));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const serializeAws_json1_1TagResourcesCommand = async (input, context) => {
60
+ const headers = {
61
+ "content-type": "application/x-amz-json-1.1",
62
+ "x-amz-target": "ResourceGroupsTaggingAPI_20170126.TagResources",
63
+ };
64
+ let body;
65
+ body = JSON.stringify(serializeAws_json1_1TagResourcesInput(input, context));
66
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
+ };
68
+ export const serializeAws_json1_1UntagResourcesCommand = async (input, context) => {
69
+ const headers = {
70
+ "content-type": "application/x-amz-json-1.1",
71
+ "x-amz-target": "ResourceGroupsTaggingAPI_20170126.UntagResources",
72
+ };
73
+ let body;
74
+ body = JSON.stringify(serializeAws_json1_1UntagResourcesInput(input, context));
75
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
+ };
77
+ export const deserializeAws_json1_1DescribeReportCreationCommand = async (output, context) => {
78
+ if (output.statusCode >= 300) {
79
+ return deserializeAws_json1_1DescribeReportCreationCommandError(output, context);
80
+ }
81
+ const data = await parseBody(output.body, context);
82
+ let contents = {};
83
+ contents = deserializeAws_json1_1DescribeReportCreationOutput(data, context);
84
+ const response = {
85
+ $metadata: deserializeMetadata(output),
86
+ ...contents,
87
+ };
88
+ return Promise.resolve(response);
89
+ };
90
+ const deserializeAws_json1_1DescribeReportCreationCommandError = async (output, context) => {
91
+ const parsedOutput = {
92
+ ...output,
93
+ body: await parseErrorBody(output.body, context),
94
+ };
95
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
96
+ switch (errorCode) {
97
+ case "ConstraintViolationException":
98
+ case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException":
99
+ throw await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context);
100
+ case "InternalServiceException":
101
+ case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
102
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
103
+ case "InvalidParameterException":
104
+ case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
105
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
106
+ case "ThrottledException":
107
+ case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
108
+ throw await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context);
109
+ default:
110
+ const parsedBody = parsedOutput.body;
111
+ throwDefaultError({
112
+ output,
113
+ parsedBody,
114
+ exceptionCtor: __BaseException,
115
+ errorCode,
116
+ });
117
+ }
118
+ };
119
+ export const deserializeAws_json1_1GetComplianceSummaryCommand = async (output, context) => {
120
+ if (output.statusCode >= 300) {
121
+ return deserializeAws_json1_1GetComplianceSummaryCommandError(output, context);
122
+ }
123
+ const data = await parseBody(output.body, context);
124
+ let contents = {};
125
+ contents = deserializeAws_json1_1GetComplianceSummaryOutput(data, context);
126
+ const response = {
127
+ $metadata: deserializeMetadata(output),
128
+ ...contents,
129
+ };
130
+ return Promise.resolve(response);
131
+ };
132
+ const deserializeAws_json1_1GetComplianceSummaryCommandError = async (output, context) => {
133
+ const parsedOutput = {
134
+ ...output,
135
+ body: await parseErrorBody(output.body, context),
136
+ };
137
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
138
+ switch (errorCode) {
139
+ case "ConstraintViolationException":
140
+ case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException":
141
+ throw await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context);
142
+ case "InternalServiceException":
143
+ case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
144
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
145
+ case "InvalidParameterException":
146
+ case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
147
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
148
+ case "ThrottledException":
149
+ case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
150
+ throw await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context);
151
+ default:
152
+ const parsedBody = parsedOutput.body;
153
+ throwDefaultError({
154
+ output,
155
+ parsedBody,
156
+ exceptionCtor: __BaseException,
157
+ errorCode,
158
+ });
159
+ }
160
+ };
161
+ export const deserializeAws_json1_1GetResourcesCommand = async (output, context) => {
162
+ if (output.statusCode >= 300) {
163
+ return deserializeAws_json1_1GetResourcesCommandError(output, context);
164
+ }
165
+ const data = await parseBody(output.body, context);
166
+ let contents = {};
167
+ contents = deserializeAws_json1_1GetResourcesOutput(data, context);
168
+ const response = {
169
+ $metadata: deserializeMetadata(output),
170
+ ...contents,
171
+ };
172
+ return Promise.resolve(response);
173
+ };
174
+ const deserializeAws_json1_1GetResourcesCommandError = async (output, context) => {
175
+ const parsedOutput = {
176
+ ...output,
177
+ body: await parseErrorBody(output.body, context),
178
+ };
179
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
180
+ switch (errorCode) {
181
+ case "InternalServiceException":
182
+ case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
183
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
184
+ case "InvalidParameterException":
185
+ case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
186
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
187
+ case "PaginationTokenExpiredException":
188
+ case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException":
189
+ throw await deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context);
190
+ case "ThrottledException":
191
+ case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
192
+ throw await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context);
193
+ default:
194
+ const parsedBody = parsedOutput.body;
195
+ throwDefaultError({
196
+ output,
197
+ parsedBody,
198
+ exceptionCtor: __BaseException,
199
+ errorCode,
200
+ });
201
+ }
202
+ };
203
+ export const deserializeAws_json1_1GetTagKeysCommand = async (output, context) => {
204
+ if (output.statusCode >= 300) {
205
+ return deserializeAws_json1_1GetTagKeysCommandError(output, context);
206
+ }
207
+ const data = await parseBody(output.body, context);
208
+ let contents = {};
209
+ contents = deserializeAws_json1_1GetTagKeysOutput(data, context);
210
+ const response = {
211
+ $metadata: deserializeMetadata(output),
212
+ ...contents,
213
+ };
214
+ return Promise.resolve(response);
215
+ };
216
+ const deserializeAws_json1_1GetTagKeysCommandError = async (output, context) => {
217
+ const parsedOutput = {
218
+ ...output,
219
+ body: await parseErrorBody(output.body, context),
220
+ };
221
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
222
+ switch (errorCode) {
223
+ case "InternalServiceException":
224
+ case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
225
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
226
+ case "InvalidParameterException":
227
+ case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
228
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
229
+ case "PaginationTokenExpiredException":
230
+ case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException":
231
+ throw await deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context);
232
+ case "ThrottledException":
233
+ case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
234
+ throw await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context);
235
+ default:
236
+ const parsedBody = parsedOutput.body;
237
+ throwDefaultError({
238
+ output,
239
+ parsedBody,
240
+ exceptionCtor: __BaseException,
241
+ errorCode,
242
+ });
243
+ }
244
+ };
245
+ export const deserializeAws_json1_1GetTagValuesCommand = async (output, context) => {
246
+ if (output.statusCode >= 300) {
247
+ return deserializeAws_json1_1GetTagValuesCommandError(output, context);
248
+ }
249
+ const data = await parseBody(output.body, context);
250
+ let contents = {};
251
+ contents = deserializeAws_json1_1GetTagValuesOutput(data, context);
252
+ const response = {
253
+ $metadata: deserializeMetadata(output),
254
+ ...contents,
255
+ };
256
+ return Promise.resolve(response);
257
+ };
258
+ const deserializeAws_json1_1GetTagValuesCommandError = async (output, context) => {
259
+ const parsedOutput = {
260
+ ...output,
261
+ body: await parseErrorBody(output.body, context),
262
+ };
263
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
264
+ switch (errorCode) {
265
+ case "InternalServiceException":
266
+ case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
267
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
268
+ case "InvalidParameterException":
269
+ case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
270
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
271
+ case "PaginationTokenExpiredException":
272
+ case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException":
273
+ throw await deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context);
274
+ case "ThrottledException":
275
+ case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
276
+ throw await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context);
277
+ default:
278
+ const parsedBody = parsedOutput.body;
279
+ throwDefaultError({
280
+ output,
281
+ parsedBody,
282
+ exceptionCtor: __BaseException,
283
+ errorCode,
284
+ });
285
+ }
286
+ };
287
+ export const deserializeAws_json1_1StartReportCreationCommand = async (output, context) => {
288
+ if (output.statusCode >= 300) {
289
+ return deserializeAws_json1_1StartReportCreationCommandError(output, context);
290
+ }
291
+ const data = await parseBody(output.body, context);
292
+ let contents = {};
293
+ contents = deserializeAws_json1_1StartReportCreationOutput(data, context);
294
+ const response = {
295
+ $metadata: deserializeMetadata(output),
296
+ ...contents,
297
+ };
298
+ return Promise.resolve(response);
299
+ };
300
+ const deserializeAws_json1_1StartReportCreationCommandError = async (output, context) => {
301
+ const parsedOutput = {
302
+ ...output,
303
+ body: await parseErrorBody(output.body, context),
304
+ };
305
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
306
+ switch (errorCode) {
307
+ case "ConcurrentModificationException":
308
+ case "com.amazonaws.resourcegroupstaggingapi#ConcurrentModificationException":
309
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
310
+ case "ConstraintViolationException":
311
+ case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException":
312
+ throw await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context);
313
+ case "InternalServiceException":
314
+ case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
315
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
316
+ case "InvalidParameterException":
317
+ case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
318
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
319
+ case "ThrottledException":
320
+ case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
321
+ throw await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context);
322
+ default:
323
+ const parsedBody = parsedOutput.body;
324
+ throwDefaultError({
325
+ output,
326
+ parsedBody,
327
+ exceptionCtor: __BaseException,
328
+ errorCode,
329
+ });
330
+ }
331
+ };
332
+ export const deserializeAws_json1_1TagResourcesCommand = async (output, context) => {
333
+ if (output.statusCode >= 300) {
334
+ return deserializeAws_json1_1TagResourcesCommandError(output, context);
335
+ }
336
+ const data = await parseBody(output.body, context);
337
+ let contents = {};
338
+ contents = deserializeAws_json1_1TagResourcesOutput(data, context);
339
+ const response = {
340
+ $metadata: deserializeMetadata(output),
341
+ ...contents,
342
+ };
343
+ return Promise.resolve(response);
344
+ };
345
+ const deserializeAws_json1_1TagResourcesCommandError = async (output, context) => {
346
+ const parsedOutput = {
347
+ ...output,
348
+ body: await parseErrorBody(output.body, context),
349
+ };
350
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
351
+ switch (errorCode) {
352
+ case "InternalServiceException":
353
+ case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
354
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
355
+ case "InvalidParameterException":
356
+ case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
357
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
358
+ case "ThrottledException":
359
+ case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
360
+ throw await deserializeAws_json1_1ThrottledExceptionResponse(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_1UntagResourcesCommand = async (output, context) => {
372
+ if (output.statusCode >= 300) {
373
+ return deserializeAws_json1_1UntagResourcesCommandError(output, context);
374
+ }
375
+ const data = await parseBody(output.body, context);
376
+ let contents = {};
377
+ contents = deserializeAws_json1_1UntagResourcesOutput(data, context);
378
+ const response = {
379
+ $metadata: deserializeMetadata(output),
380
+ ...contents,
381
+ };
382
+ return Promise.resolve(response);
383
+ };
384
+ const deserializeAws_json1_1UntagResourcesCommandError = 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 "InternalServiceException":
392
+ case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
393
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
394
+ case "InvalidParameterException":
395
+ case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
396
+ throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
397
+ case "ThrottledException":
398
+ case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
399
+ throw await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context);
400
+ default:
401
+ const parsedBody = parsedOutput.body;
402
+ throwDefaultError({
403
+ output,
404
+ parsedBody,
405
+ exceptionCtor: __BaseException,
406
+ errorCode,
407
+ });
408
+ }
409
+ };
410
+ const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (parsedOutput, context) => {
411
+ const body = parsedOutput.body;
412
+ const deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context);
413
+ const exception = new ConcurrentModificationException({
414
+ $metadata: deserializeMetadata(parsedOutput),
415
+ ...deserialized,
416
+ });
417
+ return __decorateServiceException(exception, body);
418
+ };
419
+ const deserializeAws_json1_1ConstraintViolationExceptionResponse = async (parsedOutput, context) => {
420
+ const body = parsedOutput.body;
421
+ const deserialized = deserializeAws_json1_1ConstraintViolationException(body, context);
422
+ const exception = new ConstraintViolationException({
423
+ $metadata: deserializeMetadata(parsedOutput),
424
+ ...deserialized,
425
+ });
426
+ return __decorateServiceException(exception, body);
427
+ };
428
+ const deserializeAws_json1_1InternalServiceExceptionResponse = async (parsedOutput, context) => {
429
+ const body = parsedOutput.body;
430
+ const deserialized = deserializeAws_json1_1InternalServiceException(body, context);
431
+ const exception = new InternalServiceException({
432
+ $metadata: deserializeMetadata(parsedOutput),
433
+ ...deserialized,
434
+ });
435
+ return __decorateServiceException(exception, body);
436
+ };
437
+ const deserializeAws_json1_1InvalidParameterExceptionResponse = async (parsedOutput, context) => {
438
+ const body = parsedOutput.body;
439
+ const deserialized = deserializeAws_json1_1InvalidParameterException(body, context);
440
+ const exception = new InvalidParameterException({
441
+ $metadata: deserializeMetadata(parsedOutput),
442
+ ...deserialized,
443
+ });
444
+ return __decorateServiceException(exception, body);
445
+ };
446
+ const deserializeAws_json1_1PaginationTokenExpiredExceptionResponse = async (parsedOutput, context) => {
447
+ const body = parsedOutput.body;
448
+ const deserialized = deserializeAws_json1_1PaginationTokenExpiredException(body, context);
449
+ const exception = new PaginationTokenExpiredException({
450
+ $metadata: deserializeMetadata(parsedOutput),
451
+ ...deserialized,
452
+ });
453
+ return __decorateServiceException(exception, body);
454
+ };
455
+ const deserializeAws_json1_1ThrottledExceptionResponse = async (parsedOutput, context) => {
456
+ const body = parsedOutput.body;
457
+ const deserialized = deserializeAws_json1_1ThrottledException(body, context);
458
+ const exception = new ThrottledException({
459
+ $metadata: deserializeMetadata(parsedOutput),
460
+ ...deserialized,
461
+ });
462
+ return __decorateServiceException(exception, body);
463
+ };
464
+ const serializeAws_json1_1DescribeReportCreationInput = (input, context) => {
649
465
  return {};
650
466
  };
651
- var serializeAws_json1_1GetComplianceSummaryInput = function (input, context) {
652
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.GroupBy != null && { GroupBy: serializeAws_json1_1GroupBy(input.GroupBy, context) })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.PaginationToken != null && { PaginationToken: input.PaginationToken })), (input.RegionFilters != null && {
653
- RegionFilters: serializeAws_json1_1RegionFilterList(input.RegionFilters, context),
654
- })), (input.ResourceTypeFilters != null && {
655
- ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context),
656
- })), (input.TagKeyFilters != null && {
657
- TagKeyFilters: serializeAws_json1_1TagKeyFilterList(input.TagKeyFilters, context),
658
- })), (input.TargetIdFilters != null && {
659
- TargetIdFilters: serializeAws_json1_1TargetIdFilterList(input.TargetIdFilters, context),
660
- }));
661
- };
662
- var serializeAws_json1_1GetResourcesInput = function (input, context) {
663
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ExcludeCompliantResources != null && { ExcludeCompliantResources: input.ExcludeCompliantResources })), (input.IncludeComplianceDetails != null && { IncludeComplianceDetails: input.IncludeComplianceDetails })), (input.PaginationToken != null && { PaginationToken: input.PaginationToken })), (input.ResourceARNList != null && {
664
- ResourceARNList: serializeAws_json1_1ResourceARNListForGet(input.ResourceARNList, context),
665
- })), (input.ResourceTypeFilters != null && {
666
- ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context),
667
- })), (input.ResourcesPerPage != null && { ResourcesPerPage: input.ResourcesPerPage })), (input.TagFilters != null && { TagFilters: serializeAws_json1_1TagFilterList(input.TagFilters, context) })), (input.TagsPerPage != null && { TagsPerPage: input.TagsPerPage }));
668
- };
669
- var serializeAws_json1_1GetTagKeysInput = function (input, context) {
670
- return __assign({}, (input.PaginationToken != null && { PaginationToken: input.PaginationToken }));
671
- };
672
- var serializeAws_json1_1GetTagValuesInput = function (input, context) {
673
- return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.PaginationToken != null && { PaginationToken: input.PaginationToken }));
674
- };
675
- var serializeAws_json1_1GroupBy = function (input, context) {
467
+ const serializeAws_json1_1GetComplianceSummaryInput = (input, context) => {
468
+ return {
469
+ ...(input.GroupBy != null && { GroupBy: serializeAws_json1_1GroupBy(input.GroupBy, context) }),
470
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
471
+ ...(input.PaginationToken != null && { PaginationToken: input.PaginationToken }),
472
+ ...(input.RegionFilters != null && {
473
+ RegionFilters: serializeAws_json1_1RegionFilterList(input.RegionFilters, context),
474
+ }),
475
+ ...(input.ResourceTypeFilters != null && {
476
+ ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context),
477
+ }),
478
+ ...(input.TagKeyFilters != null && {
479
+ TagKeyFilters: serializeAws_json1_1TagKeyFilterList(input.TagKeyFilters, context),
480
+ }),
481
+ ...(input.TargetIdFilters != null && {
482
+ TargetIdFilters: serializeAws_json1_1TargetIdFilterList(input.TargetIdFilters, context),
483
+ }),
484
+ };
485
+ };
486
+ const serializeAws_json1_1GetResourcesInput = (input, context) => {
487
+ return {
488
+ ...(input.ExcludeCompliantResources != null && { ExcludeCompliantResources: input.ExcludeCompliantResources }),
489
+ ...(input.IncludeComplianceDetails != null && { IncludeComplianceDetails: input.IncludeComplianceDetails }),
490
+ ...(input.PaginationToken != null && { PaginationToken: input.PaginationToken }),
491
+ ...(input.ResourceARNList != null && {
492
+ ResourceARNList: serializeAws_json1_1ResourceARNListForGet(input.ResourceARNList, context),
493
+ }),
494
+ ...(input.ResourceTypeFilters != null && {
495
+ ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context),
496
+ }),
497
+ ...(input.ResourcesPerPage != null && { ResourcesPerPage: input.ResourcesPerPage }),
498
+ ...(input.TagFilters != null && { TagFilters: serializeAws_json1_1TagFilterList(input.TagFilters, context) }),
499
+ ...(input.TagsPerPage != null && { TagsPerPage: input.TagsPerPage }),
500
+ };
501
+ };
502
+ const serializeAws_json1_1GetTagKeysInput = (input, context) => {
503
+ return {
504
+ ...(input.PaginationToken != null && { PaginationToken: input.PaginationToken }),
505
+ };
506
+ };
507
+ const serializeAws_json1_1GetTagValuesInput = (input, context) => {
508
+ return {
509
+ ...(input.Key != null && { Key: input.Key }),
510
+ ...(input.PaginationToken != null && { PaginationToken: input.PaginationToken }),
511
+ };
512
+ };
513
+ const serializeAws_json1_1GroupBy = (input, context) => {
676
514
  return input
677
- .filter(function (e) { return e != null; })
678
- .map(function (entry) {
515
+ .filter((e) => e != null)
516
+ .map((entry) => {
679
517
  return entry;
680
518
  });
681
519
  };
682
- var serializeAws_json1_1RegionFilterList = function (input, context) {
520
+ const serializeAws_json1_1RegionFilterList = (input, context) => {
683
521
  return input
684
- .filter(function (e) { return e != null; })
685
- .map(function (entry) {
522
+ .filter((e) => e != null)
523
+ .map((entry) => {
686
524
  return entry;
687
525
  });
688
526
  };
689
- var serializeAws_json1_1ResourceARNListForGet = function (input, context) {
527
+ const serializeAws_json1_1ResourceARNListForGet = (input, context) => {
690
528
  return input
691
- .filter(function (e) { return e != null; })
692
- .map(function (entry) {
529
+ .filter((e) => e != null)
530
+ .map((entry) => {
693
531
  return entry;
694
532
  });
695
533
  };
696
- var serializeAws_json1_1ResourceARNListForTagUntag = function (input, context) {
534
+ const serializeAws_json1_1ResourceARNListForTagUntag = (input, context) => {
697
535
  return input
698
- .filter(function (e) { return e != null; })
699
- .map(function (entry) {
536
+ .filter((e) => e != null)
537
+ .map((entry) => {
700
538
  return entry;
701
539
  });
702
540
  };
703
- var serializeAws_json1_1ResourceTypeFilterList = function (input, context) {
541
+ const serializeAws_json1_1ResourceTypeFilterList = (input, context) => {
704
542
  return input
705
- .filter(function (e) { return e != null; })
706
- .map(function (entry) {
543
+ .filter((e) => e != null)
544
+ .map((entry) => {
707
545
  return entry;
708
546
  });
709
547
  };
710
- var serializeAws_json1_1StartReportCreationInput = function (input, context) {
711
- return __assign({}, (input.S3Bucket != null && { S3Bucket: input.S3Bucket }));
548
+ const serializeAws_json1_1StartReportCreationInput = (input, context) => {
549
+ return {
550
+ ...(input.S3Bucket != null && { S3Bucket: input.S3Bucket }),
551
+ };
712
552
  };
713
- var serializeAws_json1_1TagFilter = function (input, context) {
714
- return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Values != null && { Values: serializeAws_json1_1TagValueList(input.Values, context) }));
553
+ const serializeAws_json1_1TagFilter = (input, context) => {
554
+ return {
555
+ ...(input.Key != null && { Key: input.Key }),
556
+ ...(input.Values != null && { Values: serializeAws_json1_1TagValueList(input.Values, context) }),
557
+ };
715
558
  };
716
- var serializeAws_json1_1TagFilterList = function (input, context) {
559
+ const serializeAws_json1_1TagFilterList = (input, context) => {
717
560
  return input
718
- .filter(function (e) { return e != null; })
719
- .map(function (entry) {
561
+ .filter((e) => e != null)
562
+ .map((entry) => {
720
563
  return serializeAws_json1_1TagFilter(entry, context);
721
564
  });
722
565
  };
723
- var serializeAws_json1_1TagKeyFilterList = function (input, context) {
566
+ const serializeAws_json1_1TagKeyFilterList = (input, context) => {
724
567
  return input
725
- .filter(function (e) { return e != null; })
726
- .map(function (entry) {
568
+ .filter((e) => e != null)
569
+ .map((entry) => {
727
570
  return entry;
728
571
  });
729
572
  };
730
- var serializeAws_json1_1TagKeyListForUntag = function (input, context) {
573
+ const serializeAws_json1_1TagKeyListForUntag = (input, context) => {
731
574
  return input
732
- .filter(function (e) { return e != null; })
733
- .map(function (entry) {
575
+ .filter((e) => e != null)
576
+ .map((entry) => {
734
577
  return entry;
735
578
  });
736
579
  };
737
- var serializeAws_json1_1TagMap = function (input, context) {
738
- return Object.entries(input).reduce(function (acc, _a) {
739
- var _b;
740
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
580
+ const serializeAws_json1_1TagMap = (input, context) => {
581
+ return Object.entries(input).reduce((acc, [key, value]) => {
741
582
  if (value === null) {
742
583
  return acc;
743
584
  }
744
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
585
+ return {
586
+ ...acc,
587
+ [key]: value,
588
+ };
745
589
  }, {});
746
590
  };
747
- var serializeAws_json1_1TagResourcesInput = function (input, context) {
748
- return __assign(__assign({}, (input.ResourceARNList != null && {
749
- ResourceARNList: serializeAws_json1_1ResourceARNListForTagUntag(input.ResourceARNList, context),
750
- })), (input.Tags != null && { Tags: serializeAws_json1_1TagMap(input.Tags, context) }));
591
+ const serializeAws_json1_1TagResourcesInput = (input, context) => {
592
+ return {
593
+ ...(input.ResourceARNList != null && {
594
+ ResourceARNList: serializeAws_json1_1ResourceARNListForTagUntag(input.ResourceARNList, context),
595
+ }),
596
+ ...(input.Tags != null && { Tags: serializeAws_json1_1TagMap(input.Tags, context) }),
597
+ };
751
598
  };
752
- var serializeAws_json1_1TagValueList = function (input, context) {
599
+ const serializeAws_json1_1TagValueList = (input, context) => {
753
600
  return input
754
- .filter(function (e) { return e != null; })
755
- .map(function (entry) {
601
+ .filter((e) => e != null)
602
+ .map((entry) => {
756
603
  return entry;
757
604
  });
758
605
  };
759
- var serializeAws_json1_1TargetIdFilterList = function (input, context) {
606
+ const serializeAws_json1_1TargetIdFilterList = (input, context) => {
760
607
  return input
761
- .filter(function (e) { return e != null; })
762
- .map(function (entry) {
608
+ .filter((e) => e != null)
609
+ .map((entry) => {
763
610
  return entry;
764
611
  });
765
612
  };
766
- var serializeAws_json1_1UntagResourcesInput = function (input, context) {
767
- return __assign(__assign({}, (input.ResourceARNList != null && {
768
- ResourceARNList: serializeAws_json1_1ResourceARNListForTagUntag(input.ResourceARNList, context),
769
- })), (input.TagKeys != null && { TagKeys: serializeAws_json1_1TagKeyListForUntag(input.TagKeys, context) }));
613
+ const serializeAws_json1_1UntagResourcesInput = (input, context) => {
614
+ return {
615
+ ...(input.ResourceARNList != null && {
616
+ ResourceARNList: serializeAws_json1_1ResourceARNListForTagUntag(input.ResourceARNList, context),
617
+ }),
618
+ ...(input.TagKeys != null && { TagKeys: serializeAws_json1_1TagKeyListForUntag(input.TagKeys, context) }),
619
+ };
770
620
  };
771
- var deserializeAws_json1_1ComplianceDetails = function (output, context) {
621
+ const deserializeAws_json1_1ComplianceDetails = (output, context) => {
772
622
  return {
773
623
  ComplianceStatus: __expectBoolean(output.ComplianceStatus),
774
624
  KeysWithNoncompliantValues: output.KeysWithNoncompliantValues != null
@@ -777,17 +627,17 @@ var deserializeAws_json1_1ComplianceDetails = function (output, context) {
777
627
  NoncompliantKeys: output.NoncompliantKeys != null ? deserializeAws_json1_1TagKeyList(output.NoncompliantKeys, context) : undefined,
778
628
  };
779
629
  };
780
- var deserializeAws_json1_1ConcurrentModificationException = function (output, context) {
630
+ const deserializeAws_json1_1ConcurrentModificationException = (output, context) => {
781
631
  return {
782
632
  Message: __expectString(output.Message),
783
633
  };
784
634
  };
785
- var deserializeAws_json1_1ConstraintViolationException = function (output, context) {
635
+ const deserializeAws_json1_1ConstraintViolationException = (output, context) => {
786
636
  return {
787
637
  Message: __expectString(output.Message),
788
638
  };
789
639
  };
790
- var deserializeAws_json1_1DescribeReportCreationOutput = function (output, context) {
640
+ const deserializeAws_json1_1DescribeReportCreationOutput = (output, context) => {
791
641
  return {
792
642
  ErrorMessage: __expectString(output.ErrorMessage),
793
643
  S3Location: __expectString(output.S3Location),
@@ -795,30 +645,31 @@ var deserializeAws_json1_1DescribeReportCreationOutput = function (output, conte
795
645
  Status: __expectString(output.Status),
796
646
  };
797
647
  };
798
- var deserializeAws_json1_1FailedResourcesMap = function (output, context) {
799
- return Object.entries(output).reduce(function (acc, _a) {
800
- var _b;
801
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
648
+ const deserializeAws_json1_1FailedResourcesMap = (output, context) => {
649
+ return Object.entries(output).reduce((acc, [key, value]) => {
802
650
  if (value === null) {
803
651
  return acc;
804
652
  }
805
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_json1_1FailureInfo(value, context), _b));
653
+ return {
654
+ ...acc,
655
+ [key]: deserializeAws_json1_1FailureInfo(value, context),
656
+ };
806
657
  }, {});
807
658
  };
808
- var deserializeAws_json1_1FailureInfo = function (output, context) {
659
+ const deserializeAws_json1_1FailureInfo = (output, context) => {
809
660
  return {
810
661
  ErrorCode: __expectString(output.ErrorCode),
811
662
  ErrorMessage: __expectString(output.ErrorMessage),
812
663
  StatusCode: __expectInt32(output.StatusCode),
813
664
  };
814
665
  };
815
- var deserializeAws_json1_1GetComplianceSummaryOutput = function (output, context) {
666
+ const deserializeAws_json1_1GetComplianceSummaryOutput = (output, context) => {
816
667
  return {
817
668
  PaginationToken: __expectString(output.PaginationToken),
818
669
  SummaryList: output.SummaryList != null ? deserializeAws_json1_1SummaryList(output.SummaryList, context) : undefined,
819
670
  };
820
671
  };
821
- var deserializeAws_json1_1GetResourcesOutput = function (output, context) {
672
+ const deserializeAws_json1_1GetResourcesOutput = (output, context) => {
822
673
  return {
823
674
  PaginationToken: __expectString(output.PaginationToken),
824
675
  ResourceTagMappingList: output.ResourceTagMappingList != null
@@ -826,34 +677,34 @@ var deserializeAws_json1_1GetResourcesOutput = function (output, context) {
826
677
  : undefined,
827
678
  };
828
679
  };
829
- var deserializeAws_json1_1GetTagKeysOutput = function (output, context) {
680
+ const deserializeAws_json1_1GetTagKeysOutput = (output, context) => {
830
681
  return {
831
682
  PaginationToken: __expectString(output.PaginationToken),
832
683
  TagKeys: output.TagKeys != null ? deserializeAws_json1_1TagKeyList(output.TagKeys, context) : undefined,
833
684
  };
834
685
  };
835
- var deserializeAws_json1_1GetTagValuesOutput = function (output, context) {
686
+ const deserializeAws_json1_1GetTagValuesOutput = (output, context) => {
836
687
  return {
837
688
  PaginationToken: __expectString(output.PaginationToken),
838
689
  TagValues: output.TagValues != null ? deserializeAws_json1_1TagValuesOutputList(output.TagValues, context) : undefined,
839
690
  };
840
691
  };
841
- var deserializeAws_json1_1InternalServiceException = function (output, context) {
692
+ const deserializeAws_json1_1InternalServiceException = (output, context) => {
842
693
  return {
843
694
  Message: __expectString(output.Message),
844
695
  };
845
696
  };
846
- var deserializeAws_json1_1InvalidParameterException = function (output, context) {
697
+ const deserializeAws_json1_1InvalidParameterException = (output, context) => {
847
698
  return {
848
699
  Message: __expectString(output.Message),
849
700
  };
850
701
  };
851
- var deserializeAws_json1_1PaginationTokenExpiredException = function (output, context) {
702
+ const deserializeAws_json1_1PaginationTokenExpiredException = (output, context) => {
852
703
  return {
853
704
  Message: __expectString(output.Message),
854
705
  };
855
706
  };
856
- var deserializeAws_json1_1ResourceTagMapping = function (output, context) {
707
+ const deserializeAws_json1_1ResourceTagMapping = (output, context) => {
857
708
  return {
858
709
  ComplianceDetails: output.ComplianceDetails != null
859
710
  ? deserializeAws_json1_1ComplianceDetails(output.ComplianceDetails, context)
@@ -862,10 +713,10 @@ var deserializeAws_json1_1ResourceTagMapping = function (output, context) {
862
713
  Tags: output.Tags != null ? deserializeAws_json1_1TagList(output.Tags, context) : undefined,
863
714
  };
864
715
  };
865
- var deserializeAws_json1_1ResourceTagMappingList = function (output, context) {
866
- var retVal = (output || [])
867
- .filter(function (e) { return e != null; })
868
- .map(function (entry) {
716
+ const deserializeAws_json1_1ResourceTagMappingList = (output, context) => {
717
+ const retVal = (output || [])
718
+ .filter((e) => e != null)
719
+ .map((entry) => {
869
720
  if (entry === null) {
870
721
  return null;
871
722
  }
@@ -873,10 +724,10 @@ var deserializeAws_json1_1ResourceTagMappingList = function (output, context) {
873
724
  });
874
725
  return retVal;
875
726
  };
876
- var deserializeAws_json1_1StartReportCreationOutput = function (output, context) {
727
+ const deserializeAws_json1_1StartReportCreationOutput = (output, context) => {
877
728
  return {};
878
729
  };
879
- var deserializeAws_json1_1Summary = function (output, context) {
730
+ const deserializeAws_json1_1Summary = (output, context) => {
880
731
  return {
881
732
  LastUpdated: __expectString(output.LastUpdated),
882
733
  NonCompliantResources: __expectLong(output.NonCompliantResources),
@@ -886,10 +737,10 @@ var deserializeAws_json1_1Summary = function (output, context) {
886
737
  TargetIdType: __expectString(output.TargetIdType),
887
738
  };
888
739
  };
889
- var deserializeAws_json1_1SummaryList = function (output, context) {
890
- var retVal = (output || [])
891
- .filter(function (e) { return e != null; })
892
- .map(function (entry) {
740
+ const deserializeAws_json1_1SummaryList = (output, context) => {
741
+ const retVal = (output || [])
742
+ .filter((e) => e != null)
743
+ .map((entry) => {
893
744
  if (entry === null) {
894
745
  return null;
895
746
  }
@@ -897,16 +748,16 @@ var deserializeAws_json1_1SummaryList = function (output, context) {
897
748
  });
898
749
  return retVal;
899
750
  };
900
- var deserializeAws_json1_1Tag = function (output, context) {
751
+ const deserializeAws_json1_1Tag = (output, context) => {
901
752
  return {
902
753
  Key: __expectString(output.Key),
903
754
  Value: __expectString(output.Value),
904
755
  };
905
756
  };
906
- var deserializeAws_json1_1TagKeyList = function (output, context) {
907
- var retVal = (output || [])
908
- .filter(function (e) { return e != null; })
909
- .map(function (entry) {
757
+ const deserializeAws_json1_1TagKeyList = (output, context) => {
758
+ const retVal = (output || [])
759
+ .filter((e) => e != null)
760
+ .map((entry) => {
910
761
  if (entry === null) {
911
762
  return null;
912
763
  }
@@ -914,10 +765,10 @@ var deserializeAws_json1_1TagKeyList = function (output, context) {
914
765
  });
915
766
  return retVal;
916
767
  };
917
- var deserializeAws_json1_1TagList = function (output, context) {
918
- var retVal = (output || [])
919
- .filter(function (e) { return e != null; })
920
- .map(function (entry) {
768
+ const deserializeAws_json1_1TagList = (output, context) => {
769
+ const retVal = (output || [])
770
+ .filter((e) => e != null)
771
+ .map((entry) => {
921
772
  if (entry === null) {
922
773
  return null;
923
774
  }
@@ -925,17 +776,17 @@ var deserializeAws_json1_1TagList = function (output, context) {
925
776
  });
926
777
  return retVal;
927
778
  };
928
- var deserializeAws_json1_1TagResourcesOutput = function (output, context) {
779
+ const deserializeAws_json1_1TagResourcesOutput = (output, context) => {
929
780
  return {
930
781
  FailedResourcesMap: output.FailedResourcesMap != null
931
782
  ? deserializeAws_json1_1FailedResourcesMap(output.FailedResourcesMap, context)
932
783
  : undefined,
933
784
  };
934
785
  };
935
- var deserializeAws_json1_1TagValuesOutputList = function (output, context) {
936
- var retVal = (output || [])
937
- .filter(function (e) { return e != null; })
938
- .map(function (entry) {
786
+ const deserializeAws_json1_1TagValuesOutputList = (output, context) => {
787
+ const retVal = (output || [])
788
+ .filter((e) => e != null)
789
+ .map((entry) => {
939
790
  if (entry === null) {
940
791
  return null;
941
792
  }
@@ -943,87 +794,64 @@ var deserializeAws_json1_1TagValuesOutputList = function (output, context) {
943
794
  });
944
795
  return retVal;
945
796
  };
946
- var deserializeAws_json1_1ThrottledException = function (output, context) {
797
+ const deserializeAws_json1_1ThrottledException = (output, context) => {
947
798
  return {
948
799
  Message: __expectString(output.Message),
949
800
  };
950
801
  };
951
- var deserializeAws_json1_1UntagResourcesOutput = function (output, context) {
802
+ const deserializeAws_json1_1UntagResourcesOutput = (output, context) => {
952
803
  return {
953
804
  FailedResourcesMap: output.FailedResourcesMap != null
954
805
  ? deserializeAws_json1_1FailedResourcesMap(output.FailedResourcesMap, context)
955
806
  : undefined,
956
807
  };
957
808
  };
958
- var deserializeMetadata = function (output) {
959
- var _a;
960
- return ({
961
- httpStatusCode: output.statusCode,
962
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
963
- extendedRequestId: output.headers["x-amz-id-2"],
964
- cfId: output.headers["x-amz-cf-id"],
965
- });
966
- };
967
- var collectBody = function (streamBody, context) {
968
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
809
+ const deserializeMetadata = (output) => ({
810
+ httpStatusCode: output.statusCode,
811
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
812
+ extendedRequestId: output.headers["x-amz-id-2"],
813
+ cfId: output.headers["x-amz-cf-id"],
814
+ });
815
+ const collectBody = (streamBody = new Uint8Array(), context) => {
969
816
  if (streamBody instanceof Uint8Array) {
970
817
  return Promise.resolve(streamBody);
971
818
  }
972
819
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
973
820
  };
974
- var collectBodyString = function (streamBody, context) {
975
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
976
- };
977
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
978
- var _a, hostname, _b, protocol, port, basePath, contents;
979
- return __generator(this, function (_c) {
980
- switch (_c.label) {
981
- case 0: return [4, context.endpoint()];
982
- case 1:
983
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
984
- contents = {
985
- protocol: protocol,
986
- hostname: hostname,
987
- port: port,
988
- method: "POST",
989
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
990
- headers: headers,
991
- };
992
- if (resolvedHostname !== undefined) {
993
- contents.hostname = resolvedHostname;
994
- }
995
- if (body !== undefined) {
996
- contents.body = body;
997
- }
998
- return [2, new __HttpRequest(contents)];
999
- }
1000
- });
1001
- }); };
1002
- var parseBody = function (streamBody, context) {
1003
- return collectBodyString(streamBody, context).then(function (encoded) {
1004
- if (encoded.length) {
1005
- return JSON.parse(encoded);
1006
- }
1007
- return {};
1008
- });
821
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
822
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
823
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
824
+ const contents = {
825
+ protocol,
826
+ hostname,
827
+ port,
828
+ method: "POST",
829
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
830
+ headers,
831
+ };
832
+ if (resolvedHostname !== undefined) {
833
+ contents.hostname = resolvedHostname;
834
+ }
835
+ if (body !== undefined) {
836
+ contents.body = body;
837
+ }
838
+ return new __HttpRequest(contents);
1009
839
  };
1010
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1011
- var value;
1012
- var _a;
1013
- return __generator(this, function (_b) {
1014
- switch (_b.label) {
1015
- case 0: return [4, parseBody(errorBody, context)];
1016
- case 1:
1017
- value = _b.sent();
1018
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1019
- return [2, value];
1020
- }
1021
- });
1022
- }); };
1023
- var loadRestJsonErrorCode = function (output, data) {
1024
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1025
- var sanitizeErrorCode = function (rawValue) {
1026
- var cleanValue = rawValue;
840
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
841
+ if (encoded.length) {
842
+ return JSON.parse(encoded);
843
+ }
844
+ return {};
845
+ });
846
+ const parseErrorBody = async (errorBody, context) => {
847
+ const value = await parseBody(errorBody, context);
848
+ value.message = value.message ?? value.Message;
849
+ return value;
850
+ };
851
+ const loadRestJsonErrorCode = (output, data) => {
852
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
853
+ const sanitizeErrorCode = (rawValue) => {
854
+ let cleanValue = rawValue;
1027
855
  if (typeof cleanValue === "number") {
1028
856
  cleanValue = cleanValue.toString();
1029
857
  }
@@ -1038,7 +866,7 @@ var loadRestJsonErrorCode = function (output, data) {
1038
866
  }
1039
867
  return cleanValue;
1040
868
  };
1041
- var headerKey = findKey(output.headers, "x-amzn-errortype");
869
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1042
870
  if (headerKey !== undefined) {
1043
871
  return sanitizeErrorCode(output.headers[headerKey]);
1044
872
  }