@aws-sdk/client-dlm 3.182.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,994 +1,855 @@
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, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { DLMServiceException as __BaseException } from "../models/DLMServiceException";
5
4
  import { InternalServerException, InvalidRequestException, LimitExceededException, ResourceNotFoundException, } from "../models/models_0";
6
- export var serializeAws_restJson1CreateLifecyclePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
- return __generator(this, function (_c) {
9
- switch (_c.label) {
10
- case 0: return [4, context.endpoint()];
11
- case 1:
12
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = {
14
- "content-type": "application/json",
15
- };
16
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/policies";
17
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.ExecutionRoleArn != null && { ExecutionRoleArn: input.ExecutionRoleArn })), (input.PolicyDetails != null && {
18
- PolicyDetails: serializeAws_restJson1PolicyDetails(input.PolicyDetails, context),
19
- })), (input.State != null && { State: input.State })), (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
20
- return [2, new __HttpRequest({
21
- protocol: protocol,
22
- hostname: hostname,
23
- port: port,
24
- method: "POST",
25
- headers: headers,
26
- path: resolvedPath,
27
- body: body,
28
- })];
29
- }
30
- });
31
- }); };
32
- export var serializeAws_restJson1DeleteLifecyclePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
33
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
34
- return __generator(this, function (_c) {
35
- switch (_c.label) {
36
- case 0: return [4, context.endpoint()];
37
- case 1:
38
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
39
- headers = {};
40
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/policies/{PolicyId}";
41
- resolvedPath = __resolvedPath(resolvedPath, input, "PolicyId", function () { return input.PolicyId; }, "{PolicyId}", false);
42
- return [2, new __HttpRequest({
43
- protocol: protocol,
44
- hostname: hostname,
45
- port: port,
46
- method: "DELETE",
47
- headers: headers,
48
- path: resolvedPath,
49
- body: body,
50
- })];
51
- }
52
- });
53
- }); };
54
- export var serializeAws_restJson1GetLifecyclePoliciesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
55
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
56
- return __generator(this, function (_c) {
57
- switch (_c.label) {
58
- case 0: return [4, context.endpoint()];
59
- case 1:
60
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
61
- headers = {};
62
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/policies";
63
- query = map({
64
- policyIds: [function () { return input.PolicyIds !== void 0; }, function () { return (input.PolicyIds || []).map(function (_entry) { return _entry; }); }],
65
- state: [, input.State],
66
- resourceTypes: [
67
- function () { return input.ResourceTypes !== void 0; },
68
- function () { return (input.ResourceTypes || []).map(function (_entry) { return _entry; }); },
69
- ],
70
- targetTags: [function () { return input.TargetTags !== void 0; }, function () { return (input.TargetTags || []).map(function (_entry) { return _entry; }); }],
71
- tagsToAdd: [function () { return input.TagsToAdd !== void 0; }, function () { return (input.TagsToAdd || []).map(function (_entry) { return _entry; }); }],
72
- });
73
- return [2, new __HttpRequest({
74
- protocol: protocol,
75
- hostname: hostname,
76
- port: port,
77
- method: "GET",
78
- headers: headers,
79
- path: resolvedPath,
80
- query: query,
81
- body: body,
82
- })];
83
- }
84
- });
85
- }); };
86
- export var serializeAws_restJson1GetLifecyclePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
87
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
88
- return __generator(this, function (_c) {
89
- switch (_c.label) {
90
- case 0: return [4, context.endpoint()];
91
- case 1:
92
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
93
- headers = {};
94
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/policies/{PolicyId}";
95
- resolvedPath = __resolvedPath(resolvedPath, input, "PolicyId", function () { return input.PolicyId; }, "{PolicyId}", false);
96
- return [2, new __HttpRequest({
97
- protocol: protocol,
98
- hostname: hostname,
99
- port: port,
100
- method: "GET",
101
- headers: headers,
102
- path: resolvedPath,
103
- body: body,
104
- })];
105
- }
106
- });
107
- }); };
108
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
109
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
110
- return __generator(this, function (_c) {
111
- switch (_c.label) {
112
- case 0: return [4, context.endpoint()];
113
- case 1:
114
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
115
- headers = {};
116
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
117
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
118
- return [2, new __HttpRequest({
119
- protocol: protocol,
120
- hostname: hostname,
121
- port: port,
122
- method: "GET",
123
- headers: headers,
124
- path: resolvedPath,
125
- body: body,
126
- })];
127
- }
128
- });
129
- }); };
130
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
131
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
132
- return __generator(this, function (_c) {
133
- switch (_c.label) {
134
- case 0: return [4, context.endpoint()];
135
- case 1:
136
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
137
- headers = {
138
- "content-type": "application/json",
139
- };
140
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
141
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
142
- body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
143
- return [2, new __HttpRequest({
144
- protocol: protocol,
145
- hostname: hostname,
146
- port: port,
147
- method: "POST",
148
- headers: headers,
149
- path: resolvedPath,
150
- body: body,
151
- })];
152
- }
153
- });
154
- }); };
155
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
156
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
157
- return __generator(this, function (_c) {
158
- switch (_c.label) {
159
- case 0: return [4, context.endpoint()];
160
- case 1:
161
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
162
- headers = {};
163
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
164
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
165
- query = map({
166
- tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
167
- });
168
- return [2, new __HttpRequest({
169
- protocol: protocol,
170
- hostname: hostname,
171
- port: port,
172
- method: "DELETE",
173
- headers: headers,
174
- path: resolvedPath,
175
- query: query,
176
- body: body,
177
- })];
178
- }
179
- });
180
- }); };
181
- export var serializeAws_restJson1UpdateLifecyclePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
182
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
183
- return __generator(this, function (_c) {
184
- switch (_c.label) {
185
- case 0: return [4, context.endpoint()];
186
- case 1:
187
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
188
- headers = {
189
- "content-type": "application/json",
190
- };
191
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/policies/{PolicyId}";
192
- resolvedPath = __resolvedPath(resolvedPath, input, "PolicyId", function () { return input.PolicyId; }, "{PolicyId}", false);
193
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.ExecutionRoleArn != null && { ExecutionRoleArn: input.ExecutionRoleArn })), (input.PolicyDetails != null && {
194
- PolicyDetails: serializeAws_restJson1PolicyDetails(input.PolicyDetails, context),
195
- })), (input.State != null && { State: input.State })));
196
- return [2, new __HttpRequest({
197
- protocol: protocol,
198
- hostname: hostname,
199
- port: port,
200
- method: "PATCH",
201
- headers: headers,
202
- path: resolvedPath,
203
- body: body,
204
- })];
205
- }
206
- });
207
- }); };
208
- export var deserializeAws_restJson1CreateLifecyclePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
209
- var contents, data, _a, _b;
210
- return __generator(this, function (_c) {
211
- switch (_c.label) {
212
- case 0:
213
- if (output.statusCode !== 200 && output.statusCode >= 300) {
214
- return [2, deserializeAws_restJson1CreateLifecyclePolicyCommandError(output, context)];
215
- }
216
- contents = map({
217
- $metadata: deserializeMetadata(output),
218
- });
219
- _a = __expectNonNull;
220
- _b = __expectObject;
221
- return [4, parseBody(output.body, context)];
222
- case 1:
223
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
224
- if (data.PolicyId != null) {
225
- contents.PolicyId = __expectString(data.PolicyId);
226
- }
227
- return [2, contents];
228
- }
229
- });
230
- }); };
231
- var deserializeAws_restJson1CreateLifecyclePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
232
- var parsedOutput, _a, errorCode, _b, parsedBody;
233
- var _c;
234
- return __generator(this, function (_d) {
235
- switch (_d.label) {
236
- case 0:
237
- _a = [__assign({}, output)];
238
- _c = {};
239
- return [4, parseErrorBody(output.body, context)];
240
- case 1:
241
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
242
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
243
- _b = errorCode;
244
- switch (_b) {
245
- case "InternalServerException": return [3, 2];
246
- case "com.amazonaws.dlm#InternalServerException": return [3, 2];
247
- case "InvalidRequestException": return [3, 4];
248
- case "com.amazonaws.dlm#InvalidRequestException": return [3, 4];
249
- case "LimitExceededException": return [3, 6];
250
- case "com.amazonaws.dlm#LimitExceededException": return [3, 6];
251
- }
252
- return [3, 8];
253
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
254
- case 3: throw _d.sent();
255
- case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
256
- case 5: throw _d.sent();
257
- case 6: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
258
- case 7: throw _d.sent();
259
- case 8:
260
- parsedBody = parsedOutput.body;
261
- throwDefaultError({
262
- output: output,
263
- parsedBody: parsedBody,
264
- exceptionCtor: __BaseException,
265
- errorCode: errorCode,
266
- });
267
- _d.label = 9;
268
- case 9: return [2];
269
- }
270
- });
271
- }); };
272
- export var deserializeAws_restJson1DeleteLifecyclePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
273
- var contents;
274
- return __generator(this, function (_a) {
275
- switch (_a.label) {
276
- case 0:
277
- if (output.statusCode !== 200 && output.statusCode >= 300) {
278
- return [2, deserializeAws_restJson1DeleteLifecyclePolicyCommandError(output, context)];
279
- }
280
- contents = map({
281
- $metadata: deserializeMetadata(output),
282
- });
283
- return [4, collectBody(output.body, context)];
284
- case 1:
285
- _a.sent();
286
- return [2, contents];
287
- }
288
- });
289
- }); };
290
- var deserializeAws_restJson1DeleteLifecyclePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
291
- var parsedOutput, _a, errorCode, _b, parsedBody;
292
- var _c;
293
- return __generator(this, function (_d) {
294
- switch (_d.label) {
295
- case 0:
296
- _a = [__assign({}, output)];
297
- _c = {};
298
- return [4, parseErrorBody(output.body, context)];
299
- case 1:
300
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
301
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
302
- _b = errorCode;
303
- switch (_b) {
304
- case "InternalServerException": return [3, 2];
305
- case "com.amazonaws.dlm#InternalServerException": return [3, 2];
306
- case "LimitExceededException": return [3, 4];
307
- case "com.amazonaws.dlm#LimitExceededException": return [3, 4];
308
- case "ResourceNotFoundException": return [3, 6];
309
- case "com.amazonaws.dlm#ResourceNotFoundException": return [3, 6];
310
- }
311
- return [3, 8];
312
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
313
- case 3: throw _d.sent();
314
- case 4: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
315
- case 5: throw _d.sent();
316
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
317
- case 7: throw _d.sent();
318
- case 8:
319
- parsedBody = parsedOutput.body;
320
- throwDefaultError({
321
- output: output,
322
- parsedBody: parsedBody,
323
- exceptionCtor: __BaseException,
324
- errorCode: errorCode,
325
- });
326
- _d.label = 9;
327
- case 9: return [2];
328
- }
329
- });
330
- }); };
331
- export var deserializeAws_restJson1GetLifecyclePoliciesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
332
- var contents, data, _a, _b;
333
- return __generator(this, function (_c) {
334
- switch (_c.label) {
335
- case 0:
336
- if (output.statusCode !== 200 && output.statusCode >= 300) {
337
- return [2, deserializeAws_restJson1GetLifecyclePoliciesCommandError(output, context)];
338
- }
339
- contents = map({
340
- $metadata: deserializeMetadata(output),
341
- });
342
- _a = __expectNonNull;
343
- _b = __expectObject;
344
- return [4, parseBody(output.body, context)];
345
- case 1:
346
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
347
- if (data.Policies != null) {
348
- contents.Policies = deserializeAws_restJson1LifecyclePolicySummaryList(data.Policies, context);
349
- }
350
- return [2, contents];
351
- }
352
- });
353
- }); };
354
- var deserializeAws_restJson1GetLifecyclePoliciesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
355
- var parsedOutput, _a, errorCode, _b, parsedBody;
356
- var _c;
357
- return __generator(this, function (_d) {
358
- switch (_d.label) {
359
- case 0:
360
- _a = [__assign({}, output)];
361
- _c = {};
362
- return [4, parseErrorBody(output.body, context)];
363
- case 1:
364
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
365
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
366
- _b = errorCode;
367
- switch (_b) {
368
- case "InternalServerException": return [3, 2];
369
- case "com.amazonaws.dlm#InternalServerException": return [3, 2];
370
- case "InvalidRequestException": return [3, 4];
371
- case "com.amazonaws.dlm#InvalidRequestException": return [3, 4];
372
- case "LimitExceededException": return [3, 6];
373
- case "com.amazonaws.dlm#LimitExceededException": return [3, 6];
374
- case "ResourceNotFoundException": return [3, 8];
375
- case "com.amazonaws.dlm#ResourceNotFoundException": return [3, 8];
376
- }
377
- return [3, 10];
378
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
379
- case 3: throw _d.sent();
380
- case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
381
- case 5: throw _d.sent();
382
- case 6: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
383
- case 7: throw _d.sent();
384
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
385
- case 9: throw _d.sent();
386
- case 10:
387
- parsedBody = parsedOutput.body;
388
- throwDefaultError({
389
- output: output,
390
- parsedBody: parsedBody,
391
- exceptionCtor: __BaseException,
392
- errorCode: errorCode,
393
- });
394
- _d.label = 11;
395
- case 11: return [2];
396
- }
397
- });
398
- }); };
399
- export var deserializeAws_restJson1GetLifecyclePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
400
- var contents, data, _a, _b;
401
- return __generator(this, function (_c) {
402
- switch (_c.label) {
403
- case 0:
404
- if (output.statusCode !== 200 && output.statusCode >= 300) {
405
- return [2, deserializeAws_restJson1GetLifecyclePolicyCommandError(output, context)];
406
- }
407
- contents = map({
408
- $metadata: deserializeMetadata(output),
409
- });
410
- _a = __expectNonNull;
411
- _b = __expectObject;
412
- return [4, parseBody(output.body, context)];
413
- case 1:
414
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
415
- if (data.Policy != null) {
416
- contents.Policy = deserializeAws_restJson1LifecyclePolicy(data.Policy, context);
417
- }
418
- return [2, contents];
419
- }
420
- });
421
- }); };
422
- var deserializeAws_restJson1GetLifecyclePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
423
- var parsedOutput, _a, errorCode, _b, parsedBody;
424
- var _c;
425
- return __generator(this, function (_d) {
426
- switch (_d.label) {
427
- case 0:
428
- _a = [__assign({}, output)];
429
- _c = {};
430
- return [4, parseErrorBody(output.body, context)];
431
- case 1:
432
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
433
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
434
- _b = errorCode;
435
- switch (_b) {
436
- case "InternalServerException": return [3, 2];
437
- case "com.amazonaws.dlm#InternalServerException": return [3, 2];
438
- case "LimitExceededException": return [3, 4];
439
- case "com.amazonaws.dlm#LimitExceededException": return [3, 4];
440
- case "ResourceNotFoundException": return [3, 6];
441
- case "com.amazonaws.dlm#ResourceNotFoundException": return [3, 6];
442
- }
443
- return [3, 8];
444
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
445
- case 3: throw _d.sent();
446
- case 4: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
447
- case 5: throw _d.sent();
448
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
449
- case 7: throw _d.sent();
450
- case 8:
451
- parsedBody = parsedOutput.body;
452
- throwDefaultError({
453
- output: output,
454
- parsedBody: parsedBody,
455
- exceptionCtor: __BaseException,
456
- errorCode: errorCode,
457
- });
458
- _d.label = 9;
459
- case 9: return [2];
460
- }
461
- });
462
- }); };
463
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
464
- var contents, data, _a, _b;
465
- return __generator(this, function (_c) {
466
- switch (_c.label) {
467
- case 0:
468
- if (output.statusCode !== 200 && output.statusCode >= 300) {
469
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
470
- }
471
- contents = map({
472
- $metadata: deserializeMetadata(output),
473
- });
474
- _a = __expectNonNull;
475
- _b = __expectObject;
476
- return [4, parseBody(output.body, context)];
477
- case 1:
478
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
479
- if (data.Tags != null) {
480
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
481
- }
482
- return [2, contents];
483
- }
5
+ export const serializeAws_restJson1CreateLifecyclePolicyCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policies";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.Description != null && { Description: input.Description }),
14
+ ...(input.ExecutionRoleArn != null && { ExecutionRoleArn: input.ExecutionRoleArn }),
15
+ ...(input.PolicyDetails != null && {
16
+ PolicyDetails: serializeAws_restJson1PolicyDetails(input.PolicyDetails, context),
17
+ }),
18
+ ...(input.State != null && { State: input.State }),
19
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
20
+ });
21
+ return new __HttpRequest({
22
+ protocol,
23
+ hostname,
24
+ port,
25
+ method: "POST",
26
+ headers,
27
+ path: resolvedPath,
28
+ body,
29
+ });
30
+ };
31
+ export const serializeAws_restJson1DeleteLifecyclePolicyCommand = async (input, context) => {
32
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
+ const headers = {};
34
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policies/{PolicyId}";
35
+ resolvedPath = __resolvedPath(resolvedPath, input, "PolicyId", () => input.PolicyId, "{PolicyId}", false);
36
+ let body;
37
+ return new __HttpRequest({
38
+ protocol,
39
+ hostname,
40
+ port,
41
+ method: "DELETE",
42
+ headers,
43
+ path: resolvedPath,
44
+ body,
45
+ });
46
+ };
47
+ export const serializeAws_restJson1GetLifecyclePoliciesCommand = async (input, context) => {
48
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
49
+ const headers = {};
50
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policies";
51
+ const query = map({
52
+ policyIds: [() => input.PolicyIds !== void 0, () => (input.PolicyIds || []).map((_entry) => _entry)],
53
+ state: [, input.State],
54
+ resourceTypes: [
55
+ () => input.ResourceTypes !== void 0,
56
+ () => (input.ResourceTypes || []).map((_entry) => _entry),
57
+ ],
58
+ targetTags: [() => input.TargetTags !== void 0, () => (input.TargetTags || []).map((_entry) => _entry)],
59
+ tagsToAdd: [() => input.TagsToAdd !== void 0, () => (input.TagsToAdd || []).map((_entry) => _entry)],
60
+ });
61
+ let body;
62
+ return new __HttpRequest({
63
+ protocol,
64
+ hostname,
65
+ port,
66
+ method: "GET",
67
+ headers,
68
+ path: resolvedPath,
69
+ query,
70
+ body,
71
+ });
72
+ };
73
+ export const serializeAws_restJson1GetLifecyclePolicyCommand = async (input, context) => {
74
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
75
+ const headers = {};
76
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policies/{PolicyId}";
77
+ resolvedPath = __resolvedPath(resolvedPath, input, "PolicyId", () => input.PolicyId, "{PolicyId}", false);
78
+ let body;
79
+ return new __HttpRequest({
80
+ protocol,
81
+ hostname,
82
+ port,
83
+ method: "GET",
84
+ headers,
85
+ path: resolvedPath,
86
+ body,
87
+ });
88
+ };
89
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
90
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
91
+ const headers = {};
92
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
93
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
94
+ let body;
95
+ return new __HttpRequest({
96
+ protocol,
97
+ hostname,
98
+ port,
99
+ method: "GET",
100
+ headers,
101
+ path: resolvedPath,
102
+ body,
103
+ });
104
+ };
105
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
106
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
107
+ const headers = {
108
+ "content-type": "application/json",
109
+ };
110
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
111
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
112
+ let body;
113
+ body = JSON.stringify({
114
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
115
+ });
116
+ return new __HttpRequest({
117
+ protocol,
118
+ hostname,
119
+ port,
120
+ method: "POST",
121
+ headers,
122
+ path: resolvedPath,
123
+ body,
124
+ });
125
+ };
126
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
127
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
128
+ const headers = {};
129
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
130
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
131
+ const query = map({
132
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
133
+ });
134
+ let body;
135
+ return new __HttpRequest({
136
+ protocol,
137
+ hostname,
138
+ port,
139
+ method: "DELETE",
140
+ headers,
141
+ path: resolvedPath,
142
+ query,
143
+ body,
144
+ });
145
+ };
146
+ export const serializeAws_restJson1UpdateLifecyclePolicyCommand = async (input, context) => {
147
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
148
+ const headers = {
149
+ "content-type": "application/json",
150
+ };
151
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policies/{PolicyId}";
152
+ resolvedPath = __resolvedPath(resolvedPath, input, "PolicyId", () => input.PolicyId, "{PolicyId}", false);
153
+ let body;
154
+ body = JSON.stringify({
155
+ ...(input.Description != null && { Description: input.Description }),
156
+ ...(input.ExecutionRoleArn != null && { ExecutionRoleArn: input.ExecutionRoleArn }),
157
+ ...(input.PolicyDetails != null && {
158
+ PolicyDetails: serializeAws_restJson1PolicyDetails(input.PolicyDetails, context),
159
+ }),
160
+ ...(input.State != null && { State: input.State }),
161
+ });
162
+ return new __HttpRequest({
163
+ protocol,
164
+ hostname,
165
+ port,
166
+ method: "PATCH",
167
+ headers,
168
+ path: resolvedPath,
169
+ body,
170
+ });
171
+ };
172
+ export const deserializeAws_restJson1CreateLifecyclePolicyCommand = async (output, context) => {
173
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
174
+ return deserializeAws_restJson1CreateLifecyclePolicyCommandError(output, context);
175
+ }
176
+ const contents = map({
177
+ $metadata: deserializeMetadata(output),
484
178
  });
485
- }); };
486
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
487
- var parsedOutput, _a, errorCode, _b, parsedBody;
488
- var _c;
489
- return __generator(this, function (_d) {
490
- switch (_d.label) {
491
- case 0:
492
- _a = [__assign({}, output)];
493
- _c = {};
494
- return [4, parseErrorBody(output.body, context)];
495
- case 1:
496
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
497
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
498
- _b = errorCode;
499
- switch (_b) {
500
- case "InternalServerException": return [3, 2];
501
- case "com.amazonaws.dlm#InternalServerException": return [3, 2];
502
- case "InvalidRequestException": return [3, 4];
503
- case "com.amazonaws.dlm#InvalidRequestException": return [3, 4];
504
- case "ResourceNotFoundException": return [3, 6];
505
- case "com.amazonaws.dlm#ResourceNotFoundException": return [3, 6];
506
- }
507
- return [3, 8];
508
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
509
- case 3: throw _d.sent();
510
- case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
511
- case 5: throw _d.sent();
512
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
513
- case 7: throw _d.sent();
514
- case 8:
515
- parsedBody = parsedOutput.body;
516
- throwDefaultError({
517
- output: output,
518
- parsedBody: parsedBody,
519
- exceptionCtor: __BaseException,
520
- errorCode: errorCode,
521
- });
522
- _d.label = 9;
523
- case 9: return [2];
524
- }
179
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
180
+ if (data.PolicyId != null) {
181
+ contents.PolicyId = __expectString(data.PolicyId);
182
+ }
183
+ return contents;
184
+ };
185
+ const deserializeAws_restJson1CreateLifecyclePolicyCommandError = async (output, context) => {
186
+ const parsedOutput = {
187
+ ...output,
188
+ body: await parseErrorBody(output.body, context),
189
+ };
190
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
191
+ switch (errorCode) {
192
+ case "InternalServerException":
193
+ case "com.amazonaws.dlm#InternalServerException":
194
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
195
+ case "InvalidRequestException":
196
+ case "com.amazonaws.dlm#InvalidRequestException":
197
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
198
+ case "LimitExceededException":
199
+ case "com.amazonaws.dlm#LimitExceededException":
200
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
201
+ default:
202
+ const parsedBody = parsedOutput.body;
203
+ throwDefaultError({
204
+ output,
205
+ parsedBody,
206
+ exceptionCtor: __BaseException,
207
+ errorCode,
208
+ });
209
+ }
210
+ };
211
+ export const deserializeAws_restJson1DeleteLifecyclePolicyCommand = async (output, context) => {
212
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
213
+ return deserializeAws_restJson1DeleteLifecyclePolicyCommandError(output, context);
214
+ }
215
+ const contents = map({
216
+ $metadata: deserializeMetadata(output),
525
217
  });
526
- }); };
527
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
528
- var contents;
529
- return __generator(this, function (_a) {
530
- switch (_a.label) {
531
- case 0:
532
- if (output.statusCode !== 200 && output.statusCode >= 300) {
533
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
534
- }
535
- contents = map({
536
- $metadata: deserializeMetadata(output),
537
- });
538
- return [4, collectBody(output.body, context)];
539
- case 1:
540
- _a.sent();
541
- return [2, contents];
542
- }
218
+ await collectBody(output.body, context);
219
+ return contents;
220
+ };
221
+ const deserializeAws_restJson1DeleteLifecyclePolicyCommandError = async (output, context) => {
222
+ const parsedOutput = {
223
+ ...output,
224
+ body: await parseErrorBody(output.body, context),
225
+ };
226
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
227
+ switch (errorCode) {
228
+ case "InternalServerException":
229
+ case "com.amazonaws.dlm#InternalServerException":
230
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
231
+ case "LimitExceededException":
232
+ case "com.amazonaws.dlm#LimitExceededException":
233
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
234
+ case "ResourceNotFoundException":
235
+ case "com.amazonaws.dlm#ResourceNotFoundException":
236
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
237
+ default:
238
+ const parsedBody = parsedOutput.body;
239
+ throwDefaultError({
240
+ output,
241
+ parsedBody,
242
+ exceptionCtor: __BaseException,
243
+ errorCode,
244
+ });
245
+ }
246
+ };
247
+ export const deserializeAws_restJson1GetLifecyclePoliciesCommand = async (output, context) => {
248
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
249
+ return deserializeAws_restJson1GetLifecyclePoliciesCommandError(output, context);
250
+ }
251
+ const contents = map({
252
+ $metadata: deserializeMetadata(output),
543
253
  });
544
- }); };
545
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
546
- var parsedOutput, _a, errorCode, _b, parsedBody;
547
- var _c;
548
- return __generator(this, function (_d) {
549
- switch (_d.label) {
550
- case 0:
551
- _a = [__assign({}, output)];
552
- _c = {};
553
- return [4, parseErrorBody(output.body, context)];
554
- case 1:
555
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
556
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
557
- _b = errorCode;
558
- switch (_b) {
559
- case "InternalServerException": return [3, 2];
560
- case "com.amazonaws.dlm#InternalServerException": return [3, 2];
561
- case "InvalidRequestException": return [3, 4];
562
- case "com.amazonaws.dlm#InvalidRequestException": return [3, 4];
563
- case "ResourceNotFoundException": return [3, 6];
564
- case "com.amazonaws.dlm#ResourceNotFoundException": return [3, 6];
565
- }
566
- return [3, 8];
567
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
568
- case 3: throw _d.sent();
569
- case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
570
- case 5: throw _d.sent();
571
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
572
- case 7: throw _d.sent();
573
- case 8:
574
- parsedBody = parsedOutput.body;
575
- throwDefaultError({
576
- output: output,
577
- parsedBody: parsedBody,
578
- exceptionCtor: __BaseException,
579
- errorCode: errorCode,
580
- });
581
- _d.label = 9;
582
- case 9: return [2];
583
- }
254
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
255
+ if (data.Policies != null) {
256
+ contents.Policies = deserializeAws_restJson1LifecyclePolicySummaryList(data.Policies, context);
257
+ }
258
+ return contents;
259
+ };
260
+ const deserializeAws_restJson1GetLifecyclePoliciesCommandError = async (output, context) => {
261
+ const parsedOutput = {
262
+ ...output,
263
+ body: await parseErrorBody(output.body, context),
264
+ };
265
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
266
+ switch (errorCode) {
267
+ case "InternalServerException":
268
+ case "com.amazonaws.dlm#InternalServerException":
269
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
270
+ case "InvalidRequestException":
271
+ case "com.amazonaws.dlm#InvalidRequestException":
272
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
273
+ case "LimitExceededException":
274
+ case "com.amazonaws.dlm#LimitExceededException":
275
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
276
+ case "ResourceNotFoundException":
277
+ case "com.amazonaws.dlm#ResourceNotFoundException":
278
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
279
+ default:
280
+ const parsedBody = parsedOutput.body;
281
+ throwDefaultError({
282
+ output,
283
+ parsedBody,
284
+ exceptionCtor: __BaseException,
285
+ errorCode,
286
+ });
287
+ }
288
+ };
289
+ export const deserializeAws_restJson1GetLifecyclePolicyCommand = async (output, context) => {
290
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
291
+ return deserializeAws_restJson1GetLifecyclePolicyCommandError(output, context);
292
+ }
293
+ const contents = map({
294
+ $metadata: deserializeMetadata(output),
584
295
  });
585
- }); };
586
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
587
- var contents;
588
- return __generator(this, function (_a) {
589
- switch (_a.label) {
590
- case 0:
591
- if (output.statusCode !== 200 && output.statusCode >= 300) {
592
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
593
- }
594
- contents = map({
595
- $metadata: deserializeMetadata(output),
596
- });
597
- return [4, collectBody(output.body, context)];
598
- case 1:
599
- _a.sent();
600
- return [2, contents];
601
- }
296
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
297
+ if (data.Policy != null) {
298
+ contents.Policy = deserializeAws_restJson1LifecyclePolicy(data.Policy, context);
299
+ }
300
+ return contents;
301
+ };
302
+ const deserializeAws_restJson1GetLifecyclePolicyCommandError = async (output, context) => {
303
+ const parsedOutput = {
304
+ ...output,
305
+ body: await parseErrorBody(output.body, context),
306
+ };
307
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
308
+ switch (errorCode) {
309
+ case "InternalServerException":
310
+ case "com.amazonaws.dlm#InternalServerException":
311
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
312
+ case "LimitExceededException":
313
+ case "com.amazonaws.dlm#LimitExceededException":
314
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
315
+ case "ResourceNotFoundException":
316
+ case "com.amazonaws.dlm#ResourceNotFoundException":
317
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
318
+ default:
319
+ const parsedBody = parsedOutput.body;
320
+ throwDefaultError({
321
+ output,
322
+ parsedBody,
323
+ exceptionCtor: __BaseException,
324
+ errorCode,
325
+ });
326
+ }
327
+ };
328
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
329
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
330
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
331
+ }
332
+ const contents = map({
333
+ $metadata: deserializeMetadata(output),
602
334
  });
603
- }); };
604
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
605
- var parsedOutput, _a, errorCode, _b, parsedBody;
606
- var _c;
607
- return __generator(this, function (_d) {
608
- switch (_d.label) {
609
- case 0:
610
- _a = [__assign({}, output)];
611
- _c = {};
612
- return [4, parseErrorBody(output.body, context)];
613
- case 1:
614
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
615
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
616
- _b = errorCode;
617
- switch (_b) {
618
- case "InternalServerException": return [3, 2];
619
- case "com.amazonaws.dlm#InternalServerException": return [3, 2];
620
- case "InvalidRequestException": return [3, 4];
621
- case "com.amazonaws.dlm#InvalidRequestException": return [3, 4];
622
- case "ResourceNotFoundException": return [3, 6];
623
- case "com.amazonaws.dlm#ResourceNotFoundException": return [3, 6];
624
- }
625
- return [3, 8];
626
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
627
- case 3: throw _d.sent();
628
- case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
629
- case 5: throw _d.sent();
630
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
631
- case 7: throw _d.sent();
632
- case 8:
633
- parsedBody = parsedOutput.body;
634
- throwDefaultError({
635
- output: output,
636
- parsedBody: parsedBody,
637
- exceptionCtor: __BaseException,
638
- errorCode: errorCode,
639
- });
640
- _d.label = 9;
641
- case 9: return [2];
642
- }
335
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
336
+ if (data.Tags != null) {
337
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
338
+ }
339
+ return contents;
340
+ };
341
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
342
+ const parsedOutput = {
343
+ ...output,
344
+ body: await parseErrorBody(output.body, context),
345
+ };
346
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
347
+ switch (errorCode) {
348
+ case "InternalServerException":
349
+ case "com.amazonaws.dlm#InternalServerException":
350
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
351
+ case "InvalidRequestException":
352
+ case "com.amazonaws.dlm#InvalidRequestException":
353
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
354
+ case "ResourceNotFoundException":
355
+ case "com.amazonaws.dlm#ResourceNotFoundException":
356
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
357
+ default:
358
+ const parsedBody = parsedOutput.body;
359
+ throwDefaultError({
360
+ output,
361
+ parsedBody,
362
+ exceptionCtor: __BaseException,
363
+ errorCode,
364
+ });
365
+ }
366
+ };
367
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
368
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
369
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
370
+ }
371
+ const contents = map({
372
+ $metadata: deserializeMetadata(output),
643
373
  });
644
- }); };
645
- export var deserializeAws_restJson1UpdateLifecyclePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
646
- var contents;
647
- return __generator(this, function (_a) {
648
- switch (_a.label) {
649
- case 0:
650
- if (output.statusCode !== 200 && output.statusCode >= 300) {
651
- return [2, deserializeAws_restJson1UpdateLifecyclePolicyCommandError(output, context)];
652
- }
653
- contents = map({
654
- $metadata: deserializeMetadata(output),
655
- });
656
- return [4, collectBody(output.body, context)];
657
- case 1:
658
- _a.sent();
659
- return [2, contents];
660
- }
374
+ await collectBody(output.body, context);
375
+ return contents;
376
+ };
377
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
378
+ const parsedOutput = {
379
+ ...output,
380
+ body: await parseErrorBody(output.body, context),
381
+ };
382
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
383
+ switch (errorCode) {
384
+ case "InternalServerException":
385
+ case "com.amazonaws.dlm#InternalServerException":
386
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
387
+ case "InvalidRequestException":
388
+ case "com.amazonaws.dlm#InvalidRequestException":
389
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
390
+ case "ResourceNotFoundException":
391
+ case "com.amazonaws.dlm#ResourceNotFoundException":
392
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
393
+ default:
394
+ const parsedBody = parsedOutput.body;
395
+ throwDefaultError({
396
+ output,
397
+ parsedBody,
398
+ exceptionCtor: __BaseException,
399
+ errorCode,
400
+ });
401
+ }
402
+ };
403
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
404
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
405
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
406
+ }
407
+ const contents = map({
408
+ $metadata: deserializeMetadata(output),
661
409
  });
662
- }); };
663
- var deserializeAws_restJson1UpdateLifecyclePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
664
- var parsedOutput, _a, errorCode, _b, parsedBody;
665
- var _c;
666
- return __generator(this, function (_d) {
667
- switch (_d.label) {
668
- case 0:
669
- _a = [__assign({}, output)];
670
- _c = {};
671
- return [4, parseErrorBody(output.body, context)];
672
- case 1:
673
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
674
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
675
- _b = errorCode;
676
- switch (_b) {
677
- case "InternalServerException": return [3, 2];
678
- case "com.amazonaws.dlm#InternalServerException": return [3, 2];
679
- case "InvalidRequestException": return [3, 4];
680
- case "com.amazonaws.dlm#InvalidRequestException": return [3, 4];
681
- case "LimitExceededException": return [3, 6];
682
- case "com.amazonaws.dlm#LimitExceededException": return [3, 6];
683
- case "ResourceNotFoundException": return [3, 8];
684
- case "com.amazonaws.dlm#ResourceNotFoundException": return [3, 8];
685
- }
686
- return [3, 10];
687
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
688
- case 3: throw _d.sent();
689
- case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
690
- case 5: throw _d.sent();
691
- case 6: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
692
- case 7: throw _d.sent();
693
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
694
- case 9: throw _d.sent();
695
- case 10:
696
- parsedBody = parsedOutput.body;
697
- throwDefaultError({
698
- output: output,
699
- parsedBody: parsedBody,
700
- exceptionCtor: __BaseException,
701
- errorCode: errorCode,
702
- });
703
- _d.label = 11;
704
- case 11: return [2];
705
- }
410
+ await collectBody(output.body, context);
411
+ return contents;
412
+ };
413
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
414
+ const parsedOutput = {
415
+ ...output,
416
+ body: await parseErrorBody(output.body, context),
417
+ };
418
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
419
+ switch (errorCode) {
420
+ case "InternalServerException":
421
+ case "com.amazonaws.dlm#InternalServerException":
422
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
423
+ case "InvalidRequestException":
424
+ case "com.amazonaws.dlm#InvalidRequestException":
425
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
426
+ case "ResourceNotFoundException":
427
+ case "com.amazonaws.dlm#ResourceNotFoundException":
428
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
429
+ default:
430
+ const parsedBody = parsedOutput.body;
431
+ throwDefaultError({
432
+ output,
433
+ parsedBody,
434
+ exceptionCtor: __BaseException,
435
+ errorCode,
436
+ });
437
+ }
438
+ };
439
+ export const deserializeAws_restJson1UpdateLifecyclePolicyCommand = async (output, context) => {
440
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
441
+ return deserializeAws_restJson1UpdateLifecyclePolicyCommandError(output, context);
442
+ }
443
+ const contents = map({
444
+ $metadata: deserializeMetadata(output),
706
445
  });
707
- }); };
708
- var map = __map;
709
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
710
- var contents, data, exception;
711
- return __generator(this, function (_a) {
712
- contents = map({});
713
- data = parsedOutput.body;
714
- if (data.Code != null) {
715
- contents.Code = __expectString(data.Code);
716
- }
717
- if (data.Message != null) {
718
- contents.Message = __expectString(data.Message);
719
- }
720
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
721
- return [2, __decorateServiceException(exception, parsedOutput.body)];
446
+ await collectBody(output.body, context);
447
+ return contents;
448
+ };
449
+ const deserializeAws_restJson1UpdateLifecyclePolicyCommandError = async (output, context) => {
450
+ const parsedOutput = {
451
+ ...output,
452
+ body: await parseErrorBody(output.body, context),
453
+ };
454
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
455
+ switch (errorCode) {
456
+ case "InternalServerException":
457
+ case "com.amazonaws.dlm#InternalServerException":
458
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
459
+ case "InvalidRequestException":
460
+ case "com.amazonaws.dlm#InvalidRequestException":
461
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
462
+ case "LimitExceededException":
463
+ case "com.amazonaws.dlm#LimitExceededException":
464
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
465
+ case "ResourceNotFoundException":
466
+ case "com.amazonaws.dlm#ResourceNotFoundException":
467
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
468
+ default:
469
+ const parsedBody = parsedOutput.body;
470
+ throwDefaultError({
471
+ output,
472
+ parsedBody,
473
+ exceptionCtor: __BaseException,
474
+ errorCode,
475
+ });
476
+ }
477
+ };
478
+ const map = __map;
479
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
480
+ const contents = map({});
481
+ const data = parsedOutput.body;
482
+ if (data.Code != null) {
483
+ contents.Code = __expectString(data.Code);
484
+ }
485
+ if (data.Message != null) {
486
+ contents.Message = __expectString(data.Message);
487
+ }
488
+ const exception = new InternalServerException({
489
+ $metadata: deserializeMetadata(parsedOutput),
490
+ ...contents,
722
491
  });
723
- }); };
724
- var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
725
- var contents, data, exception;
726
- return __generator(this, function (_a) {
727
- contents = map({});
728
- data = parsedOutput.body;
729
- if (data.Code != null) {
730
- contents.Code = __expectString(data.Code);
731
- }
732
- if (data.Message != null) {
733
- contents.Message = __expectString(data.Message);
734
- }
735
- if (data.MutuallyExclusiveParameters != null) {
736
- contents.MutuallyExclusiveParameters = deserializeAws_restJson1ParameterList(data.MutuallyExclusiveParameters, context);
737
- }
738
- if (data.RequiredParameters != null) {
739
- contents.RequiredParameters = deserializeAws_restJson1ParameterList(data.RequiredParameters, context);
740
- }
741
- exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
742
- return [2, __decorateServiceException(exception, parsedOutput.body)];
492
+ return __decorateServiceException(exception, parsedOutput.body);
493
+ };
494
+ const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
495
+ const contents = map({});
496
+ const data = parsedOutput.body;
497
+ if (data.Code != null) {
498
+ contents.Code = __expectString(data.Code);
499
+ }
500
+ if (data.Message != null) {
501
+ contents.Message = __expectString(data.Message);
502
+ }
503
+ if (data.MutuallyExclusiveParameters != null) {
504
+ contents.MutuallyExclusiveParameters = deserializeAws_restJson1ParameterList(data.MutuallyExclusiveParameters, context);
505
+ }
506
+ if (data.RequiredParameters != null) {
507
+ contents.RequiredParameters = deserializeAws_restJson1ParameterList(data.RequiredParameters, context);
508
+ }
509
+ const exception = new InvalidRequestException({
510
+ $metadata: deserializeMetadata(parsedOutput),
511
+ ...contents,
743
512
  });
744
- }); };
745
- var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
746
- var contents, data, exception;
747
- return __generator(this, function (_a) {
748
- contents = map({});
749
- data = parsedOutput.body;
750
- if (data.Code != null) {
751
- contents.Code = __expectString(data.Code);
752
- }
753
- if (data.Message != null) {
754
- contents.Message = __expectString(data.Message);
755
- }
756
- if (data.ResourceType != null) {
757
- contents.ResourceType = __expectString(data.ResourceType);
758
- }
759
- exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
760
- return [2, __decorateServiceException(exception, parsedOutput.body)];
513
+ return __decorateServiceException(exception, parsedOutput.body);
514
+ };
515
+ const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
516
+ const contents = map({});
517
+ const data = parsedOutput.body;
518
+ if (data.Code != null) {
519
+ contents.Code = __expectString(data.Code);
520
+ }
521
+ if (data.Message != null) {
522
+ contents.Message = __expectString(data.Message);
523
+ }
524
+ if (data.ResourceType != null) {
525
+ contents.ResourceType = __expectString(data.ResourceType);
526
+ }
527
+ const exception = new LimitExceededException({
528
+ $metadata: deserializeMetadata(parsedOutput),
529
+ ...contents,
761
530
  });
762
- }); };
763
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
764
- var contents, data, exception;
765
- return __generator(this, function (_a) {
766
- contents = map({});
767
- data = parsedOutput.body;
768
- if (data.Code != null) {
769
- contents.Code = __expectString(data.Code);
770
- }
771
- if (data.Message != null) {
772
- contents.Message = __expectString(data.Message);
773
- }
774
- if (data.ResourceIds != null) {
775
- contents.ResourceIds = deserializeAws_restJson1PolicyIdList(data.ResourceIds, context);
776
- }
777
- if (data.ResourceType != null) {
778
- contents.ResourceType = __expectString(data.ResourceType);
779
- }
780
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
781
- return [2, __decorateServiceException(exception, parsedOutput.body)];
531
+ return __decorateServiceException(exception, parsedOutput.body);
532
+ };
533
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
534
+ const contents = map({});
535
+ const data = parsedOutput.body;
536
+ if (data.Code != null) {
537
+ contents.Code = __expectString(data.Code);
538
+ }
539
+ if (data.Message != null) {
540
+ contents.Message = __expectString(data.Message);
541
+ }
542
+ if (data.ResourceIds != null) {
543
+ contents.ResourceIds = deserializeAws_restJson1PolicyIdList(data.ResourceIds, context);
544
+ }
545
+ if (data.ResourceType != null) {
546
+ contents.ResourceType = __expectString(data.ResourceType);
547
+ }
548
+ const exception = new ResourceNotFoundException({
549
+ $metadata: deserializeMetadata(parsedOutput),
550
+ ...contents,
782
551
  });
783
- }); };
784
- var serializeAws_restJson1Action = function (input, context) {
785
- return __assign(__assign({}, (input.CrossRegionCopy != null && {
786
- CrossRegionCopy: serializeAws_restJson1CrossRegionCopyActionList(input.CrossRegionCopy, context),
787
- })), (input.Name != null && { Name: input.Name }));
552
+ return __decorateServiceException(exception, parsedOutput.body);
788
553
  };
789
- var serializeAws_restJson1ActionList = function (input, context) {
554
+ const serializeAws_restJson1Action = (input, context) => {
555
+ return {
556
+ ...(input.CrossRegionCopy != null && {
557
+ CrossRegionCopy: serializeAws_restJson1CrossRegionCopyActionList(input.CrossRegionCopy, context),
558
+ }),
559
+ ...(input.Name != null && { Name: input.Name }),
560
+ };
561
+ };
562
+ const serializeAws_restJson1ActionList = (input, context) => {
790
563
  return input
791
- .filter(function (e) { return e != null; })
792
- .map(function (entry) {
564
+ .filter((e) => e != null)
565
+ .map((entry) => {
793
566
  return serializeAws_restJson1Action(entry, context);
794
567
  });
795
568
  };
796
- var serializeAws_restJson1ArchiveRetainRule = function (input, context) {
797
- return __assign({}, (input.RetentionArchiveTier != null && {
798
- RetentionArchiveTier: serializeAws_restJson1RetentionArchiveTier(input.RetentionArchiveTier, context),
799
- }));
569
+ const serializeAws_restJson1ArchiveRetainRule = (input, context) => {
570
+ return {
571
+ ...(input.RetentionArchiveTier != null && {
572
+ RetentionArchiveTier: serializeAws_restJson1RetentionArchiveTier(input.RetentionArchiveTier, context),
573
+ }),
574
+ };
800
575
  };
801
- var serializeAws_restJson1ArchiveRule = function (input, context) {
802
- return __assign({}, (input.RetainRule != null && { RetainRule: serializeAws_restJson1ArchiveRetainRule(input.RetainRule, context) }));
576
+ const serializeAws_restJson1ArchiveRule = (input, context) => {
577
+ return {
578
+ ...(input.RetainRule != null && { RetainRule: serializeAws_restJson1ArchiveRetainRule(input.RetainRule, context) }),
579
+ };
803
580
  };
804
- var serializeAws_restJson1AvailabilityZoneList = function (input, context) {
581
+ const serializeAws_restJson1AvailabilityZoneList = (input, context) => {
805
582
  return input
806
- .filter(function (e) { return e != null; })
807
- .map(function (entry) {
583
+ .filter((e) => e != null)
584
+ .map((entry) => {
808
585
  return entry;
809
586
  });
810
587
  };
811
- var serializeAws_restJson1CreateRule = function (input, context) {
812
- return __assign(__assign(__assign(__assign(__assign({}, (input.CronExpression != null && { CronExpression: input.CronExpression })), (input.Interval != null && { Interval: input.Interval })), (input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit })), (input.Location != null && { Location: input.Location })), (input.Times != null && { Times: serializeAws_restJson1TimesList(input.Times, context) }));
588
+ const serializeAws_restJson1CreateRule = (input, context) => {
589
+ return {
590
+ ...(input.CronExpression != null && { CronExpression: input.CronExpression }),
591
+ ...(input.Interval != null && { Interval: input.Interval }),
592
+ ...(input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }),
593
+ ...(input.Location != null && { Location: input.Location }),
594
+ ...(input.Times != null && { Times: serializeAws_restJson1TimesList(input.Times, context) }),
595
+ };
813
596
  };
814
- var serializeAws_restJson1CrossRegionCopyAction = function (input, context) {
815
- return __assign(__assign(__assign({}, (input.EncryptionConfiguration != null && {
816
- EncryptionConfiguration: serializeAws_restJson1EncryptionConfiguration(input.EncryptionConfiguration, context),
817
- })), (input.RetainRule != null && {
818
- RetainRule: serializeAws_restJson1CrossRegionCopyRetainRule(input.RetainRule, context),
819
- })), (input.Target != null && { Target: input.Target }));
597
+ const serializeAws_restJson1CrossRegionCopyAction = (input, context) => {
598
+ return {
599
+ ...(input.EncryptionConfiguration != null && {
600
+ EncryptionConfiguration: serializeAws_restJson1EncryptionConfiguration(input.EncryptionConfiguration, context),
601
+ }),
602
+ ...(input.RetainRule != null && {
603
+ RetainRule: serializeAws_restJson1CrossRegionCopyRetainRule(input.RetainRule, context),
604
+ }),
605
+ ...(input.Target != null && { Target: input.Target }),
606
+ };
820
607
  };
821
- var serializeAws_restJson1CrossRegionCopyActionList = function (input, context) {
608
+ const serializeAws_restJson1CrossRegionCopyActionList = (input, context) => {
822
609
  return input
823
- .filter(function (e) { return e != null; })
824
- .map(function (entry) {
610
+ .filter((e) => e != null)
611
+ .map((entry) => {
825
612
  return serializeAws_restJson1CrossRegionCopyAction(entry, context);
826
613
  });
827
614
  };
828
- var serializeAws_restJson1CrossRegionCopyDeprecateRule = function (input, context) {
829
- return __assign(__assign({}, (input.Interval != null && { Interval: input.Interval })), (input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }));
615
+ const serializeAws_restJson1CrossRegionCopyDeprecateRule = (input, context) => {
616
+ return {
617
+ ...(input.Interval != null && { Interval: input.Interval }),
618
+ ...(input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }),
619
+ };
830
620
  };
831
- var serializeAws_restJson1CrossRegionCopyRetainRule = function (input, context) {
832
- return __assign(__assign({}, (input.Interval != null && { Interval: input.Interval })), (input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }));
621
+ const serializeAws_restJson1CrossRegionCopyRetainRule = (input, context) => {
622
+ return {
623
+ ...(input.Interval != null && { Interval: input.Interval }),
624
+ ...(input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }),
625
+ };
833
626
  };
834
- var serializeAws_restJson1CrossRegionCopyRule = function (input, context) {
835
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.CmkArn != null && { CmkArn: input.CmkArn })), (input.CopyTags != null && { CopyTags: input.CopyTags })), (input.DeprecateRule != null && {
836
- DeprecateRule: serializeAws_restJson1CrossRegionCopyDeprecateRule(input.DeprecateRule, context),
837
- })), (input.Encrypted != null && { Encrypted: input.Encrypted })), (input.RetainRule != null && {
838
- RetainRule: serializeAws_restJson1CrossRegionCopyRetainRule(input.RetainRule, context),
839
- })), (input.Target != null && { Target: input.Target })), (input.TargetRegion != null && { TargetRegion: input.TargetRegion }));
627
+ const serializeAws_restJson1CrossRegionCopyRule = (input, context) => {
628
+ return {
629
+ ...(input.CmkArn != null && { CmkArn: input.CmkArn }),
630
+ ...(input.CopyTags != null && { CopyTags: input.CopyTags }),
631
+ ...(input.DeprecateRule != null && {
632
+ DeprecateRule: serializeAws_restJson1CrossRegionCopyDeprecateRule(input.DeprecateRule, context),
633
+ }),
634
+ ...(input.Encrypted != null && { Encrypted: input.Encrypted }),
635
+ ...(input.RetainRule != null && {
636
+ RetainRule: serializeAws_restJson1CrossRegionCopyRetainRule(input.RetainRule, context),
637
+ }),
638
+ ...(input.Target != null && { Target: input.Target }),
639
+ ...(input.TargetRegion != null && { TargetRegion: input.TargetRegion }),
640
+ };
840
641
  };
841
- var serializeAws_restJson1CrossRegionCopyRules = function (input, context) {
642
+ const serializeAws_restJson1CrossRegionCopyRules = (input, context) => {
842
643
  return input
843
- .filter(function (e) { return e != null; })
844
- .map(function (entry) {
644
+ .filter((e) => e != null)
645
+ .map((entry) => {
845
646
  return serializeAws_restJson1CrossRegionCopyRule(entry, context);
846
647
  });
847
648
  };
848
- var serializeAws_restJson1DeprecateRule = function (input, context) {
849
- return __assign(__assign(__assign({}, (input.Count != null && { Count: input.Count })), (input.Interval != null && { Interval: input.Interval })), (input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }));
649
+ const serializeAws_restJson1DeprecateRule = (input, context) => {
650
+ return {
651
+ ...(input.Count != null && { Count: input.Count }),
652
+ ...(input.Interval != null && { Interval: input.Interval }),
653
+ ...(input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }),
654
+ };
850
655
  };
851
- var serializeAws_restJson1EncryptionConfiguration = function (input, context) {
852
- return __assign(__assign({}, (input.CmkArn != null && { CmkArn: input.CmkArn })), (input.Encrypted != null && { Encrypted: input.Encrypted }));
656
+ const serializeAws_restJson1EncryptionConfiguration = (input, context) => {
657
+ return {
658
+ ...(input.CmkArn != null && { CmkArn: input.CmkArn }),
659
+ ...(input.Encrypted != null && { Encrypted: input.Encrypted }),
660
+ };
853
661
  };
854
- var serializeAws_restJson1EventParameters = function (input, context) {
855
- return __assign(__assign(__assign({}, (input.DescriptionRegex != null && { DescriptionRegex: input.DescriptionRegex })), (input.EventType != null && { EventType: input.EventType })), (input.SnapshotOwner != null && {
856
- SnapshotOwner: serializeAws_restJson1SnapshotOwnerList(input.SnapshotOwner, context),
857
- }));
662
+ const serializeAws_restJson1EventParameters = (input, context) => {
663
+ return {
664
+ ...(input.DescriptionRegex != null && { DescriptionRegex: input.DescriptionRegex }),
665
+ ...(input.EventType != null && { EventType: input.EventType }),
666
+ ...(input.SnapshotOwner != null && {
667
+ SnapshotOwner: serializeAws_restJson1SnapshotOwnerList(input.SnapshotOwner, context),
668
+ }),
669
+ };
858
670
  };
859
- var serializeAws_restJson1EventSource = function (input, context) {
860
- return __assign(__assign({}, (input.Parameters != null && { Parameters: serializeAws_restJson1EventParameters(input.Parameters, context) })), (input.Type != null && { Type: input.Type }));
671
+ const serializeAws_restJson1EventSource = (input, context) => {
672
+ return {
673
+ ...(input.Parameters != null && { Parameters: serializeAws_restJson1EventParameters(input.Parameters, context) }),
674
+ ...(input.Type != null && { Type: input.Type }),
675
+ };
861
676
  };
862
- var serializeAws_restJson1ExcludeDataVolumeTagList = function (input, context) {
677
+ const serializeAws_restJson1ExcludeDataVolumeTagList = (input, context) => {
863
678
  return input
864
- .filter(function (e) { return e != null; })
865
- .map(function (entry) {
679
+ .filter((e) => e != null)
680
+ .map((entry) => {
866
681
  return serializeAws_restJson1Tag(entry, context);
867
682
  });
868
683
  };
869
- var serializeAws_restJson1FastRestoreRule = function (input, context) {
870
- return __assign(__assign(__assign(__assign({}, (input.AvailabilityZones != null && {
871
- AvailabilityZones: serializeAws_restJson1AvailabilityZoneList(input.AvailabilityZones, context),
872
- })), (input.Count != null && { Count: input.Count })), (input.Interval != null && { Interval: input.Interval })), (input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }));
684
+ const serializeAws_restJson1FastRestoreRule = (input, context) => {
685
+ return {
686
+ ...(input.AvailabilityZones != null && {
687
+ AvailabilityZones: serializeAws_restJson1AvailabilityZoneList(input.AvailabilityZones, context),
688
+ }),
689
+ ...(input.Count != null && { Count: input.Count }),
690
+ ...(input.Interval != null && { Interval: input.Interval }),
691
+ ...(input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }),
692
+ };
873
693
  };
874
- var serializeAws_restJson1_Parameters = function (input, context) {
875
- return __assign(__assign(__assign({}, (input.ExcludeBootVolume != null && { ExcludeBootVolume: input.ExcludeBootVolume })), (input.ExcludeDataVolumeTags != null && {
876
- ExcludeDataVolumeTags: serializeAws_restJson1ExcludeDataVolumeTagList(input.ExcludeDataVolumeTags, context),
877
- })), (input.NoReboot != null && { NoReboot: input.NoReboot }));
694
+ const serializeAws_restJson1_Parameters = (input, context) => {
695
+ return {
696
+ ...(input.ExcludeBootVolume != null && { ExcludeBootVolume: input.ExcludeBootVolume }),
697
+ ...(input.ExcludeDataVolumeTags != null && {
698
+ ExcludeDataVolumeTags: serializeAws_restJson1ExcludeDataVolumeTagList(input.ExcludeDataVolumeTags, context),
699
+ }),
700
+ ...(input.NoReboot != null && { NoReboot: input.NoReboot }),
701
+ };
878
702
  };
879
- var serializeAws_restJson1PolicyDetails = function (input, context) {
880
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Actions != null && { Actions: serializeAws_restJson1ActionList(input.Actions, context) })), (input.EventSource != null && { EventSource: serializeAws_restJson1EventSource(input.EventSource, context) })), (input.Parameters != null && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) })), (input.PolicyType != null && { PolicyType: input.PolicyType })), (input.ResourceLocations != null && {
881
- ResourceLocations: serializeAws_restJson1ResourceLocationList(input.ResourceLocations, context),
882
- })), (input.ResourceTypes != null && {
883
- ResourceTypes: serializeAws_restJson1ResourceTypeValuesList(input.ResourceTypes, context),
884
- })), (input.Schedules != null && { Schedules: serializeAws_restJson1ScheduleList(input.Schedules, context) })), (input.TargetTags != null && { TargetTags: serializeAws_restJson1TargetTagList(input.TargetTags, context) }));
703
+ const serializeAws_restJson1PolicyDetails = (input, context) => {
704
+ return {
705
+ ...(input.Actions != null && { Actions: serializeAws_restJson1ActionList(input.Actions, context) }),
706
+ ...(input.EventSource != null && { EventSource: serializeAws_restJson1EventSource(input.EventSource, context) }),
707
+ ...(input.Parameters != null && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }),
708
+ ...(input.PolicyType != null && { PolicyType: input.PolicyType }),
709
+ ...(input.ResourceLocations != null && {
710
+ ResourceLocations: serializeAws_restJson1ResourceLocationList(input.ResourceLocations, context),
711
+ }),
712
+ ...(input.ResourceTypes != null && {
713
+ ResourceTypes: serializeAws_restJson1ResourceTypeValuesList(input.ResourceTypes, context),
714
+ }),
715
+ ...(input.Schedules != null && { Schedules: serializeAws_restJson1ScheduleList(input.Schedules, context) }),
716
+ ...(input.TargetTags != null && { TargetTags: serializeAws_restJson1TargetTagList(input.TargetTags, context) }),
717
+ };
885
718
  };
886
- var serializeAws_restJson1ResourceLocationList = function (input, context) {
719
+ const serializeAws_restJson1ResourceLocationList = (input, context) => {
887
720
  return input
888
- .filter(function (e) { return e != null; })
889
- .map(function (entry) {
721
+ .filter((e) => e != null)
722
+ .map((entry) => {
890
723
  return entry;
891
724
  });
892
725
  };
893
- var serializeAws_restJson1ResourceTypeValuesList = function (input, context) {
726
+ const serializeAws_restJson1ResourceTypeValuesList = (input, context) => {
894
727
  return input
895
- .filter(function (e) { return e != null; })
896
- .map(function (entry) {
728
+ .filter((e) => e != null)
729
+ .map((entry) => {
897
730
  return entry;
898
731
  });
899
732
  };
900
- var serializeAws_restJson1RetainRule = function (input, context) {
901
- return __assign(__assign(__assign({}, (input.Count != null && { Count: input.Count })), (input.Interval != null && { Interval: input.Interval })), (input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }));
733
+ const serializeAws_restJson1RetainRule = (input, context) => {
734
+ return {
735
+ ...(input.Count != null && { Count: input.Count }),
736
+ ...(input.Interval != null && { Interval: input.Interval }),
737
+ ...(input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }),
738
+ };
902
739
  };
903
- var serializeAws_restJson1RetentionArchiveTier = function (input, context) {
904
- return __assign(__assign(__assign({}, (input.Count != null && { Count: input.Count })), (input.Interval != null && { Interval: input.Interval })), (input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }));
740
+ const serializeAws_restJson1RetentionArchiveTier = (input, context) => {
741
+ return {
742
+ ...(input.Count != null && { Count: input.Count }),
743
+ ...(input.Interval != null && { Interval: input.Interval }),
744
+ ...(input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }),
745
+ };
905
746
  };
906
- var serializeAws_restJson1Schedule = function (input, context) {
907
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ArchiveRule != null && { ArchiveRule: serializeAws_restJson1ArchiveRule(input.ArchiveRule, context) })), (input.CopyTags != null && { CopyTags: input.CopyTags })), (input.CreateRule != null && { CreateRule: serializeAws_restJson1CreateRule(input.CreateRule, context) })), (input.CrossRegionCopyRules != null && {
908
- CrossRegionCopyRules: serializeAws_restJson1CrossRegionCopyRules(input.CrossRegionCopyRules, context),
909
- })), (input.DeprecateRule != null && {
910
- DeprecateRule: serializeAws_restJson1DeprecateRule(input.DeprecateRule, context),
911
- })), (input.FastRestoreRule != null && {
912
- FastRestoreRule: serializeAws_restJson1FastRestoreRule(input.FastRestoreRule, context),
913
- })), (input.Name != null && { Name: input.Name })), (input.RetainRule != null && { RetainRule: serializeAws_restJson1RetainRule(input.RetainRule, context) })), (input.ShareRules != null && { ShareRules: serializeAws_restJson1ShareRules(input.ShareRules, context) })), (input.TagsToAdd != null && { TagsToAdd: serializeAws_restJson1TagsToAddList(input.TagsToAdd, context) })), (input.VariableTags != null && {
914
- VariableTags: serializeAws_restJson1VariableTagsList(input.VariableTags, context),
915
- }));
747
+ const serializeAws_restJson1Schedule = (input, context) => {
748
+ return {
749
+ ...(input.ArchiveRule != null && { ArchiveRule: serializeAws_restJson1ArchiveRule(input.ArchiveRule, context) }),
750
+ ...(input.CopyTags != null && { CopyTags: input.CopyTags }),
751
+ ...(input.CreateRule != null && { CreateRule: serializeAws_restJson1CreateRule(input.CreateRule, context) }),
752
+ ...(input.CrossRegionCopyRules != null && {
753
+ CrossRegionCopyRules: serializeAws_restJson1CrossRegionCopyRules(input.CrossRegionCopyRules, context),
754
+ }),
755
+ ...(input.DeprecateRule != null && {
756
+ DeprecateRule: serializeAws_restJson1DeprecateRule(input.DeprecateRule, context),
757
+ }),
758
+ ...(input.FastRestoreRule != null && {
759
+ FastRestoreRule: serializeAws_restJson1FastRestoreRule(input.FastRestoreRule, context),
760
+ }),
761
+ ...(input.Name != null && { Name: input.Name }),
762
+ ...(input.RetainRule != null && { RetainRule: serializeAws_restJson1RetainRule(input.RetainRule, context) }),
763
+ ...(input.ShareRules != null && { ShareRules: serializeAws_restJson1ShareRules(input.ShareRules, context) }),
764
+ ...(input.TagsToAdd != null && { TagsToAdd: serializeAws_restJson1TagsToAddList(input.TagsToAdd, context) }),
765
+ ...(input.VariableTags != null && {
766
+ VariableTags: serializeAws_restJson1VariableTagsList(input.VariableTags, context),
767
+ }),
768
+ };
916
769
  };
917
- var serializeAws_restJson1ScheduleList = function (input, context) {
770
+ const serializeAws_restJson1ScheduleList = (input, context) => {
918
771
  return input
919
- .filter(function (e) { return e != null; })
920
- .map(function (entry) {
772
+ .filter((e) => e != null)
773
+ .map((entry) => {
921
774
  return serializeAws_restJson1Schedule(entry, context);
922
775
  });
923
776
  };
924
- var serializeAws_restJson1ShareRule = function (input, context) {
925
- return __assign(__assign(__assign({}, (input.TargetAccounts != null && {
926
- TargetAccounts: serializeAws_restJson1ShareTargetAccountList(input.TargetAccounts, context),
927
- })), (input.UnshareInterval != null && { UnshareInterval: input.UnshareInterval })), (input.UnshareIntervalUnit != null && { UnshareIntervalUnit: input.UnshareIntervalUnit }));
777
+ const serializeAws_restJson1ShareRule = (input, context) => {
778
+ return {
779
+ ...(input.TargetAccounts != null && {
780
+ TargetAccounts: serializeAws_restJson1ShareTargetAccountList(input.TargetAccounts, context),
781
+ }),
782
+ ...(input.UnshareInterval != null && { UnshareInterval: input.UnshareInterval }),
783
+ ...(input.UnshareIntervalUnit != null && { UnshareIntervalUnit: input.UnshareIntervalUnit }),
784
+ };
928
785
  };
929
- var serializeAws_restJson1ShareRules = function (input, context) {
786
+ const serializeAws_restJson1ShareRules = (input, context) => {
930
787
  return input
931
- .filter(function (e) { return e != null; })
932
- .map(function (entry) {
788
+ .filter((e) => e != null)
789
+ .map((entry) => {
933
790
  return serializeAws_restJson1ShareRule(entry, context);
934
791
  });
935
792
  };
936
- var serializeAws_restJson1ShareTargetAccountList = function (input, context) {
793
+ const serializeAws_restJson1ShareTargetAccountList = (input, context) => {
937
794
  return input
938
- .filter(function (e) { return e != null; })
939
- .map(function (entry) {
795
+ .filter((e) => e != null)
796
+ .map((entry) => {
940
797
  return entry;
941
798
  });
942
799
  };
943
- var serializeAws_restJson1SnapshotOwnerList = function (input, context) {
800
+ const serializeAws_restJson1SnapshotOwnerList = (input, context) => {
944
801
  return input
945
- .filter(function (e) { return e != null; })
946
- .map(function (entry) {
802
+ .filter((e) => e != null)
803
+ .map((entry) => {
947
804
  return entry;
948
805
  });
949
806
  };
950
- var serializeAws_restJson1Tag = function (input, context) {
951
- return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
807
+ const serializeAws_restJson1Tag = (input, context) => {
808
+ return {
809
+ ...(input.Key != null && { Key: input.Key }),
810
+ ...(input.Value != null && { Value: input.Value }),
811
+ };
952
812
  };
953
- var serializeAws_restJson1TagMap = function (input, context) {
954
- return Object.entries(input).reduce(function (acc, _a) {
955
- var _b;
956
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
813
+ const serializeAws_restJson1TagMap = (input, context) => {
814
+ return Object.entries(input).reduce((acc, [key, value]) => {
957
815
  if (value === null) {
958
816
  return acc;
959
817
  }
960
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
818
+ return {
819
+ ...acc,
820
+ [key]: value,
821
+ };
961
822
  }, {});
962
823
  };
963
- var serializeAws_restJson1TagsToAddList = function (input, context) {
824
+ const serializeAws_restJson1TagsToAddList = (input, context) => {
964
825
  return input
965
- .filter(function (e) { return e != null; })
966
- .map(function (entry) {
826
+ .filter((e) => e != null)
827
+ .map((entry) => {
967
828
  return serializeAws_restJson1Tag(entry, context);
968
829
  });
969
830
  };
970
- var serializeAws_restJson1TargetTagList = function (input, context) {
831
+ const serializeAws_restJson1TargetTagList = (input, context) => {
971
832
  return input
972
- .filter(function (e) { return e != null; })
973
- .map(function (entry) {
833
+ .filter((e) => e != null)
834
+ .map((entry) => {
974
835
  return serializeAws_restJson1Tag(entry, context);
975
836
  });
976
837
  };
977
- var serializeAws_restJson1TimesList = function (input, context) {
838
+ const serializeAws_restJson1TimesList = (input, context) => {
978
839
  return input
979
- .filter(function (e) { return e != null; })
980
- .map(function (entry) {
840
+ .filter((e) => e != null)
841
+ .map((entry) => {
981
842
  return entry;
982
843
  });
983
844
  };
984
- var serializeAws_restJson1VariableTagsList = function (input, context) {
845
+ const serializeAws_restJson1VariableTagsList = (input, context) => {
985
846
  return input
986
- .filter(function (e) { return e != null; })
987
- .map(function (entry) {
847
+ .filter((e) => e != null)
848
+ .map((entry) => {
988
849
  return serializeAws_restJson1Tag(entry, context);
989
850
  });
990
851
  };
991
- var deserializeAws_restJson1Action = function (output, context) {
852
+ const deserializeAws_restJson1Action = (output, context) => {
992
853
  return {
993
854
  CrossRegionCopy: output.CrossRegionCopy != null
994
855
  ? deserializeAws_restJson1CrossRegionCopyActionList(output.CrossRegionCopy, context)
@@ -996,10 +857,10 @@ var deserializeAws_restJson1Action = function (output, context) {
996
857
  Name: __expectString(output.Name),
997
858
  };
998
859
  };
999
- var deserializeAws_restJson1ActionList = function (output, context) {
1000
- var retVal = (output || [])
1001
- .filter(function (e) { return e != null; })
1002
- .map(function (entry) {
860
+ const deserializeAws_restJson1ActionList = (output, context) => {
861
+ const retVal = (output || [])
862
+ .filter((e) => e != null)
863
+ .map((entry) => {
1003
864
  if (entry === null) {
1004
865
  return null;
1005
866
  }
@@ -1007,22 +868,22 @@ var deserializeAws_restJson1ActionList = function (output, context) {
1007
868
  });
1008
869
  return retVal;
1009
870
  };
1010
- var deserializeAws_restJson1ArchiveRetainRule = function (output, context) {
871
+ const deserializeAws_restJson1ArchiveRetainRule = (output, context) => {
1011
872
  return {
1012
873
  RetentionArchiveTier: output.RetentionArchiveTier != null
1013
874
  ? deserializeAws_restJson1RetentionArchiveTier(output.RetentionArchiveTier, context)
1014
875
  : undefined,
1015
876
  };
1016
877
  };
1017
- var deserializeAws_restJson1ArchiveRule = function (output, context) {
878
+ const deserializeAws_restJson1ArchiveRule = (output, context) => {
1018
879
  return {
1019
880
  RetainRule: output.RetainRule != null ? deserializeAws_restJson1ArchiveRetainRule(output.RetainRule, context) : undefined,
1020
881
  };
1021
882
  };
1022
- var deserializeAws_restJson1AvailabilityZoneList = function (output, context) {
1023
- var retVal = (output || [])
1024
- .filter(function (e) { return e != null; })
1025
- .map(function (entry) {
883
+ const deserializeAws_restJson1AvailabilityZoneList = (output, context) => {
884
+ const retVal = (output || [])
885
+ .filter((e) => e != null)
886
+ .map((entry) => {
1026
887
  if (entry === null) {
1027
888
  return null;
1028
889
  }
@@ -1030,7 +891,7 @@ var deserializeAws_restJson1AvailabilityZoneList = function (output, context) {
1030
891
  });
1031
892
  return retVal;
1032
893
  };
1033
- var deserializeAws_restJson1CreateRule = function (output, context) {
894
+ const deserializeAws_restJson1CreateRule = (output, context) => {
1034
895
  return {
1035
896
  CronExpression: __expectString(output.CronExpression),
1036
897
  Interval: __expectInt32(output.Interval),
@@ -1039,7 +900,7 @@ var deserializeAws_restJson1CreateRule = function (output, context) {
1039
900
  Times: output.Times != null ? deserializeAws_restJson1TimesList(output.Times, context) : undefined,
1040
901
  };
1041
902
  };
1042
- var deserializeAws_restJson1CrossRegionCopyAction = function (output, context) {
903
+ const deserializeAws_restJson1CrossRegionCopyAction = (output, context) => {
1043
904
  return {
1044
905
  EncryptionConfiguration: output.EncryptionConfiguration != null
1045
906
  ? deserializeAws_restJson1EncryptionConfiguration(output.EncryptionConfiguration, context)
@@ -1050,10 +911,10 @@ var deserializeAws_restJson1CrossRegionCopyAction = function (output, context) {
1050
911
  Target: __expectString(output.Target),
1051
912
  };
1052
913
  };
1053
- var deserializeAws_restJson1CrossRegionCopyActionList = function (output, context) {
1054
- var retVal = (output || [])
1055
- .filter(function (e) { return e != null; })
1056
- .map(function (entry) {
914
+ const deserializeAws_restJson1CrossRegionCopyActionList = (output, context) => {
915
+ const retVal = (output || [])
916
+ .filter((e) => e != null)
917
+ .map((entry) => {
1057
918
  if (entry === null) {
1058
919
  return null;
1059
920
  }
@@ -1061,19 +922,19 @@ var deserializeAws_restJson1CrossRegionCopyActionList = function (output, contex
1061
922
  });
1062
923
  return retVal;
1063
924
  };
1064
- var deserializeAws_restJson1CrossRegionCopyDeprecateRule = function (output, context) {
925
+ const deserializeAws_restJson1CrossRegionCopyDeprecateRule = (output, context) => {
1065
926
  return {
1066
927
  Interval: __expectInt32(output.Interval),
1067
928
  IntervalUnit: __expectString(output.IntervalUnit),
1068
929
  };
1069
930
  };
1070
- var deserializeAws_restJson1CrossRegionCopyRetainRule = function (output, context) {
931
+ const deserializeAws_restJson1CrossRegionCopyRetainRule = (output, context) => {
1071
932
  return {
1072
933
  Interval: __expectInt32(output.Interval),
1073
934
  IntervalUnit: __expectString(output.IntervalUnit),
1074
935
  };
1075
936
  };
1076
- var deserializeAws_restJson1CrossRegionCopyRule = function (output, context) {
937
+ const deserializeAws_restJson1CrossRegionCopyRule = (output, context) => {
1077
938
  return {
1078
939
  CmkArn: __expectString(output.CmkArn),
1079
940
  CopyTags: __expectBoolean(output.CopyTags),
@@ -1088,10 +949,10 @@ var deserializeAws_restJson1CrossRegionCopyRule = function (output, context) {
1088
949
  TargetRegion: __expectString(output.TargetRegion),
1089
950
  };
1090
951
  };
1091
- var deserializeAws_restJson1CrossRegionCopyRules = function (output, context) {
1092
- var retVal = (output || [])
1093
- .filter(function (e) { return e != null; })
1094
- .map(function (entry) {
952
+ const deserializeAws_restJson1CrossRegionCopyRules = (output, context) => {
953
+ const retVal = (output || [])
954
+ .filter((e) => e != null)
955
+ .map((entry) => {
1095
956
  if (entry === null) {
1096
957
  return null;
1097
958
  }
@@ -1099,20 +960,20 @@ var deserializeAws_restJson1CrossRegionCopyRules = function (output, context) {
1099
960
  });
1100
961
  return retVal;
1101
962
  };
1102
- var deserializeAws_restJson1DeprecateRule = function (output, context) {
963
+ const deserializeAws_restJson1DeprecateRule = (output, context) => {
1103
964
  return {
1104
965
  Count: __expectInt32(output.Count),
1105
966
  Interval: __expectInt32(output.Interval),
1106
967
  IntervalUnit: __expectString(output.IntervalUnit),
1107
968
  };
1108
969
  };
1109
- var deserializeAws_restJson1EncryptionConfiguration = function (output, context) {
970
+ const deserializeAws_restJson1EncryptionConfiguration = (output, context) => {
1110
971
  return {
1111
972
  CmkArn: __expectString(output.CmkArn),
1112
973
  Encrypted: __expectBoolean(output.Encrypted),
1113
974
  };
1114
975
  };
1115
- var deserializeAws_restJson1EventParameters = function (output, context) {
976
+ const deserializeAws_restJson1EventParameters = (output, context) => {
1116
977
  return {
1117
978
  DescriptionRegex: __expectString(output.DescriptionRegex),
1118
979
  EventType: __expectString(output.EventType),
@@ -1121,16 +982,16 @@ var deserializeAws_restJson1EventParameters = function (output, context) {
1121
982
  : undefined,
1122
983
  };
1123
984
  };
1124
- var deserializeAws_restJson1EventSource = function (output, context) {
985
+ const deserializeAws_restJson1EventSource = (output, context) => {
1125
986
  return {
1126
987
  Parameters: output.Parameters != null ? deserializeAws_restJson1EventParameters(output.Parameters, context) : undefined,
1127
988
  Type: __expectString(output.Type),
1128
989
  };
1129
990
  };
1130
- var deserializeAws_restJson1ExcludeDataVolumeTagList = function (output, context) {
1131
- var retVal = (output || [])
1132
- .filter(function (e) { return e != null; })
1133
- .map(function (entry) {
991
+ const deserializeAws_restJson1ExcludeDataVolumeTagList = (output, context) => {
992
+ const retVal = (output || [])
993
+ .filter((e) => e != null)
994
+ .map((entry) => {
1134
995
  if (entry === null) {
1135
996
  return null;
1136
997
  }
@@ -1138,7 +999,7 @@ var deserializeAws_restJson1ExcludeDataVolumeTagList = function (output, context
1138
999
  });
1139
1000
  return retVal;
1140
1001
  };
1141
- var deserializeAws_restJson1FastRestoreRule = function (output, context) {
1002
+ const deserializeAws_restJson1FastRestoreRule = (output, context) => {
1142
1003
  return {
1143
1004
  AvailabilityZones: output.AvailabilityZones != null
1144
1005
  ? deserializeAws_restJson1AvailabilityZoneList(output.AvailabilityZones, context)
@@ -1148,7 +1009,7 @@ var deserializeAws_restJson1FastRestoreRule = function (output, context) {
1148
1009
  IntervalUnit: __expectString(output.IntervalUnit),
1149
1010
  };
1150
1011
  };
1151
- var deserializeAws_restJson1LifecyclePolicy = function (output, context) {
1012
+ const deserializeAws_restJson1LifecyclePolicy = (output, context) => {
1152
1013
  return {
1153
1014
  DateCreated: output.DateCreated != null
1154
1015
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.DateCreated)))
@@ -1166,7 +1027,7 @@ var deserializeAws_restJson1LifecyclePolicy = function (output, context) {
1166
1027
  Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
1167
1028
  };
1168
1029
  };
1169
- var deserializeAws_restJson1LifecyclePolicySummary = function (output, context) {
1030
+ const deserializeAws_restJson1LifecyclePolicySummary = (output, context) => {
1170
1031
  return {
1171
1032
  Description: __expectString(output.Description),
1172
1033
  PolicyId: __expectString(output.PolicyId),
@@ -1175,10 +1036,10 @@ var deserializeAws_restJson1LifecyclePolicySummary = function (output, context)
1175
1036
  Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
1176
1037
  };
1177
1038
  };
1178
- var deserializeAws_restJson1LifecyclePolicySummaryList = function (output, context) {
1179
- var retVal = (output || [])
1180
- .filter(function (e) { return e != null; })
1181
- .map(function (entry) {
1039
+ const deserializeAws_restJson1LifecyclePolicySummaryList = (output, context) => {
1040
+ const retVal = (output || [])
1041
+ .filter((e) => e != null)
1042
+ .map((entry) => {
1182
1043
  if (entry === null) {
1183
1044
  return null;
1184
1045
  }
@@ -1186,10 +1047,10 @@ var deserializeAws_restJson1LifecyclePolicySummaryList = function (output, conte
1186
1047
  });
1187
1048
  return retVal;
1188
1049
  };
1189
- var deserializeAws_restJson1ParameterList = function (output, context) {
1190
- var retVal = (output || [])
1191
- .filter(function (e) { return e != null; })
1192
- .map(function (entry) {
1050
+ const deserializeAws_restJson1ParameterList = (output, context) => {
1051
+ const retVal = (output || [])
1052
+ .filter((e) => e != null)
1053
+ .map((entry) => {
1193
1054
  if (entry === null) {
1194
1055
  return null;
1195
1056
  }
@@ -1197,7 +1058,7 @@ var deserializeAws_restJson1ParameterList = function (output, context) {
1197
1058
  });
1198
1059
  return retVal;
1199
1060
  };
1200
- var deserializeAws_restJson1_Parameters = function (output, context) {
1061
+ const deserializeAws_restJson1_Parameters = (output, context) => {
1201
1062
  return {
1202
1063
  ExcludeBootVolume: __expectBoolean(output.ExcludeBootVolume),
1203
1064
  ExcludeDataVolumeTags: output.ExcludeDataVolumeTags != null
@@ -1206,7 +1067,7 @@ var deserializeAws_restJson1_Parameters = function (output, context) {
1206
1067
  NoReboot: __expectBoolean(output.NoReboot),
1207
1068
  };
1208
1069
  };
1209
- var deserializeAws_restJson1PolicyDetails = function (output, context) {
1070
+ const deserializeAws_restJson1PolicyDetails = (output, context) => {
1210
1071
  return {
1211
1072
  Actions: output.Actions != null ? deserializeAws_restJson1ActionList(output.Actions, context) : undefined,
1212
1073
  EventSource: output.EventSource != null ? deserializeAws_restJson1EventSource(output.EventSource, context) : undefined,
@@ -1222,10 +1083,10 @@ var deserializeAws_restJson1PolicyDetails = function (output, context) {
1222
1083
  TargetTags: output.TargetTags != null ? deserializeAws_restJson1TargetTagList(output.TargetTags, context) : undefined,
1223
1084
  };
1224
1085
  };
1225
- var deserializeAws_restJson1PolicyIdList = function (output, context) {
1226
- var retVal = (output || [])
1227
- .filter(function (e) { return e != null; })
1228
- .map(function (entry) {
1086
+ const deserializeAws_restJson1PolicyIdList = (output, context) => {
1087
+ const retVal = (output || [])
1088
+ .filter((e) => e != null)
1089
+ .map((entry) => {
1229
1090
  if (entry === null) {
1230
1091
  return null;
1231
1092
  }
@@ -1233,10 +1094,10 @@ var deserializeAws_restJson1PolicyIdList = function (output, context) {
1233
1094
  });
1234
1095
  return retVal;
1235
1096
  };
1236
- var deserializeAws_restJson1ResourceLocationList = function (output, context) {
1237
- var retVal = (output || [])
1238
- .filter(function (e) { return e != null; })
1239
- .map(function (entry) {
1097
+ const deserializeAws_restJson1ResourceLocationList = (output, context) => {
1098
+ const retVal = (output || [])
1099
+ .filter((e) => e != null)
1100
+ .map((entry) => {
1240
1101
  if (entry === null) {
1241
1102
  return null;
1242
1103
  }
@@ -1244,10 +1105,10 @@ var deserializeAws_restJson1ResourceLocationList = function (output, context) {
1244
1105
  });
1245
1106
  return retVal;
1246
1107
  };
1247
- var deserializeAws_restJson1ResourceTypeValuesList = function (output, context) {
1248
- var retVal = (output || [])
1249
- .filter(function (e) { return e != null; })
1250
- .map(function (entry) {
1108
+ const deserializeAws_restJson1ResourceTypeValuesList = (output, context) => {
1109
+ const retVal = (output || [])
1110
+ .filter((e) => e != null)
1111
+ .map((entry) => {
1251
1112
  if (entry === null) {
1252
1113
  return null;
1253
1114
  }
@@ -1255,21 +1116,21 @@ var deserializeAws_restJson1ResourceTypeValuesList = function (output, context)
1255
1116
  });
1256
1117
  return retVal;
1257
1118
  };
1258
- var deserializeAws_restJson1RetainRule = function (output, context) {
1119
+ const deserializeAws_restJson1RetainRule = (output, context) => {
1259
1120
  return {
1260
1121
  Count: __expectInt32(output.Count),
1261
1122
  Interval: __expectInt32(output.Interval),
1262
1123
  IntervalUnit: __expectString(output.IntervalUnit),
1263
1124
  };
1264
1125
  };
1265
- var deserializeAws_restJson1RetentionArchiveTier = function (output, context) {
1126
+ const deserializeAws_restJson1RetentionArchiveTier = (output, context) => {
1266
1127
  return {
1267
1128
  Count: __expectInt32(output.Count),
1268
1129
  Interval: __expectInt32(output.Interval),
1269
1130
  IntervalUnit: __expectString(output.IntervalUnit),
1270
1131
  };
1271
1132
  };
1272
- var deserializeAws_restJson1Schedule = function (output, context) {
1133
+ const deserializeAws_restJson1Schedule = (output, context) => {
1273
1134
  return {
1274
1135
  ArchiveRule: output.ArchiveRule != null ? deserializeAws_restJson1ArchiveRule(output.ArchiveRule, context) : undefined,
1275
1136
  CopyTags: __expectBoolean(output.CopyTags),
@@ -1288,10 +1149,10 @@ var deserializeAws_restJson1Schedule = function (output, context) {
1288
1149
  VariableTags: output.VariableTags != null ? deserializeAws_restJson1VariableTagsList(output.VariableTags, context) : undefined,
1289
1150
  };
1290
1151
  };
1291
- var deserializeAws_restJson1ScheduleList = function (output, context) {
1292
- var retVal = (output || [])
1293
- .filter(function (e) { return e != null; })
1294
- .map(function (entry) {
1152
+ const deserializeAws_restJson1ScheduleList = (output, context) => {
1153
+ const retVal = (output || [])
1154
+ .filter((e) => e != null)
1155
+ .map((entry) => {
1295
1156
  if (entry === null) {
1296
1157
  return null;
1297
1158
  }
@@ -1299,7 +1160,7 @@ var deserializeAws_restJson1ScheduleList = function (output, context) {
1299
1160
  });
1300
1161
  return retVal;
1301
1162
  };
1302
- var deserializeAws_restJson1ShareRule = function (output, context) {
1163
+ const deserializeAws_restJson1ShareRule = (output, context) => {
1303
1164
  return {
1304
1165
  TargetAccounts: output.TargetAccounts != null
1305
1166
  ? deserializeAws_restJson1ShareTargetAccountList(output.TargetAccounts, context)
@@ -1308,10 +1169,10 @@ var deserializeAws_restJson1ShareRule = function (output, context) {
1308
1169
  UnshareIntervalUnit: __expectString(output.UnshareIntervalUnit),
1309
1170
  };
1310
1171
  };
1311
- var deserializeAws_restJson1ShareRules = function (output, context) {
1312
- var retVal = (output || [])
1313
- .filter(function (e) { return e != null; })
1314
- .map(function (entry) {
1172
+ const deserializeAws_restJson1ShareRules = (output, context) => {
1173
+ const retVal = (output || [])
1174
+ .filter((e) => e != null)
1175
+ .map((entry) => {
1315
1176
  if (entry === null) {
1316
1177
  return null;
1317
1178
  }
@@ -1319,10 +1180,10 @@ var deserializeAws_restJson1ShareRules = function (output, context) {
1319
1180
  });
1320
1181
  return retVal;
1321
1182
  };
1322
- var deserializeAws_restJson1ShareTargetAccountList = function (output, context) {
1323
- var retVal = (output || [])
1324
- .filter(function (e) { return e != null; })
1325
- .map(function (entry) {
1183
+ const deserializeAws_restJson1ShareTargetAccountList = (output, context) => {
1184
+ const retVal = (output || [])
1185
+ .filter((e) => e != null)
1186
+ .map((entry) => {
1326
1187
  if (entry === null) {
1327
1188
  return null;
1328
1189
  }
@@ -1330,10 +1191,10 @@ var deserializeAws_restJson1ShareTargetAccountList = function (output, context)
1330
1191
  });
1331
1192
  return retVal;
1332
1193
  };
1333
- var deserializeAws_restJson1SnapshotOwnerList = function (output, context) {
1334
- var retVal = (output || [])
1335
- .filter(function (e) { return e != null; })
1336
- .map(function (entry) {
1194
+ const deserializeAws_restJson1SnapshotOwnerList = (output, context) => {
1195
+ const retVal = (output || [])
1196
+ .filter((e) => e != null)
1197
+ .map((entry) => {
1337
1198
  if (entry === null) {
1338
1199
  return null;
1339
1200
  }
@@ -1341,26 +1202,27 @@ var deserializeAws_restJson1SnapshotOwnerList = function (output, context) {
1341
1202
  });
1342
1203
  return retVal;
1343
1204
  };
1344
- var deserializeAws_restJson1Tag = function (output, context) {
1205
+ const deserializeAws_restJson1Tag = (output, context) => {
1345
1206
  return {
1346
1207
  Key: __expectString(output.Key),
1347
1208
  Value: __expectString(output.Value),
1348
1209
  };
1349
1210
  };
1350
- var deserializeAws_restJson1TagMap = function (output, context) {
1351
- return Object.entries(output).reduce(function (acc, _a) {
1352
- var _b;
1353
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1211
+ const deserializeAws_restJson1TagMap = (output, context) => {
1212
+ return Object.entries(output).reduce((acc, [key, value]) => {
1354
1213
  if (value === null) {
1355
1214
  return acc;
1356
1215
  }
1357
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1216
+ return {
1217
+ ...acc,
1218
+ [key]: __expectString(value),
1219
+ };
1358
1220
  }, {});
1359
1221
  };
1360
- var deserializeAws_restJson1TagsToAddList = function (output, context) {
1361
- var retVal = (output || [])
1362
- .filter(function (e) { return e != null; })
1363
- .map(function (entry) {
1222
+ const deserializeAws_restJson1TagsToAddList = (output, context) => {
1223
+ const retVal = (output || [])
1224
+ .filter((e) => e != null)
1225
+ .map((entry) => {
1364
1226
  if (entry === null) {
1365
1227
  return null;
1366
1228
  }
@@ -1368,10 +1230,10 @@ var deserializeAws_restJson1TagsToAddList = function (output, context) {
1368
1230
  });
1369
1231
  return retVal;
1370
1232
  };
1371
- var deserializeAws_restJson1TargetTagList = function (output, context) {
1372
- var retVal = (output || [])
1373
- .filter(function (e) { return e != null; })
1374
- .map(function (entry) {
1233
+ const deserializeAws_restJson1TargetTagList = (output, context) => {
1234
+ const retVal = (output || [])
1235
+ .filter((e) => e != null)
1236
+ .map((entry) => {
1375
1237
  if (entry === null) {
1376
1238
  return null;
1377
1239
  }
@@ -1379,10 +1241,10 @@ var deserializeAws_restJson1TargetTagList = function (output, context) {
1379
1241
  });
1380
1242
  return retVal;
1381
1243
  };
1382
- var deserializeAws_restJson1TimesList = function (output, context) {
1383
- var retVal = (output || [])
1384
- .filter(function (e) { return e != null; })
1385
- .map(function (entry) {
1244
+ const deserializeAws_restJson1TimesList = (output, context) => {
1245
+ const retVal = (output || [])
1246
+ .filter((e) => e != null)
1247
+ .map((entry) => {
1386
1248
  if (entry === null) {
1387
1249
  return null;
1388
1250
  }
@@ -1390,10 +1252,10 @@ var deserializeAws_restJson1TimesList = function (output, context) {
1390
1252
  });
1391
1253
  return retVal;
1392
1254
  };
1393
- var deserializeAws_restJson1VariableTagsList = function (output, context) {
1394
- var retVal = (output || [])
1395
- .filter(function (e) { return e != null; })
1396
- .map(function (entry) {
1255
+ const deserializeAws_restJson1VariableTagsList = (output, context) => {
1256
+ const retVal = (output || [])
1257
+ .filter((e) => e != null)
1258
+ .map((entry) => {
1397
1259
  if (entry === null) {
1398
1260
  return null;
1399
1261
  }
@@ -1401,57 +1263,39 @@ var deserializeAws_restJson1VariableTagsList = function (output, context) {
1401
1263
  });
1402
1264
  return retVal;
1403
1265
  };
1404
- var deserializeMetadata = function (output) {
1405
- var _a;
1406
- return ({
1407
- httpStatusCode: output.statusCode,
1408
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1409
- extendedRequestId: output.headers["x-amz-id-2"],
1410
- cfId: output.headers["x-amz-cf-id"],
1411
- });
1412
- };
1413
- var collectBody = function (streamBody, context) {
1414
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1266
+ const deserializeMetadata = (output) => ({
1267
+ httpStatusCode: output.statusCode,
1268
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1269
+ extendedRequestId: output.headers["x-amz-id-2"],
1270
+ cfId: output.headers["x-amz-cf-id"],
1271
+ });
1272
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1415
1273
  if (streamBody instanceof Uint8Array) {
1416
1274
  return Promise.resolve(streamBody);
1417
1275
  }
1418
1276
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1419
1277
  };
1420
- var collectBodyString = function (streamBody, context) {
1421
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1422
- };
1423
- var isSerializableHeaderValue = function (value) {
1424
- return value !== undefined &&
1425
- value !== null &&
1426
- value !== "" &&
1427
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1428
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1429
- };
1430
- var parseBody = function (streamBody, context) {
1431
- return collectBodyString(streamBody, context).then(function (encoded) {
1432
- if (encoded.length) {
1433
- return JSON.parse(encoded);
1434
- }
1435
- return {};
1436
- });
1437
- };
1438
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1439
- var value;
1440
- var _a;
1441
- return __generator(this, function (_b) {
1442
- switch (_b.label) {
1443
- case 0: return [4, parseBody(errorBody, context)];
1444
- case 1:
1445
- value = _b.sent();
1446
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1447
- return [2, value];
1448
- }
1449
- });
1450
- }); };
1451
- var loadRestJsonErrorCode = function (output, data) {
1452
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1453
- var sanitizeErrorCode = function (rawValue) {
1454
- var cleanValue = rawValue;
1278
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1279
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1280
+ value !== null &&
1281
+ value !== "" &&
1282
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1283
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1284
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1285
+ if (encoded.length) {
1286
+ return JSON.parse(encoded);
1287
+ }
1288
+ return {};
1289
+ });
1290
+ const parseErrorBody = async (errorBody, context) => {
1291
+ const value = await parseBody(errorBody, context);
1292
+ value.message = value.message ?? value.Message;
1293
+ return value;
1294
+ };
1295
+ const loadRestJsonErrorCode = (output, data) => {
1296
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1297
+ const sanitizeErrorCode = (rawValue) => {
1298
+ let cleanValue = rawValue;
1455
1299
  if (typeof cleanValue === "number") {
1456
1300
  cleanValue = cleanValue.toString();
1457
1301
  }
@@ -1466,7 +1310,7 @@ var loadRestJsonErrorCode = function (output, data) {
1466
1310
  }
1467
1311
  return cleanValue;
1468
1312
  };
1469
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1313
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1470
1314
  if (headerKey !== undefined) {
1471
1315
  return sanitizeErrorCode(output.headers[headerKey]);
1472
1316
  }