@aws-sdk/client-dlm 3.181.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,983 +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_restJson1AvailabilityZoneList = function (input, context) {
569
+ const serializeAws_restJson1ArchiveRetainRule = (input, context) => {
570
+ return {
571
+ ...(input.RetentionArchiveTier != null && {
572
+ RetentionArchiveTier: serializeAws_restJson1RetentionArchiveTier(input.RetentionArchiveTier, context),
573
+ }),
574
+ };
575
+ };
576
+ const serializeAws_restJson1ArchiveRule = (input, context) => {
577
+ return {
578
+ ...(input.RetainRule != null && { RetainRule: serializeAws_restJson1ArchiveRetainRule(input.RetainRule, context) }),
579
+ };
580
+ };
581
+ const serializeAws_restJson1AvailabilityZoneList = (input, context) => {
797
582
  return input
798
- .filter(function (e) { return e != null; })
799
- .map(function (entry) {
583
+ .filter((e) => e != null)
584
+ .map((entry) => {
800
585
  return entry;
801
586
  });
802
587
  };
803
- var serializeAws_restJson1CreateRule = function (input, context) {
804
- 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
+ };
805
596
  };
806
- var serializeAws_restJson1CrossRegionCopyAction = function (input, context) {
807
- return __assign(__assign(__assign({}, (input.EncryptionConfiguration != null && {
808
- EncryptionConfiguration: serializeAws_restJson1EncryptionConfiguration(input.EncryptionConfiguration, context),
809
- })), (input.RetainRule != null && {
810
- RetainRule: serializeAws_restJson1CrossRegionCopyRetainRule(input.RetainRule, context),
811
- })), (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
+ };
812
607
  };
813
- var serializeAws_restJson1CrossRegionCopyActionList = function (input, context) {
608
+ const serializeAws_restJson1CrossRegionCopyActionList = (input, context) => {
814
609
  return input
815
- .filter(function (e) { return e != null; })
816
- .map(function (entry) {
610
+ .filter((e) => e != null)
611
+ .map((entry) => {
817
612
  return serializeAws_restJson1CrossRegionCopyAction(entry, context);
818
613
  });
819
614
  };
820
- var serializeAws_restJson1CrossRegionCopyDeprecateRule = function (input, context) {
821
- 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
+ };
822
620
  };
823
- var serializeAws_restJson1CrossRegionCopyRetainRule = function (input, context) {
824
- 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
+ };
825
626
  };
826
- var serializeAws_restJson1CrossRegionCopyRule = function (input, context) {
827
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.CmkArn != null && { CmkArn: input.CmkArn })), (input.CopyTags != null && { CopyTags: input.CopyTags })), (input.DeprecateRule != null && {
828
- DeprecateRule: serializeAws_restJson1CrossRegionCopyDeprecateRule(input.DeprecateRule, context),
829
- })), (input.Encrypted != null && { Encrypted: input.Encrypted })), (input.RetainRule != null && {
830
- RetainRule: serializeAws_restJson1CrossRegionCopyRetainRule(input.RetainRule, context),
831
- })), (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
+ };
832
641
  };
833
- var serializeAws_restJson1CrossRegionCopyRules = function (input, context) {
642
+ const serializeAws_restJson1CrossRegionCopyRules = (input, context) => {
834
643
  return input
835
- .filter(function (e) { return e != null; })
836
- .map(function (entry) {
644
+ .filter((e) => e != null)
645
+ .map((entry) => {
837
646
  return serializeAws_restJson1CrossRegionCopyRule(entry, context);
838
647
  });
839
648
  };
840
- var serializeAws_restJson1DeprecateRule = function (input, context) {
841
- 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
+ };
842
655
  };
843
- var serializeAws_restJson1EncryptionConfiguration = function (input, context) {
844
- 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
+ };
845
661
  };
846
- var serializeAws_restJson1EventParameters = function (input, context) {
847
- return __assign(__assign(__assign({}, (input.DescriptionRegex != null && { DescriptionRegex: input.DescriptionRegex })), (input.EventType != null && { EventType: input.EventType })), (input.SnapshotOwner != null && {
848
- SnapshotOwner: serializeAws_restJson1SnapshotOwnerList(input.SnapshotOwner, context),
849
- }));
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
+ };
850
670
  };
851
- var serializeAws_restJson1EventSource = function (input, context) {
852
- 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
+ };
853
676
  };
854
- var serializeAws_restJson1ExcludeDataVolumeTagList = function (input, context) {
677
+ const serializeAws_restJson1ExcludeDataVolumeTagList = (input, context) => {
855
678
  return input
856
- .filter(function (e) { return e != null; })
857
- .map(function (entry) {
679
+ .filter((e) => e != null)
680
+ .map((entry) => {
858
681
  return serializeAws_restJson1Tag(entry, context);
859
682
  });
860
683
  };
861
- var serializeAws_restJson1FastRestoreRule = function (input, context) {
862
- return __assign(__assign(__assign(__assign({}, (input.AvailabilityZones != null && {
863
- AvailabilityZones: serializeAws_restJson1AvailabilityZoneList(input.AvailabilityZones, context),
864
- })), (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
+ };
865
693
  };
866
- var serializeAws_restJson1_Parameters = function (input, context) {
867
- return __assign(__assign(__assign({}, (input.ExcludeBootVolume != null && { ExcludeBootVolume: input.ExcludeBootVolume })), (input.ExcludeDataVolumeTags != null && {
868
- ExcludeDataVolumeTags: serializeAws_restJson1ExcludeDataVolumeTagList(input.ExcludeDataVolumeTags, context),
869
- })), (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
+ };
870
702
  };
871
- var serializeAws_restJson1PolicyDetails = function (input, context) {
872
- 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 && {
873
- ResourceLocations: serializeAws_restJson1ResourceLocationList(input.ResourceLocations, context),
874
- })), (input.ResourceTypes != null && {
875
- ResourceTypes: serializeAws_restJson1ResourceTypeValuesList(input.ResourceTypes, context),
876
- })), (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
+ };
877
718
  };
878
- var serializeAws_restJson1ResourceLocationList = function (input, context) {
719
+ const serializeAws_restJson1ResourceLocationList = (input, context) => {
879
720
  return input
880
- .filter(function (e) { return e != null; })
881
- .map(function (entry) {
721
+ .filter((e) => e != null)
722
+ .map((entry) => {
882
723
  return entry;
883
724
  });
884
725
  };
885
- var serializeAws_restJson1ResourceTypeValuesList = function (input, context) {
726
+ const serializeAws_restJson1ResourceTypeValuesList = (input, context) => {
886
727
  return input
887
- .filter(function (e) { return e != null; })
888
- .map(function (entry) {
728
+ .filter((e) => e != null)
729
+ .map((entry) => {
889
730
  return entry;
890
731
  });
891
732
  };
892
- var serializeAws_restJson1RetainRule = function (input, context) {
893
- return __assign(__assign(__assign({}, (input.Count != null && { Count: input.Count })), (input.Interval != null && { Interval: input.Interval })), (input.IntervalUnit != null && { IntervalUnit: input.IntervalUnit }));
894
- };
895
- var serializeAws_restJson1Schedule = function (input, context) {
896
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.CopyTags != null && { CopyTags: input.CopyTags })), (input.CreateRule != null && { CreateRule: serializeAws_restJson1CreateRule(input.CreateRule, context) })), (input.CrossRegionCopyRules != null && {
897
- CrossRegionCopyRules: serializeAws_restJson1CrossRegionCopyRules(input.CrossRegionCopyRules, context),
898
- })), (input.DeprecateRule != null && {
899
- DeprecateRule: serializeAws_restJson1DeprecateRule(input.DeprecateRule, context),
900
- })), (input.FastRestoreRule != null && {
901
- FastRestoreRule: serializeAws_restJson1FastRestoreRule(input.FastRestoreRule, context),
902
- })), (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 && {
903
- VariableTags: serializeAws_restJson1VariableTagsList(input.VariableTags, context),
904
- }));
905
- };
906
- var serializeAws_restJson1ScheduleList = function (input, context) {
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
+ };
739
+ };
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
+ };
746
+ };
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
+ };
769
+ };
770
+ const serializeAws_restJson1ScheduleList = (input, context) => {
907
771
  return input
908
- .filter(function (e) { return e != null; })
909
- .map(function (entry) {
772
+ .filter((e) => e != null)
773
+ .map((entry) => {
910
774
  return serializeAws_restJson1Schedule(entry, context);
911
775
  });
912
776
  };
913
- var serializeAws_restJson1ShareRule = function (input, context) {
914
- return __assign(__assign(__assign({}, (input.TargetAccounts != null && {
915
- TargetAccounts: serializeAws_restJson1ShareTargetAccountList(input.TargetAccounts, context),
916
- })), (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
+ };
917
785
  };
918
- var serializeAws_restJson1ShareRules = function (input, context) {
786
+ const serializeAws_restJson1ShareRules = (input, context) => {
919
787
  return input
920
- .filter(function (e) { return e != null; })
921
- .map(function (entry) {
788
+ .filter((e) => e != null)
789
+ .map((entry) => {
922
790
  return serializeAws_restJson1ShareRule(entry, context);
923
791
  });
924
792
  };
925
- var serializeAws_restJson1ShareTargetAccountList = function (input, context) {
793
+ const serializeAws_restJson1ShareTargetAccountList = (input, context) => {
926
794
  return input
927
- .filter(function (e) { return e != null; })
928
- .map(function (entry) {
795
+ .filter((e) => e != null)
796
+ .map((entry) => {
929
797
  return entry;
930
798
  });
931
799
  };
932
- var serializeAws_restJson1SnapshotOwnerList = function (input, context) {
800
+ const serializeAws_restJson1SnapshotOwnerList = (input, context) => {
933
801
  return input
934
- .filter(function (e) { return e != null; })
935
- .map(function (entry) {
802
+ .filter((e) => e != null)
803
+ .map((entry) => {
936
804
  return entry;
937
805
  });
938
806
  };
939
- var serializeAws_restJson1Tag = function (input, context) {
940
- 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
+ };
941
812
  };
942
- var serializeAws_restJson1TagMap = function (input, context) {
943
- return Object.entries(input).reduce(function (acc, _a) {
944
- var _b;
945
- 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]) => {
946
815
  if (value === null) {
947
816
  return acc;
948
817
  }
949
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
818
+ return {
819
+ ...acc,
820
+ [key]: value,
821
+ };
950
822
  }, {});
951
823
  };
952
- var serializeAws_restJson1TagsToAddList = function (input, context) {
824
+ const serializeAws_restJson1TagsToAddList = (input, context) => {
953
825
  return input
954
- .filter(function (e) { return e != null; })
955
- .map(function (entry) {
826
+ .filter((e) => e != null)
827
+ .map((entry) => {
956
828
  return serializeAws_restJson1Tag(entry, context);
957
829
  });
958
830
  };
959
- var serializeAws_restJson1TargetTagList = function (input, context) {
831
+ const serializeAws_restJson1TargetTagList = (input, context) => {
960
832
  return input
961
- .filter(function (e) { return e != null; })
962
- .map(function (entry) {
833
+ .filter((e) => e != null)
834
+ .map((entry) => {
963
835
  return serializeAws_restJson1Tag(entry, context);
964
836
  });
965
837
  };
966
- var serializeAws_restJson1TimesList = function (input, context) {
838
+ const serializeAws_restJson1TimesList = (input, context) => {
967
839
  return input
968
- .filter(function (e) { return e != null; })
969
- .map(function (entry) {
840
+ .filter((e) => e != null)
841
+ .map((entry) => {
970
842
  return entry;
971
843
  });
972
844
  };
973
- var serializeAws_restJson1VariableTagsList = function (input, context) {
845
+ const serializeAws_restJson1VariableTagsList = (input, context) => {
974
846
  return input
975
- .filter(function (e) { return e != null; })
976
- .map(function (entry) {
847
+ .filter((e) => e != null)
848
+ .map((entry) => {
977
849
  return serializeAws_restJson1Tag(entry, context);
978
850
  });
979
851
  };
980
- var deserializeAws_restJson1Action = function (output, context) {
852
+ const deserializeAws_restJson1Action = (output, context) => {
981
853
  return {
982
854
  CrossRegionCopy: output.CrossRegionCopy != null
983
855
  ? deserializeAws_restJson1CrossRegionCopyActionList(output.CrossRegionCopy, context)
@@ -985,10 +857,10 @@ var deserializeAws_restJson1Action = function (output, context) {
985
857
  Name: __expectString(output.Name),
986
858
  };
987
859
  };
988
- var deserializeAws_restJson1ActionList = function (output, context) {
989
- var retVal = (output || [])
990
- .filter(function (e) { return e != null; })
991
- .map(function (entry) {
860
+ const deserializeAws_restJson1ActionList = (output, context) => {
861
+ const retVal = (output || [])
862
+ .filter((e) => e != null)
863
+ .map((entry) => {
992
864
  if (entry === null) {
993
865
  return null;
994
866
  }
@@ -996,10 +868,22 @@ var deserializeAws_restJson1ActionList = function (output, context) {
996
868
  });
997
869
  return retVal;
998
870
  };
999
- var deserializeAws_restJson1AvailabilityZoneList = function (output, context) {
1000
- var retVal = (output || [])
1001
- .filter(function (e) { return e != null; })
1002
- .map(function (entry) {
871
+ const deserializeAws_restJson1ArchiveRetainRule = (output, context) => {
872
+ return {
873
+ RetentionArchiveTier: output.RetentionArchiveTier != null
874
+ ? deserializeAws_restJson1RetentionArchiveTier(output.RetentionArchiveTier, context)
875
+ : undefined,
876
+ };
877
+ };
878
+ const deserializeAws_restJson1ArchiveRule = (output, context) => {
879
+ return {
880
+ RetainRule: output.RetainRule != null ? deserializeAws_restJson1ArchiveRetainRule(output.RetainRule, context) : undefined,
881
+ };
882
+ };
883
+ const deserializeAws_restJson1AvailabilityZoneList = (output, context) => {
884
+ const retVal = (output || [])
885
+ .filter((e) => e != null)
886
+ .map((entry) => {
1003
887
  if (entry === null) {
1004
888
  return null;
1005
889
  }
@@ -1007,7 +891,7 @@ var deserializeAws_restJson1AvailabilityZoneList = function (output, context) {
1007
891
  });
1008
892
  return retVal;
1009
893
  };
1010
- var deserializeAws_restJson1CreateRule = function (output, context) {
894
+ const deserializeAws_restJson1CreateRule = (output, context) => {
1011
895
  return {
1012
896
  CronExpression: __expectString(output.CronExpression),
1013
897
  Interval: __expectInt32(output.Interval),
@@ -1016,7 +900,7 @@ var deserializeAws_restJson1CreateRule = function (output, context) {
1016
900
  Times: output.Times != null ? deserializeAws_restJson1TimesList(output.Times, context) : undefined,
1017
901
  };
1018
902
  };
1019
- var deserializeAws_restJson1CrossRegionCopyAction = function (output, context) {
903
+ const deserializeAws_restJson1CrossRegionCopyAction = (output, context) => {
1020
904
  return {
1021
905
  EncryptionConfiguration: output.EncryptionConfiguration != null
1022
906
  ? deserializeAws_restJson1EncryptionConfiguration(output.EncryptionConfiguration, context)
@@ -1027,10 +911,10 @@ var deserializeAws_restJson1CrossRegionCopyAction = function (output, context) {
1027
911
  Target: __expectString(output.Target),
1028
912
  };
1029
913
  };
1030
- var deserializeAws_restJson1CrossRegionCopyActionList = function (output, context) {
1031
- var retVal = (output || [])
1032
- .filter(function (e) { return e != null; })
1033
- .map(function (entry) {
914
+ const deserializeAws_restJson1CrossRegionCopyActionList = (output, context) => {
915
+ const retVal = (output || [])
916
+ .filter((e) => e != null)
917
+ .map((entry) => {
1034
918
  if (entry === null) {
1035
919
  return null;
1036
920
  }
@@ -1038,19 +922,19 @@ var deserializeAws_restJson1CrossRegionCopyActionList = function (output, contex
1038
922
  });
1039
923
  return retVal;
1040
924
  };
1041
- var deserializeAws_restJson1CrossRegionCopyDeprecateRule = function (output, context) {
925
+ const deserializeAws_restJson1CrossRegionCopyDeprecateRule = (output, context) => {
1042
926
  return {
1043
927
  Interval: __expectInt32(output.Interval),
1044
928
  IntervalUnit: __expectString(output.IntervalUnit),
1045
929
  };
1046
930
  };
1047
- var deserializeAws_restJson1CrossRegionCopyRetainRule = function (output, context) {
931
+ const deserializeAws_restJson1CrossRegionCopyRetainRule = (output, context) => {
1048
932
  return {
1049
933
  Interval: __expectInt32(output.Interval),
1050
934
  IntervalUnit: __expectString(output.IntervalUnit),
1051
935
  };
1052
936
  };
1053
- var deserializeAws_restJson1CrossRegionCopyRule = function (output, context) {
937
+ const deserializeAws_restJson1CrossRegionCopyRule = (output, context) => {
1054
938
  return {
1055
939
  CmkArn: __expectString(output.CmkArn),
1056
940
  CopyTags: __expectBoolean(output.CopyTags),
@@ -1065,10 +949,10 @@ var deserializeAws_restJson1CrossRegionCopyRule = function (output, context) {
1065
949
  TargetRegion: __expectString(output.TargetRegion),
1066
950
  };
1067
951
  };
1068
- var deserializeAws_restJson1CrossRegionCopyRules = function (output, context) {
1069
- var retVal = (output || [])
1070
- .filter(function (e) { return e != null; })
1071
- .map(function (entry) {
952
+ const deserializeAws_restJson1CrossRegionCopyRules = (output, context) => {
953
+ const retVal = (output || [])
954
+ .filter((e) => e != null)
955
+ .map((entry) => {
1072
956
  if (entry === null) {
1073
957
  return null;
1074
958
  }
@@ -1076,20 +960,20 @@ var deserializeAws_restJson1CrossRegionCopyRules = function (output, context) {
1076
960
  });
1077
961
  return retVal;
1078
962
  };
1079
- var deserializeAws_restJson1DeprecateRule = function (output, context) {
963
+ const deserializeAws_restJson1DeprecateRule = (output, context) => {
1080
964
  return {
1081
965
  Count: __expectInt32(output.Count),
1082
966
  Interval: __expectInt32(output.Interval),
1083
967
  IntervalUnit: __expectString(output.IntervalUnit),
1084
968
  };
1085
969
  };
1086
- var deserializeAws_restJson1EncryptionConfiguration = function (output, context) {
970
+ const deserializeAws_restJson1EncryptionConfiguration = (output, context) => {
1087
971
  return {
1088
972
  CmkArn: __expectString(output.CmkArn),
1089
973
  Encrypted: __expectBoolean(output.Encrypted),
1090
974
  };
1091
975
  };
1092
- var deserializeAws_restJson1EventParameters = function (output, context) {
976
+ const deserializeAws_restJson1EventParameters = (output, context) => {
1093
977
  return {
1094
978
  DescriptionRegex: __expectString(output.DescriptionRegex),
1095
979
  EventType: __expectString(output.EventType),
@@ -1098,16 +982,16 @@ var deserializeAws_restJson1EventParameters = function (output, context) {
1098
982
  : undefined,
1099
983
  };
1100
984
  };
1101
- var deserializeAws_restJson1EventSource = function (output, context) {
985
+ const deserializeAws_restJson1EventSource = (output, context) => {
1102
986
  return {
1103
987
  Parameters: output.Parameters != null ? deserializeAws_restJson1EventParameters(output.Parameters, context) : undefined,
1104
988
  Type: __expectString(output.Type),
1105
989
  };
1106
990
  };
1107
- var deserializeAws_restJson1ExcludeDataVolumeTagList = function (output, context) {
1108
- var retVal = (output || [])
1109
- .filter(function (e) { return e != null; })
1110
- .map(function (entry) {
991
+ const deserializeAws_restJson1ExcludeDataVolumeTagList = (output, context) => {
992
+ const retVal = (output || [])
993
+ .filter((e) => e != null)
994
+ .map((entry) => {
1111
995
  if (entry === null) {
1112
996
  return null;
1113
997
  }
@@ -1115,7 +999,7 @@ var deserializeAws_restJson1ExcludeDataVolumeTagList = function (output, context
1115
999
  });
1116
1000
  return retVal;
1117
1001
  };
1118
- var deserializeAws_restJson1FastRestoreRule = function (output, context) {
1002
+ const deserializeAws_restJson1FastRestoreRule = (output, context) => {
1119
1003
  return {
1120
1004
  AvailabilityZones: output.AvailabilityZones != null
1121
1005
  ? deserializeAws_restJson1AvailabilityZoneList(output.AvailabilityZones, context)
@@ -1125,7 +1009,7 @@ var deserializeAws_restJson1FastRestoreRule = function (output, context) {
1125
1009
  IntervalUnit: __expectString(output.IntervalUnit),
1126
1010
  };
1127
1011
  };
1128
- var deserializeAws_restJson1LifecyclePolicy = function (output, context) {
1012
+ const deserializeAws_restJson1LifecyclePolicy = (output, context) => {
1129
1013
  return {
1130
1014
  DateCreated: output.DateCreated != null
1131
1015
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.DateCreated)))
@@ -1143,7 +1027,7 @@ var deserializeAws_restJson1LifecyclePolicy = function (output, context) {
1143
1027
  Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
1144
1028
  };
1145
1029
  };
1146
- var deserializeAws_restJson1LifecyclePolicySummary = function (output, context) {
1030
+ const deserializeAws_restJson1LifecyclePolicySummary = (output, context) => {
1147
1031
  return {
1148
1032
  Description: __expectString(output.Description),
1149
1033
  PolicyId: __expectString(output.PolicyId),
@@ -1152,10 +1036,10 @@ var deserializeAws_restJson1LifecyclePolicySummary = function (output, context)
1152
1036
  Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
1153
1037
  };
1154
1038
  };
1155
- var deserializeAws_restJson1LifecyclePolicySummaryList = function (output, context) {
1156
- var retVal = (output || [])
1157
- .filter(function (e) { return e != null; })
1158
- .map(function (entry) {
1039
+ const deserializeAws_restJson1LifecyclePolicySummaryList = (output, context) => {
1040
+ const retVal = (output || [])
1041
+ .filter((e) => e != null)
1042
+ .map((entry) => {
1159
1043
  if (entry === null) {
1160
1044
  return null;
1161
1045
  }
@@ -1163,10 +1047,10 @@ var deserializeAws_restJson1LifecyclePolicySummaryList = function (output, conte
1163
1047
  });
1164
1048
  return retVal;
1165
1049
  };
1166
- var deserializeAws_restJson1ParameterList = function (output, context) {
1167
- var retVal = (output || [])
1168
- .filter(function (e) { return e != null; })
1169
- .map(function (entry) {
1050
+ const deserializeAws_restJson1ParameterList = (output, context) => {
1051
+ const retVal = (output || [])
1052
+ .filter((e) => e != null)
1053
+ .map((entry) => {
1170
1054
  if (entry === null) {
1171
1055
  return null;
1172
1056
  }
@@ -1174,7 +1058,7 @@ var deserializeAws_restJson1ParameterList = function (output, context) {
1174
1058
  });
1175
1059
  return retVal;
1176
1060
  };
1177
- var deserializeAws_restJson1_Parameters = function (output, context) {
1061
+ const deserializeAws_restJson1_Parameters = (output, context) => {
1178
1062
  return {
1179
1063
  ExcludeBootVolume: __expectBoolean(output.ExcludeBootVolume),
1180
1064
  ExcludeDataVolumeTags: output.ExcludeDataVolumeTags != null
@@ -1183,7 +1067,7 @@ var deserializeAws_restJson1_Parameters = function (output, context) {
1183
1067
  NoReboot: __expectBoolean(output.NoReboot),
1184
1068
  };
1185
1069
  };
1186
- var deserializeAws_restJson1PolicyDetails = function (output, context) {
1070
+ const deserializeAws_restJson1PolicyDetails = (output, context) => {
1187
1071
  return {
1188
1072
  Actions: output.Actions != null ? deserializeAws_restJson1ActionList(output.Actions, context) : undefined,
1189
1073
  EventSource: output.EventSource != null ? deserializeAws_restJson1EventSource(output.EventSource, context) : undefined,
@@ -1199,10 +1083,10 @@ var deserializeAws_restJson1PolicyDetails = function (output, context) {
1199
1083
  TargetTags: output.TargetTags != null ? deserializeAws_restJson1TargetTagList(output.TargetTags, context) : undefined,
1200
1084
  };
1201
1085
  };
1202
- var deserializeAws_restJson1PolicyIdList = function (output, context) {
1203
- var retVal = (output || [])
1204
- .filter(function (e) { return e != null; })
1205
- .map(function (entry) {
1086
+ const deserializeAws_restJson1PolicyIdList = (output, context) => {
1087
+ const retVal = (output || [])
1088
+ .filter((e) => e != null)
1089
+ .map((entry) => {
1206
1090
  if (entry === null) {
1207
1091
  return null;
1208
1092
  }
@@ -1210,10 +1094,10 @@ var deserializeAws_restJson1PolicyIdList = function (output, context) {
1210
1094
  });
1211
1095
  return retVal;
1212
1096
  };
1213
- var deserializeAws_restJson1ResourceLocationList = function (output, context) {
1214
- var retVal = (output || [])
1215
- .filter(function (e) { return e != null; })
1216
- .map(function (entry) {
1097
+ const deserializeAws_restJson1ResourceLocationList = (output, context) => {
1098
+ const retVal = (output || [])
1099
+ .filter((e) => e != null)
1100
+ .map((entry) => {
1217
1101
  if (entry === null) {
1218
1102
  return null;
1219
1103
  }
@@ -1221,10 +1105,10 @@ var deserializeAws_restJson1ResourceLocationList = function (output, context) {
1221
1105
  });
1222
1106
  return retVal;
1223
1107
  };
1224
- var deserializeAws_restJson1ResourceTypeValuesList = function (output, context) {
1225
- var retVal = (output || [])
1226
- .filter(function (e) { return e != null; })
1227
- .map(function (entry) {
1108
+ const deserializeAws_restJson1ResourceTypeValuesList = (output, context) => {
1109
+ const retVal = (output || [])
1110
+ .filter((e) => e != null)
1111
+ .map((entry) => {
1228
1112
  if (entry === null) {
1229
1113
  return null;
1230
1114
  }
@@ -1232,15 +1116,23 @@ var deserializeAws_restJson1ResourceTypeValuesList = function (output, context)
1232
1116
  });
1233
1117
  return retVal;
1234
1118
  };
1235
- var deserializeAws_restJson1RetainRule = function (output, context) {
1119
+ const deserializeAws_restJson1RetainRule = (output, context) => {
1236
1120
  return {
1237
1121
  Count: __expectInt32(output.Count),
1238
1122
  Interval: __expectInt32(output.Interval),
1239
1123
  IntervalUnit: __expectString(output.IntervalUnit),
1240
1124
  };
1241
1125
  };
1242
- var deserializeAws_restJson1Schedule = function (output, context) {
1126
+ const deserializeAws_restJson1RetentionArchiveTier = (output, context) => {
1243
1127
  return {
1128
+ Count: __expectInt32(output.Count),
1129
+ Interval: __expectInt32(output.Interval),
1130
+ IntervalUnit: __expectString(output.IntervalUnit),
1131
+ };
1132
+ };
1133
+ const deserializeAws_restJson1Schedule = (output, context) => {
1134
+ return {
1135
+ ArchiveRule: output.ArchiveRule != null ? deserializeAws_restJson1ArchiveRule(output.ArchiveRule, context) : undefined,
1244
1136
  CopyTags: __expectBoolean(output.CopyTags),
1245
1137
  CreateRule: output.CreateRule != null ? deserializeAws_restJson1CreateRule(output.CreateRule, context) : undefined,
1246
1138
  CrossRegionCopyRules: output.CrossRegionCopyRules != null
@@ -1257,10 +1149,10 @@ var deserializeAws_restJson1Schedule = function (output, context) {
1257
1149
  VariableTags: output.VariableTags != null ? deserializeAws_restJson1VariableTagsList(output.VariableTags, context) : undefined,
1258
1150
  };
1259
1151
  };
1260
- var deserializeAws_restJson1ScheduleList = function (output, context) {
1261
- var retVal = (output || [])
1262
- .filter(function (e) { return e != null; })
1263
- .map(function (entry) {
1152
+ const deserializeAws_restJson1ScheduleList = (output, context) => {
1153
+ const retVal = (output || [])
1154
+ .filter((e) => e != null)
1155
+ .map((entry) => {
1264
1156
  if (entry === null) {
1265
1157
  return null;
1266
1158
  }
@@ -1268,7 +1160,7 @@ var deserializeAws_restJson1ScheduleList = function (output, context) {
1268
1160
  });
1269
1161
  return retVal;
1270
1162
  };
1271
- var deserializeAws_restJson1ShareRule = function (output, context) {
1163
+ const deserializeAws_restJson1ShareRule = (output, context) => {
1272
1164
  return {
1273
1165
  TargetAccounts: output.TargetAccounts != null
1274
1166
  ? deserializeAws_restJson1ShareTargetAccountList(output.TargetAccounts, context)
@@ -1277,10 +1169,10 @@ var deserializeAws_restJson1ShareRule = function (output, context) {
1277
1169
  UnshareIntervalUnit: __expectString(output.UnshareIntervalUnit),
1278
1170
  };
1279
1171
  };
1280
- var deserializeAws_restJson1ShareRules = function (output, context) {
1281
- var retVal = (output || [])
1282
- .filter(function (e) { return e != null; })
1283
- .map(function (entry) {
1172
+ const deserializeAws_restJson1ShareRules = (output, context) => {
1173
+ const retVal = (output || [])
1174
+ .filter((e) => e != null)
1175
+ .map((entry) => {
1284
1176
  if (entry === null) {
1285
1177
  return null;
1286
1178
  }
@@ -1288,10 +1180,10 @@ var deserializeAws_restJson1ShareRules = function (output, context) {
1288
1180
  });
1289
1181
  return retVal;
1290
1182
  };
1291
- var deserializeAws_restJson1ShareTargetAccountList = function (output, context) {
1292
- var retVal = (output || [])
1293
- .filter(function (e) { return e != null; })
1294
- .map(function (entry) {
1183
+ const deserializeAws_restJson1ShareTargetAccountList = (output, context) => {
1184
+ const retVal = (output || [])
1185
+ .filter((e) => e != null)
1186
+ .map((entry) => {
1295
1187
  if (entry === null) {
1296
1188
  return null;
1297
1189
  }
@@ -1299,10 +1191,10 @@ var deserializeAws_restJson1ShareTargetAccountList = function (output, context)
1299
1191
  });
1300
1192
  return retVal;
1301
1193
  };
1302
- var deserializeAws_restJson1SnapshotOwnerList = function (output, context) {
1303
- var retVal = (output || [])
1304
- .filter(function (e) { return e != null; })
1305
- .map(function (entry) {
1194
+ const deserializeAws_restJson1SnapshotOwnerList = (output, context) => {
1195
+ const retVal = (output || [])
1196
+ .filter((e) => e != null)
1197
+ .map((entry) => {
1306
1198
  if (entry === null) {
1307
1199
  return null;
1308
1200
  }
@@ -1310,26 +1202,27 @@ var deserializeAws_restJson1SnapshotOwnerList = function (output, context) {
1310
1202
  });
1311
1203
  return retVal;
1312
1204
  };
1313
- var deserializeAws_restJson1Tag = function (output, context) {
1205
+ const deserializeAws_restJson1Tag = (output, context) => {
1314
1206
  return {
1315
1207
  Key: __expectString(output.Key),
1316
1208
  Value: __expectString(output.Value),
1317
1209
  };
1318
1210
  };
1319
- var deserializeAws_restJson1TagMap = function (output, context) {
1320
- return Object.entries(output).reduce(function (acc, _a) {
1321
- var _b;
1322
- 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]) => {
1323
1213
  if (value === null) {
1324
1214
  return acc;
1325
1215
  }
1326
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1216
+ return {
1217
+ ...acc,
1218
+ [key]: __expectString(value),
1219
+ };
1327
1220
  }, {});
1328
1221
  };
1329
- var deserializeAws_restJson1TagsToAddList = function (output, context) {
1330
- var retVal = (output || [])
1331
- .filter(function (e) { return e != null; })
1332
- .map(function (entry) {
1222
+ const deserializeAws_restJson1TagsToAddList = (output, context) => {
1223
+ const retVal = (output || [])
1224
+ .filter((e) => e != null)
1225
+ .map((entry) => {
1333
1226
  if (entry === null) {
1334
1227
  return null;
1335
1228
  }
@@ -1337,10 +1230,10 @@ var deserializeAws_restJson1TagsToAddList = function (output, context) {
1337
1230
  });
1338
1231
  return retVal;
1339
1232
  };
1340
- var deserializeAws_restJson1TargetTagList = function (output, context) {
1341
- var retVal = (output || [])
1342
- .filter(function (e) { return e != null; })
1343
- .map(function (entry) {
1233
+ const deserializeAws_restJson1TargetTagList = (output, context) => {
1234
+ const retVal = (output || [])
1235
+ .filter((e) => e != null)
1236
+ .map((entry) => {
1344
1237
  if (entry === null) {
1345
1238
  return null;
1346
1239
  }
@@ -1348,10 +1241,10 @@ var deserializeAws_restJson1TargetTagList = function (output, context) {
1348
1241
  });
1349
1242
  return retVal;
1350
1243
  };
1351
- var deserializeAws_restJson1TimesList = function (output, context) {
1352
- var retVal = (output || [])
1353
- .filter(function (e) { return e != null; })
1354
- .map(function (entry) {
1244
+ const deserializeAws_restJson1TimesList = (output, context) => {
1245
+ const retVal = (output || [])
1246
+ .filter((e) => e != null)
1247
+ .map((entry) => {
1355
1248
  if (entry === null) {
1356
1249
  return null;
1357
1250
  }
@@ -1359,10 +1252,10 @@ var deserializeAws_restJson1TimesList = function (output, context) {
1359
1252
  });
1360
1253
  return retVal;
1361
1254
  };
1362
- var deserializeAws_restJson1VariableTagsList = function (output, context) {
1363
- var retVal = (output || [])
1364
- .filter(function (e) { return e != null; })
1365
- .map(function (entry) {
1255
+ const deserializeAws_restJson1VariableTagsList = (output, context) => {
1256
+ const retVal = (output || [])
1257
+ .filter((e) => e != null)
1258
+ .map((entry) => {
1366
1259
  if (entry === null) {
1367
1260
  return null;
1368
1261
  }
@@ -1370,57 +1263,39 @@ var deserializeAws_restJson1VariableTagsList = function (output, context) {
1370
1263
  });
1371
1264
  return retVal;
1372
1265
  };
1373
- var deserializeMetadata = function (output) {
1374
- var _a;
1375
- return ({
1376
- httpStatusCode: output.statusCode,
1377
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1378
- extendedRequestId: output.headers["x-amz-id-2"],
1379
- cfId: output.headers["x-amz-cf-id"],
1380
- });
1381
- };
1382
- var collectBody = function (streamBody, context) {
1383
- 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) => {
1384
1273
  if (streamBody instanceof Uint8Array) {
1385
1274
  return Promise.resolve(streamBody);
1386
1275
  }
1387
1276
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1388
1277
  };
1389
- var collectBodyString = function (streamBody, context) {
1390
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1391
- };
1392
- var isSerializableHeaderValue = function (value) {
1393
- return value !== undefined &&
1394
- value !== null &&
1395
- value !== "" &&
1396
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1397
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1398
- };
1399
- var parseBody = function (streamBody, context) {
1400
- return collectBodyString(streamBody, context).then(function (encoded) {
1401
- if (encoded.length) {
1402
- return JSON.parse(encoded);
1403
- }
1404
- return {};
1405
- });
1406
- };
1407
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1408
- var value;
1409
- var _a;
1410
- return __generator(this, function (_b) {
1411
- switch (_b.label) {
1412
- case 0: return [4, parseBody(errorBody, context)];
1413
- case 1:
1414
- value = _b.sent();
1415
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1416
- return [2, value];
1417
- }
1418
- });
1419
- }); };
1420
- var loadRestJsonErrorCode = function (output, data) {
1421
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1422
- var sanitizeErrorCode = function (rawValue) {
1423
- 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;
1424
1299
  if (typeof cleanValue === "number") {
1425
1300
  cleanValue = cleanValue.toString();
1426
1301
  }
@@ -1435,7 +1310,7 @@ var loadRestJsonErrorCode = function (output, data) {
1435
1310
  }
1436
1311
  return cleanValue;
1437
1312
  };
1438
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1313
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1439
1314
  if (headerKey !== undefined) {
1440
1315
  return sanitizeErrorCode(output.headers[headerKey]);
1441
1316
  }